Examples of Publication


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

     * @return A document.
     * @throws ExecutionException when something went wrong.
     */
    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) {
View Full Code Here

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

     * @param area The area in which is the sitetree.
     * @return newdocumentid The unique document id.
     */
  protected String computeUniqueId(String documentid, String area) {

    Publication publication = getPublication();

    UniqueDocumentId uniqueDocumentId = new UniqueDocumentId();
        String newdocumentid = uniqueDocumentId.computeUniqueDocumentId(publication, area, documentid);
    return newdocumentid;

View Full Code Here

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

        String id = pubidAndArea[0];
        String area = pubidAndArea[1];
      String contextPath = ObjectModelHelper.getContext(objectModel).getRealPath("");
     
      try {
      Publication pub = PublicationFactory.getPublication(id, contextPath);
      return pub.getContentDirectory(area);
    } catch (PublicationException e) {
            throw new ConfigurationException("Obtaining value for [" + name + "] failed: ", e);
    }
     
    }
View Full Code Here

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

   */
  public void execute() throws BuildException {
    log("document-id " + this.getDocumentid());
    log("area " + this.getArea());

    Publication publication = getPublication();

    String language = null;
    String url = null;
    SiteTree tree;

    try {
      tree = publication.getTree(area);
    } catch (SiteTreeException e) {
      throw new BuildException(e);
    }
    SiteTreeNode node = tree.getNode(documentid);
    Label[] labels = node.getLabels();

    DocumentBuilder builder = publication.getDocumentBuilder();

    try {
      if (labels.length < 1) {
        log("no languages found for the node with id : " + node.getId());
        url = builder.buildCanonicalUrl(publication, area, documentid);
View Full Code Here

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

   * Delete the resources of the documents corresponding to this node
   * 
   * @see org.apache.lenya.cms.publication.SiteTreeNodeVisitor#visitSiteTreeNode(org.apache.lenya.cms.publication.SiteTreeNode)
   */
  public void visitSiteTreeNode(SiteTreeNode node) {
    Publication publication = getPublication();
    DocumentBuilder builder = publication.getDocumentBuilder();

    String destDocumentid = node.getAbsoluteId();
    String srcDocumentid =
      destDocumentid.replaceFirst(
        getSecdocumentid(),
View Full Code Here

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

      log("document-id for the source :" + this.getFirstdocumentid());
      log("area for the source :" + this.getFirstarea());
      log("document-id for the destination :" + this.getSecdocumentid());
      log("area for the destination :" + this.getSecarea());

      Publication publication = getPublication();
      SiteTree tree = publication.getTree(this.getSecarea());
      SiteTreeNode node = tree.getNode(this.getSecdocumentid());
      node.acceptReverseSubtree(this);
    } catch (Exception e) {
      throw new BuildException(e);
    }
View Full Code Here

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

   * move the workflow files
   *
   * @see org.apache.lenya.cms.publication.SiteTreeNodeVisitor#visitSiteTreeNode(org.apache.lenya.cms.publication.SiteTreeNode)
   */
  public void visitSiteTreeNode(SiteTreeNode node) {
    Publication publication = getPublication();

    Label[] labels = node.getLabels();
    for (int i = 0; i < labels.length; i++) {
      String language = labels[i].getLanguage();

      String srcDocumentid = node.getAbsoluteId();
      String destDocumentid = srcDocumentid.replaceFirst(firstdocumentid, secdocumentid);

      // TODO: content(fix the build file)
      // TODO: resources (fix the build file)
      // TODO: rcml (fix the build file)
      // TODO: rcbak (fix the build file)

      //move workflow
      DocumentBuilder builder = publication.getDocumentBuilder();
      String url = builder.buildCanonicalUrl(publication, firstarea, srcDocumentid, language);
      String newurl =
        builder.buildCanonicalUrl(publication, secarea, destDocumentid, language);

      Document document;
View Full Code Here

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

      log("document id for the source" + this.getFirstdocumentid());
      log("area for the source" + this.getFirstarea());
      log("document id for the destination" + this.getSecdocumentid());
      log("area for the destination" + this.getSecarea());

      Publication publication = getPublication();
      SiteTree tree = publication.getTree(getFirstarea());
      SiteTreeNode node = tree.getNode(getFirstdocumentid());

      node.acceptSubtree(this);
    } catch (Exception e) {
      throw new BuildException(e);
View Full Code Here

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

        Object value = null;

        try {
            PageEnvelope envelope = PageEnvelopeFactory.getInstance().getPageEnvelope(objectModel);
            Publication publication = envelope.getPublication();

            if (name.equals(AUTHORING_NODE)) {
                SiteTree authoringTree = publication.getTree(Publication.AUTHORING_AREA);
                value = authoringTree.getNode(envelope.getDocument().getId());
            }

            if (name.equals(LIVE_NODE)) {
                SiteTree liveTree = publication.getTree(Publication.LIVE_AREA);
                value = liveTree.getNode(envelope.getDocument().getId());
            }

            if (name.equals(TRASH_NODE)) {
                SiteTree trashTree = publication.getTree(Publication.TRASH_AREA);
                value = trashTree.getNode(envelope.getDocument().getId());
            }
           
            if (name.equals(ARCHIVE_NODE)) {
                SiteTree archiveTree = publication.getTree(Publication.ARCHIVE_AREA);
                value = archiveTree.getNode(envelope.getDocument().getId());
            }
           
            if (name.equals(FIRST_CHILD_ID)) {
                SiteTree siteTree = publication.getTree(envelope.getDocument().getArea());
                SiteTreeNode node = siteTree.getNode(envelope.getDocument().getId());
                SiteTreeNode[] children = node.getChildren(envelope.getDocument().getLanguage());
                if (children.length > 0){
                    value = children[0].getId();
                } else {
                    value = null;  
                }
            }
           
            if (name.equals(LABEL_HREF)) {
                Document document = envelope.getDocument();
                SiteTree siteTree = publication.getTree(document.getArea());
                value = siteTree.getNode(document.getId()).getLabel(document.getLanguage()).getHref();
                if (value == null) value = "";
            }

        } catch (Exception e) {
View Full Code Here

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

    public void execute() throws BuildException {
        try {
            log("Document ID: [" + documentId + "]");
            log("Area:        [" + area + "]");

            Publication publication = getPublication();
            SiteTree tree = publication.getTree(area);
            SiteTreeNode node = tree.getNode(documentId);

            node.acceptSubtree(this);
        } catch (Exception e) {
            throw new BuildException(e);
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.