dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #26267
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13015: minor change in response from system-settings controller
------------------------------------------------------------
revno: 13015
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-11-25 11:05:20 +0100
message:
minor change in response from system-settings controller
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SystemSettingController.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/SystemSettingController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SystemSettingController.java 2013-10-28 10:18:38 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SystemSettingController.java 2013-11-25 10:05:20 +0000
@@ -51,12 +51,12 @@
{
@Autowired
private SystemSettingManager systemSettingManager;
-
+
@RequestMapping( value = "/{key}", method = RequestMethod.POST, consumes = { ContextUtils.CONTENT_TYPE_TEXT, ContextUtils.CONTENT_TYPE_HTML } )
@PreAuthorize( "hasRole('ALL') or hasRole('F_SYSTEM_SETTING')" )
- public void setSystemSetting(
- @PathVariable String key,
- @RequestParam(required = false) String value,
+ public void setSystemSetting(
+ @PathVariable String key,
+ @RequestParam(required = false) String value,
@RequestBody(required=false) String valuePayload, HttpServletResponse response )
{
if ( key == null )
@@ -64,25 +64,25 @@
ContextUtils.conflictResponse( response, "Key must be specified" );
return;
}
-
+
if ( value == null && valuePayload == null )
{
ContextUtils.conflictResponse( response, "Value must be specified as query param or as payload" );
}
-
+
value = value != null ? value : valuePayload;
-
+
systemSettingManager.saveSystemSetting( key, value );
-
- ContextUtils.okResponse( response, "System setting saved" );
+
+ ContextUtils.okResponse( response, "System setting " + key + " set as value '" + value + "'." );
}
-
+
@RequestMapping( value = "/{key}", method = RequestMethod.GET, produces = ContextUtils.CONTENT_TYPE_TEXT )
public @ResponseBody String getSystemSetting( @PathVariable( "key" ) String key )
{
return (String) systemSettingManager.getSystemSetting( key );
}
-
+
@RequestMapping( value = "/{key}", method = RequestMethod.DELETE )
@PreAuthorize( "hasRole('ALL') or hasRole('F_SYSTEM_SETTING')" )
public void removeSystemSetting( @PathVariable( "key" ) String key )