Package org.apache.lenya.cms.publication

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


        try {
            if (name.equals(PARAMETER_PARENTTITLE)) {
                value = "";
                PageEnvelope envelope = getEnvelope(objectModel);
                Document document = envelope.getDocument();
                if (document.exists()) {
                    Document parent = DocumentHelper.getParentDocument(document);
                    if (parent != null && parent.existsInAnyLanguage()) {
                        parent = DocumentHelper.getExistingLanguageVersion(parent);
                        value = parent.getDublinCore().getTitle();
                    }
                }
            }
        } catch (Exception e) {
            throw new ConfigurationException(
View Full Code Here


        if (log.isDebugEnabled()) {
            log.debug("Starting publishing");
        }

        try {
            Document authoringDocument = getAuthoringDocument();

            if (!checkPreconditions(authoringDocument)) {
                setResult(FAILURE);
            } else {
                if (log.isDebugEnabled()) {
View Full Code Here

            if (log.isDebugEnabled()) {
                log.debug("Cannot execute task: workflow event not supported.");
            }
        }

        Document liveDocument = getPublication().getAreaVersion(document, Publication.LIVE_AREA);
        Document liveParent = DocumentHelper.getParentDocument(liveDocument);
        if (liveParent != null) {
            SiteTree liveTree = getPublication().getSiteTree(Publication.LIVE_AREA);
            SiteTreeNode liveParentNode = liveTree.getNode(liveParent.getId());
            if (liveParentNode == null) {
                if (log.isDebugEnabled()) {
                    log.debug("Cannot execute task: live parent node does not exist.");
                }
                OK = false;
View Full Code Here

            IOException,
            ParameterException,
            WorkflowException {
        getPublication().copyDocumentToArea(authoringDocument, Publication.LIVE_AREA);

        Document liveDocument =
            getPublication().getAreaVersion(authoringDocument, Publication.LIVE_AREA);

        copyResources(authoringDocument, liveDocument);

        triggerWorkflow(authoringDocument);
View Full Code Here

        String id = getParameters().getParameter(PARAMETER_DOCUMENT_ID);
        String language = getParameters().getParameter(PARAMETER_DOCUMENT_LANGUAGE);
        DocumentBuilder builder = getPublication().getDocumentBuilder();
        String url =
            builder.buildCanonicalUrl(getPublication(), Publication.AUTHORING_AREA, id, language);
        Document document = builder.buildDocument(getPublication(), url);
        return document;
    }
View Full Code Here

        if (log.isDebugEnabled()) {
            log.debug("Starting deactivation");
        }

        try {
            Document liveDocument = getLiveDocument();

            if (!checkPreconditions(liveDocument)) {
                setResult(FAILURE);
            } else {
                if (log.isDebugEnabled()) {
View Full Code Here

            DocumentException,
            SiteTreeException,
            ExecutionException {
        boolean OK = true;

        Document authoringDocument = getPublication().getAreaVersion(liveDocument, Publication.AUTHORING_AREA);
        OK = OK && canWorkflowFire(authoringDocument);

        SiteTree tree = getPublication().getSiteTree(liveDocument.getArea());
        SiteTreeNode node = tree.getNode(liveDocument.getId());
View Full Code Here

        if (!liveDocument.existsInAnyLanguage()) {
            ResourcesManager resourcesManager = new ResourcesManager(liveDocument);
            resourcesManager.deleteResources();
        }

        Document authoringDocument = getPublication().getAreaVersion(liveDocument, Publication.AUTHORING_AREA);
        triggerWorkflow(authoringDocument);
    }
View Full Code Here

        String id = getParameters().getParameter(PARAMETER_DOCUMENT_ID);
        String language = getParameters().getParameter(PARAMETER_DOCUMENT_LANGUAGE);
        DocumentBuilder builder = getPublication().getDocumentBuilder();
        String url =
            builder.buildCanonicalUrl(getPublication(), Publication.LIVE_AREA, id, language);
        Document document = builder.buildDocument(getPublication(), url);
        return document;
    }
View Full Code Here

      Publication pub = getPublication("test");
      Area area = pub.getArea(Publication.AUTHORING_AREA);
      Area trashArea = pub.getArea("trash");
      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);
View Full Code Here

TOP

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

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.