Changeset 31345


Ignore:
Timestamp:
2017-01-24T04:20:25+13:00 (7 years ago)
Author:
Georgiy Litvinov
Message:

Added all collection option

File:
1 edited

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);
Note: See TracChangeset for help on using the changeset viewer.