← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18520: Analytics, renamded idScheme to outputIdScheme to allow for inputIdScheme later

 

------------------------------------------------------------
revno: 18520
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2015-03-07 17:26:59 +0100
message:
  Analytics, renamded idScheme to outputIdScheme to allow for inputIdScheme later
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsService.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/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-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsService.java	2015-03-07 16:16:41 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsService.java	2015-03-07 16:26:59 +0000
@@ -156,16 +156,16 @@
      * @param hierarchyMeta whether to include meta data about the org units 
      *        in the hierarchy.
      * @param ignoreLimit whether to ignore the max number of cells limit.
-     * @param hideEmptyRows whether to hide rows without data values, applis to table layout.
+     * @param hideEmptyRows whether to hide rows without data values, applies to table layout.
      * @param showHierarchy whether to show the org unit hierarchy together with the name.
      * @param displayProperty the property to display for meta-data.
-     * @param idScheme the identifier scheme to use.
+     * @param outputIdScheme the identifier scheme to use in the query response.
      * @param format the i18n format.
      * @return a data query parameter object created based on the given URL info.
      */
     DataQueryParams getFromUrl( Set<String> dimensionParams, Set<String> filterParams, AggregationType aggregationType, String measureCriteria, 
         boolean skipMeta, boolean skipRounding, boolean hierarchyMeta, boolean ignoreLimit, boolean hideEmptyRows, boolean showHierarchy, 
-        DisplayProperty displayProperty, IdentifiableProperty idScheme, I18nFormat format );
+        DisplayProperty displayProperty, IdentifiableProperty outputIdScheme, I18nFormat format );
     
     /**
      * Creates a data query parameter object from the given BaseAnalyticalObject.

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2015-03-07 16:16:41 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2015-03-07 16:26:59 +0000
@@ -155,9 +155,9 @@
     protected DisplayProperty displayProperty;
     
     /**
-     * The property to use as identifier in the response.
+     * The property to use as identifier in the query response.
      */
-    protected IdentifiableProperty idScheme;
+    protected IdentifiableProperty outputIdScheme;
     
     // -------------------------------------------------------------------------
     // Transient properties
@@ -216,7 +216,7 @@
         params.hideEmptyRows = this.hideEmptyRows;
         params.showHierarchy = this.showHierarchy;
         params.displayProperty = this.displayProperty;
-        params.idScheme = this.idScheme;
+        params.outputIdScheme = this.outputIdScheme;
         
         params.partitions = new Partitions( this.partitions );
         params.dataType = this.dataType;
@@ -921,9 +921,9 @@
      * Indicates whether this params defines an identifier scheme different from
      * UID.
      */
-    public boolean hasNonUidIdScheme()
+    public boolean hasNonUidOutputIdScheme()
     {
-        return idScheme != null && !IdentifiableProperty.UID.equals( idScheme );
+        return outputIdScheme != null && !IdentifiableProperty.UID.equals( outputIdScheme );
     }
 
     /**
@@ -1198,14 +1198,14 @@
         this.displayProperty = displayProperty;
     }
 
-    public IdentifiableProperty getIdScheme()
+    public IdentifiableProperty getOutputIdScheme()
     {
-        return idScheme;
+        return outputIdScheme;
     }
 
-    public void setIdScheme( IdentifiableProperty idScheme )
+    public void setOutputIdScheme( IdentifiableProperty outputIdScheme )
     {
-        this.idScheme = idScheme;
+        this.outputIdScheme = outputIdScheme;
     }
 
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-03-07 16:16:41 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-03-07 16:26:59 +0000
@@ -534,11 +534,11 @@
      */
     private void applyIdScheme( DataQueryParams params, Grid grid )
     {
-        if ( params.hasNonUidIdScheme() )
+        if ( params.hasNonUidOutputIdScheme() )
         {
             List<NameableObject> items = params.getAllDimensionItems();
             
-            Map<String, String> map = NameableObjectUtils.getUidPropertyMap( items, params.getIdScheme() );
+            Map<String, String> map = NameableObjectUtils.getUidPropertyMap( items, params.getOutputIdScheme() );
             
             grid.substituteMetaData( map );
         }
@@ -555,7 +555,7 @@
         }
         else
         {
-            params.setIdScheme( null );
+            params.setOutputIdScheme( null );
             grid = getAggregatedDataValues( params );
         }
 
@@ -816,7 +816,7 @@
     @Override
     public DataQueryParams getFromUrl( Set<String> dimensionParams, Set<String> filterParams, AggregationType aggregationType,
         String measureCriteria, boolean skipMeta, boolean skipRounding, boolean hierarchyMeta, boolean ignoreLimit,
-        boolean hideEmptyRows, boolean showHierarchy, DisplayProperty displayProperty, IdentifiableProperty idScheme, I18nFormat format )
+        boolean hideEmptyRows, boolean showHierarchy, DisplayProperty displayProperty, IdentifiableProperty outputIdScheme, I18nFormat format )
     {
         DataQueryParams params = new DataQueryParams();
 
@@ -844,7 +844,7 @@
         params.setHideEmptyRows( hideEmptyRows );
         params.setShowHierarchy( showHierarchy );
         params.setDisplayProperty( displayProperty );
-        params.setIdScheme( idScheme );
+        params.setOutputIdScheme( outputIdScheme );
 
         return params;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AnalyticsController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AnalyticsController.java	2015-03-07 16:16:41 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AnalyticsController.java	2015-03-07 16:26:59 +0000
@@ -88,14 +88,14 @@
         @RequestParam( required = false ) boolean hideEmptyRows,
         @RequestParam( required = false ) boolean showHierarchy,
         @RequestParam( required = false ) DisplayProperty displayProperty,
-        @RequestParam( required = false ) IdentifiableProperty idScheme,
+        @RequestParam( required = false ) IdentifiableProperty outputIdScheme,
         @RequestParam( required = false ) String columns,
         @RequestParam( required = false ) String rows,
         Model model,
         HttpServletResponse response ) throws Exception
     {
         DataQueryParams params = analyticsService.getFromUrl( dimension, filter, aggregationType, measureCriteria,
-            skipMeta, skipRounding, hierarchyMeta, ignoreLimit, hideEmptyRows, showHierarchy, displayProperty, idScheme, i18nManager.getI18nFormat() );
+            skipMeta, skipRounding, hierarchyMeta, ignoreLimit, hideEmptyRows, showHierarchy, displayProperty, outputIdScheme, i18nManager.getI18nFormat() );
 
         contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_JSON, CacheStrategy.RESPECT_SYSTEM_SETTING );
         Grid grid = analyticsService.getAggregatedDataValues( params, tableLayout, getDimensionsFromParam( columns ), getDimensionsFromParam( rows ) );
@@ -118,14 +118,14 @@
         @RequestParam( required = false ) boolean hideEmptyRows,
         @RequestParam( required = false ) boolean showHierarchy,
         @RequestParam( required = false ) DisplayProperty displayProperty,
-        @RequestParam( required = false ) IdentifiableProperty idScheme,
+        @RequestParam( required = false ) IdentifiableProperty outputIdScheme,
         @RequestParam( required = false ) String columns,
         @RequestParam( required = false ) String rows,
         Model model,
         HttpServletResponse response ) throws Exception
     {
         DataQueryParams params = analyticsService.getFromUrl( dimension, filter, aggregationType, measureCriteria,
-            skipMeta, skipRounding, hierarchyMeta, ignoreLimit, hideEmptyRows, showHierarchy, displayProperty, idScheme, i18nManager.getI18nFormat() );
+            skipMeta, skipRounding, hierarchyMeta, ignoreLimit, hideEmptyRows, showHierarchy, displayProperty, outputIdScheme, i18nManager.getI18nFormat() );
 
         contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_XML, CacheStrategy.RESPECT_SYSTEM_SETTING );
         Grid grid = analyticsService.getAggregatedDataValues( params, tableLayout, getDimensionsFromParam( columns ), getDimensionsFromParam( rows ) );
@@ -146,14 +146,14 @@
         @RequestParam( required = false ) boolean hideEmptyRows,
         @RequestParam( required = false ) boolean showHierarchy,
         @RequestParam( required = false ) DisplayProperty displayProperty,
-        @RequestParam( required = false ) IdentifiableProperty idScheme,
+        @RequestParam( required = false ) IdentifiableProperty outputIdScheme,
         @RequestParam( required = false ) String columns,
         @RequestParam( required = false ) String rows,
         Model model,
         HttpServletResponse response ) throws Exception
     {
         DataQueryParams params = analyticsService.getFromUrl( dimension, filter, aggregationType, measureCriteria,
-            skipMeta, skipRounding, hierarchyMeta, ignoreLimit, hideEmptyRows, showHierarchy, displayProperty, idScheme, i18nManager.getI18nFormat() );
+            skipMeta, skipRounding, hierarchyMeta, ignoreLimit, hideEmptyRows, showHierarchy, displayProperty, outputIdScheme, i18nManager.getI18nFormat() );
 
         contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_HTML, CacheStrategy.RESPECT_SYSTEM_SETTING );
         Grid grid = analyticsService.getAggregatedDataValues( params, tableLayout, getDimensionsFromParam( columns ), getDimensionsFromParam( rows ) );
@@ -174,14 +174,14 @@
         @RequestParam( required = false ) boolean hideEmptyRows,
         @RequestParam( required = false ) boolean showHierarchy,
         @RequestParam( required = false ) DisplayProperty displayProperty,
-        @RequestParam( required = false ) IdentifiableProperty idScheme,
+        @RequestParam( required = false ) IdentifiableProperty outputIdScheme,
         @RequestParam( required = false ) String columns,
         @RequestParam( required = false ) String rows,
         Model model,
         HttpServletResponse response ) throws Exception
     {
         DataQueryParams params = analyticsService.getFromUrl( dimension, filter, aggregationType, measureCriteria,
-            skipMeta, skipRounding, hierarchyMeta, ignoreLimit, hideEmptyRows, showHierarchy, displayProperty, idScheme, i18nManager.getI18nFormat() );
+            skipMeta, skipRounding, hierarchyMeta, ignoreLimit, hideEmptyRows, showHierarchy, displayProperty, outputIdScheme, i18nManager.getI18nFormat() );
 
         contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_HTML, CacheStrategy.RESPECT_SYSTEM_SETTING );
         Grid grid = analyticsService.getAggregatedDataValues( params, tableLayout, getDimensionsFromParam( columns ), getDimensionsFromParam( rows ) );
@@ -202,14 +202,14 @@
         @RequestParam( required = false ) boolean hideEmptyRows,
         @RequestParam( required = false ) boolean showHierarchy,
         @RequestParam( required = false ) DisplayProperty displayProperty,
-        @RequestParam( required = false ) IdentifiableProperty idScheme,
+        @RequestParam( required = false ) IdentifiableProperty outputIdScheme,
         @RequestParam( required = false ) String columns,
         @RequestParam( required = false ) String rows,
         Model model,
         HttpServletResponse response ) throws Exception
     {
         DataQueryParams params = analyticsService.getFromUrl( dimension, filter, aggregationType, measureCriteria,
-            skipMeta, skipRounding, hierarchyMeta, ignoreLimit, hideEmptyRows, showHierarchy, displayProperty, idScheme, i18nManager.getI18nFormat() );
+            skipMeta, skipRounding, hierarchyMeta, ignoreLimit, hideEmptyRows, showHierarchy, displayProperty, outputIdScheme, i18nManager.getI18nFormat() );
 
         contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_CSV, CacheStrategy.RESPECT_SYSTEM_SETTING, "data.csv", true );
         Grid grid = analyticsService.getAggregatedDataValues( params, tableLayout, getDimensionsFromParam( columns ), getDimensionsFromParam( rows ) );
@@ -230,14 +230,14 @@
         @RequestParam( required = false ) boolean hideEmptyRows,
         @RequestParam( required = false ) boolean showHierarchy,
         @RequestParam( required = false ) DisplayProperty displayProperty,
-        @RequestParam( required = false ) IdentifiableProperty idScheme,
+        @RequestParam( required = false ) IdentifiableProperty outputIdScheme,
         @RequestParam( required = false ) String columns,
         @RequestParam( required = false ) String rows,
         Model model,
         HttpServletResponse response ) throws Exception
     {
         DataQueryParams params = analyticsService.getFromUrl( dimension, filter, aggregationType, measureCriteria,
-            skipMeta, skipRounding, hierarchyMeta, ignoreLimit, hideEmptyRows, showHierarchy, displayProperty, idScheme, i18nManager.getI18nFormat() );
+            skipMeta, skipRounding, hierarchyMeta, ignoreLimit, hideEmptyRows, showHierarchy, displayProperty, outputIdScheme, i18nManager.getI18nFormat() );
 
         contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_EXCEL, CacheStrategy.RESPECT_SYSTEM_SETTING, "data.xls", true );
         Grid grid = analyticsService.getAggregatedDataValues( params, tableLayout, getDimensionsFromParam( columns ), getDimensionsFromParam( rows ) );
@@ -258,7 +258,7 @@
         @RequestParam( required = false ) boolean hideEmptyRows,
         @RequestParam( required = false ) boolean showHierarchy,
         @RequestParam( required = false ) DisplayProperty displayProperty,
-        @RequestParam( required = false ) IdentifiableProperty idScheme,
+        @RequestParam( required = false ) IdentifiableProperty outputIdScheme,
         @RequestParam( required = false ) String columns,
         @RequestParam( required = false ) String rows,
         Model model,