- Timestamp:
- 2012-07-31T16:15:49+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GS2BrowseAction.java
r26026 r26048 125 125 { 126 126 Element global_format_elem = (Element) GSXML.getChildByTagName(format_response, GSXML.GLOBAL_FORMAT_ELEM); 127 if (global_format_elem != null)127 if (global_format_elem != null) 128 128 { 129 129 GSXSLT.mergeFormatElements(this_format, global_format_elem, false); … … 132 132 Element new_format = GSXML.duplicateWithNewName(this.doc, this_format, GSXML.FORMAT_ELEM, false); 133 133 extractMetadataNames(new_format, doc_meta_names, class_meta_names); 134 134 135 135 Element extraMetaListElem = (Element) GSXML.getChildByTagName(request, GSXML.EXTRA_METADATA + GSXML.LIST_MODIFIER); 136 if (extraMetaListElem != null)136 if (extraMetaListElem != null) 137 137 { 138 138 NodeList extraMetaList = extraMetaListElem.getElementsByTagName(GSXML.EXTRA_METADATA); 139 for (int i = 0; i < extraMetaList.getLength(); i++)140 { 141 class_meta_names.add(((Element) extraMetaList.item(i)).getAttribute(GSXML.NAME_ATT));142 } 143 } 144 139 for (int i = 0; i < extraMetaList.getLength(); i++) 140 { 141 class_meta_names.add(((Element) extraMetaList.item(i)).getAttribute(GSXML.NAME_ATT)); 142 } 143 } 144 145 145 // set the format type 146 146 new_format.setAttribute(GSXML.TYPE_ATT, "browse"); … … 454 454 protected void extractMetadataNames(Element new_format, HashSet<String> doc_meta_names, HashSet<String> class_meta_names) 455 455 { 456 NodeList templates = new_format.getElementsByTagName ("gsf:template");456 NodeList templates = new_format.getElementsByTagNameNS("http://www.greenstone.org/greenstone3/schema/ConfigFormat", "template"); 457 457 for (int i = 0; i < templates.getLength(); i++) 458 458 { 459 459 Element template = (Element) templates.item(i); 460 String match = template.getAttribute("match"); 461 if (match.startsWith("documentNode")) 460 String match = template.getAttribute(GSXML.MATCH_ATT); 461 String name = template.getAttribute(GSXML.NAME_ATT); 462 if (match != null && match.length() > 0) 463 { 464 if (match.startsWith("documentNode")) 465 { 466 getRequiredMetadataNames(template, doc_meta_names); 467 } 468 else if (match.startsWith("classifierNode")) // not match.equals, as we want to match nodes like: classifierNode[@classifierStyle = 'VList'] 469 { 470 getRequiredMetadataNames(template, class_meta_names); 471 } 472 } 473 else 462 474 { 463 475 getRequiredMetadataNames(template, doc_meta_names); 464 }465 else if (match.startsWith("classifierNode")) // not match.equals, as we want to match nodes like: classifierNode[@classifierStyle = 'VList']466 {467 476 getRequiredMetadataNames(template, class_meta_names); 468 477 }
Note:
See TracChangeset
for help on using the changeset viewer.