Changeset 26473 for main

Show
Ignore:
Timestamp:
20.11.2012 06:10:39 (7 years ago)
Author:
davidb
Message:

Block of code added to monitors for the new '<gsf:foreach-metadata>' tag and adds it to the list of metadata terms to be retrieved

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java

    r26458 r26473  
    200200            Document currentDoc = this.converter.getDOM(currentFile); 
    201201            NodeList metadataElems = currentDoc.getElementsByTagNameNS(GSXML.GSF_NAMESPACE, "metadata"); //gsf:metadata 
     202            NodeList foreachMetadataElems = currentDoc.getElementsByTagNameNS(GSXML.GSF_NAMESPACE, "foreach-metadata"); //gsf:foreach-metadata 
    202203            NodeList imageElems = currentDoc.getElementsByTagNameNS(GSXML.GSF_NAMESPACE, "image"); //gsf:image 
    203204            NodeList includeElems = currentDoc.getElementsByTagNameNS(GSXML.XSL_NAMESPACE, "include"); 
     
    208209            { 
    209210                Element current = (Element) metadataElems.item(i); 
     211                String name = current.getAttribute(GSXML.NAME_ATT); 
     212                if (name != null && name.length() > 0 && !names.contains(name)) 
     213                { 
     214                    names.add(name); 
     215                } 
     216            } 
     217 
     218            for (int i = 0; i < foreachMetadataElems.getLength(); i++) 
     219            { 
     220                Element current = (Element) foreachMetadataElems.item(i); 
    210221                String name = current.getAttribute(GSXML.NAME_ATT); 
    211222                if (name != null && name.length() > 0 && !names.contains(name))