Package org.apache.jetspeed.page.document

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


    private void securityConstraintAction(String action, String constraint,
            String oldConstraintName)
    {
        SiteTreeNode node = getUserSelectedNode();
        Node jetspeedNode = null;
        PageManager pageManager = getServiceLocator().getPageManager();
        if (node.getDocType() == SiteTreeNode.FileType.Folder)
        {
            jetspeedNode = (Node) getJetspeedFolder(node.getNodePath());
            if (action.equals(ADD_ACTION) || action.equals(SAVE_ACTION))
View Full Code Here


    private void metaDataAction(String action,
            JetspeedDocumentMetaData metaData,
            JetspeedDocumentMetaData oldMetaData)
    {
        SiteTreeNode node = getUserSelectedNode();
        Node jetspeedNode = null;
        PageManager pageManager = getServiceLocator().getPageManager();
        if (node.getDocType() == SiteTreeNode.FileType.Folder)
        {
            jetspeedNode = (Node) getJetspeedFolder(node.getNodePath());
            if (action.equals(ADD_ACTION) || action.equals(SAVE_ACTION))
View Full Code Here

            FileType docType = getUserSelectedNode().getDocType();
           
            if (getUserSelectedNode().getDocType() == FileType.Folder)
            {
                Folder sourceFolder = getJetspeedFolder(oldPath);
                Node sourceParentNode = sourceFolder.getParent();
               
                try
                {
                    String destFolderPath = newPath + JETSPEED_PATH_SEPRATOR + newName;
                    getServiceLocator().getPageManager().deepCopyFolder(sourceFolder, destFolderPath, getFolderOwner(sourceFolder));
                   
                    Folder destFolder = getServiceLocator().getPageManager().getFolder(destFolderPath);
                    if (destFolder.getParent() != null)
                    {
                        setFolderTreeNodeLoadedByPath(destFolder.getParent(), false);
                    }
                   
                    if (!copy)
                    {
                        folderAction(sourceFolder, REMOVE_ACTION);
                       
                        if (sourceParentNode != null)
                        {
                            setFolderTreeNodeLoadedByPath(sourceParentNode, false);
                        }
                    }
                }
                catch (Exception e)
                {
                    log.error("Failed to copy folder.", e);
                }
            }
            else if (docType == FileType.Page)
            {
                Page sourcePage = getJetspeedPage(oldPath);
                Node sourceParentNode = sourcePage.getParent();
               
                try
                {
                    Page newPage = getServiceLocator().getPageManager().copyPage(sourcePage, newPath + JETSPEED_PATH_SEPRATOR + newName, copyIds);
                    PageAction(newPage, SAVE_ACTION);
                   
                    if (newPage.getParent() != null)
                    {
                        setFolderTreeNodeLoadedByPath(newPage.getParent(), false);
                    }
                   
                    if (!copy)
                    {
                        PageAction(sourcePage, REMOVE_ACTION);
                       
                        if (sourceParentNode != null)
                        {
                            setFolderTreeNodeLoadedByPath(sourceParentNode, false);
                        }
                    }
                }
                catch (NodeException e)
                {
                    log.error("Failed to copy page.", e);
                }
            }
            else if (docType == FileType.Link)
            {
                Link sourceLink = getJetspeedLink(oldPath);
                Node sourceParentNode = sourceLink.getParent();
               
                try
                {
                    Link newLink = getServiceLocator().getPageManager().copyLink(sourceLink, newPath + JETSPEED_PATH_SEPRATOR + newName);
                    linkAction(newLink, SAVE_ACTION);
View Full Code Here

    public void doView(RenderRequest request, RenderResponse response)
            throws PortletException, IOException
    {   
        RequestContext rc = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
        Stack<BreadcrumbMenuItem> stack = new Stack<BreadcrumbMenuItem>();
        Node node = rc.getPage().getPageOrTemplate().getParent();
        while (node != null)
        {
            stack.push(new BreadcrumbMenuItem(node.getTitle(), admin.getPortalURL(request, response, node.getPath())));
            node = node.getParent();
        }
        List<BreadcrumbMenuItem> breadcrumbs = new LinkedList<BreadcrumbMenuItem>();
        while (!stack.empty())
        {
            breadcrumbs.add(stack.pop());
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(SecuredResource.VIEW_ACTION);
                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

            //DocumentHandler docHandler = getHandlerFactory().getDocumentHandler(documentType);

            String[] nodeNames = folderHandler.listAll(getPath());
            for (int i = 0; i < nodeNames.length; i++)
            {
                Node node = null;
                try
                {
                    if (getPath().endsWith(PATH_SEPARATOR))
                    {
                        if(nodeNames[i].indexOf(".") > -1)
                        {   
                            node = getHandlerFactory().getDocumentHandlerForPath(nodeNames[i]).getDocument(getPath() + nodeNames[i]);
                        }
                        else
                        {
                            node = folderHandler.getFolder(getPath() + nodeNames[i]);
                        }
                    }
                    else
                    {
                       
                        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

                    // cannot remove from NodeSet: copy to replace setNode and return new set
                    NodeSetImpl newSet = new NodeSetImpl(null, set.getComparator());
                    Iterator copyIter = set.iterator();
                    while (copyIter.hasNext())
                    {
                        Node copyNode = (Node) copyIter.next();
                        if (copyNode != setNode)
                        {
                            newSet.add(copyNode);
                        }
                        else
View Full Code Here

       
        if(nodeName != null)
        {
            try
            {
                Node node = null;
                if(actionType.equals("folder"))
                {
                    node = pageManager.getFolder(nodeName);
                }
                else
View Full Code Here

            }

            // lookup request path in view for viewable page or folder
            // nodes; note: directly requested pages/folders may be hidden
            // or not viewable
            Node requestNode = null;
            try
            {
                // try page or folder request url
                requestNode = view.getNodeView(requestPath, null, null, !forceTemplatesAccessible, false, false);
            }
View Full Code Here

                // 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();

                    // filter profiling property folders unless forced; they are
                    // normally accessed only via SiteView search path aggregation
                    // that directly utilizes the current view page manager
                    boolean visible = (forceReservedVisible || (!(child instanceof Folder) ||
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.