← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19471: Analytics, centrlized code

 

------------------------------------------------------------
revno: 19471
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-06-19 15:27:23 +0200
message:
  Analytics, centrlized code
modified:
  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-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-06-19 12:16:36 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2015-06-19 13:27:23 +0000
@@ -761,6 +761,23 @@
     }
 
     /**
+     * Retrieves the options for all data-related (dx) dimensions and filters.
+     * Returns an empty list if not present.
+     */
+    public List<NameableObject> getDataDimensionAndFilterOptions()
+    {
+        List<NameableObject> options = new ArrayList<>();
+        
+        for ( String dim : DATA_DIMS )
+        {
+            options.addAll( getDimensionOptions( dim ) );
+            options.addAll( getFilterOptions( dim ) );
+        }
+        
+        return options;
+    }
+    
+    /**
      * Retrieves the options for the given dimension identifier. Returns an empty
      * list if the dimension is not present.
      */

=== 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-06-19 12:16:36 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-06-19 13:27:23 +0000
@@ -556,7 +556,7 @@
      */
     private void addDynamicDimensionValues( DataQueryParams params, Grid grid )
     {
-        if ( params.getIndicators().isEmpty() && params.getDataElements().isEmpty() && params.getDataSets().isEmpty() && params.getProgramDataElements().isEmpty() )
+        if ( params.getDataDimensionAndFilterOptions().isEmpty() )
         {
             Map<String, Double> aggregatedDataMap = getAggregatedDataValueMap( params.instance() );