← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13019: support ?package=xyz in i18n controller, to search for a specific bundle order

 

------------------------------------------------------------
revno: 13019
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-11-25 17:40:55 +0100
message:
  support ?package=xyz in i18n controller, to search for a specific bundle order
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/I18nController.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/I18nController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/I18nController.java	2013-11-20 13:16:03 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/I18nController.java	2013-11-25 16:40:55 +0000
@@ -36,6 +36,7 @@
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -47,16 +48,17 @@
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
 @Controller
-@RequestMapping( value = "/i18n" )
+@RequestMapping(value = "/i18n")
 public class I18nController
 {
     @Autowired
     private I18nManager i18nManager;
 
-    @RequestMapping( method = RequestMethod.POST )
-    public void postI18n( OutputStream outputStream, InputStream inputStream ) throws Exception
+    @RequestMapping(method = RequestMethod.POST)
+    public void postI18n( @RequestParam( value = "package", required = false, defaultValue = "org.hisp.dhis" ) String searchPackage,
+        OutputStream outputStream, InputStream inputStream ) throws Exception
     {
-        I18n i18n = i18nManager.getI18n( "org.hisp.dhis" );
+        I18n i18n = i18nManager.getI18n( searchPackage );
         Map<String, String> output = new HashMap<String, String>();
 
         List<String> input = JacksonUtils.getJsonMapper().readValue( inputStream, new TypeReference<List<String>>()