← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3279: Implemented system setting for a system identifier. Will be used in relation to stable identifiers.

 

------------------------------------------------------------
revno: 3279
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-04-04 19:23:41 +0200
message:
  Implemented system setting for a system identifier. Will be used in relation to stable identifiers.
modified:
  dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/SystemSettingManager.java
  dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/setting/DefaultSystemSettingManager.java
  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/SetSystemSettingsAction.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/systemSettings.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-services/dhis-service-options/src/main/java/org/hisp/dhis/options/SystemSettingManager.java'
--- dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/SystemSettingManager.java	2011-03-08 14:55:19 +0000
+++ dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/SystemSettingManager.java	2011-04-04 17:23:41 +0000
@@ -40,6 +40,7 @@
 {
     final String ID = SystemSettingManager.class.getName();
     
+    final String KEY_SYSTEM_IDENTIFIER = "keySystemIdentifier";
     final String KEY_APPLICATION_TITLE = "applicationTitle";
     final String KEY_FLAG = "flag";
     final String KEY_START_MODULE = "startModule";
@@ -55,9 +56,7 @@
     final String KEY_COMPLETENESS_OFFSET = "completenessOffset";
     final String KEY_PATIENT_EXCEL_TEMPLATE_FILE_NAME = "patientExcelTemplateFileName";
     
-    final String KEY_CHR_IMAGE_DIRECTORY = "chrImageDirectory";
-    final String KEY_CHR_NUMBER_OF_RECORDS = "chrNumberOfRecords";
-    
+    final String DEFAULT_SYSTEM_IDENTIFIER = "http://dhis2.org";;
     final int DEFAULT_MAX_NUMBER_OF_ATTEMPTS = 20;
     final int DEFAULT_TIMEFRAME_MINUTES = 1;
     final double DEFAULT_FACTOR_OF_DEVIATION = 2.0;
@@ -81,4 +80,6 @@
     SortedMap<String, String> getFlags();
     
     List<String> getAggregationStrategies();
+    
+    String getSystemIdentifier();
 }

=== modified file 'dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/setting/DefaultSystemSettingManager.java'
--- dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/setting/DefaultSystemSettingManager.java	2011-01-07 11:37:47 +0000
+++ dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/setting/DefaultSystemSettingManager.java	2011-04-04 17:23:41 +0000
@@ -136,4 +136,9 @@
     {
         return Arrays.asList( AGGREGATION_STRATEGY_REAL_TIME, AGGREGATION_STRATEGY_BATCH );
     }
+    
+    public String getSystemIdentifier()
+    {
+        return (String) getSystemSetting( KEY_SYSTEM_IDENTIFIER, DEFAULT_SYSTEM_IDENTIFIER );
+    }
 }

=== 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	2011-02-18 20:20:07 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/SystemSettingInterceptor.java	2011-04-04 17:23:41 +0000
@@ -80,6 +80,7 @@
     {
         Map<String, Object> map = new HashMap<String, Object>();
         
+        map.put( KEY_SYSTEM_IDENTIFIER, systemSettingManager.getSystemIdentifier() );
         map.put( KEY_APPLICATION_TITLE, systemSettingManager.getSystemSetting( KEY_APPLICATION_TITLE ) );
         map.put( KEY_FLAG, systemSettingManager.getSystemSetting( KEY_FLAG ) );
         map.put( KEY_START_MODULE, systemSettingManager.getSystemSetting( KEY_START_MODULE ) );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetSystemSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetSystemSettingsAction.java	2011-02-18 20:20:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetSystemSettingsAction.java	2011-04-04 17:23:41 +0000
@@ -70,6 +70,13 @@
     // Output
     // -------------------------------------------------------------------------
     
+    private String systemIdentifier;
+    
+    public void setSystemIdentifier( String systemIdentifier )
+    {
+        this.systemIdentifier = systemIdentifier;
+    }
+
     private String applicationTitle;
 
     public void setApplicationTitle( String applicationTitle )
@@ -151,6 +158,7 @@
             startModule = null;
         }
         
+        systemSettingManager.saveSystemSetting( KEY_SYSTEM_IDENTIFIER, systemIdentifier );
         systemSettingManager.saveSystemSetting( KEY_APPLICATION_TITLE, applicationTitle );
         systemSettingManager.saveSystemSetting( KEY_FLAG, flag );
         systemSettingManager.saveSystemSetting( KEY_START_MODULE, startModule );

=== 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	2011-02-21 09:38:50 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties	2011-04-04 17:23:41 +0000
@@ -84,4 +84,5 @@
 aggregation_strategy = Aggregation strategy
 real_time = Real-time
 batch = Batch
-days_after_period_timeliness = Days after period end to qualify for timely data submission
\ No newline at end of file
+days_after_period_timeliness = Days after period end to qualify for timely data submission
+system_identifier = System identifier
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemSettings.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemSettings.vm	2011-02-18 20:20:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemSettings.vm	2011-04-04 17:23:41 +0000
@@ -3,6 +3,10 @@
 
 <form id="systemSettingForm" method="post" action="setSystemSettings.action">
 
+<h4>$i18n.getString( "system_identifier" )</h4>
+
+<p><input type="text" name="systemIdentifier" style="width:30em" maxlength="40" value="$!keySystemIdentifier"/></p>
+
 <h4>$i18n.getString( "application_title" )</h4>
 
 <p><input type="text" name="applicationTitle" style="width:30em" maxlength="40" value="$!applicationTitle"/></p>