Package org.apache.jetspeed.page.document

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


     */
    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

     * @param type
     * @return
     */
    public NodeSet subset( String type )
    {
        NodeSet subset = (NodeSet) subsets.get(type);
        if (subset == null)
        {
            subset = new NodeSetImpl(resolveToPath, comparator);
            subsets.put(type, subset);

            Iterator nodeItr = nodes.values().iterator();
            while (nodeItr.hasNext())
            {
                Node node = (Node) nodeItr.next();
                if (node.getType().equals(type))
                {
                    subset.add(node);
                }
            }
        }

        return subset;
View Full Code Here

    private void updateFolderNodes(FolderImpl folderImpl) throws FolderNotUpdatedException
    {
        try
        {
            // update folder documents
            NodeSet nodes = folderImpl.getAllNodes();
            Iterator nodesIter = nodes.iterator();
            while (nodesIter.hasNext())
            {
                Node node = (Node) nodesIter.next();
                if (node instanceof Page)
                {
                    updatePage((Page)node);
                }
                else if (node instanceof Link)
                {
                    updateLink((Link)node);
                }
                else if (node instanceof PageSecurity)
                {
                    updatePageSecurity((PageSecurity)node);
                }
            }

            // update folders last: breadth first recursion
            nodesIter = nodes.iterator();
            while (nodesIter.hasNext())
            {
                Node node = (Node) nodesIter.next();
                if (node instanceof Folder)
                {
View Full Code Here

        assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(requestPageProxy.getId()));
        Folder requestFolderProxy = requestContext.getFolder();
        assertNotNull(requestFolderProxy);
        assertEquals("/", requestFolderProxy.getName());
        assertEquals("/_user/user", extractFileSystemPathFromId(requestFolderProxy.getId()));
        NodeSet requestSiblingPageProxies = requestContext.getSiblingPages();
        assertNotNull(requestSiblingPageProxies);
        assertEquals(3, requestSiblingPageProxies.size());
        assertNotNull(requestSiblingPageProxies.get("page0.psml"));
        assertEquals("/page0.psml", extractFileSystemPathFromId(requestSiblingPageProxies.get("page0.psml").getId()));
        assertNotNull(requestSiblingPageProxies.get("page1.psml"));
        assertEquals("/page1.psml", extractFileSystemPathFromId(requestSiblingPageProxies.get("page1.psml").getId()));
        assertNotNull(requestSiblingPageProxies.get("page2.psml"));
        assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(requestSiblingPageProxies.get("page2.psml").getId()));
        Folder requestParentFolderProxy = requestContext.getParentFolder();
        assertNull(requestParentFolderProxy);
        NodeSet requestSiblingFolderProxies = requestContext.getSiblingFolders();
        assertNotNull(requestSiblingFolderProxies);
        assertEquals(3, requestSiblingFolderProxies.size());
        assertNotNull(requestSiblingFolderProxies.get("folder0"));
        assertEquals("/folder0", extractFileSystemPathFromId(requestSiblingFolderProxies.get("folder0").getId()));
        assertNotNull(requestSiblingFolderProxies.get("folder1"));
        assertEquals("/_user/user/folder1", extractFileSystemPathFromId(requestSiblingFolderProxies.get("folder1").getId()));
        assertNotNull(requestSiblingFolderProxies.get("folder2"));
        assertEquals("/folder2", extractFileSystemPathFromId(requestSiblingFolderProxies.get("folder2").getId()));
        Folder requestRootFolderProxy = requestContext.getRootFolder();
        assertNotNull(requestRootFolderProxy);
        assertEquals("/", requestRootFolderProxy.getName());
        assertEquals("/_user/user", extractFileSystemPathFromId(requestRootFolderProxy.getId()));
        NodeSet requestRootLinkProxies = requestContext.getRootLinks();
        assertNotNull(requestRootLinkProxies);
        assertEquals(2, requestRootLinkProxies.size());
        assertNotNull(requestRootLinkProxies.get("link0.link"));
        assertEquals("/_group/group/link0.link", extractFileSystemPathFromId(requestRootLinkProxies.get("link0.link").getId()));
        assertNotNull(requestRootLinkProxies.get("link1.link"));
        assertEquals("/link1.link", extractFileSystemPathFromId(requestRootLinkProxies.get("link1.link").getId()));
    }
View Full Code Here

     * @throws DocumentException
     */
    public NodeSet getFolders(boolean checkAccess) throws DocumentException
    {
        // get list of all folders
        NodeSet folders = getAllNodes().subset(FOLDER_TYPE);

        // filter node set by access
        if (checkAccess)
        {
            folders = checkAccess(folders, JetspeedActions.VIEW);
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.