← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18748: Added setting for keyInstanceBaseUrl in general system settings.

 

Merge authors:
  Halvdan Hoem Grelland (halvdanhg)
------------------------------------------------------------
revno: 18748 [merge]
committer: Halvdan Hoem Grelland <halvdanhg@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-03-30 16:13:48 +0200
message:
  Added setting for keyInstanceBaseUrl in general system settings.
modified:
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/SystemSettingInterceptor.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetGeneralSettingsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemGeneralSettings.vm


--
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-commons/src/main/java/org/hisp/dhis/interceptor/SystemSettingInterceptor.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/SystemSettingInterceptor.java	2015-02-19 09:18:17 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/SystemSettingInterceptor.java	2015-03-30 13:18:13 +0000
@@ -114,6 +114,7 @@
         map.put( KEY_ACCOUNT_INVITE, systemSettingManager.getSystemSetting( KEY_ACCOUNT_INVITE, false ) );
         map.put( KEY_CONFIGURATION, configurationService.getConfiguration() );
         map.put( KEY_APP_BASE_URL, systemSettingManager.getSystemSetting( KEY_APP_BASE_URL ) );
+        map.put( KEY_INSTANCE_BASE_URL, systemSettingManager.getSystemSetting( KEY_INSTANCE_BASE_URL ) );
         map.put( KEY_GOOGLE_ANALYTICS_UA, systemSettingManager.getSystemSetting( KEY_GOOGLE_ANALYTICS_UA, "" ) );
         map.put( KEY_CREDENTIALS_EXPIRES, systemSettingManager.credentialsExpires() );
         map.put( KEY_SELF_REGISTRATION_NO_RECAPTCHA, systemSettingManager.selfRegistrationNoRecaptcha() );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetGeneralSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetGeneralSettingsAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetGeneralSettingsAction.java	2015-03-30 14:13:48 +0000
@@ -35,6 +35,7 @@
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_FACTOR_OF_DEVIATION;
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_GOOGLE_ANALYTICS_UA;
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_HELP_PAGE_LINK;
+import static org.hisp.dhis.setting.SystemSettingManager.KEY_INSTANCE_BASE_URL;
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_MULTI_ORGANISATION_UNIT_FORMS;
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_OMIT_INDICATORS_ZERO_NUMERATOR_DATAMART;
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_PHONE_NUMBER_AREA_CODE;
@@ -237,6 +238,13 @@
         this.helpPageLink = helpPageLink;
     }
 
+    private String instanceBaseUrl;
+
+    public void setInstanceBaseUrl( String instanceBaseUrl )
+    {
+        this.instanceBaseUrl = instanceBaseUrl;
+    }
+
     private String message;
 
     public String getMessage()
@@ -257,7 +265,7 @@
 
     @Override
     public String execute()
-    { 
+    {
         systemSettingManager.saveSystemSetting( KEY_CACHE_STRATEGY, cacheStrategy );
         systemSettingManager.saveSystemSetting( KEY_ANALYTICS_MAX_LIMIT, analyticsMaxLimit );
         systemSettingManager.saveSystemSetting( KEY_DATABASE_SERVER_CPUS, databaseServerCpus );
@@ -268,6 +276,7 @@
         systemSettingManager.saveSystemSetting( KEY_GOOGLE_ANALYTICS_UA, googleAnalyticsUA );
         systemSettingManager.saveSystemSetting( KEY_ANALYTICS_MAINTENANCE_MODE, analyticsMaintenanceMode );
         systemSettingManager.saveSystemSetting( KEY_HELP_PAGE_LINK, StringUtils.trimToNull( helpPageLink ) );
+        systemSettingManager.saveSystemSetting( KEY_INSTANCE_BASE_URL, StringUtils.removeEnd( StringUtils.trimToNull( instanceBaseUrl ), "/" ) );
         systemSettingManager.saveSystemSetting( KEY_SYSTEM_NOTIFICATIONS_EMAIL, systemNotificationsEmail );
         systemSettingManager.saveSystemSetting( KEY_ANALYSIS_RELATIVE_PERIOD, analysisRelativePeriod );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties	2015-02-13 12:51:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties	2015-03-30 14:13:48 +0000
@@ -123,6 +123,7 @@
 automatic=Automatic
 detect_based_on_web_server=detect based on web server
 help_page_link = Help page link
+server_base_url = Server base URL
 acceptance_required_before_approval=Acceptance required before approval
 system_notifications_email_address=System notifications email address
 default_analysis_relative_period=Default relative period for analysis

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemGeneralSettings.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemGeneralSettings.vm	2015-03-15 20:49:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemGeneralSettings.vm	2015-03-30 14:13:48 +0000
@@ -1,4 +1,5 @@
 <script>
+    console.log( '$!keyInstanceBaseUrl' );
   jQuery(document).ready(function() {
     jQuery("input[type=button]").click(function() {
       jQuery.postUTF8('setSystemGeneralSettings.action', {
@@ -18,7 +19,8 @@
         googleAnalyticsUA: getFieldValue('googleAnalyticsUA'),
         multiOrganisationUnitForms: jQuery('#multiOrganisationUnitForms').is(':checked'),
         analyticsMaintenanceMode: jQuery('#analyticsMaintenanceMode').is(':checked'),
-        helpPageLink: getFieldValue('helpPageLink')
+        helpPageLink: getFieldValue('helpPageLink' ),
+        instanceBaseUrl: getFieldValue('instanceBaseUrl')
       }, function( json ) {
         if( json.response == "success" ) {
           setHeaderDelayMessage(json.message);
@@ -154,6 +156,12 @@
 	<input type="text" id="helpPageLink" name="helpPageLink" value="$!helpPageLink"/>
 </div>
 
+<div class="settingLabel">$i18n.getString( "server_base_url" )</div>
+
+<div class="setting">
+    <input type="text" id="instanceBaseUrl" name="instanceBaseUrl" value="$!keyInstanceBaseUrl"/>
+</div>
+
 <div class="settingLabel">$i18n.getString( "google_analytics_ua_key" )</div>
 
 <div class="setting">