dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #00802
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 234: Map comboboxes now display map name instead of map layer path.
------------------------------------------------------------
revno: 234
committer: Jan Henrik Overland janhenrik.overland@xxxxxxxxx
branch nick: trunk
timestamp: Thu 2009-04-23 15:08:41 +0200
message:
Map comboboxes now display map name instead of map layer path.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java
gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddOrUpdateMapAction.java
gis/dhis-web-mapping/src/main/webapp/demos/geostat/geostat.js
gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMap.vm
gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminMaps.vm
gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Choropleth.js
gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Mapping.js
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java 2009-04-23 12:08:22 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java 2009-04-23 13:08:41 +0000
@@ -53,6 +53,7 @@
/**
* Adds a Map.
*
+ * @param name, Map description.
* @param mapLayerPath, the link to Geoserver.
* @param organisationUnitId, the id of the organisation unit.
* @param organisationUnitLevelId, the level of the organisation units into
@@ -73,6 +74,7 @@
* Adds a map. If a map with the same mapLayerPath already exists, the map
* will be updated.
*
+ * @param name, Map description.
* @param mapLayerPath, the link to Geoserver.
* @param organisationUnitId, the id of the organisation unit.
* @param organisationUnitLevelId, the level of the organisation units into
=== modified file 'gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddOrUpdateMapAction.java'
--- gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddOrUpdateMapAction.java 2009-04-21 12:56:13 +0000
+++ gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddOrUpdateMapAction.java 2009-04-23 13:08:41 +0000
@@ -53,6 +53,13 @@
// Input
// -------------------------------------------------------------------------
+ private String name;
+
+ public void setName( String name )
+ {
+ this.name = name;
+ }
+
private String mapLayerPath;
public void setMapLayerPath( String mapLayerPath )
@@ -116,7 +123,7 @@
public String execute()
throws Exception
{
- mappingService.addOrUpdateMap( mapLayerPath, organisationUnitId,
+ mappingService.addOrUpdateMap( name, mapLayerPath, organisationUnitId,
organisationUnitLevelId, uniqueColumn, nameColumn, longitude, latitude, zoom );
return SUCCESS;
=== modified file 'gis/dhis-web-mapping/src/main/webapp/demos/geostat/geostat.js'
--- gis/dhis-web-mapping/src/main/webapp/demos/geostat/geostat.js 2009-04-22 16:19:08 +0000
+++ gis/dhis-web-mapping/src/main/webapp/demos/geostat/geostat.js 2009-04-23 13:08:41 +0000
@@ -1,4 +1,4 @@
-// reference local blank image
+ // reference local blank image
Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif';
Ext.onReady(function()
@@ -93,7 +93,7 @@
url: path + 'getAllMaps' + type,
baseParams: { format: 'jsonmin' },
root: 'maps',
- fields: ['id', 'mapLayerPath', 'organisationUnitLevel'],
+ fields: ['id', 'name', 'mapLayerPath', 'organisationUnitLevel'],
autoLoad: true
});
@@ -158,6 +158,18 @@
}
});
+ var newNameTextField = new Ext.form.TextField({
+ id: 'newname_tf',
+ emptyText: 'Required',
+ width: combo_width
+ });
+
+ var editNameTextField = new Ext.form.TextField({
+ id: 'editname_tf',
+ emptyText: '',
+ width: combo_width
+ });
+
var mapLayerPathTextField = new Ext.form.TextField({
id: 'maplayerpath_tf',
emptyText: 'Required',
@@ -172,7 +184,7 @@
var editUniqueColumnTextField = new Ext.form.TextField({
id: 'edituniquecolumn_tf',
- emptyText: 'Required',
+ emptyText: '',
width: combo_width
});
@@ -184,7 +196,7 @@
var editNameColumnTextField = new Ext.form.TextField({
id: 'editnamecolumn_tf',
- emptyText: 'Required',
+ emptyText: '',
width: combo_width
});
@@ -196,7 +208,7 @@
var editLongitudeTextField = new Ext.form.TextField({
id: 'editlongitude_tf',
- emptyText: 'Required',
+ emptyText: '',
width: combo_width
});
@@ -208,7 +220,7 @@
var editLatitudeTextField = new Ext.form.TextField({
id: 'editlatitude_tf',
- emptyText: 'Required',
+ emptyText: '',
width: combo_width
});
@@ -232,7 +244,7 @@
var editZoomComboBox = new Ext.form.ComboBox({
id: 'editzoom_cb',
editable: false,
- emptyText: 'Required',
+ emptyText: '',
displayField: 'value',
valueField: 'value',
width: combo_width,
@@ -254,14 +266,15 @@
var nm = Ext.getCmp('newmap_cb').getValue();
var oui = Ext.getCmp('organisationunit_cb').getValue();
var ouli = Ext.getCmp('organisationunitlevel_cb').getValue();
+ var nn = Ext.getCmp('newname_tf').getValue();
var mlp = Ext.getCmp('maplayerpath_tf').getValue();
var uc = Ext.getCmp('newuniquecolumn_tf').getValue();
var nc = Ext.getCmp('newnamecolumn_tf').getValue();
var lon = Ext.getCmp('newlongitude_tf').getValue();
var lat = Ext.getCmp('newlatitude_tf').getValue();
var zoom = Ext.getCmp('newzoom_cb').getValue();
-
- if (!nm || !mlp || !oui || !ouli || !uc || !nc || !lon || !lat)
+
+ if (!nm || !nn || !mlp || !oui || !ouli || !uc || !nc || !lon || !lat)
{
Ext.MessageBox.alert('Error', 'Form is not complete');
return;
@@ -271,7 +284,7 @@
{
url: path + 'addOrUpdateMap' + type,
method: 'GET',
- params: { mapLayerPath: mlp, organisationUnitId: oui, organisationUnitLevelId: ouli, uniqueColumn: uc, nameColumn: nc,
+ params: { name: nn, mapLayerPath: mlp, organisationUnitId: oui, organisationUnitLevelId: ouli, uniqueColumn: uc, nameColumn: nc,
longitude: lon, latitude: lat, zoom: zoom},
success: function( responseObject )
@@ -302,13 +315,14 @@
handler: function()
{
var em = Ext.getCmp('editmap_cb').getValue();
+ var en = Ext.getCmp('editname_tf').getValue();
var uc = Ext.getCmp('edituniquecolumn_tf').getValue();
var nc = Ext.getCmp('editnamecolumn_tf').getValue();
var lon = Ext.getCmp('editlongitude_tf').getValue();
var lat = Ext.getCmp('editlatitude_tf').getValue();
var zoom = Ext.getCmp('editzoom_cb').getValue();
- if (!em || !uc || !nc || !lon || !lat)
+ if (!em || !en || !uc || !nc || !lon || !lat)
{
Ext.MessageBox.alert('Error', 'Form is not complete');
return;
@@ -318,7 +332,7 @@
{
url: path + 'addOrUpdateMap' + type,
method: 'GET',
- params: { mapLayerPath: em, uniqueColumn: uc, nameColumn: nc, longitude: lon, latitude: lat, zoom: zoom },
+ params: { mapLayerPath: em, name: en, uniqueColumn: uc, nameColumn: nc, longitude: lon, latitude: lat, zoom: zoom },
success: function( responseObject )
{
@@ -416,7 +430,7 @@
typeAhead: true,
editable: false,
valueField: 'mapLayerPath',
- displayField: 'mapLayerPath',
+ displayField: 'name',
emptyText: 'Required',
mode: 'remote',
forceSelection: true,
@@ -443,6 +457,7 @@
{
var map = Ext.util.JSON.decode( responseObject.responseText ).map;
+ Ext.getCmp('editname_tf').setValue(map.name);
Ext.getCmp('edituniquecolumn_tf').setValue(map.uniqueColumn);
Ext.getCmp('editnamecolumn_tf').setValue(map.nameColumn);
Ext.getCmp('editlongitude_tf').setValue(map.longitude);
@@ -468,7 +483,7 @@
typeAhead: true,
editable: false,
valueField: 'mapLayerPath',
- displayField: 'mapLayerPath',
+ displayField: 'name',
emptyText: 'Required',
mode: 'remote',
forceSelection: true,
@@ -487,6 +502,7 @@
{ html: '<p style="padding-bottom:4px">Organisation unit level:</p>' }, newMapComboBox, { html: '<br>' },
{ html: '<p style="padding-bottom:4px">Organisation unit:</p>' }, organisationUnitComboBox, { html: '<br>' },
{ html: '<p style="padding-bottom:4px">Divided into level:</p>' }, organisationUnitLevelComboBox, { html: '<br>' },
+ { html: '<p style="padding-bottom:4px">Map name:</p>' }, newNameTextField, { html: '<br>' },
{ html: '<p style="padding-bottom:4px">Geoserver map layer path:</p>' }, mapLayerPathTextField, { html: '<br>' },
{ html: '<p style="padding-bottom:4px">Unique column:</p>' }, newUniqueColumnTextField, { html: '<br>' },
{ html: '<p style="padding-bottom:4px">Name column:</p>' }, newNameColumnTextField, { html: '<br>' },
@@ -502,6 +518,7 @@
items:
[
{ html: '<p style="padding-bottom:4px">Choose a map:</p>' }, editMapComboBox, { html: '<br>' },
+ { html: '<p style="padding-bottom:4px">Map name:</p>' }, editNameTextField, { html: '<br>' },
{ html: '<p style="padding-bottom:4px">Unique column:</p>' }, editUniqueColumnTextField, { html: '<br>' },
{ html: '<p style="padding-bottom:4px">Name column:</p>' }, editNameColumnTextField, { html: '<br>' },
{ html: '<p style="padding-bottom:4px">Longitude:</p>' }, editLongitudeTextField, { html: '<br>' },
=== modified file 'gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMap.vm'
--- gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMap.vm 2009-04-20 16:24:17 +0000
+++ gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMap.vm 2009-04-23 13:08:41 +0000
@@ -1,6 +1,7 @@
{ "map":
{
"id": $!{object.id},
+ "name": "$!encoder.jsEncode( ${object.name} )",
"mapLayerPath": "$!encoder.jsEncode( ${object.mapLayerPath} )",
"organisationUnit": "$!encoder.jsEncode( ${object.organisationUnit.name} )",
"organisationUnitLevel": $!{object.organisationUnitLevel.level},
=== modified file 'gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminMaps.vm'
--- gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminMaps.vm 2009-04-20 17:49:20 +0000
+++ gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminMaps.vm 2009-04-23 13:08:41 +0000
@@ -3,6 +3,7 @@
#foreach( $map in $object )
{
"id": $!{map.id},
+ "name": "$!encoder.jsEncode( ${map.name} )",
"mapLayerPath": "$!encoder.jsEncode( ${map.mapLayerPath} )",
"organisationUnitLevel": $!{map.organisationUnitLevel.level}
}#if( $velocityCount < $size ),#end
=== modified file 'gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Choropleth.js'
--- gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Choropleth.js 2009-04-22 16:19:08 +0000
+++ gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Choropleth.js 2009-04-23 13:08:41 +0000
@@ -180,7 +180,7 @@
url: path + 'getAllMaps' + type,
baseParams: { format: 'jsonmin' },
root: 'maps',
- fields: ['id', 'mapLayerPath', 'organisationUnitLevel'],
+ fields: ['id', 'name', 'mapLayerPath', 'organisationUnitLevel'],
sortInfo: { field: 'mapLayerPath', direction: 'ASC' },
autoLoad: true
});
@@ -312,7 +312,7 @@
typeAhead: true,
editable: false,
valueField: 'mapLayerPath',
- displayField: 'mapLayerPath',
+ displayField: 'name',
mode: 'remote',
forceSelection: true,
triggerAction: 'all',
=== modified file 'gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Mapping.js'
--- gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Mapping.js 2009-04-21 10:54:29 +0000
+++ gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Mapping.js 2009-04-23 13:08:41 +0000
@@ -139,15 +139,13 @@
newUrl : false,
- currentUrl : false,
-
initComponent : function() {
mapStore = new Ext.data.JsonStore({
url: path + 'getAllMaps' + type,
baseParams: { format: 'jsonmin' },
root: 'maps',
- fields: ['id', 'mapLayerPath', 'organisationUnitLevel'],
+ fields: ['id', 'name', 'mapLayerPath', 'organisationUnitLevel'],
autoLoad: true
});
@@ -186,7 +184,7 @@
typeAhead: true,
editable: false,
valueField: 'mapLayerPath',
- displayField: 'mapLayerPath',
+ displayField: 'name',
mode: 'remote',
forceSelection: true,
triggerAction: 'all',
--
Trunk
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.