← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5444: Web api, forwarding uid/data to uid.png for maps for consistency

 

------------------------------------------------------------
revno: 5444
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-12-15 20:55:51 +0100
message:
  Web api, forwarding uid/data to uid.png for maps for consistency
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/MapController.java


--
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-api/src/main/java/org/hisp/dhis/api/controller/MapController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/MapController.java	2011-12-15 17:53:48 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/MapController.java	2011-12-15 19:55:51 +0000
@@ -80,7 +80,7 @@
         return "maps";
     }
 
-    @RequestMapping( value = {"/{uid}","/{uid}/data"}, method = RequestMethod.GET )
+    @RequestMapping( value = "/{uid}", method = RequestMethod.GET )
     public String getMap( @PathVariable String uid, IdentifiableObjectParams params, Model model, HttpServletRequest request )
     {
         MapView mapView = mappingService.getMapView( uid );
@@ -96,6 +96,14 @@
         return "map";
     }
     
+    @RequestMapping( value = "/{uid}/data", method = RequestMethod.GET )
+    public String getMap( @PathVariable String uid, HttpServletRequest request, HttpServletResponse response )
+    {
+        String url = "forward:" + request.getRequestURI().replace( "/data", "" ) + ".png";
+        
+        return url;
+    }
+    
     @RequestMapping( value = "/data", method = RequestMethod.GET )
     public String getMap( Model model,
         @RequestParam( value = "in" ) String indicatorUid,