Package org.apache.lenya.cms.publication

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


        Request request = ObjectModelHelper.getRequest(objectModel);

        try {
            Session session = RepositoryUtil.getSession(this.manager, request);
            DocumentFactory docFactory = DocumentUtil.createDocumentFactory(this.manager, session);
            Publication pub = docFactory.getPublication(publicationId);
            document = docFactory.get(pub, area, uuid, language, revision);
        } catch (Exception e) {
            throw new ConfigurationException("Error getting document [" + publicationId + ":"
                    + area + ":" + uuid + ":" + language + "]: " + e.getMessage(), e);
        }
        return document;
View Full Code Here


            Publication pub = null;
            String attribute;

            String[] steps = name.split(":");
            if (steps.length == 1) {
                DocumentFactory docFactory = DocumentUtil.createDocumentFactory(this.manager,
                        session);
                String webappUrl = ServletHelper.getWebappURI(request);
                Document document = docFactory.getFromURL(webappUrl);
                pub = document.getPublication();

                attribute = name;
                resourceType = document.getResourceType();
            } else {
View Full Code Here

            String contextPath = request.getContextPath();
            Context context = ObjectModelHelper.getContext(objectModel);
            String servletContextPath = context.getRealPath("");

            try {
                DocumentFactory factory = getDocumentFactory();
                Publication pub = null;
                String pubId = new URLInformation(webappUrl).getPublicationId();
                if (pubId != null && factory.existsPublication(pubId)) {
                    pub = factory.getPublication(pubId);
                }
                envelope = PageEnvelopeFactory.getInstance().getPageEnvelope(
                        factory,
                        contextPath,
                        webappUrl,
View Full Code Here

     */
    public PageEnvelope getPageEnvelope(FOM_Cocoon cocoon) throws PageEnvelopeException {
        Request request = getRequest(cocoon);
        try {
            Session session = RepositoryUtil.getSession(this.manager, request);
            DocumentFactory map = DocumentUtil.createDocumentFactory(this.manager, session);
            PageEnvelopeFactory factory = PageEnvelopeFactory.getInstance();
            Publication publication = PublicationUtil.getPublication(this.manager, request);
            return factory.getPageEnvelope(map, cocoon.getObjectModel(), publication);
        } catch (Exception e) {
            throw new PageEnvelopeException(e);
View Full Code Here

        String webappUri = ServletHelper.getWebappURI(request);
        URLInformation info = new URLInformation(webappUri);
        String pubId = null;
        try {
            Session session = RepositoryUtil.getSession(this.manager, request);
            DocumentFactory factory = DocumentUtil.createDocumentFactory(this.manager, session);
            String pubIdCandidate = info.getPublicationId();
            if (pubIdCandidate != null && factory.existsPublication(pubIdCandidate)) {
                pubId = pubIdCandidate;
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here

            pub = PublicationUtil.getPublication(this.manager, request);
        } catch (Exception e) {
            throw new AccessControlException(e);
        }
        Session session = RepositoryUtil.getSession(this.manager, request);
        DocumentFactory map = DocumentUtil.createDocumentFactory(this.manager, session);
        Document document = map.get(pub, area, documentId, language);

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("    Invoking workflow event");
        }
        WorkflowUtil.invoke(this.manager, session, getLogger(), document, eventName);
View Full Code Here

        String pubId = steps[0];
        String area = steps[2];

        try {

            DocumentFactory factory = DocumentUtil
                    .createDocumentFactory(manager, node.getSession());
            Publication pub = factory.getPublication(pubId);
            String docPath = path.substring((pubId + "/content/" + area).length());

            String uuid = docPath.substring(1, docPath.length() - "/en".length());
            String language = docPath.substring(docPath.length() - "en".length());

            doc = factory.get(pub, area, uuid, language);

            if (doc == null) {
                // this happens if the node was not a document node
                logger.info("No document found for node [" + sourceUri + "]");
            }
View Full Code Here

        try {
            String pubBase = Node.LENYA_PROTOCOL + Publication.PUBLICATION_PREFIX_URI + "/";
            String publicationsPath = sourceUri.substring(pubBase.length());
            int firstSlashIndex = publicationsPath.indexOf("/");
            publicationId = publicationsPath.substring(0, firstSlashIndex);
            DocumentFactory factory = DocumentUtil.createDocumentFactory(manager, session);
            Publication pub = factory.getPublication(publicationId);
            contentDir = pub.getContentDir();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here

    }

    protected Document getSourceDocument() {
        Document doc = null;
        try {
            DocumentFactory factory = getDocumentFactory();
            String sourceUrl = getParameterAsString(SOURCE_URL);
            if (factory.isDocument(sourceUrl)) {
                doc = factory.getFromURL(sourceUrl);
            }
        } catch (DocumentBuildException e) {
            throw new RuntimeException(e);
        }
        return doc;
View Full Code Here

            if (clipboard != null) {
               
                Node siteNode = getArea().getSite().getRepositoryNode();
                nodes.add(siteNode);

                DocumentFactory map = getDocumentFactory();
                Publication pub = getPublication();
                Document clippedDocument = clipboard.getDocument(map, pub);
   
                NodeSet subsite = SiteUtil
                        .getSubSite(this.manager, clippedDocument.getLink().getNode());
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.