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

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


        }
    }

    protected String getContextPath() throws ServiceException {
        String prefix;
        ContextUtility ctxUtil = null;
        try {
            ctxUtil = (ContextUtility) this.manager.lookup(ContextUtility.ROLE);
            prefix = ctxUtil.getRequest().getContextPath();
        } finally {
            if (ctxUtil != null) {
                this.manager.release(ctxUtil);
            }
        }
View Full Code Here


        }
    }

    protected String getContextPath() throws ServiceException {
        String prefix;
        ContextUtility ctxUtil = null;
        try {
            ctxUtil = (ContextUtility) this.manager.lookup(ContextUtility.ROLE);
            prefix = ctxUtil.getRequest().getContextPath();
        } finally {
            if (ctxUtil != null) {
                this.manager.release(ctxUtil);
            }
        }
View Full Code Here

        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

                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

   
    private String contextPath;
   
    protected String getContextPath() {
        if (this.contextPath == null) {
            ContextUtility context = null;
            try {
                context = (ContextUtility) this.manager.lookup(ContextUtility.ROLE);
                this.contextPath = context.getRequest().getContextPath();
            } catch (ServiceException e) {
                throw new RuntimeException(e);
            }
            finally {
                if (context != null) {
View Full Code Here

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Resolving policy for webapp URL [" + webappUrl + "]");
        }

        String url = null;
        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);

            // always check for authoring URL since the live document doesn't
            // have to exist
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

        }
    }

    protected String getContextPath() throws ServiceException {
        String prefix;
        ContextUtility ctxUtil = null;
        try {
            ctxUtil = (ContextUtility) this.manager.lookup(ContextUtility.ROLE);
            prefix = ctxUtil.getRequest().getContextPath();
        } finally {
            if (ctxUtil != null) {
                this.manager.release(ctxUtil);
            }
        }
View Full Code Here

        // now check all publications and add their indexes:
        PublicationManager pubManager = null;
        SourceResolver resolver = null;
        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);
View Full Code Here

        }
        return (Document[]) list.toArray(new Document[list.size()]);
    }

    protected void loadResources() {
        ContextUtility context = null;
        try {
            context = (ContextUtility) this.manager.lookup(ContextUtility.ROLE);
            Request request = context.getRequest();
            boolean ssl = request.isSecure();

            LinkRewriter rewriter = new OutgoingLinkRewriter(this.manager, getSession(),
                    getSourceURL(), ssl, false, false);
            Map asset2proxyUrl = new HashMap();
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.