← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15281: Applied patch from TW. Implements post of system settings map.

 

Merge authors:
  Aravind M (arav-psgtech)
------------------------------------------------------------
revno: 15281 [merge]
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-05-15 23:07:04 +0200
message:
  Applied patch from TW. Implements post of system settings map.
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	2014-05-15 16:58:37 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SystemSettingController.java	2014-05-15 21:07:04 +0000
@@ -79,6 +79,18 @@
         ContextUtils.okResponse( response, "System setting " + key + " set as value '" + value + "'." );
     }
 
+    @RequestMapping( method = RequestMethod.POST, consumes = { ContextUtils.CONTENT_TYPE_JSON } )
+    @PreAuthorize("hasRole('ALL') or hasRole('F_SYSTEM_SETTING')")
+    public void setSystemSetting( @RequestBody Map<String,Object> settings, HttpServletResponse response )
+    {
+        for ( String key : settings.keySet() )
+        {
+            systemSettingManager.saveSystemSetting( key, (Serializable) settings.get( key ) );
+        }
+
+        ContextUtils.okResponse( response, "System settings imported" );
+    }
+
     @RequestMapping(value = "/{key}", method = RequestMethod.GET, produces = ContextUtils.CONTENT_TYPE_TEXT)
     public @ResponseBody String getSystemSetting( @PathVariable("key") String key )
     {