Package org.apache.jetspeed.page.document

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


            // 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)
                {
                    updateFolder((Folder)node, true);
                }
            }
View Full Code Here


     */
    public void refresh( FileCacheEntry entry ) throws Exception
    {
        // file cache managed component refreshed:
        // notify page manager listeners
        Node refreshedNode = null;
        if (entry.getDocument() instanceof Node)
        {
            refreshedNode = (Node)entry.getDocument();
        }
        if (entry.getFile().exists())
View Full Code Here

        log.debug("Entry is refreshing: " + entry.getFile().getName());

        if (entry.getDocument() instanceof Document && ((Document) entry.getDocument()).getPath().endsWith(documentType))
        {
            Document document = (Document) entry.getDocument();
            Node parent = ((AbstractNode)document).getParent(false);
            if (parent instanceof FolderImpl)
            {
                Document freshDoc = getDocument(document.getPath(), false);
                freshDoc.setParent(parent);
                ((FolderImpl)parent).getAllNodes().add(freshDoc);
View Full Code Here

           
            // remove folder nodes
            Iterator removeIter = removeNodes.iterator();
            while (removeIter.hasNext())
            {
                Node node = (Node)removeIter.next();
                if (node instanceof Folder)
                {
                    // recursively remove folder
                    removeFolder((Folder)node);
                }
                else if (node instanceof Document)
                {
                    // remove folder document
                    try
                    {
                        handlerFactory.getDocumentHandler(node.getType()).removeDocument((Document)node);
                    }
                    catch (Exception e)
                    {
                        File documentFile = new File(this.documentRootDir, node.getPath());
                        throw new FailedToDeleteFolderException(documentFile.getAbsolutePath()+" document cannot be deleted.");
                    }
                }
                ((NodeSetImpl)folderImpl.getAllNodes()).remove(node);
            }
View Full Code Here

        {
            // get single matched node
            Iterator findIter = ((FolderImpl)folder).getAllNodes().iterator();
            while (findIter.hasNext())
            {
                Node addNode = (Node) findIter.next();
                if (addNode.getPath().equals(nodePath))
                {
                    matched.add(addNode);
                    break;
                }
            }
View Full Code Here

    {
        if (entry.getDocument() instanceof Folder )
        {
            Folder folder = (Folder) entry.getDocument();           
            entry.setDocument(getFolder(folder.getPath(), false));
            Node parentNode = ((AbstractNode)folder).getParent(false);
            if (parentNode != null)
            {
                FileCacheEntry parentEntry = fileCache.get(parentNode.getPath());
                refresh(parentEntry);               
            }
        }
        else if(entry.getDocument() instanceof Document)
        {
            Document doc = (Document) entry.getDocument();
            if (doc.getType().equals(FolderMetaDataImpl.DOCUMENT_TYPE))
            {
                Node folderNode = ((AbstractNode)doc).getParent(false);
                if (folderNode != null)
                {               
                    FileCacheEntry folderEntry = fileCache.get(folderNode.getPath());
                    refresh(folderEntry);
                }
            }
        }
       
View Full Code Here

                        // to new filteredNodes node set with same comparator
                        filteredNodes = new NodeSetImpl(null, ((NodeSetImpl) nodes).getComparator());
                        Iterator copyIter = nodes.iterator();
                        while (copyIter.hasNext())
                        {
                            Node copyNode = (Node)copyIter.next();
                            if (copyNode != node)
                            {
                                filteredNodes.add(copyNode);
                            }
                            else
View Full Code Here

           
            // remove folder nodes
            Iterator removeIter = removeNodes.iterator();
            while (removeIter.hasNext())
            {
                Node node = (Node)removeIter.next();
                if (node instanceof Folder)
                {
                    // recursively remove folder
                    removeFolder((Folder)node);
                }
                else if (node instanceof Document)
                {
                    // remove folder document
                    try
                    {
                        handlerFactory.getDocumentHandler(node.getType()).removeDocument((Document)node);
                    }
                    catch (Exception e)
                    {
                        File documentFile = new File(this.documentRootDir, node.getPath());
                        throw new FailedToDeleteFolderException(documentFile.getAbsolutePath()+" document cannot be deleted.");
                    }
                }
                ((NodeSetImpl)folderImpl.getAllNodes()).remove(node);
            }
View Full Code Here

        {
            // get single matched node
            Iterator findIter = ((FolderImpl)folder).getAllNodes().iterator();
            while (findIter.hasNext())
            {
                Node addNode = (Node) findIter.next();
                if (addNode.getPath().equals(nodePath))
                {
                    matched.add(addNode);
                    break;
                }
            }
View Full Code Here

            List filteredNodes = null;
            Iterator nodesIter = nodes.iterator();
            while (nodesIter.hasNext())
            {
                // test hidden status of individual node proxies
                Node node = (Node)nodesIter.next();
                if (node.isHidden())
                {
                    // if not copying, create new node set
                    // and copy preceding node proxies
                    if (filteredNodes == null)
                    {
                        filteredNodes = new ArrayList(nodes.size());
                        Iterator copyIter = nodes.iterator();
                        while (copyIter.hasNext())
                        {
                            Node copyNode = (Node)copyIter.next();
                            if (copyNode != node)
                            {
                                filteredNodes.add(copyNode);
                            }
                            else
View Full Code Here

TOP

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

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.