dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #42227
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21576: App installation, translations
------------------------------------------------------------
revno: 21576
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2016-01-04 17:36:24 +0100
message:
App installation, translations
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/appmanager/AppStatus.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties
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/appmanager/AppStatus.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/appmanager/AppStatus.java 2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/appmanager/AppStatus.java 2016-01-04 16:36:24 +0000
@@ -30,12 +30,13 @@
public enum AppStatus
{
- OK( "OK" ),
- NAMESPACE_TAKEN( "Namespace defined in manifest is protected" ),
- INVALID_ZIP_FORMAT( "Zipfile could not be read" ),
- INVALID_MANIFEST_JSON( "Invalid JSON in app manifest file" ),
- INSTALLATION_FAILED( "App could not be installed on file system" ),
- NOT_FOUND( "App could not be found" );
+ OK( "ok" ),
+ NAMESPACE_TAKEN( "namespace_defined_in_manifest_is_in_use" ),
+ INVALID_ZIP_FORMAT( "zip_file_could_not_be_read" ),
+ INVALID_MANIFEST_JSON( "invalid_json_in_app_manifest_file" ),
+ INSTALLATION_FAILED( "app_could_not_be_installed_on_file_system" ),
+ NOT_FOUND( "app_could_not_be_found" ),
+ MISSING_SYSTEM_BASE_URL( "system_base_url_is_not_defined" );
private String message;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties 2015-12-24 00:21:36 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties 2016-01-04 16:36:24 +0000
@@ -945,6 +945,15 @@
app_order_name_alpha=Alphabetical
app_search_placeholder=Search apps
+#-- App manager----------------------------------------------------------------#
+
+namespace_defined_in_manifest_is_in_use=Namespace defined in manifest is already in use
+zip_file_could_not_be_read=Zipfile could not be read
+invalid_json_in_app_manifest_file=Invalid JSON in app manifest file
+app_could_not_be_installed_on_file_system=App could not be installed on file system
+app_could_not_be_found=App could not be found
+system_base_url_is_not_defined=System base URL is not defined
+
#-- Data value error codes ----------------------------------------------------#
data_element_or_type_null_or_empty=Data element or type is null or empty
=== 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 2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AppController.java 2016-01-04 16:36:24 +0000
@@ -39,6 +39,7 @@
import org.hisp.dhis.dxf2.webmessage.WebMessageException;
import org.hisp.dhis.external.location.LocationManager;
import org.hisp.dhis.hibernate.exception.ReadAccessDeniedException;
+import org.hisp.dhis.i18n.I18nManager;
import org.hisp.dhis.setting.SettingKey;
import org.hisp.dhis.system.util.DateUtils;
import org.hisp.dhis.webapi.utils.ContextUtils;
@@ -81,7 +82,10 @@
@Autowired
private LocationManager locationManager;
-
+
+ @Autowired
+ private I18nManager i18nManager;
+
private final ResourceLoader resourceLoader = new DefaultResourceLoader();
// -------------------------------------------------------------------------
@@ -129,7 +133,9 @@
if ( !status.ok() )
{
- throw new WebMessageException( WebMessageUtils.conflict( status.getMessage() ) );
+ String message = i18nManager.getI18n().getString( status.getMessage() );
+
+ throw new WebMessageException( WebMessageUtils.conflict( message ) );
}
}