Package org.apache.lenya.cms.site

Examples of org.apache.lenya.cms.site.SiteStructure


                return;
            }

            Publication publication = document.getPublication();
            DocumentFactory map = document.getFactory();
            SiteStructure liveSite = publication.getArea(Publication.LIVE_AREA).getSite();

            List missingDocuments = new ArrayList();

            ServiceSelector selector = null;
            SiteManager siteManager = null;
            try {
                selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
                siteManager = (SiteManager) selector.select(publication.getSiteManagerHint());

                if (!liveSite.contains(document.getPath())) {
                    DocumentLocator liveLoc = document.getLocator().getAreaVersion(
                            Publication.LIVE_AREA);
                    DocumentLocator[] requiredNodes = siteManager
                            .getRequiredResources(map, liveLoc);
                    for (int i = 0; i < requiredNodes.length; i++) {
                        String path = requiredNodes[i].getPath();
                        if (!liveSite.contains(path)) {
                            Link link = getExistingLink(path, document);
                            if (link != null) {
                                missingDocuments.add(link.getDocument());
                            }
                        }
View Full Code Here


        return url;
    }

    protected void createAncestorNodes(Document document) throws PublicationException,
            DocumentException, SiteException {
        SiteStructure liveSite = document.getPublication().getArea(Publication.LIVE_AREA).getSite();
        String[] steps = document.getPath().substring(1).split("/");
        int s = 0;
        String path = "";
        while (s < steps.length) {
            if (!liveSite.contains(path)) {
                liveSite.add(path);
            }
            path += "/" + steps[s];
            s++;
        }
    }
View Full Code Here

     * @see org.apache.lenya.cms.usecase.AbstractUsecase#getNodesToLock()
     */
    protected Node[] getNodesToLock() throws UsecaseException {
        List nodes = new ArrayList();
        if(getSourceDocument() != null) {
            SiteStructure structure = getSourceDocument().area().getSite();
            nodes.add(structure.getRepositoryNode());
        }

        return (Node[]) nodes.toArray(new Node[nodes.size()]);
    }
View Full Code Here

     */
    public void testLinks() throws Exception {
       
        Publication pub = getPublication("test");
        Area area = pub.getArea("authoring");
        SiteStructure site = area.getSite();
       
        Document source = site.getNode("/index").getLink("en").getDocument();
        Document target = site.getNode("/tutorial").getLink("en").getDocument();
       
        LinkManager linkManager = null;
        LinkResolver resolver = null;
        try {
            linkManager = (LinkManager) getManager().lookup(LinkManager.ROLE);
View Full Code Here

    /**
     * @see org.apache.lenya.cms.usecase.AbstractUsecase#getNodesToLock()
     */
    protected Node[] getNodesToLock() throws UsecaseException {
        SiteStructure structure = getSourceDocument().area().getSite();
        Node[] nodes = { structure.getRepositoryNode() };
        return nodes;
    }
View Full Code Here

            Document[] documents = set.getDocuments();
            for (int i = 0; i < documents.length; i++) {
                nodes.add(documents[i].getRepositoryNode());
            }

            SiteStructure structure = getSourceDocument().area().getSite();
            nodes.add(structure.getRepositoryNode());
            return (Node[]) nodes.toArray(new Node[nodes.size()]);

        } catch (Exception e) {
            throw new UsecaseException(e);
        }
View Full Code Here

                // lock the authoring site to avoid having live nodes for which no corresponding
                // authoring node exists
                nodes.add(doc.area().getSite().getRepositoryNode());
               
                // lock the live site to avoid overriding changes made by others
                SiteStructure liveSite = doc.getPublication().getArea(Publication.LIVE_AREA).getSite();
                nodes.add(liveSite.getRepositoryNode());
            }

            return (org.apache.lenya.cms.repository.Node[]) nodes
                    .toArray(new org.apache.lenya.cms.repository.Node[nodes.size()]);
View Full Code Here

                return;
            }

            Publication publication = document.getPublication();
            DocumentFactory map = document.getFactory();
            SiteStructure liveSite = publication.getArea(Publication.LIVE_AREA).getSite();

            List missingDocuments = new ArrayList();

            ServiceSelector selector = null;
            SiteManager siteManager = null;
            try {
                selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
                siteManager = (SiteManager) selector.select(publication.getSiteManagerHint());

                if (!liveSite.contains(document.getPath())) {
                    DocumentLocator liveLoc = document.getLocator().getAreaVersion(
                            Publication.LIVE_AREA);
                    DocumentLocator[] requiredNodes = siteManager
                            .getRequiredResources(map, liveLoc);
                    for (int i = 0; i < requiredNodes.length; i++) {
                        String path = requiredNodes[i].getPath();
                        if (!liveSite.contains(path)) {
                            Link link = getExistingLink(path, document);
                            if (link != null) {
                                missingDocuments.add(link.getDocument());
                            }
                        }
View Full Code Here

        }
    }

    protected void createAncestorNodes(Document document) throws PublicationException,
            DocumentException, SiteException {
        SiteStructure liveSite = document.getPublication().getArea(Publication.LIVE_AREA).getSite();
        String[] steps = document.getPath().substring(1).split("/");
        int s = 0;
        String path = "";
        while (s < steps.length) {
            if (!liveSite.contains(path)) {
                liveSite.add(path);
            }
            path += "/" + steps[s];
            s++;
        }
    }
View Full Code Here

        } else {
            preOrder = new ArrayList();
            URLInformation info = new URLInformation(getSourceURL());
            Publication pub = factory.getPublication(info.getPublicationId());
            Area area = pub.getArea(info.getArea());
            SiteStructure site = area.getSite();
            SiteNode[] topLevelNodes = site.getTopLevelNodes();
            for (int i = 0; i < topLevelNodes.length; i++) {
                preOrder.addAll(getPreOrder(topLevelNodes[i]));
            }
        }
        return preOrder;
View Full Code Here

TOP

Related Classes of org.apache.lenya.cms.site.SiteStructure

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.