← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19997: Analytics, fixed bug with download in table layout and data element operands / details

 

------------------------------------------------------------
revno: 19997
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-09-04 16:25:32 +0200
message:
  Analytics, fixed bug with download in table layout and data element operands / details
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.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/common/BaseAnalyticalObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java	2015-09-03 15:25:27 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java	2015-09-04 14:25:32 +0000
@@ -780,8 +780,7 @@
         {
             if ( item.getClass().equals( DataElementOperand.class ) )
             {
-                ids.add( ((DataElementOperand) item).getDataElement().getUid() );
-                ids.add( ((DataElementOperand) item).getCategoryOptionCombo().getUid() );
+                ids.add( ((DataElementOperand) item).getAnalyticsId() );
             }
             else
             {

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java	2015-09-03 02:35:05 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java	2015-09-04 14:25:32 +0000
@@ -308,6 +308,16 @@
     {
         return COLUMN_PREFIX + dataElementId + COLUMN_SEPARATOR + optionComboId;
     }
+    
+    /**
+     * Returns an identifier on the format <data element uid>.<category option combo uid>.
+     * 
+     * @return an identifier.
+     */
+    public String getAnalyticsId()
+    {
+        return dataElement.getUid() + SEPARATOR + categoryOptionCombo.getUid();
+    }
 
     /**
      * Returns a pretty-print name based on the given data element and category

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2015-09-04 13:51:59 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2015-09-04 14:25:32 +0000
@@ -1464,7 +1464,7 @@
      * dimension is specified, all category option combos for the first data 
      * element is returned. Returns an empty array if the dimension is not present.
      */
-    public NameableObject[] getDimensionArrayCollapseDxExplodeCoc( String dimension )
+    public NameableObject[] getDimensionArrayExplodeCoc( String dimension )
     {
         List<NameableObject> items = new ArrayList<>();
         

=== 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	2015-09-02 19:49:48 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-09-04 14:25:32 +0000
@@ -667,7 +667,7 @@
             {
                 reportTable.getColumnDimensions().add( dimension );
 
-                tableColumns.add( params.getDimensionArrayCollapseDxExplodeCoc( dimension ) );
+                tableColumns.add( params.getDimensionArrayExplodeCoc( dimension ) );
             }
         }
 
@@ -677,7 +677,7 @@
             {
                 reportTable.getRowDimensions().add( dimension );
 
-                tableRows.add( params.getDimensionArrayCollapseDxExplodeCoc( dimension ) );
+                tableRows.add( params.getDimensionArrayExplodeCoc( dimension ) );
             }
         }