Package org.apache.jetspeed.page.document

Examples of org.apache.jetspeed.page.document.NodeSet


            if (!subsiteRoot.equals(""))
            {
                try
                {
                    Folder subsiteFolder = pageManager.getFolder(subsiteRoot);
                    NodeSet set = pageManager.getFolders(subsiteFolder);
                    if (set != null && !set.isEmpty())
                    {
                        Iterator setIterator = set.iterator();
                        while (setIterator.hasNext())
                        {
                            Folder f = (Folder)setIterator.next();
                            subsites.add(new SubsiteInfo(f.getPath(), f.getTitle()));
                        }
View Full Code Here


    public NodeSet getFolders(Object proxy) throws DocumentException
    {
        // latently subset folders by type from aggregated children
        if (!foldersAggregated)
        {
            NodeSet allChildren = getAll(proxy);
            if (allChildren != null)
            {
                folders = allChildren.subset(Folder.FOLDER_TYPE);
            }
            foldersAggregated = true;
        }
        return folders;
    }
View Full Code Here

     */
    public Folder getFolder(Object proxy, String name) throws FolderNotFoundException, DocumentException
    {
        // search for folder by name or absolute path from
        // aggregated folders
        NodeSet allFolders = getFolders(proxy);
        if (allFolders != null)
        {
            Folder folder = (Folder)allFolders.get(name);
            if (folder != null)
            {
                return folder;
            }
        }
View Full Code Here

    public NodeSet getLinks(Object proxy) throws NodeException
    {
        // latently subset links by type from aggregated children
        if (!linksAggregated)
        {
            NodeSet allChildren = getAll(proxy);
            if (allChildren != null)
            {
                links = allChildren.subset(Link.DOCUMENT_TYPE);
            }
            linksAggregated = true;
        }
        return links;
    }
View Full Code Here

     */   
    public Link getLink(Object proxy, String name) throws DocumentNotFoundException, NodeException
    {
        // search for link by name or absolute path from
        // aggregated links
        NodeSet allLinks = getLinks(proxy);
        if (allLinks != null)
        {
            Link link = (Link)allLinks.get(name);
            if (link != null)
            {
                return link;
            }
        }
View Full Code Here

    public NodeSet getPages(Object proxy) throws NodeException
    {
        // latently subset pages by type from aggregated children
        if (!pagesAggregated)
        {
            NodeSet allChildren = getAll(proxy);
            if (allChildren != null)
            {
                pages = allChildren.subset(Page.DOCUMENT_TYPE);
            }
            pagesAggregated = true;
        }
        return pages;
    }
View Full Code Here

     */
    public Page getPage(Object proxy, String name) throws PageNotFoundException, NodeException
    {
        // search for page by name or absolute path from
        // aggregated pages
        NodeSet allPages = getPages(proxy);
        if (allPages != null)
        {
            Page page = (Page)allPages.get(name);
            if (page != null)
            {
                return page;
            }
        }
View Full Code Here

                SearchFolder searchFolder = (SearchFolder)foldersIter.next();
                Folder folder = searchFolder.folder;
                String locatorName = searchFolder.locatorName;

                // create and save proxies for concrete children
                NodeSet children = folder.getAll();
                Iterator childrenIter = children.iterator();
                while (childrenIter.hasNext())
                {
                    Node child = (Node)childrenIter.next();
                    String childName = child.getName();
View Full Code Here

                // access remaining path as page, folder, or link node
                // proxy; return null if not found or not viewable/visible
                // and visibility is required
                try
                {
                    NodeSet children = currentFolder.getAll();
                    if (children != null)
                    {
                        Node node = children.get(currentPath);
                        if ((node != null) && (!onlyVisible || !node.isHidden() || (node == currentPage)) &&
                            (!onlyViewable || isProxyViewable(node, onlyVisible)))
                        {
                            return node;
                        }
View Full Code Here

                        // check for regular expression pattern
                        String subfolderPattern = pathRegexpPattern(subfolder);
                        if (subfolderPattern != null)
                        {
                            // follow all matching sub-folders
                            NodeSet subfolders = currentFolder.getFolders();
                            if (subfolders != null)
                            {
                                subfolders = subfolders.inclusiveSubset(subfolderPattern);
                                if (subfolders != null)
                                {
                                    // recursively process sub-folders if more than
                                    // one match, access single sub-folder, or return
                                    // null if nonexistent
                                    if (subfolders.size() > 1)
                                    {
                                        // recursively process matching sub-folders
                                        List proxies = null;
                                        Iterator subfoldersIter = subfolders.iterator();
                                        while (subfoldersIter.hasNext())
                                        {
                                            currentFolder = (Folder)subfoldersIter.next();
                                            List subfolderProxies = getNodeProxies(currentRegexpPath, currentFolder, onlyViewable, onlyVisible);
                                            if ((subfolderProxies != null) && !subfolderProxies.isEmpty())
                                            {
                                                if (proxies == null)
                                                {
                                                    proxies = new ArrayList();
                                                }
                                                proxies.addAll(subfolderProxies);
                                            }
                                        }
                                        return proxies;
                                    }
                                    else if (subfolders.size() == 1)
                                    {
                                        // access single sub-folder
                                        currentFolder = (Folder)subfolders.iterator().next();
                                    }
                                    else
                                    {
                                        // no matching sub-folders
                                        return null;
                                    }
                                }
                                else
                                {
                                    // no matching sub-folders
                                    return null;
                                }
                            }
                            else
                            {
                                // no sub-folders
                                return null;
                            }
                        }
                        else
                        {
                            // access single sub-folder or return null if
                            // nonexistent by throwing exception
                            currentFolder = currentFolder.getFolder(subfolder);
                        }
                    }
                    catch (NodeException ne)
                    {
                        // could not access sub-folders
                        return null;
                    }
                    catch (NodeNotFoundException nnfe)
                    {
                        // could not access sub-folders
                        return null;
                    }
                    catch (SecurityException se)
                    {
                        // could not access sub-folders
                        return null;
                    }
                }
            }
            else
            {
                try
                {
                    // get all children of current folder
                    NodeSet children = currentFolder.getAll();
                    if (children != null)
                    {
                        // check for regular expression pattern
                        String pathPattern = pathRegexpPattern(currentRegexpPath);
                        if (pathPattern != null)
                        {
                            // copy children matching remaining path pattern as
                            // page, folder, or link proxies if viewable/visible or
                            // visibilty not required
                            children = children.inclusiveSubset(pathPattern);
                            if ((children != null) && !children.isEmpty())
                            {
                                List proxies = null;
                                Iterator childrenIter = children.iterator();
                                while (childrenIter.hasNext())
                                {
                                    Node child = (Node)childrenIter.next();
                                    if ((!onlyVisible || !child.isHidden() || (child == currentPage)) &&
                                        (!onlyViewable || isProxyViewable(child, onlyVisible)))
                                    {
                                        if (proxies == null)
                                        {
                                            proxies = new ArrayList(children.size());
                                        }
                                        proxies.add(child);
                                    }
                                }
                                return proxies;
                            }
                        }
                        else
                        {
                            // access remaining path as page, folder, or link
                            // node proxy; return null if not found or not
                            // viewable and visiblity is required
                            Node child = children.get(currentRegexpPath);
                            if ((child != null) && (!onlyVisible || !child.isHidden() || (child == currentPage)) &&
                                (!onlyViewable || isProxyViewable(child, onlyVisible)))
                            {
                                List proxies = new ArrayList(1);
                                proxies.add(currentFolder);
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.page.document.NodeSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.