← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20340: Added static final Strings for the predefined keys.

 

Merge authors:
  Stian Sandvold (stian-sandvold)
------------------------------------------------------------
revno: 20340 [merge]
committer: Stian Sandvold <stian.sandvold@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-09-24 09:36:33 +0200
message:
  Added static final Strings for the predefined keys.
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/StaticContentController.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-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/StaticContentController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/StaticContentController.java	2015-09-24 07:35:03 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/StaticContentController.java	2015-09-24 07:36:33 +0000
@@ -66,9 +66,12 @@
     @Autowired
     private SystemSettingManager systemSettingManager;
 
+    private static final String LOGO_BANNER = "logo_banner";
+    private static final String LOGO_FRONT = "logo_front";
+
     private static final Map<String, String> KEY_WHITELIST_MAP = ImmutableMap.<String, String>builder().
-        put( "logo_banner", SystemSettingManager.KEY_USE_CUSTOM_LOGO_BANNER ).
-        put( "logo_front", SystemSettingManager.KEY_USE_CUSTOM_LOGO_FRONT ).build();
+        put( LOGO_BANNER, SystemSettingManager.KEY_USE_CUSTOM_LOGO_BANNER ).
+        put( LOGO_FRONT, SystemSettingManager.KEY_USE_CUSTOM_LOGO_FRONT ).build();
 
     /**
      * Serves a PNG associated with the key. if custom logo is not used, the 
@@ -182,12 +185,12 @@
     {
         String relativeUrlToImage = null;
         
-        if ( key.equals( "logo_banner" ) )
+        if ( key.equals( LOGO_BANNER ) )
         {
             relativeUrlToImage = "/dhis-web-commons/css/light_blue/logo_banner.png";
         }
 
-        if ( key.equals( "logo_front" ) )
+        if ( key.equals( LOGO_FRONT ) )
         {
             relativeUrlToImage = "/dhis-web-commons/flags/" + systemSettingManager.getFlagImage();
         }