← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19387: Event analytics, added query property

 

------------------------------------------------------------
revno: 19387
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2015-06-13 19:43:20 +0200
message:
  Event analytics, added query property
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventQueryParams.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.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/EventQueryParams.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventQueryParams.java	2015-06-13 16:16:08 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventQueryParams.java	2015-06-13 17:43:20 +0000
@@ -92,6 +92,12 @@
     private boolean collapseDataDimensions;
     
     private boolean coordinatesOnly;
+
+    // -------------------------------------------------------------------------
+    // Transient properties
+    // -------------------------------------------------------------------------
+
+    private boolean aggregateQuery;
     
     // -------------------------------------------------------------------------
     // Constructors
@@ -132,6 +138,7 @@
         params.outputType = this.outputType;
         params.collapseDataDimensions = this.collapseDataDimensions;
         params.coordinatesOnly = this.coordinatesOnly;
+        params.aggregateQuery = this.aggregateQuery;
         
         params.periodType = this.periodType;
         
@@ -341,6 +348,14 @@
         return SortOrder.ASC.equals( sortOrder ) ? -1 : SortOrder.DESC.equals( sortOrder ) ? 1 : 0;
     }
     
+    /**
+     * Indicates whether this query is aggregate as opposed to event-based.
+     */
+    public boolean isAggregateQuery()
+    {
+        return aggregateQuery;
+    }
+    
     public String toString()
     {
         return "[" +
@@ -541,4 +556,9 @@
     {
         this.coordinatesOnly = coordinatesOnly;
     }
+
+    public void setAggregateQuery( boolean aggregateQuery )
+    {
+        this.aggregateQuery = aggregateQuery;
+    }
 }

=== 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	2015-06-13 16:56:08 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java	2015-06-13 17:43:20 +0000
@@ -384,6 +384,7 @@
         params.setLimit( limit );
         params.setOutputType( MoreObjects.firstNonNull( outputType, EventOutputType.EVENT ) );
         params.setCollapseDataDimensions( collapseDataDimensions );
+        params.setAggregateQuery( true );
 
         return params;
     }
@@ -490,6 +491,7 @@
         params.setDisplayProperty( displayProperty );
         params.setPage( page );
         params.setPageSize( pageSize );
+        params.setAggregateQuery( false );
         
         return params;
     }