← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17022: Moved default values for calendar/dateformat to CalendarService

 

------------------------------------------------------------
revno: 17022
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-10-09 14:31:54 +0200
message:
  Moved default values for calendar/dateformat to CalendarService
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/CalendarService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/calendar/DefaultCalendarService.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/calendar/CalendarService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/CalendarService.java	2014-10-07 17:30:40 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/CalendarService.java	2014-10-09 12:31:54 +0000
@@ -39,6 +39,9 @@
 {
     final String KEY_CALENDAR = "keyCalendar";
     final String KEY_DATE_FORMAT = "keyDateFormat";
+
+    final String DEFAULT_CALENDAR = "iso8601";
+    final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd"; // ISO 8601
     
     /**
      * Gets all available calendars as a sorted list.

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java	2014-10-07 17:30:40 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java	2014-10-09 12:31:54 +0000
@@ -105,8 +105,6 @@
 
     final String DEFAULT_SCHEDULE_AGGREGATE_QUERY_BUILDER_TASK_STRATEGY = "lastMonth";
     final String DEFAULT_FLAG = "dhis2";
-    final String DEFAULT_CALENDAR = "iso8601";
-    final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd"; // ISO 8601
     final int DEFAULT_MAX_NUMBER_OF_ATTEMPTS = 20;
     final int DEFAULT_TIMEFRAME_MINUTES = 1;
     final double DEFAULT_FACTOR_OF_DEVIATION = 2.0;
@@ -127,8 +125,8 @@
         {
             put( KEY_SCHEDULE_AGGREGATE_QUERY_BUILDER_TASK_STRATEGY, DEFAULT_SCHEDULE_AGGREGATE_QUERY_BUILDER_TASK_STRATEGY );
             put( KEY_FLAG, DEFAULT_FLAG );
-            put( CalendarService.KEY_CALENDAR, DEFAULT_CALENDAR );
-            put( CalendarService.KEY_DATE_FORMAT, DEFAULT_DATE_FORMAT );
+            put( CalendarService.KEY_CALENDAR, CalendarService.DEFAULT_CALENDAR );
+            put( CalendarService.KEY_DATE_FORMAT, CalendarService.DEFAULT_DATE_FORMAT );
             put( KEY_FACTOR_OF_DEVIATION, DEFAULT_FACTOR_OF_DEVIATION );
             put( KEY_ORGUNITGROUPSET_AGG_LEVEL, DEFAULT_ORGUNITGROUPSET_AGG_LEVEL );
             put( KEY_START_MODULE, DEFAULT_START_MODULE );

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/calendar/DefaultCalendarService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/calendar/DefaultCalendarService.java	2014-10-07 17:30:40 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/calendar/DefaultCalendarService.java	2014-10-09 12:31:54 +0000
@@ -146,7 +146,7 @@
     public String getSystemCalendarKey()
     {
         String key = keyCache.containsKey( KEY_CALENDAR ) ? keyCache.get( KEY_CALENDAR ) : 
-            (String) settingManager.getSystemSetting( KEY_CALENDAR, SystemSettingManager.DEFAULT_CALENDAR );        
+            (String) settingManager.getSystemSetting( KEY_CALENDAR, DEFAULT_CALENDAR );        
         keyCache.put( KEY_CALENDAR, key );        
         return key;
     }
@@ -160,7 +160,7 @@
     public String getSystemDateFormatKey()
     {
         String key = keyCache.containsKey( KEY_DATE_FORMAT ) ? keyCache.get( KEY_DATE_FORMAT ) :
-            (String) settingManager.getSystemSetting( KEY_DATE_FORMAT, SystemSettingManager.DEFAULT_DATE_FORMAT );
+            (String) settingManager.getSystemSetting( KEY_DATE_FORMAT, DEFAULT_DATE_FORMAT );
         keyCache.put( KEY_DATE_FORMAT, key );
         return key;
     }