Package org.apache.lenya.cms.cocoon.components.context

Examples of org.apache.lenya.cms.cocoon.components.context.ContextUtility


        if (url.length() > 0) {

            URLInformation info = new URLInformation(webappUrl);
            String pubId = info.getPublicationId();

            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) {
View Full Code Here


        URLInformation info = new URLInformation(webappUrl);
        String pubId = info.getPublicationId();
        String area = info.getArea();
       
        if (pubId != null && area != null && info.getDocumentUrl().length() > 1) {
            ContextUtility contextUtility = null;
            try {
                contextUtility = (ContextUtility) serviceManager.lookup(ContextUtility.ROLE);
                Session session = RepositoryUtil.getSession(this.serviceManager, contextUtility
                        .getRequest());
                DocumentFactory map = DocumentUtil.createDocumentFactory(this.serviceManager, session);
                Publication pub = map.getPublication(pubId);
                DocumentLocator loc = pub.getDocumentBuilder().getLocator(map, webappUrl);
                url = "/" + pubId + "/" + area + loc.getPath();
View Full Code Here

     * @throws AccessControlException when the publication could not be created.
     */
    protected Publication getPublication(String url) throws AccessControlException {
        getLogger().debug("Building publication");

        ContextUtility util = null;
        try {
            util = (ContextUtility) this.serviceManager.lookup(ContextUtility.ROLE);
            Request request = util.getRequest();
            DocumentFactory factory = DocumentUtil.getDocumentFactory(this.serviceManager, request);
            return PublicationUtil.getPublicationFromUrl(this.serviceManager, factory, url);
        } catch (Exception e) {
            throw new AccessControlException(e);
        } finally {
View Full Code Here

                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);
                } finally {
                    if (util != null) {
                        this.manager.release(util);
                    }
View Full Code Here

TOP

Related Classes of org.apache.lenya.cms.cocoon.components.context.ContextUtility

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.