Changeset 33671

Show
Ignore:
Timestamp:
14.11.2019 14:12:44 (3 weeks ago)
Author:
kjdon
Message:

added a static getTextString method - currently this is in Action.java and Servicerack.java. And now I want it in LibraryServiet?. Added a simple one here. At a later stage, merge these all into Dictionary so all places can use it

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/Dictionary.java

    r32318 r33671  
    233233        } 
    234234    } 
     235 
     236  public static String getTextString(String key, String lang, String dictionary_name, ClassLoader class_loader, String[] args) 
     237  { 
     238 
     239      // we want to use the collection class loader in case there are coll specific files 
     240      if (dictionary_name != null) 
     241        { 
     242          // just try the one specified dictionary 
     243          Dictionary dict = new Dictionary(dictionary_name, lang, class_loader); 
     244          String result = dict.get(key, args); 
     245          if (result == null) 
     246        { // not found 
     247           
     248          logger.error("couldn't find key in dict, "+key); 
     249          return "_" + key + "_"; 
     250          //return null; 
     251        } 
     252          return result; 
     253        } 
     254      return "_" + key + "_"; 
     255  } 
     256 
    235257}