Package org.apache.lenya.cms.publication

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


        final String language = attributes[2];

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

            DocumentBuilder builder = publication.getDocumentBuilder();

            // Create canonical URL
            String canonicalUrl = builder
                    .buildCanonicalUrl(publication, area, documentId, language);
View Full Code Here


            allParameters.put(sessionAttributeName, session.getAttribute(sessionAttributeName));
        }

        try {
            Publication publication = PublicationFactory.getPublication(objectModel);
            creator.create(publication, new File(absoluteDoctypesPath + "samples"),
                new File(sitemapParentPath + docsPath + parentid), parentid, childid, childType, childname, language,
                allParameters);
        } catch (Exception e) {
            getLogger().error("Creator threw exception: " + e);
View Full Code Here

     * @param documentid  The document id.
     * @param propertyname The name of the property
     */
    public void compute(String area, String documentid, String propertyname) {

        Publication publication = getPublication();
        DocumentIdToPathMapper pathMapper = publication.getPathMapper();
        String path = pathMapper.getPath(documentid, "");
        log("path " + path);

        int index = path.lastIndexOf("/");
        String dir = path.substring(0, index);
View Full Code Here

   * @throws SiteTreeException
   *             if an error occurs
   */
  public void deactivateResources(String language, String documentid, String area)
    throws SiteTreeException {
    Publication publication = getPublication();
    SiteTree tree = null;

    try {
      tree = publication.getTree(area);
      SiteTreeNode node = tree.getNode(documentid);
      Label[] labels = null;
      if (node != null) {
        labels = node.getLabels();
      }
      if (node == null || (labels != null && labels.length < 1)) {

        DocumentBuilder builder = publication.getDocumentBuilder();
        String url = builder.buildCanonicalUrl(publication, area, documentid, language);
        Document doc;
        try {
          doc = builder.buildDocument(publication, url);
        } catch (DocumentBuildException e) {
View Full Code Here

     * @throws SiteTreeException if there are problems with creating or saving the site tree.
     */
    public void manipulateTree(String firstDocumentId, String secDocumentId, String firstArea,
            String secArea) throws SiteTreeException {

        Publication publication = getPublication();
        SiteTree firsttree = publication.getTree(firstArea);
        SiteTree sectree = publication.getTree(secArea);
       
        StringTokenizer st = new StringTokenizer(secDocumentId, "/");
        int length = st.countTokens() - 1;
        StringBuffer parentId = new StringBuffer(secDocumentId.length());
        for (int i = 0; i < length; i++) {
View Full Code Here

  /**
   * @see org.apache.lenya.cms.publication.SiteTreeNodeVisitor#visitSiteTreeNode(org.apache.lenya.cms.publication.SiteTreeNode)
   */
  public void visitSiteTreeNode(SiteTreeNode node) {
    try {
      Publication publication = getPublication();
      String publicationPath =
        this.getPublicationDirectory().getCanonicalPath();
      DocumentBuilder builder = publication.getDocumentBuilder();

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

  /** (non-Javadoc)
   * @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();

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

View Full Code Here

        String area,
        String documentid,
        String language,
        String propertyname) {

        Publication publication = getPublication();
        DocumentIdToPathMapper pathMapper = publication.getPathMapper();
        String fileName =
            pathMapper
                .getFile(publication, area, documentid, language)
                .getAbsolutePath();
View Full Code Here

    String secDocumentId,
    String firstArea,
    String secArea)
    throws SiteTreeException {

    Publication publication = getPublication();
    SiteTree firsttree = publication.getTree(firstArea);
    SiteTree sectree = publication.getTree(secArea);

    StringTokenizer st = new StringTokenizer(secDocumentId, "/");
    int length = st.countTokens() - 1;
        StringBuffer parentId = new StringBuffer(secDocumentId.length());
    for (int i = 0; i < length; i++) {
View Full Code Here

     * @see org.apache.tools.ant.Task#execute()
     */
    public void execute() throws BuildException {
        try {
           
            Publication pub = getPublication();
            DocumentBuilder builder = pub.getDocumentBuilder();
           
            String oldTargetUrl = builder.buildCanonicalUrl(pub, getArea(), getOldDocumentId());
            Document oldTargetDocument = builder.buildDocument(pub, oldTargetUrl);
           
            String newTargetUrl = builder.buildCanonicalUrl(pub, getArea(), getNewDocumentId());
View Full Code Here

TOP

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

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.