← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12343: Minor

 

------------------------------------------------------------
revno: 12343
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-10-01 09:04:49 +0200
message:
  Minor
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.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/event/data/DefaultEventAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java	2013-09-29 21:05:46 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java	2013-10-01 07:04:49 +0000
@@ -187,7 +187,7 @@
         {
             IdentifiableObject item = queryItem.getItem();
             
-            grid.addHeader( new GridHeader( item.getName(), item.getUid() ) );
+            grid.addHeader( new GridHeader( item.getUid(), item.getName() ) );
         }
 
         // ---------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java	2013-09-29 21:05:46 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java	2013-10-01 07:04:49 +0000
@@ -206,6 +206,10 @@
     // Supportive methods
     // -------------------------------------------------------------------------
 
+    /**
+     * Returns the dynamic select columns. Dimensions come first and query items
+     * second.
+     */
     private String getSelectColumns( EventQueryParams params )
     {
         String sql = "";
@@ -267,11 +271,11 @@
             sql += "and ps = '" + params.getProgramStage().getUid() + "' ";
         }
 
-        for ( QueryItem filter : params.getItems() )
+        for ( QueryItem item : params.getItems() )
         {
-            if ( filter.hasFilter() )
+            if ( item.hasFilter() )
             {                
-                sql += "and lower(" + filter.getItem().getUid() + ") " + filter.getSqlOperator() + " " + getSqlFilter( filter ) + " ";
+                sql += "and lower(" + item.getItem().getUid() + ") " + item.getSqlOperator() + " " + getSqlFilter( item ) + " ";
             }
         }
         
@@ -286,6 +290,9 @@
         return sql;
     }
     
+    /**
+     * Returns the filter value for the given query item.
+     */
     private String getSqlFilter( QueryItem item )
     {
         String operator = item.getOperator();