dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #41720
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21274: App store index file in web api
------------------------------------------------------------
revno: 21274
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-12-02 20:43:42 +0100
message:
App store index file in web api
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/Setting.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/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-api/src/main/java/org/hisp/dhis/setting/Setting.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/Setting.java 2015-10-30 04:55:03 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/Setting.java 2015-12-02 19:43:42 +0000
@@ -108,7 +108,8 @@
DATE_FORMAT( "keyDateFormat", "yyyy-MM-dd", String.class ),
APP_FOLDER_PATH( "appFolderPath" ),
APP_BASE_URL( "appBaseUrl" ),
- APP_STORE_URL( "appStoreUrl", "http://www.dhis2.org/appstore", String.class ),
+ APP_STORE_URL( "appStoreUrl", "https://www.dhis2.org/appstore", String.class ),
+ APP_STORE_INDEX_URL( "appStoreIndexUrl", "https://s3-eu-west-1.amazonaws.com/dhis2-appstore/appstore.json", String.class ),
STYLE( "currentStyle", "light_blue/light_blue.css", String.class );
private final String name;
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AppController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AppController.java 2015-10-12 08:55:04 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AppController.java 2015-12-02 19:43:42 +0000
@@ -51,6 +51,7 @@
import org.springframework.stereotype.Controller;
import org.springframework.util.StreamUtils;
import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
import org.springframework.web.context.request.ServletWebRequest;
import org.springframework.web.multipart.MultipartFile;
@@ -80,6 +81,9 @@
@Autowired
private LocationManager locationManager;
+
+ @Autowired
+ private RestTemplate restTemplate;
private final ResourceLoader resourceLoader = new DefaultResourceLoader();
@@ -278,6 +282,12 @@
appManager.setAppBaseUrl( appBaseUrl );
}
+ @RequestMapping( value = "/appStore", method = RequestMethod.GET, produces = "application/json" )
+ public @ResponseBody String getAppStoreUrl()
+ {
+ return restTemplate.getForObject( Setting.APP_STORE_INDEX_URL.getDefaultValue().toString(), String.class );
+ }
+
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------