← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11060: Added analytics jrxml format

 

------------------------------------------------------------
revno: 11060
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-05-28 19:29:42 +0200
message:
  Added analytics jrxml format
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AnalyticsController.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/api/controller/AnalyticsController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AnalyticsController.java	2013-05-23 16:57:03 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AnalyticsController.java	2013-05-28 17:29:42 +0000
@@ -167,6 +167,25 @@
         GridUtils.toXls( substituteMetaData( grid ), response.getOutputStream() );
     }
 
+    @RequestMapping( value = RESOURCE_PATH + ".jrxml", method = RequestMethod.GET )
+    public void getJrxml( 
+        @RequestParam Set<String> dimension,
+        @RequestParam(required = false) Set<String> filter,
+        @RequestParam(required = false) AggregationType aggregationType,
+        @RequestParam(required = false) String measureCriteria,
+        @RequestParam(required = false) boolean tableLayout,
+        @RequestParam(required = false) String columns,
+        @RequestParam(required = false) String rows,
+        Model model,
+        HttpServletResponse response ) throws Exception
+    {
+        DataQueryParams params = analyticsService.getFromUrl( dimension, filter, null, null, i18nManager.getI18nFormat() );
+
+        contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_XML, CacheStrategy.RESPECT_SYSTEM_SETTING, "data.jrxml", false );
+        Grid grid = analyticsService.getAggregatedDataValues( params );
+        GridUtils.toJrxml( substituteMetaData( grid ), null, response.getWriter() );
+    }
+
     // -------------------------------------------------------------------------
     // Exception handling
     // -------------------------------------------------------------------------