dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25601
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12750: Minor
------------------------------------------------------------
revno: 12750
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-10-16 21:06:05 +0200
message:
Minor
modified:
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventAnalyticsService.java
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
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventQueryPlanner.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/EventAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventAnalyticsService.java 2013-10-03 12:17:41 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventAnalyticsService.java 2013-10-16 19:06:05 +0000
@@ -43,9 +43,15 @@
Grid getEvents( EventQueryParams params );
+ /**
+ * Used for aggregate query.
+ */
EventQueryParams getFromUrl( String program, String stage, String startDate, String endDate,
Set<String> dimension, Set<String> filter, boolean hierarchyMeta, SortOrder sortOrder, Integer limit, I18nFormat format );
-
+
+ /**
+ * Used for event query.
+ */
EventQueryParams getFromUrl( String program, String stage, String startDate, String endDate, Set<String> dimension, Set<String> filter,
String ouMode, Set<String> asc, Set<String> desc, boolean hierarchyMeta, Integer page, Integer pageSize, I18nFormat format );
}
=== 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 2013-10-16 18:47:07 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventQueryParams.java 2013-10-16 19:06:05 +0000
@@ -86,6 +86,8 @@
private String periodType;
+ private boolean aggregate;
+
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -119,7 +121,9 @@
params.pageSize = this.pageSize;
params.sortOrder = this.sortOrder;
params.limit = this.limit;
+
params.periodType = this.periodType;
+ params.aggregate = this.aggregate;
return params;
}
@@ -351,4 +355,14 @@
{
this.periodType = periodType;
}
+
+ public boolean isAggregate()
+ {
+ return aggregate;
+ }
+
+ public void setAggregate( boolean aggregate )
+ {
+ this.aggregate = aggregate;
+ }
}
=== 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-10-16 18:47:07 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java 2013-10-16 19:06:05 +0000
@@ -132,7 +132,7 @@
//TODO order the event analytics tables up front to avoid default sorting in queries
//TODO filter items support
-
+ //TODO parallel processing of queries
//TODO proper query when start/end period or period filter span multiple partitions
public Grid getAggregatedEventData( EventQueryParams params )
@@ -262,22 +262,17 @@
return grid;
}
- /**
- * Used for aggregate query.
- */
public EventQueryParams getFromUrl( String program, String stage, String startDate, String endDate,
Set<String> dimension, Set<String> filter, boolean hierarchyMeta, SortOrder sortOrder, Integer limit, I18nFormat format )
{
EventQueryParams params = getFromUrl( program, stage, startDate, endDate, dimension, filter, null, null, null, hierarchyMeta, null, null, format );
params.setSortOrder( sortOrder );
params.setLimit( limit );
+ params.setAggregate( true );
return params;
}
- /**
- * Used for event query.
- */
public EventQueryParams getFromUrl( String program, String stage, String startDate, String endDate, Set<String> dimension, Set<String> filter,
String ouMode, Set<String> asc, Set<String> desc, boolean hierarchyMeta, Integer page, Integer pageSize, I18nFormat format )
{
@@ -381,6 +376,7 @@
params.setHierarchyMeta( hierarchyMeta );
params.setPage( page );
params.setPageSize( pageSize );
+ params.setAggregate( false );
return params;
}
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventQueryPlanner.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventQueryPlanner.java 2013-10-16 18:47:07 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventQueryPlanner.java 2013-10-16 19:06:05 +0000
@@ -175,7 +175,7 @@
return list;
}
- private static EventQueryParams getQuery( EventQueryParams params, Date startDate, Date endDate, Program program )
+ private EventQueryParams getQuery( EventQueryParams params, Date startDate, Date endDate, Program program )
{
EventQueryParams query = params.instance();
query.setStartDate( startDate );
=== 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-10-16 18:47:07 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java 2013-10-16 19:06:05 +0000
@@ -311,9 +311,7 @@
private String getFromWhereClause( EventQueryParams params )
{
- String sql = "";
-
- sql += "from " + params.getPartitions().getSinglePartition() + " ";
+ String sql = "from " + params.getPartitions().getSinglePartition() + " ";
if ( params.hasStartEndDate() )
{