← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15836: Naming conventions

 

------------------------------------------------------------
revno: 15836
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-06-24 23:22:44 +0200
message:
  Naming conventions
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/TranslateSystemSettingManager.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultTranslateSystemSettingManager.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/i18n/action/GetStringsFromLocaleAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetAppearanceSettingsStringAction.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/TranslateSystemSettingManager.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/TranslateSystemSettingManager.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/TranslateSystemSettingManager.java	2014-06-24 21:22:44 +0000
@@ -33,10 +33,9 @@
 /**
  * @author James Chang
  */
-
 public interface TranslateSystemSettingManager
 {
-    Map<String, String> getTranslation_SystemAppearanceSetting( String localeStr );
+    Map<String, String> getTranslationSystemAppearanceSettings( String localeStr );
 
-    Map<String, String> getTranslationNoFallback_SystemAppearanceSetting( String localeStr );
+    Map<String, String> getTranslationNoFallbackSystemAppearanceSettings( String localeStr );
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultTranslateSystemSettingManager.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultTranslateSystemSettingManager.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultTranslateSystemSettingManager.java	2014-06-24 21:22:44 +0000
@@ -40,11 +40,9 @@
 /**
  * @author James Chang
  */
-
 public class DefaultTranslateSystemSettingManager
     implements TranslateSystemSettingManager
 {
-
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
@@ -61,11 +59,10 @@
     // -------------------------------------------------------------------------
 
     @Override
-    public Map<String, String> getTranslation_SystemAppearanceSetting( String localeStr )
+    public Map<String, String> getTranslationSystemAppearanceSettings( String localeStr )
     {
         Map<String, String> translations = new Hashtable<String, String>();
 
-         // Add the key application data (with localeCode name) into translations map object
         translations.put( KEY_APPLICATION_TITLE, getSystemSettingWithFallbacks( KEY_APPLICATION_TITLE, localeStr, DEFAULT_APPLICATION_TITLE ) );        
         translations.put( KEY_APPLICATION_INTRO, getSystemSettingWithFallbacks( KEY_APPLICATION_INTRO, localeStr, "" ) );
         translations.put( KEY_APPLICATION_NOTIFICATION, getSystemSettingWithFallbacks( KEY_APPLICATION_NOTIFICATION, localeStr, "" ) );
@@ -75,11 +72,10 @@
     }
 
     @Override
-    public Map<String, String> getTranslationNoFallback_SystemAppearanceSetting( String localeStr )
+    public Map<String, String> getTranslationNoFallbackSystemAppearanceSettings( String localeStr )
     {
         Map<String, String> translations = new Hashtable<String, String>();
 
-         // Add the key application data (with localeCode name) into translations map object
         translations.put( KEY_APPLICATION_TITLE, systemSettingManager.getSystemSetting( KEY_APPLICATION_TITLE + localeStr, DEFAULT_APPLICATION_TITLE ).toString() );        
         translations.put( KEY_APPLICATION_INTRO, systemSettingManager.getSystemSetting( KEY_APPLICATION_INTRO + localeStr, "" ).toString() );
         translations.put( KEY_APPLICATION_NOTIFICATION, systemSettingManager.getSystemSetting( KEY_APPLICATION_NOTIFICATION + localeStr, "" ).toString() );
@@ -91,15 +87,16 @@
     // -------------------------------------------------------------------------
     // Support Method implementation
     // -------------------------------------------------------------------------
+    
     private String getSystemSettingWithFallbacks( String keyName, String localeStr, String defaultValue )
     {
         String settingValue = "";
 
-        String keyWithLocale = systemSettingManager.getSystemSetting( keyName + localeStr, "" ).toString();
+        String keyWithLocale = (String) systemSettingManager.getSystemSetting( keyName + localeStr, "" );
 
         if ( keyWithLocale.isEmpty() )
         {
-            settingValue = systemSettingManager.getSystemSetting( keyName, defaultValue ).toString();            
+            settingValue = (String) systemSettingManager.getSystemSetting( keyName, defaultValue );          
         }
         else
         {
@@ -107,6 +104,5 @@
         }
 
         return settingValue;
-    }
-        
+    }        
 }

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/i18n/action/GetStringsFromLocaleAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/i18n/action/GetStringsFromLocaleAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/i18n/action/GetStringsFromLocaleAction.java	2014-06-24 21:22:44 +0000
@@ -95,7 +95,7 @@
     
             i18nObject = manager.getI18n( this.getClass(), locale );
         
-            translations = translateSystemSettingManager.getTranslation_SystemAppearanceSetting( loc );
+            translations = translateSystemSettingManager.getTranslationSystemAppearanceSettings( loc );
         }
         
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetAppearanceSettingsStringAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetAppearanceSettingsStringAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetAppearanceSettingsStringAction.java	2014-06-24 21:22:44 +0000
@@ -80,7 +80,7 @@
 
     public String execute()
     {
-        translations = translateSystemSettingManager.getTranslationNoFallback_SystemAppearanceSetting( localeCode );
+        translations = translateSystemSettingManager.getTranslationNoFallbackSystemAppearanceSettings( localeCode );
         
         return SUCCESS;
     }