← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13423: GIS, migrated download of map to web api

 

------------------------------------------------------------
revno: 13423
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-12-25 08:52:15 +0100
message:
  GIS, migrated download of map to web api
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SvgConversionController.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/index.html
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.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-api/src/main/java/org/hisp/dhis/api/controller/SvgConversionController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SvgConversionController.java	2013-12-24 15:33:27 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SvgConversionController.java	2013-12-25 07:52:15 +0000
@@ -56,7 +56,7 @@
     @Autowired
     private ContextUtils contextUtils;
     
-    @RequestMapping( value = "/svg.png", method = RequestMethod.POST, consumes = { ContextUtils.CONTENT_TYPE_XML, ContextUtils.CONTENT_TYPE_FORM_ENCODED } )
+    @RequestMapping( value = "/svg.png", method = RequestMethod.POST, consumes = ContextUtils.CONTENT_TYPE_FORM_ENCODED )
     public void toPng( @RequestParam String svg, @RequestParam( required = false ) String filename, HttpServletResponse response )
         throws Exception
     {
@@ -67,7 +67,7 @@
         convertToPng( svg, response.getOutputStream() );
     }
 
-    @RequestMapping( value = "/svg.pdf", method = RequestMethod.POST, consumes = { ContextUtils.CONTENT_TYPE_XML, ContextUtils.CONTENT_TYPE_FORM_ENCODED } )
+    @RequestMapping( value = "/svg.pdf", method = RequestMethod.POST, consumes = ContextUtils.CONTENT_TYPE_FORM_ENCODED )
     public void toPdf( @RequestParam String svg, @RequestParam( required = false ) String filename, HttpServletResponse response )
         throws Exception
     {

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/index.html'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/index.html	2013-10-11 11:44:58 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/index.html	2013-12-25 07:52:15 +0000
@@ -12,8 +12,7 @@
 	<div id="layerItems"></div>
 
 	<form id="exportForm" method="post">
-        <input type="hidden" id="typeField" name="type"/>
-        <input type="hidden" id="titleField" name="title"/>
+        <input type="hidden" id="filenameField" name="filename"/>
         <input type="hidden" id="svgField" name="svg"/>
 	</form>
 

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js	2013-12-23 16:05:10 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js	2013-12-25 07:52:15 +0000
@@ -3747,10 +3747,9 @@
 					return;
 				}
 
-				document.getElementById('typeField').value = type;
-				document.getElementById('titleField').value = title;
+				document.getElementById('filenameField').value = title;
 				document.getElementById('svgField').value = svg;
-				exportForm.action = '../exportImage.action';
+				exportForm.action = '../../api/svg.' + type;
 				exportForm.method = 'post';
 				exportForm.submit();