Examples of DocumentLocator


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

        Document sourceDoc = getSourceDocument();
        String basePath = sourceDoc != null ? sourceDoc.getPath() : "";

        String potentialPath = basePath + "/" + nodeId;

        DocumentLocator potentialLoc = DocumentLocator.getLocator(getPublication().getId(),
                targetArea, potentialPath, language);
        return SiteUtil.getAvailableLocator(this.manager, getDocumentFactory(), potentialLoc)
                .getPath();
    }
View Full Code Here

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

                contextUtility = (ContextUtility) serviceManager.lookup(ContextUtility.ROLE);
                Session session = RepositoryUtil.getSession(this.serviceManager, contextUtility
                        .getRequest());
                DocumentFactory map = DocumentUtil.createDocumentFactory(this.serviceManager, session);
                Publication pub = map.getPublication(pubId);
                DocumentLocator loc = pub.getDocumentBuilder().getLocator(map, webappUrl);
                url = "/" + pubId + "/" + area + loc.getPath();
            } catch (ServiceException e) {
                throw new AccessControlException("Error looking up ContextUtility component", e);
            } catch (Exception e) {
                throw new AccessControlException(e);
            } finally {
View Full Code Here

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

            String relation = getRelation();
            Document sourceDoc = getSourceDocument();
            if (sourceDoc == null) {
                return "/" + getNewDocumentName();
            } else {
                DocumentLocator sourceLoc = getSourceDocument().getLocator();
                if (relation.equals(RELATION_CHILD)) {
                    return sourceLoc.getChild(getNewDocumentName()).getPath();
                } else if (relation.equals(RELATION_BEFORE) || relation.equals(RELATION_AFTER)) {
                    return sourceLoc.getParent().getChild(getNewDocumentName()).getPath();
                } else {
                    throw new IllegalStateException("unsupported relation " + relation);
                }
            }
        }
View Full Code Here

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

    }

    public DocumentLocator[] getRequiredResources(DocumentFactory map, DocumentLocator loc)
            throws SiteException {
        List ancestors = new ArrayList();
        DocumentLocator locator = loc;
        while (locator.getParent() != null) {
            DocumentLocator parent = locator.getParent();
            ancestors.add(parent);
            locator = parent;
        }
        return (DocumentLocator[]) ancestors.toArray(new DocumentLocator[ancestors.size()]);
    }
View Full Code Here

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

    public DocumentLocator[] getRequiredResources(DocumentFactory map, final DocumentLocator loc)
            throws SiteException {
       
        List ancestors = new ArrayList();
        DocumentLocator locator = loc;
        while (locator.getParent() != null) {
            DocumentLocator parent = locator.getParent();
            ancestors.add(parent);
            locator = parent;
        }
        return (DocumentLocator[]) ancestors.toArray(new DocumentLocator[ancestors.size()]);
    }
View Full Code Here

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

            String webappUrl = ServletHelper.getWebappURI(request);
            Document document = this.identityMap.getFromURL(webappUrl);

            contextPath = request.getContextPath();

            DocumentLocator parentLocator = document.getLocator().getParent("/index");
            Document parent = this.identityMap.get(parentLocator);
            parentUrl = parent.getCanonicalWebappURL();
        } catch (final DocumentBuildException e) {
            throw new ProcessingException(e);
        }
View Full Code Here

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

     */
    public String[] getLanguages() throws ProcessingException {
        List availableLanguages = new ArrayList();

        try {
            DocumentLocator locator = getLocator();
            String[] languages = pub.getLanguages();
            for (int i = 0; i < languages.length; i++) {
                DocumentLocator version = locator.getLanguageVersion(languages[i]);
                Publication pub = factory.getPublication(locator.getPublicationId());
                if (pub.getArea(version.getArea()).getSite().contains(version.getPath(), version.getLanguage())) {
                    availableLanguages.add(languages[i]);
                }
            }

        } catch (Exception e) {
View Full Code Here

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

     * @throws ProcessingException if the document for the given language could not be created.
     */
    protected Document getDocument(String language) throws ProcessingException {
        Document document;
        try {
            DocumentLocator locator = getLocator();
            DocumentLocator version = locator.getLanguageVersion(language);
            document = this.factory.get(version);
        } catch (Exception e) {
            throw new ProcessingException(e);
        }
        return document;
View Full Code Here

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

        }
        return document;
    }

    protected DocumentLocator getLocator() throws DocumentBuildException {
        DocumentLocator locator = this.pub.getDocumentBuilder().getLocator(this.factory, this.url);
        return locator;
    }
View Full Code Here

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

        try {
            docMgr = (DocumentManager) getManager().lookup(DocumentManager.ROLE);

            String pubId = doc.getPublication().getId();
            String area = doc.getArea();
            DocumentLocator loc = DocumentLocator.getLocator(pubId, area, PATH, doc.getLanguage());

            authoringSite.add("/foo");
            authoringSite.add("/foo/bar");

            docMgr.copy(doc, loc);

            // add an ancestor language version to test the method
            // MoveSubSite.getTargetURL()
            DocumentLocator ancestorLoc = DocumentLocator.getLocator(pubId, area, "/foo", "de");
            docMgr.copy(doc, ancestorLoc);

            SiteNode childNode = authoringSite.getNode(PATH);
            this.uuid = childNode.getUuid();
        } finally {
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.