← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7485: (DV) Value param names set to in/de/ds/ou (like api) to avoid full header error.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 7485 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-07-02 13:49:15 +0200
message:
  (DV) Value param names set to in/de/ds/ou (like api) to avoid full header error.
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ChartPluginController.java
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/plugin.js
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js


--
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/ChartPluginController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ChartPluginController.java	2012-06-09 18:28:35 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ChartPluginController.java	2012-07-02 11:46:10 +0000
@@ -110,10 +110,10 @@
     private ContextUtils contextUtils;
 
     @RequestMapping( method = RequestMethod.GET )
-    public String getChartValues( @RequestParam( required = false ) Set<String> indicatorIds,
-        @RequestParam( required = false ) Set<String> dataElementIds,
-        @RequestParam( required = false ) Set<String> dataSetIds,
-        @RequestParam Set<String> organisationUnitIds,
+    public String getChartValues( @RequestParam( required = false ) Set<String> in,
+        @RequestParam( required = false ) Set<String> de,
+        @RequestParam( required = false ) Set<String> ds,
+        @RequestParam Set<String> ou,
         @RequestParam( required = false ) boolean orgUnitIsParent,
         @RequestParam( required = false ) String organisationUnitGroupSetId,
         @RequestParam( required = false ) boolean userOrganisationUnit,
@@ -168,7 +168,7 @@
         }
         else
         {
-            organisationUnits = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitsByUid( organisationUnitIds ) );
+            organisationUnits = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitsByUid( ou ) );
         }
 
         if ( orgUnitIsParent )
@@ -223,9 +223,9 @@
         // Indicators
         // ---------------------------------------------------------------------
 
-        if ( indicatorIds != null )
+        if ( in != null )
         {
-            List<Indicator> indicators = indicatorService.getIndicatorsByUid( indicatorIds );
+            List<Indicator> indicators = indicatorService.getIndicatorsByUid( in );
 
             if ( indicators.isEmpty() )
             {
@@ -263,9 +263,9 @@
         // Data elements
         // ---------------------------------------------------------------------
 
-        if ( dataElementIds != null )
+        if ( de != null )
         {
-            List<DataElement> dataElements = dataElementService.getDataElementsByUid( dataElementIds );
+            List<DataElement> dataElements = dataElementService.getDataElementsByUid( de );
 
             if ( dataElements.isEmpty() )
             {
@@ -303,9 +303,9 @@
         // Data set completeness
         // ---------------------------------------------------------------------
 
-        if ( dataSetIds != null )
+        if ( ds != null )
         {
-            List<DataSet> dataSets = dataSetService.getDataSetsByUid( dataSetIds );
+            List<DataSet> dataSets = dataSetService.getDataSetsByUid( ds );
             
             if ( dataSets.isEmpty() )
             {

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/plugin.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/plugin.js	2012-06-16 21:17:34 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/plugin.js	2012-07-02 11:46:10 +0000
@@ -18,11 +18,13 @@
             },
             indicator: {
                 value: 'indicator',
-                rawvalue: 'Indicator'
+                rawvalue: 'Indicator',
+                paramname: 'in'
             },
             dataelement: {
                 value: 'dataelement',
-                rawvalue: 'Data element'
+                rawvalue: 'Data element',
+                paramname: 'de'
             },
             period: {
                 value: 'period',
@@ -30,7 +32,8 @@
             },
             organisationunit: {
                 value: 'organisationunit',
-                rawvalue: 'Organisation unit'
+                rawvalue: 'Organisation unit',
+                paramname: 'ou'
             }
         },
         chart: {
@@ -152,10 +155,10 @@
                 getUrl: function(isFilter) {
                     var a = [];
                     Ext.Array.each(DHIS.chart.state.state.conf.indicators, function(r) {
-                        a.push('indicatorIds=' + r);
+                        a.push(DHIS.chart.conf.finals.dimension.indicator.paramname + '=' + r);
                     });
                     Ext.Array.each(DHIS.chart.state.state.conf.dataelements, function(r) {
-                        a.push('dataElementIds=' + r);
+                        a.push(DHIS.chart.conf.finals.dimension.dataelement.paramname + '=' + r);
                     });
                     return (isFilter && a.length > 1) ? a.slice(0,1) : a;
                 }
@@ -182,7 +185,7 @@
                 getUrl: function(isFilter) {
                     var a = [];
                     Ext.Array.each(DHIS.chart.state.state.conf.organisationunits, function(r) {
-						a.push('organisationUnitIds=' + r)
+						a.push(DHIS.chart.conf.finals.dimension.organisationunit.paramname + '=' + r)
                     });
                     return (isFilter && a.length > 1) ? a.slice(0,1) : a;
                 },

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js	2012-06-29 16:01:00 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js	2012-07-02 11:46:10 +0000
@@ -124,15 +124,18 @@
             },
             indicator: {
                 value: 'indicator',
-                rawvalue: DV.i18n.indicator
+                rawvalue: DV.i18n.indicator,
+                paramname: 'in'
             },
             dataelement: {
                 value: 'dataelement',
-                rawvalue: DV.i18n.data_element
+                rawvalue: DV.i18n.data_element,
+                paramname: 'de'
             },
             dataset: {
 				value: 'dataset',
-                rawvalue: DV.i18n.dataset
+                rawvalue: DV.i18n.dataset,
+                paramname: 'ds'
 			},
             period: {
                 value: 'period',
@@ -144,6 +147,7 @@
             organisationunit: {
                 value: 'organisationunit',
                 rawvalue: DV.i18n.organisation_unit,
+                paramname: 'ou',
                 warning: {
 					filter: DV.i18n.wm_multiple_filter_orgunit
 				}
@@ -531,15 +535,15 @@
 					var obj = DV.c.indicator.objects,
 						a = [];
                     for (var i = 0; i < obj.length; i++) {
-						a.push('indicatorIds=' + obj[i].id);
+						a.push(DV.conf.finals.dimension.indicator.paramname + '=' + obj[i].id);
 					}
 					obj = DV.c.dataelement.objects;
                     for (var i = 0; i < obj.length; i++) {
-						a.push('dataElementIds=' + obj[i].id);
+						a.push(DV.conf.finals.dimension.dataelement.paramname + '=' + obj[i].id);
 					}
 					obj = DV.c.dataset.objects;
                     for (var i = 0; i < obj.length; i++) {
-						a.push('dataSetIds=' + obj[i].id);
+						a.push(DV.conf.finals.dimension.dataset.paramname + '=' + obj[i].id);
 					}
 					return (isFilter && a.length > 1) ? a.slice(0,1) : a;
 				}
@@ -629,7 +633,7 @@
 					var ou = DV.c.organisationunit,
 						a = [];
 					for (var i = 0; i < ou.objects.length; i++) {
-						a.push('organisationUnitIds=' + ou.objects[i].id);
+						a.push(DV.conf.finals.dimension.organisationunit.paramname + '=' + ou.objects[i].id);
 					}
 					if (isFilter && a.length > 1) {
 						a = a.slice(0,1);
@@ -1380,6 +1384,7 @@
             Ext.Array.each(DV.chart.data, function(item) {
 				keys = Ext.Array.merge(keys, Ext.Object.getKeys(item));
             });
+            
             this.chart = Ext.create('Ext.data.Store', {
                 fields: keys,
                 data: DV.chart.data
@@ -1702,11 +1707,11 @@
 			if (DV.c.baselinelabel) {
 				p.baseLineLabel = DV.c.baselinelabel;
 			}
-            p.indicatorIds = DV.c.indicator.ids;
-            p.dataElementIds = DV.c.dataelement.ids;
-            p.dataSetIds = DV.c.dataset.ids;
+            p[DV.conf.finals.dimension.indicator.paramname] = DV.c.indicator.ids;
+            p[DV.conf.finals.dimension.dataelement.paramname] = DV.c.dataelement.ids;
+            p[DV.conf.finals.dimension.dataset.paramname] = DV.c.dataset.ids;
             p = Ext.Object.merge(p, DV.c.period.rp);
-            p.organisationUnitIds = DV.c.organisationunit.ids;
+            p[DV.conf.finals.dimension.organisationunit.paramname] = DV.c.organisationunit.ids;
             if (DV.c.organisationunit.groupsetid) {
 				p.organisationUnitGroupSetId = DV.c.organisationunit.groupsetid;
 			}