dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #27353
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13608: allow reload of apps using PUT /api/apps
------------------------------------------------------------
revno: 13608
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-01-07 12:47:11 +0100
message:
allow reload of apps using PUT /api/apps
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/appmanager/DefaultAppManager.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AppController.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-core/src/main/java/org/hisp/dhis/appmanager/DefaultAppManager.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/appmanager/DefaultAppManager.java 2014-01-07 11:00:46 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/appmanager/DefaultAppManager.java 2014-01-07 11:47:11 +0000
@@ -65,8 +65,6 @@
private void init()
{
reloadApps();
-
- log.info( "Detecting apps: " + apps );
}
@Autowired
@@ -270,5 +268,7 @@
}
this.apps = appList;
+
+ log.info( "Detected apps: " + apps );
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AppController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AppController.java 2014-01-07 11:00:46 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AppController.java 2014-01-07 11:47:11 +0000
@@ -39,12 +39,14 @@
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
+import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StreamUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseStatus;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -76,6 +78,13 @@
return "apps";
}
+ @RequestMapping( value = RESOURCE_PATH, method = RequestMethod.PUT )
+ @ResponseStatus( HttpStatus.NO_CONTENT )
+ public void reloadApps()
+ {
+ appManager.reloadApps();
+ }
+
@RequestMapping( value = "/apps/{app}/**", method = RequestMethod.GET )
public void renderApp( @PathVariable( "app" ) String app, HttpServletRequest request, HttpServletResponse response ) throws IOException, NotFoundException
{