dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #33864
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17349: minor fixes
------------------------------------------------------------
revno: 17349
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-11-03 19:30:39 +0700
message:
minor fixes
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SystemSettingController.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/mapping/GeoFeatureController.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/CurrentUserController.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/webapi/controller/SystemSettingController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SystemSettingController.java 2014-11-03 12:06:54 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SystemSettingController.java 2014-11-03 12:30:39 +0000
@@ -32,6 +32,7 @@
import org.hisp.dhis.setting.SystemSettingManager;
import org.hisp.dhis.webapi.utils.ContextUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
@@ -111,6 +112,7 @@
@RequestMapping( method = RequestMethod.GET, produces = { ContextUtils.CONTENT_TYPE_JSON, ContextUtils.CONTENT_TYPE_HTML } )
public void getSystemSettingsJson( @RequestParam( value = "key", required = false ) Set<String> key, HttpServletResponse response ) throws IOException
{
+ response.setContentType( MediaType.APPLICATION_JSON_VALUE );
renderService.toJson( response.getOutputStream(), getSystemSettings( key ) );
}
@@ -120,6 +122,7 @@
@RequestParam( defaultValue = "callback" ) String callback,
HttpServletResponse response ) throws IOException
{
+ response.setContentType( "application/javascript" );
renderService.toJsonP( response.getOutputStream(), getSystemSettings( key ), callback );
}
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/mapping/GeoFeatureController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/mapping/GeoFeatureController.java 2014-11-03 12:11:14 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/mapping/GeoFeatureController.java 2014-11-03 12:30:39 +0000
@@ -45,6 +45,7 @@
import org.hisp.dhis.webapi.webdomain.GeoFeature;
import org.hisp.dhis.webapi.webdomain.WebOptions;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -104,6 +105,7 @@
List<GeoFeature> features = getGeoFeatures( ou, displayProperty, request, response, includeGroupSets );
if ( features == null ) return;
+ response.setContentType( MediaType.APPLICATION_JSON_VALUE );
renderService.toJson( response.getOutputStream(), features );
}
@@ -121,6 +123,7 @@
List<GeoFeature> features = getGeoFeatures( ou, displayProperty, request, response, includeGroupSets );
if ( features == null ) return;
+ response.setContentType( "application/javascript" );
renderService.toJsonP( response.getOutputStream(), features, callback );
}
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/CurrentUserController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/CurrentUserController.java 2014-11-03 12:06:54 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/CurrentUserController.java 2014-11-03 12:30:39 +0000
@@ -291,8 +291,6 @@
{
UserAccount userAccount = getUserAccount();
- System.err.println( "accept:" + request.getHeader( "Accept" ) );
-
response.setContentType( "application/javascript" );
renderService.toJsonP( response.getOutputStream(), userAccount, callback );
}