Package org.apache.lenya.cms.publication

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


     * @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);
        log("dir " + dir);
View Full Code Here


        String documentid,
        String language,
        String propertyname) {

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

        Target target = getOwningTarget();
        Project project = target.getProject();
View Full Code Here

            new File(
                publication.getDirectory(),
                DocumentTypeBuilder.DOCTYPE_DIRECTORY);

        try {
            DocumentIdToPathMapper mapper = publication.getPathMapper();
            log.debug("Parent directory: " + mapper.getFile(publication, "authoring", parentId, language));
            creator.create(
                publication,
                new File(doctypesDirectory, "samples"),
                mapper.getDirectory(publication, "authoring", parentId, language),
                //new File(authoringDirectory, parentId),
                parentId,
                childId,
                childType,
                childName,
View Full Code Here

   (non-Javadoc)
   * @see org.apache.lenya.cms.task.AntTaskTest#evaluateTest()
   */
    protected void evaluateTest() throws IOException {
        Publication pub = PublicationHelper.getPublication();
        DocumentIdToPathMapper mapper = pub.getPathMapper();
        File publishedFile = mapper.getFile(pub, Publication.LIVE_AREA, DOCUMENT_ID, DOCUMENT_LANGUAGE);
        System.out.println("Path of file to publish: " + publishedFile);
        assertTrue(publishedFile.exists());
        System.out.println("Published file exists: " + publishedFile.getCanonicalPath());
    }
View Full Code Here

    protected Parameters getTaskParameters() {
        Parameters parameters = super.getTaskParameters();
        parameters.setParameter("properties.publish.documentid", DOCUMENT_ID);
        parameters.setParameter("properties.publish.language", DOCUMENT_LANGUAGE);
        Publication pub = PublicationHelper.getPublication();
        DocumentIdToPathMapper mapper = pub.getPathMapper();
        parameters.setParameter("properties.publish.sources", mapper.getPath(DOCUMENT_ID, DOCUMENT_LANGUAGE));

        return parameters;
    }
View Full Code Here

     * Returns the path of the history file inside the publication directory.
     * @param document A CMS document.
     * @return A string.
     */
    public String getHistoryPath(Document document) {
        DocumentIdToPathMapper pathMapper = document.getPublication().getPathMapper();
        String documentPath = pathMapper.getPath(document.getId(), document.getLanguage());

        String area = document.getArea();
        if (!area.equals(Publication.ARCHIVE_AREA) && !area.equals(Publication.TRASH_AREA)) {
            area = Publication.AUTHORING_AREA;
        }
View Full Code Here

     */
    public Document[] getReferences(String area) throws ProcessingException {

        ArrayList documents = new ArrayList();
        Publication publication = pageEnvelope.getPublication();
        DocumentIdToPathMapper mapper = publication.getPathMapper();
        if (mapper instanceof PathToDocumentIdMapper) {
            PathToDocumentIdMapper fileMapper = (PathToDocumentIdMapper)mapper;
            String documentId = null;
            String language = null;
            DocumentBuilder builder = publication.getDocumentBuilder();
View Full Code Here

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

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

      String parentid = node.getAbsoluteParentId();
View Full Code Here

     */
    public Document[] getReferences(String area) throws ProcessingException {

        ArrayList documents = new ArrayList();
        Publication publication = pageEnvelope.getPublication();
        DocumentIdToPathMapper mapper = publication.getPathMapper();
        if (mapper instanceof PathToDocumentIdMapper) {
            PathToDocumentIdMapper fileMapper = (PathToDocumentIdMapper)mapper;
            String documentId = null;
            String language = null;
            DocumentBuilder builder = publication.getDocumentBuilder();
View Full Code Here

        try {
            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);

            Document doc = getSourceDocument();
            DocumentIdToPathMapper mapper = doc.getPublication().getPathMapper();
            String path = mapper.getPath(doc.getId(), getSourceDocument().getLanguage());
            String sourceUri = doc.getSourceURI();
            String pubId = doc.getPublication().getId();
            String tempSourceUri = "cocoon:/request/PUT";

            SourceUtil.copy(resolver, tempSourceUri, sourceUri, true);
View Full Code Here

TOP

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

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.