Examples of DocumentFactory


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

            } else if (action.equals(DELETE)) {
                String jobId = getJobId(schedulerParameters);
                getScheduler().deleteJob(jobId, publicationId);
            } else if (action.equals(DOCUMENT_DELETED)) {
                String documentUrl = (String) schedulerParameters.get(PARAMETER_DOCUMENT_URL);
                DocumentFactory map = DocumentUtil.createDocumentIdentityMap(null, null);
                org.apache.lenya.cms.publication.Document document = map.getFromURL(documentUrl);
                deleteDocumentJobs(document);
            }

            // handle the remainder of the request by simply returning all
            // scheduled jobs (for the given publication ID).
View Full Code Here

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

                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

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

     * @throws PublicationException if an error occurs.
     * @throws SiteException if an error occurs.
     */
    protected Document[] getDocuments() throws PublicationException, SiteException {
        Publication publication = getPublication();
        DocumentFactory identityMap = getDocumentFactory();
        Document[] documents;

        ServiceSelector selector = null;
        SiteManager siteManager = null;
        try {
View Full Code Here

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

        Request request = ObjectModelHelper.getRequest(objectModel);
        this.useIgnore = true;
        try {
            String currentUrl = getWebappUrl(params, objectModel);
            DocumentFactory factory = DocumentUtil.getDocumentFactory(this.manager, request);
            this.linkResolver = (LinkResolver) this.manager.lookup(LinkResolver.ROLE);
            this.rewriter = new UuidToUrlRewriter(currentUrl, this.linkResolver, factory);
           
            if (factory.isDocument(currentUrl)) {
                this.rewriter.setCurrentDocument(factory.getFromURL(currentUrl));
            }
           
        } catch (final Exception e) {
            throw new ProcessingException(e);
        }
View Full Code Here

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

        super.setup(_resolver, _objectModel, _source, _parameters);

        Request request = ObjectModelHelper.getRequest(_objectModel);
        try {
            Session session = RepositoryUtil.getSession(this.manager, request);
            DocumentFactory factory = DocumentUtil.createDocumentFactory(this.manager, session);
            this.rewriter = new UrlToUuidRewriter(factory);
        } catch (final Exception e1) {
            throw new ProcessingException(e1);
        }
    }
View Full Code Here

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

        super.setup(_resolver, _objectModel, _source, params);
        Request request = ObjectModelHelper.getRequest(_objectModel);

        try {
            Session session = RepositoryUtil.getSession(this.manager, request);
            DocumentFactory factory = DocumentUtil.createDocumentFactory(this.manager, session);
            String webappUrl = getWebappUrl(params, objectModel);
            URLInformation info = new URLInformation(webappUrl);
            String pubId = info.getPublicationId();
            this.rewriter = new IncomingLinkRewriter(factory.getPublication(pubId));
        } catch (final Exception e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

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

            ContextUtility util = null;
            try {
                util = (ContextUtility) this.manager.lookup(ContextUtility.ROLE);
                Request request = util.getRequest();
                DocumentFactory factory = DocumentUtil.getDocumentFactory(manager, request);
                if (pubId != null && factory.existsPublication(pubId)) {
                    publication = factory.getPublication(pubId);
                }
            } catch (Exception e) {
                throw new AccessControlException(e);
            } finally {
                if (util != null) {
View Full Code Here

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

            if (tab.getUsecase() != null) {
                if (getLogger().isDebugEnabled()) {
                    getLogger().debug("Found usecase [" + tab.getUsecase() + "]");
                }

                DocumentFactory factory;
                ContextUtility util = null;
                try {
                    util = (ContextUtility) this.manager.lookup(ContextUtility.ROLE);
                    Request request = util.getRequest();
                    factory = DocumentUtil.getDocumentFactory(this.manager, request);
View Full Code Here

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

    public Part getPart(String name) {
        return (Part) getParameter(name);
    }

    protected DocumentFactory getDocumentFactory() {
        DocumentFactory factory = (DocumentFactory) getParameter(PARAMETER_FACTORY);
        Session session = getSession();
        if (factory == null || factory.getSession() != session) {
            factory = DocumentUtil.createDocumentFactory(this.manager, session);
            setParameter(PARAMETER_FACTORY, factory);
        }
        return factory;
    }
View Full Code Here

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

    }

    protected void doExecute() throws Exception {
        super.doExecute();
        String pubId = getParameterAsString(PUBLICATION);
        DocumentFactory factory = getDocumentFactory();
        ServiceSelector selector = null;
        SiteManager siteManager = null;
        SourceResolver resolver = null;
        try {
            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
            Publication pub = factory.getPublication(pubId);
            selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
            siteManager = (SiteManager) selector.select(pub.getSiteManagerHint());

            List nodes = new ArrayList();
            Map uri2meta = new HashMap();
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.