Package org.apache.lenya.cms.publication

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


      builder.buildCanonicalUrl(
        publication,
        getFirstarea(),
        srcDocumentid,
        language);
    Document srcDoc;
    try {
      srcDoc = builder.buildDocument(publication, srcUrl);
    } catch (DocumentBuildException e) {
      throw new BuildException(e);
    }
    ResourcesManager resourcesMgr = new ResourcesManager(srcDoc);
    List resources = new ArrayList(Arrays.asList(resourcesMgr.getResources()));
    resources.addAll(Arrays.asList(resourcesMgr.getMetaFiles()));
    File[] srcFiles =
      (File[]) resources.toArray(new File[resources.size()]);

    if (srcFiles == null) {
      log(
        "There are no resources for the document "
          + getFirstdocumentid());
      return;
    }

    String destUrl =
      builder.buildCanonicalUrl(
        publication,
        getSecarea(),
        destDocumentid,
        language);
    Document destDoc;
    try {
      destDoc = builder.buildDocument(publication, destUrl);
    } catch (DocumentBuildException e) {
      throw new BuildException(e);
    }
View Full Code Here


        builder.buildCanonicalUrl(
          publication,
          getFirstarea(),
          srcDocumentid,
          language);
      Document doc;
      try {
        doc = builder.buildDocument(publication, url);
      } catch (DocumentBuildException e) {
        throw new BuildException(e);
      }
      File srcFile = doc.getFile();
      if (!srcFile.exists()) {
        log("There are no file " + srcFile.getAbsolutePath());
        return;
      }
      File directory = srcFile.getParentFile();
View Full Code Here

        String rights)
        throws BuildException, DocumentBuildException, DocumentException {

        DocumentBuilder builder = getPublication().getDocumentBuilder();
        String url = builder.buildCanonicalUrl(getPublication(), area, documentId, lang);
        Document doc = builder.buildDocument(getPublication(), url);
        DublinCore dc = doc.getDublinCore();
        dc.setValue(DublinCore.ELEMENT_CREATOR, creator);
        dc.setValue(DublinCore.ELEMENT_TITLE, title);
        dc.setValue(DublinCore.ELEMENT_DESCRIPTION, description);
        dc.setValue(DublinCore.ELEMENT_SUBJECT, subject);
        dc.setValue(DublinCore.ELEMENT_PUBLISHER, publisher);
View Full Code Here

    /**
     * @see org.apache.lenya.cms.publication.AbstractPublication#copyDocumentToArea(org.apache.lenya.cms.publication.Document, java.lang.String)
     */
    public void copyDocumentToArea(Document document, String destinationArea)
        throws PublicationException {
        Document destinationDocument = getAreaVersion(document, destinationArea);
        copyDocument(document, destinationDocument);
    }
View Full Code Here

                        if (url.startsWith(contextPath + "/" + publication.getId())) {
                            final String webappUrl = url.substring(contextPath.length());
                           
                            if (builder.isDocument(publication, webappUrl)) {
                                Document targetDocument = builder.buildDocument(publication, webappUrl);

                                if (matches(targetDocument, originalTargetDocument)) {
                                    String newTargetUrl = getNewTargetURL(targetDocument,
                                            originalTargetDocument,
                                            newTargetDocument);
View Full Code Here

      String srcUrl = builder.buildCanonicalUrl(publication, getFirstarea(), srcDocumentid, language);
      String destUrl = builder.buildCanonicalUrl(publication, getSecarea(), destDocumentid, language);


      Document document;
      Document newdocument;
      WorkflowFactory factory = WorkflowFactory.newInstance();
     
      log("init workflow history");
      try {
        document = builder.buildDocument(publication, srcUrl);
View Full Code Here

        Object value = null;

   
        try {
            PageEnvelope envelope = PageEnvelopeFactory.getInstance().getPageEnvelope(objectModel);
            Document document = envelope.getDocument();

            WorkflowFactory factory = WorkflowFactory.newInstance();
            if (factory.hasWorkflow(document)) {
                WorkflowInstance instance = factory.buildInstance(document);
                if (name.equals(STATE)) {
View Full Code Here

     * ({@link #PARAMETER_DOCUMENT_ID}, {@link #PARAMETER_DOCUMENT_AREA}, {@link #PARAMETER_DOCUMENT_LANGUAGE}).
     * @return A document.
     * @throws ExecutionException when something went wrong.
     */
    protected Document getDocument() throws ExecutionException {
        Document document;
        try {
            String id = getParameters().getParameter(PARAMETER_DOCUMENT_ID);
            String area = getParameters().getParameter(PARAMETER_DOCUMENT_AREA);
            String language = getParameters().getParameter(PARAMETER_DOCUMENT_LANGUAGE);
            document = getDocument(id, area, language);
View Full Code Here

    protected Document getDocument(String documentId, String area, String language)
        throws ExecutionException {
        Publication publication = getPublication();
        DocumentBuilder builder = publication.getDocumentBuilder();
        String url = builder.buildCanonicalUrl(publication, area, documentId, language);
        Document document;
        try {
            document = builder.buildDocument(publication, url);
        } catch (Exception e) {
            throw new ExecutionException(e);
        }
View Full Code Here

        if (!Arrays.asList(DublinCoreImpl.ELEMENTS).contains(name)
            && !Arrays.asList(DublinCoreImpl.TERMS).contains(name)) {
            throw new ConfigurationException("The attribute [" + name + "] is not supported!");
        }

        Document document = getEnvelope(objectModel).getDocument();

        if (document == null) {
            throw new ConfigurationException("There is no document for this page envelope!");
        }
        Object value;
        try {
            value = document.getDublinCore().getFirstValue(name);
        } catch (DocumentException e) {
            throw new ConfigurationException(
                "Obtaining dublin core value for [" + name + "] failed: ",
                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.