Package org.apache.lenya.cms.publication

Examples of org.apache.lenya.cms.publication.DocumentLocator


      SiteStructure site = area.getSite();
      SiteNode node = site.getNode(PATH);
      Document doc_en = node.getLink("en").getDocument();
      Document doc_de = node.getLink("de").getDocument();

      DocumentLocator loc = DocumentLocator.getLocator(pub.getId(), "trash", PATH, doc_en.getLanguage());

      docMgr.copyAll(area, PATH, trashArea, PATH);

      SiteStructure trashSite = trashArea.getSite();
      assertTrue(trashSite.contains(PATH));
View Full Code Here


        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();
View Full Code Here

            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();
View Full Code Here

            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();
View Full Code Here

            String relation = getRelation();
            Document sourceDoc = getSourceDocument();
            if (sourceDoc == null) {
                return "/" + getNewDocumentName();
            } else {
                DocumentLocator sourceLoc = getSourceDocument().getLocator();
                if (relation.equals(RELATION_CHILD)) {
                    return sourceLoc.getChild(getNewDocumentName()).getPath();
                } else if (relation.equals(RELATION_BEFORE) || relation.equals(RELATION_AFTER)) {
                    return sourceLoc.getParent().getChild(getNewDocumentName()).getPath();
                } else {
                    throw new IllegalStateException("unsupported relation " + relation);
                }
            }
        }
View Full Code Here

        Document doc = envelope.getDocument();
        if (doc == null) {
            Publication pub = envelope.getPublication();
            Request request = ObjectModelHelper.getRequest(objectModel);
            String url = ServletHelper.getWebappURI(request);
            DocumentLocator loc;
            try {
                loc = pub.getDocumentBuilder().getLocator(pub.getFactory(), url);
            } catch (DocumentBuildException e) {
                throw new SiteException(e);
            }
            path = loc.getPath();
        } else {
            path = doc.getLocator().getPath();
        }
        return path;
    }
View Full Code Here

        String nodeId = getParameterAsString(NODE_ID);
        DocumentBuilder builder = getSourceDocument().getPublication().getDocumentBuilder();
        if (!builder.isValidDocumentName(nodeId)) {
            addErrorMessage("The document ID is not valid.");
        } else {
            DocumentLocator target = getTargetLocator();
            Publication pub = getDocumentFactory().getPublication(target.getPublicationId());
            SiteStructure site = pub.getArea(target.getArea()).getSite();
            if (site.contains(target.getPath(), target.getLanguage())) {
                addErrorMessage("The document does already exist.");
            }
        }
    }
View Full Code Here

    protected DocumentLocator getTargetLocator() throws DocumentBuildException, SiteException,
            DocumentException {
        String nodeId = getParameterAsString(NODE_ID);
        Document doc = getSourceDocument();
        DocumentLocator loc = DocumentLocator.getLocator(doc.getPublication().getId(), doc
                .getArea(), doc.getPath(), doc.getLanguage());
        DocumentLocator parent = loc.getParent();
        return parent.getChild(nodeId);
    }
View Full Code Here

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

        Document targetDoc;
        Document source = getSourceDocument();
        DocumentLocator target = getTargetLocator();
        DocumentManager documentManager = null;
        try {
            documentManager = (DocumentManager) this.manager.lookup(DocumentManager.ROLE);
            documentManager.moveAll(source.area(), source.getPath(), source.area(), target
                    .getPath());
            targetDoc = getDocumentFactory().get(target);
        } finally {
            if (documentManager != null) {
                this.manager.release(documentManager);
View Full Code Here

        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();
View Full Code Here

TOP

Related Classes of org.apache.lenya.cms.publication.DocumentLocator

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.