Package org.apache.jetspeed.page.document

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


            // check permissions and constraints, filter nodes as required
            NodeSetImpl filteredNodes = null;
            Iterator checkAccessIter = nodes.iterator();
            while (checkAccessIter.hasNext())
            {
                Node node = (Node)checkAccessIter.next();
                try
                {
                    // check access
                    node.checkAccess(JetspeedActions.VIEW);

                    // add to filteredNodes nodes if copying
                    if (filteredNodes != null)
                    {
                        // permitted, add to filteredNodes nodes
                        filteredNodes.add(node);
                    }
                }
                catch (SecurityException se)
                {
                    // create filteredNodes nodes if not already copying
                    if (filteredNodes == null)
                    {
                        // not permitted, copy previously permitted nodes
                        // to new filteredNodes node set with same comparator
                        filteredNodes = new NodeSetImpl(nodes);
                        Iterator copyIter = nodes.iterator();
                        while (copyIter.hasNext())
                        {
                            Node copyNode = (Node)copyIter.next();
                            if (copyNode != node)
                            {
                                filteredNodes.add(copyNode);
                            }
                            else
View Full Code Here


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

        NodeSet nodes = getAllNodes();
        NodeSet filteredNodes = null;
        Iterator checkAccessIter = nodes.iterator();
        while (checkAccessIter.hasNext())
        {
            Node node = (Node)checkAccessIter.next();
            try
            {
                ((AbstractNode) node).checkAccess(JetspeedActions.VIEW);
                if (filteredNodes != null)
                {
                    filteredNodes.add(node);
                }
            }
            catch (SecurityException se)
            {
                if (filteredNodes == null)
                {
                    filteredNodes = new NodeSetImpl(getPath(), ((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

                String[] nodeNames = folderHandler.listAll(getPath());
                for (int i = 0; i < nodeNames.length; i++)
                {
                    if (!nodeNames[i].equals(FolderMetaDataImpl.DOCUMENT_TYPE))
                    {
                        Node node = null;
                        try
                        {
                            if (getPath().endsWith(PATH_SEPARATOR))
                            {
                                String full = PageManagerUtils.concatenatePaths(getPath(), nodeNames[i]);
                                if (!folderHandler.isFolder(full))
                                {
                                    node = getHandlerFactory().getDocumentHandlerForPath(nodeNames[i]).getDocument(getPath() + nodeNames[i]);
                                }
                                else
                                {
                                    node = folderHandler.getFolder(getPath() + nodeNames[i]);
                                }
                            }
                            else
                            {
                                String full = PageManagerUtils.concatenatePaths(getPath(), nodeNames[i]);
                                if (!folderHandler.isFolder(full))                               
                                //if(nodeNames[i].indexOf(".") > -1)
                                {
                                    node = getHandlerFactory().getDocumentHandlerForPath(nodeNames[i]).getDocument(getPath() + PATH_SEPARATOR + nodeNames[i]);
                                }
                                else
                                {
                                    node = folderHandler.getFolder(getPath() + PATH_SEPARATOR + nodeNames[i]);
                                }
                            }
                            node.setParent(this);
                            allNodes.add(node);
                        }              
                        catch (UnsupportedDocumentTypeException e)
                        {
                            // Skip unsupported documents
View Full Code Here

    {
        this.nodes = new TreeMap(comparator);       
        Object[] nodeToCopy = nodes.toArray();
        for (int ix = 0; ix < nodeToCopy.length; ix++)
        {
            Node node = (Node)nodeToCopy[ix];
            if (!this.nodes.containsKey( node.getName()))
            {
                this.nodes.put(node.getName(), node);
            }
        }        
        this.comparator = comparator;
    }
View Full Code Here

    {
        NodeSetImpl subset = new NodeSetImpl(comparator);
        Iterator nodeItr = iterator();
        while (nodeItr.hasNext())
        {
            Node node = (Node) nodeItr.next();
            if (node.getType().equals(type))
            {
                subset.add(node);
            }
        }
        return subset;
View Full Code Here

        Pattern pattern = getCachedPattern(regex);
        NodeSetImpl subset = new NodeSetImpl(comparator);
        Iterator nodeItr = iterator();
        while (nodeItr.hasNext())
        {
            Node node = (Node) nodeItr.next();
            if (pattern.matcher(node.getName()).matches())
            {
                subset.add(node);
            }
        }
        return subset;
View Full Code Here

        Pattern pattern = getCachedPattern(regex);
        NodeSetImpl subset = new NodeSetImpl(comparator);
        Iterator nodeItr = iterator();
        while (nodeItr.hasNext())
        {
            Node node = (Node) nodeItr.next();
            if (!pattern.matcher(node.getName()).matches())
            {
                subset.add(node);
            }
        }
        return subset;
View Full Code Here

            subset = new NodeSetImpl(resolveToPath, comparator);

            Iterator nodeItr = nodes.values().iterator();
            while (nodeItr.hasNext())
            {
                Node node = (Node) nodeItr.next();
                if (node.getType().equals(type))
                {
                    subset.add(node);
                }
            }
           
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.