← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 22067: Analytics table layout download, respecting display name in analysis property

 

------------------------------------------------------------
revno: 22067
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2016-02-28 13:29:01 +0100
message:
  Analytics table layout download, respecting display name in analysis property
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2016-02-27 12:02:42 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2016-02-28 12:29:01 +0000
@@ -47,6 +47,7 @@
 import org.hisp.dhis.common.DimensionalObject;
 import org.hisp.dhis.common.DimensionalObjectUtils;
 import org.hisp.dhis.common.DisplayDensity;
+import org.hisp.dhis.common.DisplayProperty;
 import org.hisp.dhis.common.DxfNamespaces;
 import org.hisp.dhis.common.FontSize;
 import org.hisp.dhis.common.Grid;
@@ -515,13 +516,14 @@
      * Generates a grid for this report table based on the given aggregate value
      * map.
      *
-     * @param grid         the grid, should be empty and not null.
-     * @param valueMap     the mapping of identifiers to aggregate values.
+     * @param grid the grid, should be empty and not null.
+     * @param valueMap the mapping of identifiers to aggregate values.
+     * @param displayProperty the display property to use for meta data.
      * @param paramColumns whether to include report parameter columns.
      * @return a grid.
      */
     @SuppressWarnings( "unchecked" )
-    public Grid getGrid( Grid grid, Map<String, Object> valueMap, boolean paramColumns )
+    public Grid getGrid( Grid grid, Map<String, Object> valueMap, DisplayProperty displayProperty, boolean paramColumns )
     {
         valueMap = new HashMap<>( valueMap );
 
@@ -593,7 +595,7 @@
             for ( DimensionalItemObject object : row )
             {
                 grid.addValue( object.getUid() );
-                grid.addValue( object.getDisplayName() );
+                grid.addValue( object.getDisplayProperty( displayProperty ) );
                 grid.addValue( object.getCode() );
                 grid.addValue( object.getDisplayDescription() );
             }

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2016-02-27 12:08:07 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2016-02-28 12:29:01 +0000
@@ -653,7 +653,7 @@
 
         Map<String, Object> valueMap = getAggregatedDataValueMapping( grid );
 
-        return reportTable.getGrid( new ListGrid( grid.getMetaData() ), valueMap, false );
+        return reportTable.getGrid( new ListGrid( grid.getMetaData() ), valueMap, params.getDisplayProperty(), false );
     }
 
     @Override

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java	2016-01-06 14:25:55 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java	2016-02-28 12:29:01 +0000
@@ -35,6 +35,7 @@
 
 import org.hisp.dhis.analytics.AnalyticsService;
 import org.hisp.dhis.common.AnalyticalObjectStore;
+import org.hisp.dhis.common.DisplayProperty;
 import org.hisp.dhis.common.GenericAnalyticalObjectService;
 import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.i18n.I18nFormat;
@@ -128,7 +129,7 @@
 
         Map<String, Object> valueMap = analyticsService.getAggregatedDataValueMapping( reportTable, format );
 
-        return reportTable.getGrid( new ListGrid(), valueMap, true );
+        return reportTable.getGrid( new ListGrid(), valueMap, DisplayProperty.SHORTNAME, true );
     }
 
     @Override