Changeset 31345

Show
Ignore:
Timestamp:
24.01.2017 04:20:25 (3 years ago)
Author:
litvinovg
Message:

Added all collection option

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CollectionGroups.java

    r31285 r31345  
    248248        addGroupInfo(currentContent, currentPath); 
    249249        addUngroupedCollections(currentContent, searchableCollectionList); 
     250        addAllOption(currentContent); 
    250251        result.appendChild(doc.importNode(currentContent, true)); 
    251252        return result; 
    252253    } 
    253254     
     255    private void addAllOption(Element currentContent) { 
     256        if (currentContent == null){ 
     257            return; 
     258        } 
     259        Document doc = currentContent.getOwnerDocument(); 
     260        Element allOption = doc.createElement(GSXML.COLLECTION_ELEM); 
     261        allOption.setAttribute(GSXML.NAME_ATT, "all"); 
     262        if (currentContent.hasChildNodes()){ 
     263            currentContent.insertBefore(allOption,currentContent.getFirstChild());   
     264        } else  
     265            currentContent.appendChild(allOption); 
     266         
     267         
     268    } 
     269 
    254270    private void addGroupInfo(Element currentContent, String groupPath) { 
    255271        NodeList groups = GSXML.getChildrenByTagName(currentContent,GSXML.GROUP_ELEM);