Changeset 26248 for main

Show
Ignore:
Timestamp:
25.09.2012 15:20:04 (7 years ago)
Author:
kjdon
Message:

trying to implement getCollectionText with no arguments for the dictionary string

Location:
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util
Files:
2 modified

Legend:

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

    r18405 r26248  
    123123        initial = initial.substring(0, initial.indexOf("#")); 
    124124        } 
     125        // if we haven't been given any args, don't bother looking for them 
     126        if (args == null) { 
     127          return initial; 
     128        } 
    125129        // If the string contains arguments we have to insert them. 
    126130        StringBuffer complete = new StringBuffer(); 
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java

    r26243 r26248  
    283283    } 
    284284 
     285  public static String getCollectionText(String collection, String site_name, String lang, String key) { 
     286    return getCollectionTextWithDOMMulti(collection, site_name, lang, key); 
     287  } 
    285288  // xslt didn't like calling the function with Node varargs, so have this hack for now 
    286289  public static String getCollectionTextWithDOM(String collection, String site_name, String lang, String key, Node n1) { 
     
    299302 
    300303    int num_nodes = nodes.length; 
    301     String[] args = new String[num_nodes]; 
    302  
    303     for (int i=0; i<num_nodes; i++) { 
     304    String [] args = null; 
     305    if (num_nodes != 0) { 
     306      args = new String[num_nodes]; 
     307 
     308      for (int i=0; i<num_nodes; i++) { 
    304309       
    305       String node_str = XMLConverter.getString(nodes[i]); 
    306       args[i] = node_str; 
     310    String node_str = XMLConverter.getString(nodes[i]); 
     311    args[i] = node_str; 
     312      } 
    307313    } 
    308314    CollectionClassLoader class_loader = new CollectionClassLoader(XSLTUtil.class.getClassLoader(), GSFile.siteHome(GlobalProperties.getGSDL3Home(), site_name), collection);