dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19874
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8851: GIS, adding contextpath in init response
------------------------------------------------------------
revno: 8851
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2012-11-04 11:01:42 +0300
message:
GIS, adding contextpath in init response
modified:
dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/InitializeAction.java
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonInitialize.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/java/org/hisp/dhis/mapping/action/InitializeAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/InitializeAction.java 2012-09-27 12:49:50 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/InitializeAction.java 2012-11-04 08:01:42 +0000
@@ -32,6 +32,8 @@
import java.util.Collections;
import java.util.List;
+import org.apache.struts2.ServletActionContext;
+import org.hisp.dhis.api.utils.ContextUtils;
import org.hisp.dhis.configuration.ConfigurationService;
import org.hisp.dhis.dataelement.DataElementGroup;
import org.hisp.dhis.mapping.MapLayer;
@@ -91,6 +93,13 @@
// Output
// -------------------------------------------------------------------------
+ private String contextPath;
+
+ public String getContextPath()
+ {
+ return contextPath;
+ }
+
private MapView mapView;
public MapView getMapView()
@@ -138,6 +147,8 @@
mapView = mappingService.getMapView( id );
}
+ contextPath = ContextUtils.getContextPath( ServletActionContext.getRequest() );
+
overlays = new ArrayList<MapLayer>( mappingService.getMapLayersByType( MappingService.MAP_LAYER_TYPE_OVERLAY ) );
Collections.sort( overlays, new MapLayerNameComparator() );
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonInitialize.vm'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonInitialize.vm 2012-09-27 12:49:50 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonInitialize.vm 2012-11-04 08:01:42 +0000
@@ -2,6 +2,7 @@
#set( $overlaysSize = $overlays.size() )
#set( $rootNodesSize = $roteNodes.size() )
{
+ "contextPath":"$!{contextPath}",
"mapView": {
"id": "$!{mapView.id}",
"name": "$!encoder.jsonEncode( ${mapView.name} )",