Package org.apache.lenya.cms.publication

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


            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

            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

    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

    }

    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

            Map wrapperParameters = wrapper.getParameters();
            map.putAll(wrapperParameters);

            NamespaceMap schedulerParameters = new NamespaceMap(LoadQuartzServlet.PREFIX);

            DocumentFactory identityMap = DocumentUtil.createDocumentIdentityMap(null, null);
            String url = ServletHelper.getWebappURI(ObjectModelHelper.getRequest(this.objectModel));
            Publication pub = null;

            schedulerParameters.put(ServletJob.PARAMETER_DOCUMENT_URL,identityMap.getFromURL(url)
                    .getCanonicalWebappURL());
            schedulerParameters.put(LoadQuartzServlet.PARAMETER_PUBLICATION_ID, pub.getId());
            map.putAll(schedulerParameters.getPrefixedMap());
        } catch (final Exception e) {
            throw new ProcessingException(e);
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);
        Area area = pub.getArea(info.getArea());

        Document[] docs = area.getDocuments();

        IndexUpdater updater = null;
View Full Code Here

        }

        Source source = null;
        try {
            Session session = RepositoryUtil.getSession(this.manager, request);
            DocumentFactory factory = DocumentUtil.createDocumentFactory(this.manager, session);
            String pubId = null;
            if (par.isParameter(PARAM_PUB)) {
                pubId = par.getParameter(PARAM_PUB);
            } else {
                String webappUrl = ServletHelper.getWebappURI(request);
                URLInformation info = new URLInformation(webappUrl);
                pubId = info.getPublicationId();
            }
            Publication pub = factory.getPublication(pubId);
            this.site = pub.getArea(area).getSite();

            if (this.path == null) {
                if (site.containsByUuid(uuid, language)) {
                    Link link = site.getByUuid(uuid, language);
View Full Code Here

        ServiceSelector selector = null;
        SiteManager siteManager = null;
        try {           
            Session session = RepositoryUtil.getSession(this.manager, request);
            DocumentFactory map = DocumentUtil.createDocumentFactory(this.manager, session);
            Publication publication = PublicationUtil.getPublication(
                    this.manager, request);
           
           
            selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE
View Full Code Here

        ServiceSelector selector = null;
        SiteManager siteManager = null;
        try {
            Request request = ObjectModelHelper.getRequest(this.objectModel);
            Session session = RepositoryUtil.getSession(this.manager, request);
            DocumentFactory map = DocumentUtil.createDocumentFactory(this.manager, session);
            Publication publication = PublicationUtil.getPublication(this.manager, request);

            selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
            siteManager = (SiteManager) selector.select(publication.getSiteManagerHint());
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.