Package org.apache.cocoon

Examples of org.apache.cocoon.Processor$InternalPipelineDescription


       
        // enter & leave environment, as a manager is looked up using
        // the processing context stack
        MockEnvironment env = new
        MockEnvironment(null);
        Processor processor = (Processor)this.manager.lookup(Processor.ROLE);
       
        CocoonComponentManager.enterEnvironment(
        env, this.manager, processor);
       
        assertEqual( load(result),
View Full Code Here


        }

        // does the uri point to this sitemap or to the root sitemap?
        if (uri.startsWith("//")) {
            uri = uri.substring(2);
            Processor processor = null;
            try {
                processor = (Processor)this.manager.lookup(Processor.ROLE);
            } catch (ComponentException e) {
                throw new ProcessingException("Cannot get Processor instance", e);
            }
View Full Code Here

                    uri = uri.substring(4);
                    rawMode = true;
                }
            }
   
            Processor actualProcessor;
           
            // Does the uri point to this sitemap or to the root sitemap?
            if (uri.startsWith("//")) {
                uri = uri.substring(2);
                prefix = ""; // start at the root
                try {
                    actualProcessor = (Processor)this.manager.lookup(Processor.ROLE);
                } catch (ComponentException e) {
                    throw new ProcessingException("Cannot get Processor instance", e);
                }
   
            } else if (uri.startsWith("/")) {
                prefix = null; // means use current prefix
                uri = uri.substring(1);
                actualProcessor = this.processor;
   
            } else {
                throw new ProcessingException("Malformed cocoon URI.");
            }
   
            // create the queryString (if available)
            String queryString = null;
            int queryStringPos = uri.indexOf('?');
            if (queryStringPos != -1) {
                queryString = uri.substring(queryStringPos + 1);
                uri = uri.substring(0, queryStringPos);
            }
   
            // build the request uri which is relative to the context
            String requestURI = (prefix == null ? env.getURIPrefix() + uri : uri);
   
            ForwardEnvironmentWrapper newEnv =
                new ForwardEnvironmentWrapper(env, requestURI, queryString, getLogger(), rawMode);
            newEnv.setURI(prefix, uri);
   
            boolean processingResult;
           
            if (this.eventPipe == null && this.streamPipe == null) {
                processingResult = actualProcessor.process(newEnv);
            } else {
                processingResult = actualProcessor.process(newEnv, this.streamPipe, this.eventPipe);
            }
           
            if (!processingResult) {
                throw new ProcessingException("Couldn't process URI " + requestURI);
            }
View Full Code Here

        }

        // does the uri point to this sitemap or to the root sitemap?
        if (uri.startsWith("//", position)) {
            position += 2;
            Processor processor = null;
            try {
                processor = (Processor)this.manager.lookup(Processor.ROLE);
            } catch (ComponentException e) {
                throw new ProcessingException("Cannot get Processor instance", e);
            }
View Full Code Here

        FlowHelper.setContextObject(objectModel, biz);

        // Attermpt to start processing the wrapper environment
        Object key = CocoonComponentManager.startProcessing(wrapper);

        Processor processor = null;
        boolean result = false;
        try {
            // Retrieve a processor instance
            processor = (Processor)this.manager.lookup(Processor.ROLE);
           
            // Enter the environment
            CocoonComponentManager.enterEnvironment(wrapper, this.manager, processor);
           
            // Process the subrequest
            result = processor.process(wrapper);
            wrapper.commitResponse();
            out.flush();

            // Return whatever the processor returned us
            return(result);
View Full Code Here

        wrapper.setAttribute("bean-dict", biz);

        // Attermpt to start processing the wrapper environment
        Object key = CocoonComponentManager.startProcessing(wrapper);

        Processor processor = null;
        boolean result = false;
        try {
            // Retrieve a processor instance
            processor = (Processor)this.manager.lookup(Processor.ROLE);

            // Enter the environment
            CocoonComponentManager.enterEnvironment(wrapper, this.manager, processor);

            // Process the subrequest
            result = processor.process(wrapper);
            wrapper.commitResponse();
            out.flush();

            // Return whatever the processor returned us
            return(result);
View Full Code Here

        this.hasRedirected = true;
    }

    private void cocoonRedirect(boolean sessionMode, String uri)
    throws IOException, ProcessingException {
        Processor actualProcessor = null;
        try {
            boolean rawMode = false;
            String prefix;

            // remove the protocol
            int protocolEnd = uri.indexOf(':');
            if (protocolEnd != -1) {
                uri = uri.substring(protocolEnd + 1);
                // check for subprotocol
                if (uri.startsWith("raw:")) {
                    uri = uri.substring(4);
                    rawMode = true;
                }
            }

            Processor usedProcessor;

            // Does the uri point to this sitemap or to the root sitemap?
            if (uri.startsWith("//")) {
                uri = uri.substring(2);
                prefix = ""; // start at the root
                try {
                    actualProcessor = (Processor)this.manager.lookup(Processor.ROLE);
                    usedProcessor = actualProcessor;
                } catch (ComponentException e) {
                    throw new ProcessingException("Cannot get Processor instance", e);
                }

            } else if (uri.startsWith("/")) {
                prefix = null; // means use current prefix
                uri = uri.substring(1);
                usedProcessor = this.processor;

            } else {
                throw new ProcessingException("Malformed cocoon URI.");
            }

            // create the queryString (if available)
            String queryString = null;
            int queryStringPos = uri.indexOf('?');
            if (queryStringPos != -1) {
                queryString = uri.substring(queryStringPos + 1);
                uri = uri.substring(0, queryStringPos);
            }

            // build the request uri which is relative to the context
            String requestURI = (prefix == null ? env.getURIPrefix() + uri : uri);

            ForwardEnvironmentWrapper newEnv =
                new ForwardEnvironmentWrapper(env, requestURI, queryString, getLogger(), rawMode);
            newEnv.setURI(prefix, uri);

            boolean processingResult;

            // FIXME - What to do here?
            Object processKey = CocoonComponentManager.startProcessing(newEnv);
            try {
               
                if ( !this.internal ) {
                    processingResult = usedProcessor.process(newEnv);
                } else {
                    ProcessingPipeline pp = usedProcessor.processInternal(newEnv);
                    if (pp != null) pp.release();
                    processingResult = pp != null;
                }
            } finally {
                CocoonComponentManager.endProcessing(newEnv, processKey);
View Full Code Here

            ServiceManager serviceManager =
                (ServiceManager) this.cocoonBeanFactory.getBean(AvalonUtils.SERVICE_MANAGER_ROLE);

            // create the tree processor
            Processor processor;
            try {
                processor = new TreeProcessor();
                ContainerUtil.service(processor, serviceManager);
                ContainerUtil.configure(processor, config);
                ContainerUtil.initialize(processor);
View Full Code Here

     * @throws MalformedURLException if unable to parse location URI
     */
    public Source resolveURI(String location, String baseURI, Map parameters)
    throws IOException {
        if (baseURI == null) {
            final Processor processor = EnvironmentHelper.getCurrentProcessor();
            if (processor != null) {
                baseURI = processor.getContext();
            }
        }
        if (this.customResolver != null) {
            return this.customResolver.resolveURI(location, baseURI, parameters);
        }
View Full Code Here

                            (org.apache.cocoon.environment.Context) context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
                    env = new BackgroundEnvironment(ctx);
                } catch (ContextException e) {
                    throw new CascadingRuntimeException("No context found", e);
                }
                Processor processor;
                try {
                    processor = (Processor) manager.lookup(Processor.ROLE);
                } catch (ServiceException e) {
                    throw new CascadingRuntimeException("No processor found", e);
                }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.Processor$InternalPipelineDescription

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.