Examples of DocumentLocator


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

        if(doc == null) {
            return;
        }
        // Check to see if parent node exists in target to prevent ghost nodes
        Area targetArea = doc.getPublication().getArea(targetAreaName);
        DocumentLocator targetLoc = doc.getLocator().getAreaVersion(targetAreaName);
        targetLoc = SiteUtil.getAvailableLocator(this.manager, getDocumentFactory(), targetLoc);
        String targetPath = targetLoc.getPath();
        targetPath = targetPath.substring(0,targetPath.lastIndexOf('/'));
        if(!targetArea.getSite().contains(targetPath)) {
            addErrorMessage("The authoring path [" + targetPath + "] does not exist.");
        }
    }
View Full Code Here

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

        Document doc = getSourceDocument();
        Document[] sources = SiteUtil.getSubSite(this.manager, doc.getLink().getNode())
                .getDocuments();
        Area targetArea = doc.getPublication().getArea(targetAreaName);

        DocumentLocator targetLoc = doc.getLocator().getAreaVersion(targetAreaName);
        targetLoc = SiteUtil.getAvailableLocator(this.manager, getDocumentFactory(), targetLoc);

        for (int i = 0; i < sources.length; i++) {
            WorkflowUtil.invoke(this.manager, getSession(), getLogger(), sources[i], getEvent(),
                    true);
           
            if (this.getClass().getName().equals(Restore.class.getName())) {
                Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager, getSession(),
                        getLogger(), sources[i]);
                String state = workflowable.getLatestVersion().getState();
                if (!state.equals("authoring")) {
                    addErrorMessage("The state is [" + state + "] instead of [authoring]!");
                }
            }
           
        }

        DocumentManager docManager = null;
        try {
            docManager = (DocumentManager) this.manager.lookup(DocumentManager.ROLE);
            docManager.moveAll(doc.area(), doc.getPath(), targetArea, targetLoc.getPath());

        } finally {
            if (docManager != null) {
                this.manager.release(docManager);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.