Package org.apache.lenya.cms.publication

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


            selector = (ServiceSelector) this.manager.lookup(ResourceType.ROLE + "Selector");
            resourceType = (ResourceType) selector.select(getDocumentTypeName());

            documentManager = (DocumentManager) this.manager.lookup(DocumentManager.ROLE);

            DocumentFactory map = getDocumentFactory();

            String documentId = getDocumentID();
           
            String sampleName = resourceType.getSampleNames()[0];
            String sampleUri = resourceType.getSample(sampleName).getUri();
View Full Code Here


                    selector = (ServiceSelector) this.manager
                            .lookup(ResourceType.ROLE + "Selector");

                    documentManager = (DocumentManager) this.manager.lookup(DocumentManager.ROLE);

                    DocumentFactory map = getDocumentFactory();
                    String path = doc.getPath();
                    // lookupResourceType(extension)
                    resourceType = lookUpExtension(extension, selector);
                    ResourceType.Sample sample = resourceType.getSample(resourceType.getSampleNames()[0]);
                    doc = documentManager.add(map, resourceType, sample.getUri(), getPublication(), doc
View Full Code Here

        Assert.notNull("language", lang);
        Assert.notNull("label", label);
        if (this.language2link.containsKey(lang)) {
            throw new RuntimeException("The language [" + lang + "] is already contained.");
        }
        DocumentFactory factory = getTree().getPublication().getFactory();
        Link link = new SiteTreeLink(factory, this, label, lang);
        this.language2link.put(lang, link);
        getTree().linkAdded(link);
        return link;
    }
View Full Code Here

     * @throws SiteException if an error occurs.
     */
    private DocumentStore getStore(Document document) throws SiteException {
        Publication publication = document.getPublication();
        String area = document.getArea();
        DocumentFactory map = document.getFactory();
        return getStore(map, publication, area);
    }
View Full Code Here

        String publicationId = snippets[0];
        String areaName = snippets[1];
        String uuid = snippets[2];
        DocumentStore store;
        try {
            DocumentFactory factory = DocumentUtil.createDocumentFactory(this.manager, session);
            Publication publication = factory.getPublication(publicationId);
            Area area = publication.getArea(areaName);
            String lang = publication.getDefaultLanguage();

            if (!area.contains(uuid, lang)) {
                createAreaVersion(publication, areaName, uuid, lang);
View Full Code Here

        String[] snippets = key.split(":");
        String publicationId = snippets[0];
        String areaName = snippets[1];
        SiteTree tree;
        try {
            DocumentFactory factory = DocumentUtil.createDocumentFactory(this.manager, session);
            Publication publication = factory.getPublication(publicationId);
            Area  area = publication.getArea(areaName);
           
            if (session.isModifiable() || session instanceof SharedItemStore) {
                tree = new SiteTreeImpl(this.manager, area, getLogger());
            }
View Full Code Here

            if (this.sourceResolver == null) {
                this.sourceResolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
            }

            resolver = (LinkResolver) this.manager.lookup(LinkResolver.ROLE);
            DocumentFactory factory = DocumentUtil.getDocumentFactory(this.manager, request);
            String webappUrl = ServletHelper.getWebappURI(request);
            LinkTarget target;
            if (factory.isDocument(webappUrl)) {
                Document currentDoc = factory.getFromURL(webappUrl);
                target = resolver.resolve(currentDoc, linkUri);
            }
            else {
                Link link = new Link(linkUri);
                contextualize(link, webappUrl);
View Full Code Here

                addErrorMessage("This usecase can only be invoked from the authoring area.");
                return;
            }

            Publication publication = document.getPublication();
            DocumentFactory map = document.getFactory();
            SiteStructure liveSite = publication.getArea(Publication.LIVE_AREA).getSite();

            List missingDocuments = new ArrayList();

            ServiceSelector selector = null;
View Full Code Here

        Assert.notNull("language", lang);
        Assert.notNull("label", label);
        if (this.language2link.containsKey(lang)) {
            throw new RuntimeException("The language [" + lang + "] is already contained.");
        }
        DocumentFactory factory = getTree().getPublication().getFactory();
        Link link = new SiteTreeLink(factory, this, label, lang);
        this.language2link.put(lang, link);
        getTree().linkAdded(link);
        return link;
    }
View Full Code Here

    }

    protected List getNodes() throws DocumentBuildException, DocumentException, PublicationException {
        List preOrder;
        String sourceUrl = getSourceURL();
        DocumentFactory factory = getDocumentFactory();
        if (getDocumentFactory().isDocument(sourceUrl)) {
            Document doc = factory.getFromURL(sourceUrl);
            preOrder = getPreOrder(doc.getLink().getNode());
        } else {
            preOrder = new ArrayList();
            URLInformation info = new URLInformation(getSourceURL());
            Publication pub = factory.getPublication(info.getPublicationId());
            Area area = pub.getArea(info.getArea());
            SiteStructure site = area.getSite();
            SiteNode[] topLevelNodes = site.getTopLevelNodes();
            for (int i = 0; i < topLevelNodes.length; i++) {
                preOrder.addAll(getPreOrder(topLevelNodes[i]));
View Full Code Here

TOP

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

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.