dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16680
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6399: (DV) Plugin update + (GIS) i18n update.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 6399 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-03-27 17:33:09 +0200
message:
(DV) Plugin update + (GIS) i18n update.
modified:
dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module.properties
dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module_fr_FR.properties
dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedValuesPluginAction.java
dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.html
dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.js
dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedValuesPlugin.vm
--
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-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module.properties 2012-02-08 15:15:18 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module.properties 2012-03-27 14:58:33 +0000
@@ -298,3 +298,5 @@
no_values_found=No values found
close=Close
boundary_layer=Boundary layer
+legend_symbolizer=Symbolizer
+image=Image
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module_fr_FR.properties'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module_fr_FR.properties 2012-03-08 08:08:46 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module_fr_FR.properties 2012-03-27 14:58:33 +0000
@@ -298,3 +298,5 @@
no_values_found=Aucune valeur trouv\u00e9e
close=Fermer
boundary_layer=Couche fronti\u00e8re
+legend_symbolizer=Symbolisant
+image=Image
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedValuesPluginAction.java'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedValuesPluginAction.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedValuesPluginAction.java 2012-03-27 14:58:12 +0000
@@ -177,6 +177,18 @@
{
this.last5Years = last5Years;
}
+
+ public String callback;
+
+ public String getCallback()
+ {
+ return callback;
+ }
+
+ public void setCallback( String callback )
+ {
+ this.callback = callback;
+ }
// -------------------------------------------------------------------------
// Output
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.html'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.html 2011-12-25 15:40:58 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.html 2012-03-27 14:58:12 +0000
@@ -1,10 +1,9 @@
<html>
<head>
- <link rel="stylesheet" type="text/css" href="../lib/ext/resources/css/ext-all-gray.css" />
- <script type="text/javascript" src="../lib/ext/ext-all.js"></script>
- <script type="text/javascript" src="plugin.js"></script>
-
- <link rel="stylesheet" type="text/css" href="../css/plugin.css" />
+ <link rel="stylesheet" type="text/css" href="http://extjs-public.googlecode.com/svn/tags/extjs-4.0.7/release/resources/css/ext-all-gray.css" />
+ <link rel="stylesheet" type="text/css" href="http://apps.dhis2.org/demo/dhis-web-visualizer/app/css/plugin.css" />
+ <script type="text/javascript" src="http://extjs-public.googlecode.com/svn/tags/extjs-4.0.7/release/ext-all.js"></script>
+ <script type="text/javascript" src="http://apps.dhis2.org/demo/dhis-web-visualizer/app/plugin/plugin.js"></script>
</head>
<body>
@@ -17,7 +16,7 @@
<script>
Ext.onReady( function() {
- var url = 'http://localhost:8180/dhis/';
+ var url = 'http://apps.dhis2.org/demo/';
/*
CONFIG TYPE DEFAULT DESCRIPTION
@@ -30,29 +29,31 @@
series string 'data' (Optional) Series: 'data', 'period' or 'organisationunit'
category string 'period' (Optional) Category: 'indicator', 'dataelement', 'period' or 'organisationunit'
filter string 'organisationunit' (Optional) Filter: 'indicator', 'dataelement', 'period' or 'organisationunit'
-el string (Required) The element to render the chart.
+el string (Required) The element id to render the chart.
width integer <el width> (Optional) Chart width. Default is the element width.
height integer <el height> (Optional) Chart height. Default is the element height.
legendPosition string 'top' (Optional) Positions: 'top', 'right', 'bottom' or 'left'
-url string (Required) The web service url.
-uid string (Optional) The uid of a store chart.
+url string (Required) The base url of the DHIS instance.
+uid string (Optional) The chart uid.
Note: If a uid is provided, only 'el' and 'url' are required.
*/
+
+ DHIS.getChart({
+ uid: 'R0DVGvXDUNP',
+ el: 'chart1',
+ url: url
+ });
+
DHIS.getChart({
type: 'stackedcolumn',
indicators: [52486, 52491],
- organisationunits: [18],
- el: 'chart1',
+ periods: 'last12Months',
+ organisationunits: [525],
+ el: 'chart2',
url: url
});
-
- DHIS.getChart({
- uid: 'UlfTKWZWV4u',
- el: 'chart2',
- url: url
- });
});
</script>
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.js 2011-12-21 23:16:44 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.js 2012-03-27 15:30:24 +0000
@@ -2,7 +2,7 @@
DHIS.conf = {
finals: {
ajax: {
- data_get: 'dhis-web-visualizer/app/getAggregatedValuesPlugin.action',
+ data_get: 'dhis-web-visualizer/getAggregatedValuesPlugin.action',
favorite_get: 'api/charts/'
},
dimension: {
@@ -278,8 +278,7 @@
}
},
value: {
- jsonfy: function(r) {
- r = Ext.JSON.decode(r.responseText);
+ jsonfy: function(r) {
var object = {
values: [],
periods: r.p
@@ -386,28 +385,28 @@
},
setState: function(conf) {
if (conf.uid) {
- Ext.Ajax.request({
- url: conf.url + DHIS.conf.finals.ajax.favorite_get + conf.uid + '.json',
+ Ext.data.JsonP.request({
+ url: conf.url + DHIS.conf.finals.ajax.favorite_get + conf.uid + '.jsonp',
scope: this,
success: function(r) {
- if (!r.responseText) {
+ if (!r) {
alert('Invalid uid');
return;
}
- var f = Ext.JSON.decode(r.responseText);
- conf.type = f.type.toLowerCase();
- conf.periods = DHIS.util.dimension.period.getRelativesFromObject(f.relativePeriods);
- conf.organisationunits = DHIS.util.dimension.organisationunit.getIdsFromObjects(f.organisationUnits);
- conf.series = f.series.toLowerCase();
- conf.category = f.category.toLowerCase();
- conf.filter = f.filter.toLowerCase();
+
+ conf.type = r.type.toLowerCase();
+ conf.periods = DHIS.util.dimension.period.getRelativesFromObject(r.relativePeriods);
+ conf.organisationunits = DHIS.util.dimension.organisationunit.getIdsFromObjects(r.organisationUnits);
+ conf.series = r.series.toLowerCase();
+ conf.category = r.category.toLowerCase();
+ conf.filter = r.filter.toLowerCase();
conf.legendPosition = conf.legendPosition || false;
- if (f.indicators) {
- conf.indicators = DHIS.util.dimension.indicator.getIdsFromObjects(f.indicators);
+ if (r.indicators) {
+ conf.indicators = DHIS.util.dimension.indicator.getIdsFromObjects(r.indicators);
}
- if (f.dataelements) {
- conf.dataelements = DHIS.util.dimension.dataelement.getIdsFromObjects(f.dataelements);
+ if (r.dataelements) {
+ conf.dataelements = DHIS.util.dimension.dataelement.getIdsFromObjects(r.dataelements);
}
this.getState(conf);
@@ -429,7 +428,7 @@
baseUrl = Ext.String.urlAppend(baseUrl, item);
});
- Ext.Ajax.request({
+ Ext.data.JsonP.request({
url: baseUrl,
success: function(r) {
var json = DHIS.util.value.jsonfy(r);
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedValuesPlugin.vm'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedValuesPlugin.vm 2011-12-21 19:42:20 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedValuesPlugin.vm 2012-03-27 15:30:24 +0000
@@ -1,1 +1,2 @@
-#set( $indicatorSize = $indicatorValues.size() )#set( $dataSize = $dataValues.size() )#set( $periodSize = $periods.size() ){"v":[#if( $indicatorSize > 0 )#foreach( $iv in $indicatorValues )["$!{iv.value}","$!{iv.indicatorName}","$!{iv.periodName}","$!{iv.organisationUnitName}"]#if( $velocityCount < $indicatorSize ),#end#end#end#if( $dataSize > 0 )#if( $indicatorSize > 0 ),#end#foreach( $dv in $dataValues )["$!{dv.value}","$!{dv.dataElementName}","$!{dv.periodName}","$!{dv.organisationUnitName}"]#if( $velocityCount < $dataSize ),#end#end#end],"p":[#foreach($p in $periods)"$!encoder.jsonEncode(${p.name})"#if($velocityCount<$periodSize),#end#end]}
\ No newline at end of file
+#set( $indicatorSize = $indicatorValues.size() )#set( $dataSize = $dataValues.size() )#set( $periodSize = $periods.size() )
+${callback}({"v":[#if( $indicatorSize > 0 )#foreach( $iv in $indicatorValues )["$!{iv.value}","$!{iv.indicatorName}","$!{iv.periodName}","$!{iv.organisationUnitName}"]#if( $velocityCount < $indicatorSize ),#end#end#end#if( $dataSize > 0 )#if( $indicatorSize > 0 ),#end#foreach( $dv in $dataValues )["$!{dv.value}","$!{dv.dataElementName}","$!{dv.periodName}","$!{dv.organisationUnitName}"]#if( $velocityCount < $dataSize ),#end#end#end],"p":[#foreach($p in $periods)"$!encoder.jsonEncode(${p.name})"#if($velocityCount<$periodSize),#end#end]})
\ No newline at end of file