Package org.apache.lenya.cms.publication

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


                // Workaround:
                // We create a new session because the sitetree of the transaction doesn't yet 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);
                LinkRewriter urlToUuidRewriter = new UrlToUuidRewriter(newFactory);

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


        }
        finally {
            getManager().release(registry);
        }
       
        DocumentFactory factory = getFactory();
        Document source = factory.get(pub, Publication.AUTHORING_AREA, "/index", "en");
        Document target = factory.get(pub, Publication.AUTHORING_AREA, "/index", "en");
       
        MetaData sourceMeta = source.getMetaData(NAMESPACE);
        sourceMeta.setValue("copy", "sourceCopy");
        sourceMeta.setValue("ignore", "sourceIgnore");
        sourceMeta.setValue("delete", "sourceDelete");
View Full Code Here

     * @throws Exception when something went wrong.
     */
    public void testWorkflow() throws Exception {
        Publication publication = getPublication("test");
        String url = "/" + publication.getId() + URL;
        DocumentFactory map = getFactory();
        Document document = map.getFromURL(url);

        document.getRepositoryNode().lock();

        Session session = getSession(submitSituation);
        Workflowable workflowable = WorkflowUtil.getWorkflowable(getManager(),
View Full Code Here

        WorkflowManager workflowManager = null;

        try {
            Request request = ObjectModelHelper.getRequest(_objectModel);
            Session session = RepositoryUtil.getSession(this.manager, request);
            DocumentFactory map = DocumentUtil.createDocumentFactory(this.manager, session);

            String webappUrl = ServletHelper.getWebappURI(request);
            Document document = null;
            if (map.isDocument(webappUrl)) {
                document = map.getFromURL(webappUrl);
                ResourceType doctype = document.getResourceType();
                if (document.getPublication().getWorkflowSchema(doctype) != null) {
                    setHasWorkflow(true);
                    workflowManager = (WorkflowManager) this.manager.lookup(WorkflowManager.ROLE);
                } else {
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

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

        try {
            URLInformation info = new URLInformation(getSourceURL());
            setParameter(COMPLETE_AREA, info.getCompleteArea());

            DocumentFactory map = getDocumentFactory();
            if (map.isDocument(getSourceURL())) {
                Document sourceDocument = map.getFromURL(getSourceURL());
                setParameter(DOCUMENT, sourceDocument);
            }

            setParameter(SSL, Boolean.toString(isSSLProtected()));
            setParameter(ANCESTOR_SSL, Boolean.toString(isAncestorSSLProtected()));
View Full Code Here

    public void doExecute() throws Exception {
        String url = getSourceURL();
        URLInformation info = new URLInformation(url);
        String pubId = info.getPublicationId();

        DocumentFactory factory = getDocumentFactory();
        Publication pub = factory.getPublication(pubId);

        String areaName = getParameterAsString(PARAM_INDEX_AREA);

        String[] areaNames = pub.getAreaNames();
        if (areaName != null && Arrays.asList(areaNames).contains(areaName)) {
View Full Code Here

        updateIndex("delete", resourceType, pubId, area, uuid, language);
    }

    public void index(Session session, ResourceType resourceType, String pubId, String area,
            String uuid, String language) throws IndexException {
        DocumentFactory factory = DocumentUtil.createDocumentFactory(this.manager, session);
        try {
            Publication pub = factory.getPublication(pubId);
            Area areaObj = pub.getArea(area);
            if (areaObj.contains(uuid, language)) {
                updateIndex("index", resourceType, pubId, area, uuid, language);
            } else {
                getLogger().debug(
View Full Code Here

        Source confSource = null;
        ContextUtility util = null;
        try {
            util = (ContextUtility) this.manager.lookup(ContextUtility.ROLE);
            Request request = util.getRequest();
            DocumentFactory factory = DocumentUtil.getDocumentFactory(this.manager, request);
            pubManager = (PublicationManager) this.manager.lookup(PublicationManager.ROLE);
            Publication[] publications = pubManager.getPublications(factory);
            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);

            for (int i = 0; i < publications.length; 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.