dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #39461
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19979: Event analytics, supporting html+css representation
------------------------------------------------------------
revno: 19979
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-09-03 19:21:28 +0200
message:
Event analytics, supporting html+css representation
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/EventAnalyticsController.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-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/EventAnalyticsController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/EventAnalyticsController.java 2015-09-03 15:25:27 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/EventAnalyticsController.java 2015-09-03 17:21:28 +0000
@@ -242,6 +242,39 @@
GridUtils.toHtml( substituteMetaData( grid ), response.getWriter() );
}
+ @RequestMapping( value = RESOURCE_PATH + "/aggregate/{program}.html+css", method = RequestMethod.GET )
+ public void getAggregateHtmlCss(
+ @PathVariable String program,
+ @RequestParam( required = false ) String stage,
+ @RequestParam( required = false ) String startDate,
+ @RequestParam( required = false ) String endDate,
+ @RequestParam Set<String> dimension,
+ @RequestParam( required = false ) Set<String> filter,
+ @RequestParam( required = false ) String value,
+ @RequestParam( required = false ) AggregationType aggregationType,
+ @RequestParam( required = false ) boolean skipMeta,
+ @RequestParam( required = false ) boolean skipData,
+ @RequestParam( required = false ) boolean skipRounding,
+ @RequestParam( required = false ) boolean hierarchyMeta,
+ @RequestParam( required = false ) boolean showHierarchy,
+ @RequestParam( required = false ) SortOrder sortOrder,
+ @RequestParam( required = false ) Integer limit,
+ @RequestParam( required = false ) EventOutputType outputType,
+ @RequestParam( required = false ) boolean collapseDataDimensions,
+ @RequestParam( required = false ) boolean aggregateData,
+ @RequestParam( required = false ) DisplayProperty displayProperty,
+ Model model,
+ HttpServletResponse response ) throws Exception
+ {
+ EventQueryParams params = analyticsService.getFromUrl( program, stage, startDate, endDate, dimension, filter,
+ value, aggregationType, skipMeta, skipData, skipRounding, hierarchyMeta, showHierarchy, sortOrder, limit, outputType,
+ collapseDataDimensions, aggregateData, displayProperty, i18nManager.getI18nFormat() );
+
+ contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_HTML, CacheStrategy.RESPECT_SYSTEM_SETTING, "events.html", false );
+ Grid grid = analyticsService.getAggregatedEventData( params );
+ GridUtils.toHtmlCss( substituteMetaData( grid ), response.getWriter() );
+ }
+
// -------------------------------------------------------------------------
// Query
// -------------------------------------------------------------------------
@@ -393,6 +426,35 @@
GridUtils.toHtml( substituteMetaData( grid ), response.getWriter() );
}
+ @RequestMapping( value = RESOURCE_PATH + "/query/{program}.html+css", method = RequestMethod.GET )
+ public void getQueryHtmlCss(
+ @PathVariable String program,
+ @RequestParam( required = false ) String stage,
+ @RequestParam( required = false ) String startDate,
+ @RequestParam( required = false ) String endDate,
+ @RequestParam Set<String> dimension,
+ @RequestParam( required = false ) Set<String> filter,
+ @RequestParam( required = false ) String ouMode,
+ @RequestParam( required = false ) Set<String> asc,
+ @RequestParam( required = false ) Set<String> desc,
+ @RequestParam( required = false ) boolean skipMeta,
+ @RequestParam( required = false ) boolean skipData,
+ @RequestParam( required = false ) boolean hierarchyMeta,
+ @RequestParam( required = false ) boolean coordinatesOnly,
+ @RequestParam( required = false ) Integer page,
+ @RequestParam( required = false ) Integer pageSize,
+ @RequestParam( required = false ) DisplayProperty displayProperty,
+ Model model,
+ HttpServletResponse response ) throws Exception
+ {
+ EventQueryParams params = analyticsService.getFromUrl( program, stage, startDate, endDate, dimension, filter,
+ ouMode, asc, desc, skipMeta, skipData, hierarchyMeta, coordinatesOnly, displayProperty, page, pageSize, i18nManager.getI18nFormat() );
+
+ contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_HTML, CacheStrategy.RESPECT_SYSTEM_SETTING, "events.html", false );
+ Grid grid = analyticsService.getEvents( params );
+ GridUtils.toHtmlCss( substituteMetaData( grid ), response.getWriter() );
+ }
+
// -------------------------------------------------------------------------
// Supportive methods
// -------------------------------------------------------------------------