- Timestamp:
- 2012-09-25T13:49:14+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java
r26104 r26243 34 34 import org.greenstone.util.GlobalProperties; 35 35 import org.w3c.dom.Node; 36 import org.w3c.dom.NodeList; 36 37 37 38 /** … … 282 283 } 283 284 285 // xslt didn't like calling the function with Node varargs, so have this hack for now 286 public static String getCollectionTextWithDOM(String collection, String site_name, String lang, String key, Node n1) { 287 return getCollectionTextWithDOMMulti(collection, site_name, lang, key, n1); 288 } 289 public static String getCollectionTextWithDOM(String collection, String site_name, String lang, String key, Node n1, Node n2) { 290 return getCollectionTextWithDOMMulti(collection, site_name, lang, key, n1, n2); 291 } 292 public static String getCollectionTextWithDOM(String collection, String site_name, String lang, String key, Node n1, Node n2, Node n3) { 293 return getCollectionTextWithDOMMulti(collection, site_name, lang, key, n1, n2, n3); 294 } 295 public static String getCollectionTextWithDOM(String collection, String site_name, String lang, String key, Node n1, Node n2, Node n3, Node n4) { 296 return getCollectionTextWithDOMMulti(collection, site_name, lang, key, n1, n2, n3, n4); 297 } 298 public static String getCollectionTextWithDOMMulti(String collection, String site_name, String lang, String key, Node ... nodes) { 299 300 int num_nodes = nodes.length; 301 String[] args = new String[num_nodes]; 302 303 for (int i=0; i<num_nodes; i++) { 304 305 String node_str = XMLConverter.getString(nodes[i]); 306 args[i] = node_str; 307 } 308 CollectionClassLoader class_loader = new CollectionClassLoader(XSLTUtil.class.getClassLoader(), GSFile.siteHome(GlobalProperties.getGSDL3Home(), site_name), collection); 309 Dictionary dict = new Dictionary(collection, lang, class_loader); 310 String result = dict.get(key, args); 311 if (result != null) { 312 return result; 313 } 314 return "text:"+collection+":"+key; 315 316 } 317 318 284 319 public static boolean isImage(String mimetype) 285 320 {
Note:
See TracChangeset
for help on using the changeset viewer.