Package org.apache.lenya.cms.publication

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


            envelope = PageEnvelopeFactory.getInstance().getPageEnvelope(objectModel);
        } catch (Exception e) {
            throw new ProcessingException(e);
        }

        Document document = envelope.getDocument();
        WorkflowFactory factory = WorkflowFactory.newInstance();

        setHasWorkflow(factory.hasWorkflow(document));

        if (hasWorkflow()) {
View Full Code Here


            AccessControlException,
            PageEnvelopeException,
            DocumentBuildException {
        Publication publication = PublicationHelper.getPublication();
        String url = "/" + publication.getId() + URL;
        Document document = publication.getDocumentBuilder().buildDocument(publication, url);

        File configDir = new File(publication.getDirectory(), FileItemManager.PATH);
        assertTrue(configDir.exists());

        Policy policy = getPolicyManager().getPolicy(getAccreditableManager(), url);
View Full Code Here

            DocumentBuilder builder = publication.getDocumentBuilder();

            String srcUrl =
                builder.buildCanonicalUrl(publication, document.getArea(), documentid, language);
            Document srcDoc = builder.buildDocument(publication, srcUrl);
            File newFile = srcDoc.getFile();
            filename = newFile.getAbsolutePath();

        } else {
            filename = document.getFile().getAbsolutePath();
        }
View Full Code Here

        PageEnvelope envelope = PageEnvelopeFactory.getInstance().getPageEnvelope(objectModel);
        Publication publication = envelope.getPublication();
        DocumentBuilder builder = publication.getDocumentBuilder();
        String url = builder.buildCanonicalUrl(publication, area, documentId, language);
        Document document = builder.buildDocument(publication, url);

        WorkflowFactory factory = WorkflowFactory.newInstance();

        if (factory.hasWorkflow(document)) {
View Full Code Here

        Publication publication = PublicationFactory.getPublication(resolver, request);

        DocumentBuilder builder = publication.getDocumentBuilder();
        if (builder.isDocument(publication, url)) {

          Document document = builder.buildDocument(publication, url);
          WorkflowFactory factory = WorkflowFactory.newInstance();

          if (factory.hasWorkflow(document)) {
            SynchronizedWorkflowInstances instance =
              factory.buildSynchronizedInstance(document);
View Full Code Here

   * @return the url for the given language
   *
   * @throws ProcessingException if the document for the given language could not be created.
   */
    public String getUrl(String language) throws ProcessingException {
        Document doc = getDocument(language);
        return pageEnvelope.getContext() + doc.getCompleteURL();
    }
View Full Code Here

   * @return the url for the given language
   *
   * @throws ProcessingException if the document for the given language could not be created.
   */
    public String getInfoUrl(String language) throws ProcessingException {
        Document doc = getDocument(language);
        return pageEnvelope.getContext() + doc.getCompleteInfoURL();
    }
View Full Code Here

   *
   * @throws ProcessingException if the document for the given language could not be created.
   */
    protected Document getDocument(String language) throws ProcessingException {
        DocumentBuilder builder = pageEnvelope.getPublication().getDocumentBuilder();
        Document document = builder.buildLanguageVersion(pageEnvelope.getDocument(), language);
        return document;
    }
View Full Code Here

                            getLogger().debug(this.indent + "webapp URL: [" + webappUrl + "]");
                            getLogger().debug(this.indent + "anchor:     [" + anchor + "]");
                        }
                        if (builder.isDocument(publication, webappUrl)) {

                            Document targetDocument = builder.buildDocument(publication, webappUrl);

                            if (getLogger().isDebugEnabled()) {
                                getLogger().debug(this.indent + "Resolved target document: ["
                                        + targetDocument + "]");
                            }

                            String currentAreaUrl = builder.buildCanonicalUrl(publication,
                                    getCurrentDocument().getArea(),
                                    targetDocument.getId(),
                                    targetDocument.getLanguage());
                            targetDocument = builder.buildDocument(publication, currentAreaUrl);

                            if (targetDocument.exists()) {
                                rewriteLink(newAttrs, targetDocument, anchor, queryString);
                            } else {
                                setIgnoreAElement(true);
                            }
                        }
View Full Code Here

        Publication publication = getPublication(webappUrl);
        DocumentBuilder builder = publication.getDocumentBuilder();
        String url = null;
        try {
            if (builder.isDocument(publication, webappUrl)) {
                Document document = builder.buildDocument(publication, webappUrl);
                if (document.existsInAnyLanguage()) {
                    url = "/" + document.getArea() + document.getId();
                    if (getLogger().isDebugEnabled()) {
                        getLogger().debug("    Document exists");
                        getLogger().debug("    Document ID: [" + document.getId() + "]");
                    }
                }
            }
        } catch (Exception e) {
            throw new AccessControlException(e);
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.