Package org.apache.jetspeed.om.page

Examples of org.apache.jetspeed.om.page.Link


   
    private DefaultMutableTreeNode retrieveFolders(String folderPath, DefaultMutableTreeNode rootNode, boolean cleanBeforeRetrieve)
    {
        try
        {
            Link link;
            Folder folder;
            DefaultMutableTreeNode tmpNode;
            Page page;
            Folder rootfolder = getServiceLocator().getPageManager().getFolder(folderPath);
           
View Full Code Here


                {
                    PageAction(page, REMOVE_ACTION);
                }
            } else if (node.getDocType() == SiteTreeNode.FileType.Link)
            {
                Link link = getJetspeedLink(node.getNodePath());
                if (action.equals("save"))
                {
                    link.setTitle(document.getTitle());
                    link.setShortTitle(document.getShortTitle());
                    link.setUrl(document.getUrl());
                    link.setTitle(document.getTitle());
                    link.setHidden(document.isHidden());
                    linkAction(link, SAVE_ACTION);
                } else if (action.equals("remove"))
                {
                    linkAction(link, REMOVE_ACTION);
                }
View Full Code Here

                } else if (siteNode.getDocType() == SiteTreeNode.FileType.Link)
                {
                    objectPath = PortalSiteManagerUtil
                            .getParentPath(objectPath);
                    Folder folder = pageManager.getFolder(objectPath);
                    Link link = folder.getLink(siteNode.getNodeName());
                    Link destLink = castorPageManager.copyLink(link,
                            PortalSiteManagerUtil.getUserFolder(userName, true)
                                    + siteNode.getNodeName());
                    castorPageManager.updateLink(destLink);
                }
                String link = userName + "_" + siteNode.getNodeName();
View Full Code Here

            pageManager.updatePage(dstPage);
        }
        Iterator links = srcFolder.getLinks().iterator();
        while (links.hasNext())
        {
            Link srcLink = (Link) links.next();
            Link dstLink = lookupLink(castorPageManager, srcLink.getPath());
            newPath = destination + getRealPath(srcLink.getPath());
            dstLink = pageManager.copyLink(srcLink, newPath);
            pageManager.updateLink(dstLink);
        }
        Iterator folders = srcFolder.getFolders().iterator();
View Full Code Here

        return page;
    }

    protected Link getJetspeedLink(String pagePath)
    {
        Link link = null;
        try
        {
            link = getServiceLocator().getPageManager().getLink(pagePath);
        }
        catch (PageNotFoundException e)
View Full Code Here

                    siteTreeNode = new SiteTreeNode(folder.getName(), folder.getPath(), SiteTreeNode.FileType.Folder, true);
                    treeRootNode = new DefaultMutableTreeNode(new SiteTreeNode(folder, true));
                }
                else if (LINK_NODE_TYPE.equals(type))
                {
                    Link link = pageManager.getLink(pathParam);
                    siteTreeNode = new SiteTreeNode(link.getName(), link.getPath(), SiteTreeNode.FileType.Link, true);
                    treeRootNode = new DefaultMutableTreeNode(new SiteTreeNode(link));
                }
            }
            catch (Exception e)
            {
View Full Code Here

                requestContext.setSessionAttribute(PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY, null);
            }
            else if (Link.DOCUMENT_TYPE.equals(type))
            {
                String path = nodePath + Link.DOCUMENT_TYPE;
                Link link = pageManager.newLink(path);
                link.setTitle(name);
                pageManager.updateLink(link);
               
                requestContext.setSessionAttribute(PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY, null);
            }
        }
View Full Code Here

                                        pageManager.updateFragmentDefinition(fragmentDefinition);
                                        success = true;
                                    } else if (fileType
                                            .equalsIgnoreCase("link"))
                                    {
                                        Link source = folder.getLink(fileName);
                                        Link link;
                                        if (pageManager.linkExists(destPath
                                                + pathSeparator + fileName))
                                        {
                                            pageManager.removeLink(pageManager
                                                    .getLink(destPath
View Full Code Here

                    } else
                    {
                        documentPath = treeNode.getNodePath()
                                + JETSPEED_PATH_SEPRATOR;
                    }
                    Link link = getServiceLocator().getPageManager().newLink(
                            documentPath + document.getName() + ".link");
                    link.setTitle(document.getTitle());
                    link.setShortTitle(document.getShortTitle());
                    link.setUrl(document.getUrl());
                    link.setTarget(document.getTarget());
                    link.setHidden(document.isHidden());
                    linkAction(link, SAVE_ACTION);
                    node.insert(new DefaultMutableTreeNode(new SiteTreeNode(
                            link)), 0);
                    LinkTree tree = (PortalTree) getPage().get("siteTree");
                    tree.getTreeState().expandNode(node);
View Full Code Here

                    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);
                   
                    if (newLink.getParent() != null)
                    {
                        setFolderTreeNodeLoadedByPath(newLink.getParent(), false);
                    }
                   
                    if (!copy)
                    {
                        linkAction(sourceLink, REMOVE_ACTION);
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.page.Link

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.