Changeset 9426


Ignore:
Timestamp:
2005-03-15T14:44:28+13:00 (19 years ago)
Author:
kjdon
Message:

changed the collection specific stuff slightly - instead of the single collection.properties file, now we need the correct class name.properties to be in collection/resources - otherwise services with the same key names will get mixed up.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/service/ServiceRack.java

    r9423 r9426  
    342342    protected String getTextString(String key, String lang, String dictionary, String[] args) {
    343343
     344    // we want to use the collection class loader in case there are coll specific files
     345    CollectionClassLoader class_loader = new CollectionClassLoader(this.site_home, this.cluster_name);
     346   
    344347    if (dictionary != null) {
    345348        // just try the one specified dictionary
    346         Dictionary dict = new Dictionary(dictionary, lang);
     349        Dictionary dict = new Dictionary(dictionary, lang, class_loader);
    347350        String result = dict.get(key, args);
    348351        if (result == null) { // not found
     
    352355    }
    353356
    354     // If no dictionary was specified, we try collection specific one, then
    355     // dictionaries based on the class names
    356    
    357     // first we try a collection properties file
    358     Dictionary dict = new Dictionary("collection", lang, new CollectionClassLoader(this.site_home, this.cluster_name));
    359     String result = dict.get(key, args);
    360     if (result != null) {
    361         return result;
    362     }
    363    
    364     // then we try class names for dictionary names
     357    // now we try class names for dictionary names
    365358    String class_name = this.getClass().getName();
    366359    class_name = class_name.substring(class_name.lastIndexOf('.')+1);
    367     dict = new Dictionary(class_name, lang);
    368     result = dict.get(key, args);
     360    Dictionary dict = new Dictionary(class_name, lang, class_loader);
     361    String result = dict.get(key, args);
    369362    if (result != null) {
    370363        return result;
     
    380373        break;
    381374        }
    382         dict = new Dictionary(class_name, lang, new CollectionClassLoader(this.site_home, this.cluster_name));
     375        dict = new Dictionary(class_name, lang, class_loader);
    383376        result = dict.get(key, args);
    384377        c = c.getSuperclass();
Note: See TracChangeset for help on using the changeset viewer.