← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5451: Web api, minor fix

 

------------------------------------------------------------
revno: 5451
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-12-16 11:26:08 +0100
message:
  Web api, minor fix
modified:
  dhis-2/dhis-services/dhis-service-sms/src/main/resources/org/hisp/dhis/sms/incoming/IncomingSms.hbm.xml
  dhis-2/dhis-services/dhis-service-sms/src/main/resources/org/hisp/dhis/sms/outbound/OutboundSms.hbm.xml
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DocumentController.java
  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-services/dhis-service-sms/src/main/resources/org/hisp/dhis/sms/incoming/IncomingSms.hbm.xml'
--- dhis-2/dhis-services/dhis-service-sms/src/main/resources/org/hisp/dhis/sms/incoming/IncomingSms.hbm.xml	2011-12-15 08:46:42 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/resources/org/hisp/dhis/sms/incoming/IncomingSms.hbm.xml	2011-12-16 10:26:08 +0000
@@ -1,6 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd";>
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+  "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd";>
 
 <hibernate-mapping>
   <class name="org.hisp.dhis.sms.incoming.IncomingSms" table="incomingsms">

=== modified file 'dhis-2/dhis-services/dhis-service-sms/src/main/resources/org/hisp/dhis/sms/outbound/OutboundSms.hbm.xml'
--- dhis-2/dhis-services/dhis-service-sms/src/main/resources/org/hisp/dhis/sms/outbound/OutboundSms.hbm.xml	2011-12-15 08:46:42 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/resources/org/hisp/dhis/sms/outbound/OutboundSms.hbm.xml	2011-12-16 10:26:08 +0000
@@ -1,6 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd";>
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+  "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd";>
 
 <hibernate-mapping>
   <class name="org.hisp.dhis.sms.outbound.OutboundSms" table="outbound_sms">

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DocumentController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DocumentController.java	2011-12-14 15:28:36 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DocumentController.java	2011-12-16 10:26:08 +0000
@@ -109,9 +109,7 @@
         
         if ( document.isExternal() )
         {
-            String redirectUrl = response.encodeRedirectURL( document.getUrl() );
-            
-            response.sendRedirect( redirectUrl );
+            response.sendRedirect( response.encodeRedirectURL( document.getUrl() ) );
         }
         else
         {

=== 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 21:05:08 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/MapController.java	2011-12-16 10:26:08 +0000
@@ -102,11 +102,11 @@
     }
     
     @RequestMapping( value = "/{uid}/data", method = RequestMethod.GET )
-    public String getMap( @PathVariable String uid, HttpServletRequest request, HttpServletResponse response )
+    public void getMapPng( HttpServletRequest request, HttpServletResponse response ) throws Exception
     {
-        String url = "forward:" + request.getRequestURI().replace( "/data", "" ) + ".png";
+        String url = request.getRequestURL().toString().replace( "/data", ".png" );
         
-        return url;
+        response.sendRedirect( response.encodeRedirectURL( url ) );
     }
     
     @RequestMapping( value = "/data", method = RequestMethod.GET )