← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20179: DV plugin updated.

 

------------------------------------------------------------
revno: 20179
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-09-16 01:25:51 +0200
message:
  DV plugin updated.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/plugin.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/chart.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-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/chart.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-visualizer/plugin.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/plugin.html	2015-09-11 22:00:37 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/plugin.html	2015-09-15 23:25:51 +0000
@@ -24,8 +24,7 @@
 				el: 'chart1',
 				uid: 'vIlITOVLOjI',
                 crossDomain: false,
-                dashboard: true,
-                userOrgUnit: 'qhqAxPSTUXp'
+                dashboard: true
 			});
 
 			//DHIS.getChart({

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/chart.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/chart.js	2015-09-11 22:00:37 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/chart.js	2015-09-15 23:25:51 +0000
@@ -4299,62 +4299,116 @@
 			web.chart.getData = function(layout, isUpdateGui) {
 				var xLayout,
 					paramString,
-                    success,
-                    failure,
-                    config = {};
+                    sortedParamString,
+                    onFailure;
 
 				if (!layout) {
 					return;
 				}
 
+                onFailure = function(r) {
+                    if (!ns.skipMask) {
+                        web.mask.hide(ns.app.centerRegion);
+                    }
+                };
+
 				xLayout = service.layout.getExtendedLayout(layout);
-				paramString = web.analytics.getParamString(xLayout, true);
+				paramString = web.analytics.getParamString(xLayout) + '&skipData=true';
+				sortedParamString = web.analytics.getParamString(xLayout, true) + '&skipMeta=true';
 
 				// mask
                 if (!ns.skipMask) {
                     web.mask.show(ns.app.centerRegion);
                 }
 
-                success = function(r) {
-                    var response = api.response.Response((r.responseText ? Ext.decode(r.responseText) : r));
-
-                    if (!response) {
-                        web.mask.hide(ns.app.centerRegion);
-                        return;
-                    }
-
-                    // sync xLayout with response
-                    xLayout = service.layout.getSyncronizedXLayout(xLayout, response);
-
-                    if (!xLayout) {
-                        web.mask.hide(ns.app.centerRegion);
-                        return;
-                    }
-
-                    ns.app.paramString = paramString;
-
-                    web.chart.getChart(layout, xLayout, response, isUpdateGui);
-                };
-
-                failure = function(r) {
-                    if (!ns.skipMask) {
-                        web.mask.hide(ns.app.centerRegion);
-                    }
-                };
-
-                config.url = init.contextPath + '/api/analytics.' + type + paramString;
-                config.disableCaching = false;
-                config.timeout = 60000;
-                config.headers = headers;
-                config.success = success;
-                config.failure = failure;
-
-                if (type === 'jsonp') {
-                    Ext.data.JsonP.request(config);
-                }
-                else {
-                    Ext.Ajax.request(config);
-                }
+                ns.ajax({
+					url: init.contextPath + '/api/analytics.json' + paramString,
+					timeout: 60000,
+					headers: {
+						'Content-Type': 'application/json',
+						'Accepts': 'application/json'
+					},
+					disableCaching: false,
+					failure: function(r) {
+                        onFailure(r);
+					},
+					success: function(r) {
+                        var metaData = Ext.decode(r.responseText).metaData;
+
+                        ns.ajax({
+                            url: init.contextPath + '/api/analytics.json' + sortedParamString,
+                            timeout: 60000,
+                            headers: {
+                                'Content-Type': 'application/json',
+                                'Accepts': 'application/json'
+                            },
+                            disableCaching: false,
+                            failure: function(r) {
+                                onFailure(r);
+                            },
+                            success: function(r) {
+                                var response = api.response.Response(Ext.decode(r.responseText));
+
+                                if (!response) {
+                                    onFailure();
+                                    return;
+                                }
+
+                                response.metaData = metaData;
+
+                                // sync xLayout with response
+                                xLayout = service.layout.getSyncronizedXLayout(xLayout, response);
+
+                                if (!xLayout) {
+                                    return;
+                                }
+
+                                ns.app.paramString = sortedParamString;
+
+                                web.chart.getChart(layout, xLayout, response, isUpdateGui);
+                            }
+                        }, ns);
+					}
+				}, ns);
+
+
+
+
+
+                //success = function(r) {
+                    //var response = api.response.Response((r.responseText ? Ext.decode(r.responseText) : r));
+
+                    //if (!response) {
+                        //web.mask.hide(ns.app.centerRegion);
+                        //return;
+                    //}
+
+                    //// sync xLayout with response
+                    //xLayout = service.layout.getSyncronizedXLayout(xLayout, response);
+
+                    //if (!xLayout) {
+                        //web.mask.hide(ns.app.centerRegion);
+                        //return;
+                    //}
+
+                    //ns.app.paramString = paramString;
+
+                    //web.chart.getChart(layout, xLayout, response, isUpdateGui);
+                //};
+
+                //config.url = init.contextPath + '/api/analytics.' + type + paramString;
+                //config.disableCaching = false;
+                //config.timeout = 60000;
+                //config.headers = headers;
+                //config.success = success;
+                //config.failure = failure;
+
+                //if (type === 'jsonp') {
+                    //Ext.data.JsonP.request(config);
+                //}
+                //else {
+                    //Ext.Ajax.request(config);
+                //}
 			};
 
 			web.chart.getChart = function(layout, xLayout, response, isUpdateGui) {

=== 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-09-11 22:00:37 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/chart.js	2015-09-15 23:25:51 +0000
@@ -4299,62 +4299,116 @@
 			web.chart.getData = function(layout, isUpdateGui) {
 				var xLayout,
 					paramString,
-                    success,
-                    failure,
-                    config = {};
+                    sortedParamString,
+                    onFailure;
 
 				if (!layout) {
 					return;
 				}
 
+                onFailure = function(r) {
+                    if (!ns.skipMask) {
+                        web.mask.hide(ns.app.centerRegion);
+                    }
+                };
+
 				xLayout = service.layout.getExtendedLayout(layout);
-				paramString = web.analytics.getParamString(xLayout, true);
+				paramString = web.analytics.getParamString(xLayout) + '&skipData=true';
+				sortedParamString = web.analytics.getParamString(xLayout, true) + '&skipMeta=true';
 
 				// mask
                 if (!ns.skipMask) {
                     web.mask.show(ns.app.centerRegion);
                 }
 
-                success = function(r) {
-                    var response = api.response.Response((r.responseText ? Ext.decode(r.responseText) : r));
-
-                    if (!response) {
-                        web.mask.hide(ns.app.centerRegion);
-                        return;
-                    }
-
-                    // sync xLayout with response
-                    xLayout = service.layout.getSyncronizedXLayout(xLayout, response);
-
-                    if (!xLayout) {
-                        web.mask.hide(ns.app.centerRegion);
-                        return;
-                    }
-
-                    ns.app.paramString = paramString;
-
-                    web.chart.getChart(layout, xLayout, response, isUpdateGui);
-                };
-
-                failure = function(r) {
-                    if (!ns.skipMask) {
-                        web.mask.hide(ns.app.centerRegion);
-                    }
-                };
-
-                config.url = init.contextPath + '/api/analytics.' + type + paramString;
-                config.disableCaching = false;
-                config.timeout = 60000;
-                config.headers = headers;
-                config.success = success;
-                config.failure = failure;
-
-                if (type === 'jsonp') {
-                    Ext.data.JsonP.request(config);
-                }
-                else {
-                    Ext.Ajax.request(config);
-                }
+                ns.ajax({
+					url: init.contextPath + '/api/analytics.json' + paramString,
+					timeout: 60000,
+					headers: {
+						'Content-Type': 'application/json',
+						'Accepts': 'application/json'
+					},
+					disableCaching: false,
+					failure: function(r) {
+                        onFailure(r);
+					},
+					success: function(r) {
+                        var metaData = Ext.decode(r.responseText).metaData;
+
+                        ns.ajax({
+                            url: init.contextPath + '/api/analytics.json' + sortedParamString,
+                            timeout: 60000,
+                            headers: {
+                                'Content-Type': 'application/json',
+                                'Accepts': 'application/json'
+                            },
+                            disableCaching: false,
+                            failure: function(r) {
+                                onFailure(r);
+                            },
+                            success: function(r) {
+                                var response = api.response.Response(Ext.decode(r.responseText));
+
+                                if (!response) {
+                                    onFailure();
+                                    return;
+                                }
+
+                                response.metaData = metaData;
+
+                                // sync xLayout with response
+                                xLayout = service.layout.getSyncronizedXLayout(xLayout, response);
+
+                                if (!xLayout) {
+                                    return;
+                                }
+
+                                ns.app.paramString = sortedParamString;
+
+                                web.chart.getChart(layout, xLayout, response, isUpdateGui);
+                            }
+                        }, ns);
+					}
+				}, ns);
+
+
+
+
+
+                //success = function(r) {
+                    //var response = api.response.Response((r.responseText ? Ext.decode(r.responseText) : r));
+
+                    //if (!response) {
+                        //web.mask.hide(ns.app.centerRegion);
+                        //return;
+                    //}
+
+                    //// sync xLayout with response
+                    //xLayout = service.layout.getSyncronizedXLayout(xLayout, response);
+
+                    //if (!xLayout) {
+                        //web.mask.hide(ns.app.centerRegion);
+                        //return;
+                    //}
+
+                    //ns.app.paramString = paramString;
+
+                    //web.chart.getChart(layout, xLayout, response, isUpdateGui);
+                //};
+
+                //config.url = init.contextPath + '/api/analytics.' + type + paramString;
+                //config.disableCaching = false;
+                //config.timeout = 60000;
+                //config.headers = headers;
+                //config.success = success;
+                //config.failure = failure;
+
+                //if (type === 'jsonp') {
+                    //Ext.data.JsonP.request(config);
+                //}
+                //else {
+                    //Ext.Ajax.request(config);
+                //}
 			};
 
 			web.chart.getChart = function(layout, xLayout, response, isUpdateGui) {

=== 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-09-11 22:00:37 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/chart.js	2015-09-15 23:25:51 +0000
@@ -4299,62 +4299,116 @@
 			web.chart.getData = function(layout, isUpdateGui) {
 				var xLayout,
 					paramString,
-                    success,
-                    failure,
-                    config = {};
+                    sortedParamString,
+                    onFailure;
 
 				if (!layout) {
 					return;
 				}
 
+                onFailure = function(r) {
+                    if (!ns.skipMask) {
+                        web.mask.hide(ns.app.centerRegion);
+                    }
+                };
+
 				xLayout = service.layout.getExtendedLayout(layout);
-				paramString = web.analytics.getParamString(xLayout, true);
+				paramString = web.analytics.getParamString(xLayout) + '&skipData=true';
+				sortedParamString = web.analytics.getParamString(xLayout, true) + '&skipMeta=true';
 
 				// mask
                 if (!ns.skipMask) {
                     web.mask.show(ns.app.centerRegion);
                 }
 
-                success = function(r) {
-                    var response = api.response.Response((r.responseText ? Ext.decode(r.responseText) : r));
-
-                    if (!response) {
-                        web.mask.hide(ns.app.centerRegion);
-                        return;
-                    }
-
-                    // sync xLayout with response
-                    xLayout = service.layout.getSyncronizedXLayout(xLayout, response);
-
-                    if (!xLayout) {
-                        web.mask.hide(ns.app.centerRegion);
-                        return;
-                    }
-
-                    ns.app.paramString = paramString;
-
-                    web.chart.getChart(layout, xLayout, response, isUpdateGui);
-                };
-
-                failure = function(r) {
-                    if (!ns.skipMask) {
-                        web.mask.hide(ns.app.centerRegion);
-                    }
-                };
-
-                config.url = init.contextPath + '/api/analytics.' + type + paramString;
-                config.disableCaching = false;
-                config.timeout = 60000;
-                config.headers = headers;
-                config.success = success;
-                config.failure = failure;
-
-                if (type === 'jsonp') {
-                    Ext.data.JsonP.request(config);
-                }
-                else {
-                    Ext.Ajax.request(config);
-                }
+                ns.ajax({
+					url: init.contextPath + '/api/analytics.json' + paramString,
+					timeout: 60000,
+					headers: {
+						'Content-Type': 'application/json',
+						'Accepts': 'application/json'
+					},
+					disableCaching: false,
+					failure: function(r) {
+                        onFailure(r);
+					},
+					success: function(r) {
+                        var metaData = Ext.decode(r.responseText).metaData;
+
+                        ns.ajax({
+                            url: init.contextPath + '/api/analytics.json' + sortedParamString,
+                            timeout: 60000,
+                            headers: {
+                                'Content-Type': 'application/json',
+                                'Accepts': 'application/json'
+                            },
+                            disableCaching: false,
+                            failure: function(r) {
+                                onFailure(r);
+                            },
+                            success: function(r) {
+                                var response = api.response.Response(Ext.decode(r.responseText));
+
+                                if (!response) {
+                                    onFailure();
+                                    return;
+                                }
+
+                                response.metaData = metaData;
+
+                                // sync xLayout with response
+                                xLayout = service.layout.getSyncronizedXLayout(xLayout, response);
+
+                                if (!xLayout) {
+                                    return;
+                                }
+
+                                ns.app.paramString = sortedParamString;
+
+                                web.chart.getChart(layout, xLayout, response, isUpdateGui);
+                            }
+                        }, ns);
+					}
+				}, ns);
+
+
+
+
+
+                //success = function(r) {
+                    //var response = api.response.Response((r.responseText ? Ext.decode(r.responseText) : r));
+
+                    //if (!response) {
+                        //web.mask.hide(ns.app.centerRegion);
+                        //return;
+                    //}
+
+                    //// sync xLayout with response
+                    //xLayout = service.layout.getSyncronizedXLayout(xLayout, response);
+
+                    //if (!xLayout) {
+                        //web.mask.hide(ns.app.centerRegion);
+                        //return;
+                    //}
+
+                    //ns.app.paramString = paramString;
+
+                    //web.chart.getChart(layout, xLayout, response, isUpdateGui);
+                //};
+
+                //config.url = init.contextPath + '/api/analytics.' + type + paramString;
+                //config.disableCaching = false;
+                //config.timeout = 60000;
+                //config.headers = headers;
+                //config.success = success;
+                //config.failure = failure;
+
+                //if (type === 'jsonp') {
+                    //Ext.data.JsonP.request(config);
+                //}
+                //else {
+                    //Ext.Ajax.request(config);
+                //}
 			};
 
 			web.chart.getChart = function(layout, xLayout, response, isUpdateGui) {