Package org.apache.lenya.cms.publication

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


                // contain
                // references to any new documents that were uploaded during the transaction.
                // See https://issues.apache.org/bugzilla/show_bug.cgi?id=47621
                Session readOnlySession = RepositoryUtil.createSession(this.manager,
                        examinedDocument.getSession().getIdentity(), false);
                DocumentFactory newFactory = DocumentUtil.createDocumentFactory(this.manager,
                        readOnlySession);
                final LinkRewriter[] rewriters = { new UrlToUuidRewriter(pub.getFactory()),
                        new UrlToUuidRewriter(newFactory) };

                org.w3c.dom.Document xml = DocumentHelper.readDocument(examinedDocument
View Full Code Here


            return;
        }
       
        Document document = getSourceDocument();
        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

    public void testSimpleSiteManager() throws Exception {

        Session session = login("lenya");

        DocumentFactory factory = DocumentUtil.createDocumentFactory(getManager(), session);
        Publication[] pubs = factory.getPublications();

        for (int i = 0; i < pubs.length; i++) {
            checkPublication(session, factory, pubs[i]);
        }
    }
View Full Code Here

     * @throws Exception
     */
    public void testMigrateUuids() throws Exception {

        Session session = login("lenya");
        DocumentFactory factory = DocumentUtil.createDocumentFactory(getManager(), session);
        Publication[] pubs = factory.getPublications();
        for (int i = 0; i < pubs.length; i++) {
            this.migratedDocs.clear();
            migratePublication(pubs[i]);
        }
        session.commit();
View Full Code Here

        } else {
            log.debug("Workflow event: [" + eventName + "]");
            // check for workflow instance first (task can initialize the workflow history)
            try {
                Session session = RepositoryUtil.createSession(this.manager, null);
                DocumentFactory map = DocumentUtil.createDocumentIdentityMap(this.manager, session);
                this.document = map.getFromURL(webappUrl);
            } catch (Exception e) {
                throw new ExecutionException(e);
            }
        }
    }
View Full Code Here

            } 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

                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

     * @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

        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

        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

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.