Package org.apache.lenya.cms.site

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


        return this.context;
    }

    public void moveAll(Area sourceArea, String sourcePath, Area targetArea, String targetPath)
            throws PublicationException {
        SiteStructure site = sourceArea.getSite();

        SiteNode root = site.getNode(sourcePath);
        List subsite = preOrder(root);

        for (Iterator n = subsite.iterator(); n.hasNext();) {
            SiteNode node = (SiteNode) n.next();
            String subPath = node.getPath().substring(sourcePath.length());
View Full Code Here


    }

    public void copyAll(Area sourceArea, String sourcePath, Area targetArea, String targetPath)
            throws PublicationException {

        SiteStructure site = sourceArea.getSite();
        SiteNode root = site.getNode(sourcePath);
       
        List preOrder = preOrder(root);
        for (Iterator i = preOrder.iterator(); i.hasNext(); ) {
            SiteNode node = (SiteNode) i.next();
            String nodeSourcePath = node.getPath();
View Full Code Here

public class ObservationTest extends AbstractAccessControlTest {
   
    public void testObservation() throws Exception {

        Publication publication = getPublication("test");
        SiteStructure site = publication.getArea("authoring").getSite();
        Document doc = site.getNode("/index").getLink("en").getDocument();
       
        TestListener docListener = new TestListener();
        TestListener allListener = new TestListener();
       
        ObservationRegistry registry = null;
View Full Code Here

                nodes.add(docs[i].getRepositoryNode());
            }

            selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
            siteManager = (SiteManager) selector.select(publication.getSiteManagerHint());
            SiteStructure structure = siteManager.getSiteStructure(identityMap,
                    publication,
                    Publication.TRASH_AREA);
            nodes.add(structure.getRepositoryNode());
        } catch (Exception e) {
            throw new UsecaseException(e);
        } finally {
            if (selector != null) {
                if (siteManager != null) {
View Full Code Here

    protected void prepareUsecase() throws Exception {
        super.prepareUsecase();

        Publication pub = getPublication("test");
        SiteStructure site = pub.getArea(Publication.AUTHORING_AREA).getSite();
        Document parent = site.getNode(PARENT_PATH).getLink(pub.getDefaultLanguage()).getDocument();

        Clipboard clipboard = new Clipboard(parent, Clipboard.METHOD_COPY);
        ClipboardHelper helper = new ClipboardHelper();
        helper.saveClipboard(this.context, clipboard);
    }
View Full Code Here

    protected void checkPostconditions() throws Exception {
        super.checkPostconditions();
       
        Publication pub = getPublication("test");
        SiteStructure site = pub.getArea(Publication.AUTHORING_AREA).getSite();
        assertTrue(site.contains(VERIFICATION_PATH));
    }
View Full Code Here

        assertTrue(getTargetUrl().startsWith(TARGET_URL));

        super.checkPostconditions();

        Area authoring = getPublication("test").getArea("authoring");
        SiteStructure authoringSite = authoring.getSite();
        assertFalse(authoringSite.contains(PATH));

        Area trash = getPublication("test").getArea("trash");
        SiteStructure trashSite = trash.getSite();
        assertTrue(trashSite.contains(PATH));
        String trashUuid = trashSite.getNode(PATH).getUuid();
        assertNotNull(trashUuid);
        assertEquals(trashUuid, this.uuid);

    }
View Full Code Here

    protected void prepareUsecase() throws Exception {
        super.prepareUsecase();
        Area authoring = getPublication("test").getArea("authoring");

        SiteStructure authoringSite = authoring.getSite();
        SiteNode node = authoringSite.getNode(SOURCE_PATH);
        Document doc = node.getLink("en").getDocument();

        DocumentManager docMgr = null;
        try {
            docMgr = (DocumentManager) getManager().lookup(DocumentManager.ROLE);

            String pubId = doc.getPublication().getId();
            String area = doc.getArea();
            DocumentLocator loc = DocumentLocator.getLocator(pubId, area, PATH, doc.getLanguage());

            authoringSite.add("/foo");
            authoringSite.add("/foo/bar");

            docMgr.copy(doc, loc);

            // add an ancestor language version to test the method
            // MoveSubSite.getTargetURL()
            DocumentLocator ancestorLoc = DocumentLocator.getLocator(pubId, area, "/foo", "de");
            docMgr.copy(doc, ancestorLoc);

            SiteNode childNode = authoringSite.getNode(PATH);
            this.uuid = childNode.getUuid();
        } finally {
            if (docMgr != null) {
                getManager().release(docMgr);
            }
View Full Code Here

    /**
     * @see org.apache.lenya.cms.usecase.AbstractUsecase#getNodesToLock()
     */
    protected Node[] getNodesToLock() throws UsecaseException {
        try {
            SiteStructure structure = getPublication().getArea(getArea()).getSite();
            Node[] nodes = { structure.getRepositoryNode() };
            return nodes;
        } catch (Exception e) {
            throw new UsecaseException(e);
        }
    }
View Full Code Here

            }
        }

        if (isPathValid()) {
            String path = getNewDocumentPath();
            SiteStructure site = getPublication().getArea(getArea()).getSite();
            if (!createVersion() && site.contains(path)) {
                String[] params = { path };
                addErrorMessage("path-already-exists", params);
            }
        }
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.