← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18413: Analysis plugins, legend set renamed.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 18413 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-02-25 16:18:26 +0100
message:
  Analysis plugins, legend set renamed.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/eventreport.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/map.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/table.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/chart.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventchart.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventreport.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/map.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/table.js
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/chart.js
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventchart.js
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventreport.js
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/map.js
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.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-apps/src/main/webapp/dhis-web-event-reports/scripts/eventreport.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/eventreport.js	2015-02-25 15:08:02 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/eventreport.js	2015-02-25 15:17:20 +0000
@@ -1153,9 +1153,9 @@
 				// legend set
 				xLayout.legendSet = layout.legendSet ? init.idLegendSetMap[layout.legendSet.id] : null;
 
-				if (layout.legendSet && layout.legendSet.mapLegends) {
+				if (layout.legendSet && layout.legendSet.legends) {
 					xLayout.legendSet = init.idLegendSetMap[layout.legendSet.id];
-					support.prototype.array.sort(xLayout.legendSet.mapLegends, 'ASC', 'startValue');
+					support.prototype.array.sort(xLayout.legendSet.legends, 'ASC', 'startValue');
 				}
 
 				// unique dimension names
@@ -2191,7 +2191,7 @@
 					valueObjects = [],
 					totalColObjects = [],
 					uuidDimUuidsMap = {},
-					isLegendSet = Ext.isObject(xLayout.legendSet) && Ext.isArray(xLayout.legendSet.mapLegends) && xLayout.legendSet.mapLegends.length,
+					isLegendSet = Ext.isObject(xLayout.legendSet) && Ext.isArray(xLayout.legendSet.legends) && xLayout.legendSet.legends.length,
                     tdCount = 0,
 					htmlArray;
 
@@ -2204,7 +2204,7 @@
 
 				getTdHtml = function(config, metaDataId) {
 					var bgColor,
-						mapLegends,
+						legends,
 						colSpan,
 						rowSpan,
 						htmlValue,
@@ -2229,11 +2229,11 @@
 					// background color from legend set
 					if (isNumeric && xLayout.legendSet) {
 						var value = parseFloat(config.value);
-						mapLegends = xLayout.legendSet.mapLegends;
+						legends = xLayout.legendSet.legends;
 
-						for (var i = 0; i < mapLegends.length; i++) {
-							if (Ext.Number.constrain(value, mapLegends[i].startValue, mapLegends[i].endValue) === value) {
-								bgColor = mapLegends[i].color;
+						for (var i = 0; i < legends.length; i++) {
+							if (Ext.Number.constrain(value, legends[i].startValue, legends[i].endValue) === value) {
+								bgColor = legends[i].color;
 							}
 						}
 					}
@@ -3316,9 +3316,9 @@
 
         // legend sets
         requests.push({
-            url: init.contextPath + '/api/mapLegendSets.json?fields=id,name,mapLegends[id,name,startValue,endValue,color]&paging=false',
+            url: init.contextPath + '/api/legendSets.json?fields=id,name,legends[id,name,startValue,endValue,color]&paging=false',
             success: function(r) {
-                init.legendSets = Ext.decode(r.responseText).mapLegendSets || [];
+                init.legendSets = Ext.decode(r.responseText).legendSets || [];
                 fn();
             }
         });

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/map.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/map.js	2015-02-25 15:08:02 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/map.js	2015-02-25 15:17:20 +0000
@@ -3842,7 +3842,7 @@
                     config = {};
 
                 success = function(r) {
-                    legends = r.responseText ? Ext.decode(r.responseText).mapLegends : r.mapLegends;
+                    legends = r.responseText ? Ext.decode(r.responseText).legends : r.legends;
 
                     Ext.Array.sort(legends, function(a, b) {
                         return a.startValue - b.startValue;
@@ -3871,7 +3871,7 @@
                     console.log(r);
                 };
 
-                config.url = gis.init.contextPath + '/api/mapLegendSets/' + view.legendSet.id + '.' + type + '?fields=' + gis.conf.url.mapLegendSetFields.join(',');
+                config.url = gis.init.contextPath + '/api/legendSets/' + view.legendSet.id + '.' + type + '?fields=' + gis.conf.url.legendSetFields.join(',');
                 config.disableCaching = false;
                 config.scope = this;
                 config.success = success;
@@ -4321,7 +4321,7 @@
                 'mapViews[' + conf.url.analysisFields.join(',') + ']'
             ];
 
-            conf.url.mapLegendFields = [
+            conf.url.legendFields = [
                 '*',
                 '!created',
                 '!lastUpdated',
@@ -4331,8 +4331,8 @@
                 '!userGroupAccesses'
             ];
 
-            conf.url.mapLegendSetFields = [
-                'id,name,mapLegends[' + conf.url.mapLegendFields.join(',') + ']'
+            conf.url.legendSetFields = [
+                'id,name,legends[' + conf.url.legendFields.join(',') + ']'
             ];
         }());
 

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/table.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/table.js	2015-02-25 15:08:02 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/table.js	2015-02-25 15:17:20 +0000
@@ -1039,7 +1039,7 @@
 
 				if (layout.legendSet) {
 					xLayout.legendSet = init.idLegendSetMap[layout.legendSet.id];
-					support.prototype.array.sort(xLayout.legendSet.mapLegends, 'ASC', 'startValue');
+					support.prototype.array.sort(xLayout.legendSet.legends, 'ASC', 'startValue');
 				}
 
 				// unique dimension names
@@ -2088,7 +2088,7 @@
 					valueObjects = [],
 					totalColObjects = [],
 					uuidDimUuidsMap = {},
-					isLegendSet = Ext.isObject(xLayout.legendSet) && Ext.isArray(xLayout.legendSet.mapLegends) && xLayout.legendSet.mapLegends.length,
+					isLegendSet = Ext.isObject(xLayout.legendSet) && Ext.isArray(xLayout.legendSet.legends) && xLayout.legendSet.legends.length,
                     tdCount = 0,
                     htmlArray;
 
@@ -2101,7 +2101,7 @@
 
 				getTdHtml = function(config, metaDataId) {
 					var bgColor,
-						mapLegends,
+						legends,
 						colSpan,
 						rowSpan,
 						htmlValue,
@@ -2151,11 +2151,11 @@
 					// background color from legend set
 					if (isValue && xLayout.legendSet) {
 						var value = parseFloat(config.value);
-						mapLegends = xLayout.legendSet.mapLegends;
+						legends = xLayout.legendSet.legends;
 
-						for (var i = 0; i < mapLegends.length; i++) {
-							if (Ext.Number.constrain(value, mapLegends[i].startValue, mapLegends[i].endValue) === value) {
-								bgColor = mapLegends[i].color;
+						for (var i = 0; i < legends.length; i++) {
+							if (Ext.Number.constrain(value, legends[i].startValue, legends[i].endValue) === value) {
+								bgColor = legends[i].color;
 							}
 						}
 					}
@@ -3013,9 +3013,9 @@
 
         // legend sets
         requests.push({
-            url: init.contextPath + '/api/mapLegendSets.json?fields=id,name,mapLegends[id,name,startValue,endValue,color]&paging=false',
+            url: init.contextPath + '/api/legendSets.json?fields=id,name,legends[id,name,startValue,endValue,color]&paging=false',
             success: function(r) {
-                init.legendSets = Ext.decode(r.responseText).mapLegendSets || [];
+                init.legendSets = Ext.decode(r.responseText).legendSets || [];
                 fn();
             }
         });

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/chart.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/chart.js	2015-02-25 15:08:02 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/chart.js	2015-02-25 15:17:20 +0000
@@ -1643,9 +1643,9 @@
 				// legend set
 				xLayout.legendSet = layout.legendSet ? init.idLegendSetMap[layout.legendSet.id] : null;
 
-				if (layout.legendSet && layout.legendSet.mapLegends) {
+				if (layout.legendSet && layout.legendSet.legends) {
 					xLayout.legendSet = init.idLegendSetMap[layout.legendSet.id];
-					support.prototype.array.sort(xLayout.legendSet.mapLegends, 'ASC', 'startValue');
+					support.prototype.array.sort(xLayout.legendSet.legends, 'ASC', 'startValue');
 				}
 
 				// unique dimension names
@@ -2119,17 +2119,17 @@
 			};
 
             // legend set
-            service.mapLegend = {};
+            service.legend = {};
 
-            service.mapLegend.getColorByValue = function(legendSet, value) {
+            service.legend.getColorByValue = function(legendSet, value) {
                 var color;
 
                 if (!(legendSet && value)) {
                     return;
                 }
 
-                for (var i = 0, legend; i < legendSet.mapLegends.length; i++) {
-                    legend = legendSet.mapLegends[i];
+                for (var i = 0, legend; i < legendSet.legends.length; i++) {
+                    legend = legendSet.legends[i];
 
                     if (value >= parseFloat(legend.startValue) && value < parseFloat(legend.endValue)) {
                         return legend.color;
@@ -3667,7 +3667,7 @@
 
                     // series, legendset
                     if (legendSet) {
-                        valueColor = service.mapLegend.getColorByValue(legendSet, store.getRange()[0].data[failSafeColumnIds[0]]) || valueColor;
+                        valueColor = service.legend.getColorByValue(legendSet, store.getRange()[0].data[failSafeColumnIds[0]]) || valueColor;
                     }
 
                     series = {
@@ -4135,7 +4135,7 @@
                 // legend set
                 if (xLayout.type === 'gauge' && Ext.Array.contains(xLayout.axisObjectNames, ind) && xLayout.objectNameIdsMap[ind].length) {
                     Ext.Ajax.request({
-                        url: ns.core.init.contextPath + '/api/indicators/' + xLayout.objectNameIdsMap[ind][0] + '.json?fields=legendSet[mapLegends[id,name,startValue,endValue,color]]',
+                        url: ns.core.init.contextPath + '/api/indicators/' + xLayout.objectNameIdsMap[ind][0] + '.json?fields=legendSet[legends[id,name,startValue,endValue,color]]',
                         disableCaching: false,
                         success: function(r) {
                             legendSet = Ext.decode(r.responseText).legendSet;

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventchart.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventchart.js	2015-02-25 15:08:02 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventchart.js	2015-02-25 15:17:20 +0000
@@ -1727,9 +1727,9 @@
 				// legend set
 				xLayout.legendSet = layout.legendSet ? init.idLegendSetMap[layout.legendSet.id] : null;
 
-				if (layout.legendSet && layout.legendSet.mapLegends) {
+				if (layout.legendSet && layout.legendSet.legends) {
 					xLayout.legendSet = init.idLegendSetMap[layout.legendSet.id];
-					support.prototype.array.sort(xLayout.legendSet.mapLegends, 'ASC', 'startValue');
+					support.prototype.array.sort(xLayout.legendSet.legends, 'ASC', 'startValue');
 				}
 
 				// unique dimension names
@@ -4107,7 +4107,7 @@
 
                     // series, legendset
                     if (legendSet) {
-                        valueColor = service.mapLegend.getColorByValue(legendSet, store.getRange()[0].data[failSafeColumnIds[0]]) || valueColor;
+                        valueColor = service.legend.getColorByValue(legendSet, store.getRange()[0].data[failSafeColumnIds[0]]) || valueColor;
                     }
 
                     series = {

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventreport.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventreport.js	2015-02-25 15:08:02 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventreport.js	2015-02-25 15:17:20 +0000
@@ -1153,9 +1153,9 @@
 				// legend set
 				xLayout.legendSet = layout.legendSet ? init.idLegendSetMap[layout.legendSet.id] : null;
 
-				if (layout.legendSet && layout.legendSet.mapLegends) {
+				if (layout.legendSet && layout.legendSet.legends) {
 					xLayout.legendSet = init.idLegendSetMap[layout.legendSet.id];
-					support.prototype.array.sort(xLayout.legendSet.mapLegends, 'ASC', 'startValue');
+					support.prototype.array.sort(xLayout.legendSet.legends, 'ASC', 'startValue');
 				}
 
 				// unique dimension names
@@ -2191,7 +2191,7 @@
 					valueObjects = [],
 					totalColObjects = [],
 					uuidDimUuidsMap = {},
-					isLegendSet = Ext.isObject(xLayout.legendSet) && Ext.isArray(xLayout.legendSet.mapLegends) && xLayout.legendSet.mapLegends.length,
+					isLegendSet = Ext.isObject(xLayout.legendSet) && Ext.isArray(xLayout.legendSet.legends) && xLayout.legendSet.legends.length,
                     tdCount = 0,
 					htmlArray;
 
@@ -2204,7 +2204,7 @@
 
 				getTdHtml = function(config, metaDataId) {
 					var bgColor,
-						mapLegends,
+						legends,
 						colSpan,
 						rowSpan,
 						htmlValue,
@@ -2229,11 +2229,11 @@
 					// background color from legend set
 					if (isNumeric && xLayout.legendSet) {
 						var value = parseFloat(config.value);
-						mapLegends = xLayout.legendSet.mapLegends;
+						legends = xLayout.legendSet.legends;
 
-						for (var i = 0; i < mapLegends.length; i++) {
-							if (Ext.Number.constrain(value, mapLegends[i].startValue, mapLegends[i].endValue) === value) {
-								bgColor = mapLegends[i].color;
+						for (var i = 0; i < legends.length; i++) {
+							if (Ext.Number.constrain(value, legends[i].startValue, legends[i].endValue) === value) {
+								bgColor = legends[i].color;
 							}
 						}
 					}
@@ -3316,9 +3316,9 @@
 
         // legend sets
         requests.push({
-            url: init.contextPath + '/api/mapLegendSets.json?fields=id,name,mapLegends[id,name,startValue,endValue,color]&paging=false',
+            url: init.contextPath + '/api/legendSets.json?fields=id,name,legends[id,name,startValue,endValue,color]&paging=false',
             success: function(r) {
-                init.legendSets = Ext.decode(r.responseText).mapLegendSets || [];
+                init.legendSets = Ext.decode(r.responseText).legendSets || [];
                 fn();
             }
         });

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/map.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/map.js	2015-02-25 15:08:02 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/map.js	2015-02-25 15:17:20 +0000
@@ -3842,7 +3842,7 @@
                     config = {};
 
                 success = function(r) {
-                    legends = r.responseText ? Ext.decode(r.responseText).mapLegends : r.mapLegends;
+                    legends = r.responseText ? Ext.decode(r.responseText).legends : r.legends;
 
                     Ext.Array.sort(legends, function(a, b) {
                         return a.startValue - b.startValue;
@@ -3871,7 +3871,7 @@
                     console.log(r);
                 };
 
-                config.url = gis.init.contextPath + '/api/mapLegendSets/' + view.legendSet.id + '.' + type + '?fields=' + gis.conf.url.mapLegendSetFields.join(',');
+                config.url = gis.init.contextPath + '/api/legendSets/' + view.legendSet.id + '.' + type + '?fields=' + gis.conf.url.legendSetFields.join(',');
                 config.disableCaching = false;
                 config.scope = this;
                 config.success = success;
@@ -4321,7 +4321,7 @@
                 'mapViews[' + conf.url.analysisFields.join(',') + ']'
             ];
 
-            conf.url.mapLegendFields = [
+            conf.url.legendFields = [
                 '*',
                 '!created',
                 '!lastUpdated',
@@ -4331,8 +4331,8 @@
                 '!userGroupAccesses'
             ];
 
-            conf.url.mapLegendSetFields = [
-                'id,name,mapLegends[' + conf.url.mapLegendFields.join(',') + ']'
+            conf.url.legendSetFields = [
+                'id,name,legends[' + conf.url.legendFields.join(',') + ']'
             ];
         }());
 

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/table.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/table.js	2015-02-25 15:08:02 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/table.js	2015-02-25 15:17:20 +0000
@@ -1039,7 +1039,7 @@
 
 				if (layout.legendSet) {
 					xLayout.legendSet = init.idLegendSetMap[layout.legendSet.id];
-					support.prototype.array.sort(xLayout.legendSet.mapLegends, 'ASC', 'startValue');
+					support.prototype.array.sort(xLayout.legendSet.legends, 'ASC', 'startValue');
 				}
 
 				// unique dimension names
@@ -2088,7 +2088,7 @@
 					valueObjects = [],
 					totalColObjects = [],
 					uuidDimUuidsMap = {},
-					isLegendSet = Ext.isObject(xLayout.legendSet) && Ext.isArray(xLayout.legendSet.mapLegends) && xLayout.legendSet.mapLegends.length,
+					isLegendSet = Ext.isObject(xLayout.legendSet) && Ext.isArray(xLayout.legendSet.legends) && xLayout.legendSet.legends.length,
                     tdCount = 0,
                     htmlArray;
 
@@ -2101,7 +2101,7 @@
 
 				getTdHtml = function(config, metaDataId) {
 					var bgColor,
-						mapLegends,
+						legends,
 						colSpan,
 						rowSpan,
 						htmlValue,
@@ -2151,11 +2151,11 @@
 					// background color from legend set
 					if (isValue && xLayout.legendSet) {
 						var value = parseFloat(config.value);
-						mapLegends = xLayout.legendSet.mapLegends;
+						legends = xLayout.legendSet.legends;
 
-						for (var i = 0; i < mapLegends.length; i++) {
-							if (Ext.Number.constrain(value, mapLegends[i].startValue, mapLegends[i].endValue) === value) {
-								bgColor = mapLegends[i].color;
+						for (var i = 0; i < legends.length; i++) {
+							if (Ext.Number.constrain(value, legends[i].startValue, legends[i].endValue) === value) {
+								bgColor = legends[i].color;
 							}
 						}
 					}
@@ -3013,9 +3013,9 @@
 
         // legend sets
         requests.push({
-            url: init.contextPath + '/api/mapLegendSets.json?fields=id,name,mapLegends[id,name,startValue,endValue,color]&paging=false',
+            url: init.contextPath + '/api/legendSets.json?fields=id,name,legends[id,name,startValue,endValue,color]&paging=false',
             success: function(r) {
-                init.legendSets = Ext.decode(r.responseText).mapLegendSets || [];
+                init.legendSets = Ext.decode(r.responseText).legendSets || [];
                 fn();
             }
         });

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/chart.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/chart.js	2015-02-25 15:08:02 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/chart.js	2015-02-25 15:17:20 +0000
@@ -1643,9 +1643,9 @@
 				// legend set
 				xLayout.legendSet = layout.legendSet ? init.idLegendSetMap[layout.legendSet.id] : null;
 
-				if (layout.legendSet && layout.legendSet.mapLegends) {
+				if (layout.legendSet && layout.legendSet.legends) {
 					xLayout.legendSet = init.idLegendSetMap[layout.legendSet.id];
-					support.prototype.array.sort(xLayout.legendSet.mapLegends, 'ASC', 'startValue');
+					support.prototype.array.sort(xLayout.legendSet.legends, 'ASC', 'startValue');
 				}
 
 				// unique dimension names
@@ -2119,17 +2119,17 @@
 			};
 
             // legend set
-            service.mapLegend = {};
+            service.legend = {};
 
-            service.mapLegend.getColorByValue = function(legendSet, value) {
+            service.legend.getColorByValue = function(legendSet, value) {
                 var color;
 
                 if (!(legendSet && value)) {
                     return;
                 }
 
-                for (var i = 0, legend; i < legendSet.mapLegends.length; i++) {
-                    legend = legendSet.mapLegends[i];
+                for (var i = 0, legend; i < legendSet.legends.length; i++) {
+                    legend = legendSet.legends[i];
 
                     if (value >= parseFloat(legend.startValue) && value < parseFloat(legend.endValue)) {
                         return legend.color;
@@ -3660,7 +3660,7 @@
 
                     // series, legendset
                     if (legendSet) {
-                        valueColor = service.mapLegend.getColorByValue(legendSet, store.getRange()[0].data[failSafeColumnIds[0]]) || valueColor;
+                        valueColor = service.legend.getColorByValue(legendSet, store.getRange()[0].data[failSafeColumnIds[0]]) || valueColor;
                     }
 
                     series = {
@@ -4132,7 +4132,7 @@
                 // legend set
                 if (xLayout.type === 'gauge' && Ext.Array.contains(xLayout.axisObjectNames, ind) && xLayout.objectNameIdsMap[ind].length) {
                     Ext.Ajax.request({
-                        url: ns.core.init.contextPath + '/api/indicators/' + xLayout.objectNameIdsMap[ind][0] + '.json?fields=legendSet[mapLegends[id,name,startValue,endValue,color]]',
+                        url: ns.core.init.contextPath + '/api/indicators/' + xLayout.objectNameIdsMap[ind][0] + '.json?fields=legendSet[legends[id,name,startValue,endValue,color]]',
                         disableCaching: false,
                         success: function(r) {
                             legendSet = Ext.decode(r.responseText).legendSet;

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventchart.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventchart.js	2015-02-25 15:08:02 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventchart.js	2015-02-25 15:17:20 +0000
@@ -1727,9 +1727,9 @@
 				// legend set
 				xLayout.legendSet = layout.legendSet ? init.idLegendSetMap[layout.legendSet.id] : null;
 
-				if (layout.legendSet && layout.legendSet.mapLegends) {
+				if (layout.legendSet && layout.legendSet.legends) {
 					xLayout.legendSet = init.idLegendSetMap[layout.legendSet.id];
-					support.prototype.array.sort(xLayout.legendSet.mapLegends, 'ASC', 'startValue');
+					support.prototype.array.sort(xLayout.legendSet.legends, 'ASC', 'startValue');
 				}
 
 				// unique dimension names
@@ -4100,7 +4100,7 @@
 
                     // series, legendset
                     if (legendSet) {
-                        valueColor = service.mapLegend.getColorByValue(legendSet, store.getRange()[0].data[failSafeColumnIds[0]]) || valueColor;
+                        valueColor = service.legend.getColorByValue(legendSet, store.getRange()[0].data[failSafeColumnIds[0]]) || valueColor;
                     }
 
                     series = {

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventreport.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventreport.js	2015-02-25 15:08:02 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventreport.js	2015-02-25 15:17:20 +0000
@@ -1153,9 +1153,9 @@
 				// legend set
 				xLayout.legendSet = layout.legendSet ? init.idLegendSetMap[layout.legendSet.id] : null;
 
-				if (layout.legendSet && layout.legendSet.mapLegends) {
+				if (layout.legendSet && layout.legendSet.legends) {
 					xLayout.legendSet = init.idLegendSetMap[layout.legendSet.id];
-					support.prototype.array.sort(xLayout.legendSet.mapLegends, 'ASC', 'startValue');
+					support.prototype.array.sort(xLayout.legendSet.legends, 'ASC', 'startValue');
 				}
 
 				// unique dimension names
@@ -2184,7 +2184,7 @@
 					valueObjects = [],
 					totalColObjects = [],
 					uuidDimUuidsMap = {},
-					isLegendSet = Ext.isObject(xLayout.legendSet) && Ext.isArray(xLayout.legendSet.mapLegends) && xLayout.legendSet.mapLegends.length,
+					isLegendSet = Ext.isObject(xLayout.legendSet) && Ext.isArray(xLayout.legendSet.legends) && xLayout.legendSet.legends.length,
                     tdCount = 0,
 					htmlArray;
 
@@ -2197,7 +2197,7 @@
 
 				getTdHtml = function(config, metaDataId) {
 					var bgColor,
-						mapLegends,
+						legends,
 						colSpan,
 						rowSpan,
 						htmlValue,
@@ -2222,11 +2222,11 @@
 					// background color from legend set
 					if (isNumeric && xLayout.legendSet) {
 						var value = parseFloat(config.value);
-						mapLegends = xLayout.legendSet.mapLegends;
+						legends = xLayout.legendSet.legends;
 
-						for (var i = 0; i < mapLegends.length; i++) {
-							if (Ext.Number.constrain(value, mapLegends[i].startValue, mapLegends[i].endValue) === value) {
-								bgColor = mapLegends[i].color;
+						for (var i = 0; i < legends.length; i++) {
+							if (Ext.Number.constrain(value, legends[i].startValue, legends[i].endValue) === value) {
+								bgColor = legends[i].color;
 							}
 						}
 					}
@@ -3309,9 +3309,9 @@
 
         // legend sets
         requests.push({
-            url: init.contextPath + '/api/mapLegendSets.json?fields=id,name,mapLegends[id,name,startValue,endValue,color]&paging=false',
+            url: init.contextPath + '/api/legendSets.json?fields=id,name,legends[id,name,startValue,endValue,color]&paging=false',
             success: function(r) {
-                init.legendSets = Ext.decode(r.responseText).mapLegendSets || [];
+                init.legendSets = Ext.decode(r.responseText).legendSets || [];
                 fn();
             }
         });

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/map.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/map.js	2015-02-25 15:08:02 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/map.js	2015-02-25 15:17:20 +0000
@@ -3852,7 +3852,7 @@
                     config = {};
 
                 success = function(r) {
-                    legends = r.responseText ? Ext.decode(r.responseText).mapLegends : r.mapLegends;
+                    legends = r.responseText ? Ext.decode(r.responseText).legends : r.legends;
 
                     Ext.Array.sort(legends, function(a, b) {
                         return a.startValue - b.startValue;
@@ -3881,7 +3881,7 @@
                     console.log(r);
                 };
 
-                config.url = gis.init.contextPath + '/api/mapLegendSets/' + view.legendSet.id + '.' + type + '?fields=' + gis.conf.url.mapLegendSetFields.join(',');
+                config.url = gis.init.contextPath + '/api/legendSets/' + view.legendSet.id + '.' + type + '?fields=' + gis.conf.url.legendSetFields.join(',');
                 config.disableCaching = false;
                 config.scope = this;
                 config.success = success;
@@ -4331,7 +4331,7 @@
                 'mapViews[' + conf.url.analysisFields.join(',') + ']'
             ];
 
-            conf.url.mapLegendFields = [
+            conf.url.legendFields = [
                 '*',
                 '!created',
                 '!lastUpdated',
@@ -4341,8 +4341,8 @@
                 '!userGroupAccesses'
             ];
 
-            conf.url.mapLegendSetFields = [
-                'id,name,mapLegends[' + conf.url.mapLegendFields.join(',') + ']'
+            conf.url.legendSetFields = [
+                'id,name,legends[' + conf.url.legendFields.join(',') + ']'
             ];
         }());
 

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js	2015-02-25 15:08:02 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js	2015-02-25 15:17:20 +0000
@@ -1039,7 +1039,7 @@
 
 				if (layout.legendSet) {
 					xLayout.legendSet = init.idLegendSetMap[layout.legendSet.id];
-					support.prototype.array.sort(xLayout.legendSet.mapLegends, 'ASC', 'startValue');
+					support.prototype.array.sort(xLayout.legendSet.legends, 'ASC', 'startValue');
 				}
 
 				// unique dimension names
@@ -2081,7 +2081,7 @@
 					valueObjects = [],
 					totalColObjects = [],
 					uuidDimUuidsMap = {},
-					isLegendSet = Ext.isObject(xLayout.legendSet) && Ext.isArray(xLayout.legendSet.mapLegends) && xLayout.legendSet.mapLegends.length,
+					isLegendSet = Ext.isObject(xLayout.legendSet) && Ext.isArray(xLayout.legendSet.legends) && xLayout.legendSet.legends.length,
                     tdCount = 0,
                     htmlArray;
 
@@ -2094,7 +2094,7 @@
 
 				getTdHtml = function(config, metaDataId) {
 					var bgColor,
-						mapLegends,
+						legends,
 						colSpan,
 						rowSpan,
 						htmlValue,
@@ -2144,11 +2144,11 @@
 					// background color from legend set
 					if (isValue && xLayout.legendSet) {
 						var value = parseFloat(config.value);
-						mapLegends = xLayout.legendSet.mapLegends;
+						legends = xLayout.legendSet.legends;
 
-						for (var i = 0; i < mapLegends.length; i++) {
-							if (Ext.Number.constrain(value, mapLegends[i].startValue, mapLegends[i].endValue) === value) {
-								bgColor = mapLegends[i].color;
+						for (var i = 0; i < legends.length; i++) {
+							if (Ext.Number.constrain(value, legends[i].startValue, legends[i].endValue) === value) {
+								bgColor = legends[i].color;
 							}
 						}
 					}
@@ -3006,9 +3006,9 @@
 
         // legend sets
         requests.push({
-            url: init.contextPath + '/api/mapLegendSets.json?fields=id,name,mapLegends[id,name,startValue,endValue,color]&paging=false',
+            url: init.contextPath + '/api/legendSets.json?fields=id,name,legends[id,name,startValue,endValue,color]&paging=false',
             success: function(r) {
-                init.legendSets = Ext.decode(r.responseText).mapLegendSets || [];
+                init.legendSets = Ext.decode(r.responseText).legendSets || [];
                 fn();
             }
         });