Examples of MutableEnvironmentFacade


Examples of org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade

        // Build an environment wrapper
        // If the current env is a facade, change the delegate and continue processing the facade, since
        // we may have other redirects that will in turn also change the facade delegate

        MutableEnvironmentFacade facade = environment instanceof MutableEnvironmentFacade ?
            ((MutableEnvironmentFacade)environment) : null;

        if (facade != null) {
            // Consider the facade delegate (the real environment)
            environment = facade.getDelegate();
        }

        // test if this is a call from flow
        boolean isRedirect = (environment.getObjectModel().remove("cocoon:forward") == null);
        Environment newEnv = new ForwardEnvironmentWrapper(environment, this.sitemapComponentManager, uri, getLogger());
        if ( isRedirect ) {
            ((ForwardEnvironmentWrapper)newEnv).setInternalRedirect(true);
        }

        if (facade != null) {
            // Change the facade delegate
            facade.setDelegate((EnvironmentWrapper)newEnv);
            newEnv = facade;
        }

        // Get the processor that should process this request
        ConcreteTreeProcessor processor;
        if (newEnv.getRootContext().equals(newEnv.getContext())) {
            processor = ((TreeProcessor)getRootProcessor()).concreteProcessor;
        } else {
            processor = this;
        }

        // Process the redirect
        // No more reset since with TreeProcessorRedirector, we need to pop values from the redirect location
        // context.reset();
        // The following is a fix for bug #26854 and #26571
        final boolean result = processor.process(newEnv, context);
        if ( facade != null ) {
            newEnv = facade.getDelegate();
        }
        if ( ((ForwardEnvironmentWrapper)newEnv).getRedirectURL() != null ) {
            environment.redirect( false, ((ForwardEnvironmentWrapper)newEnv).getRedirectURL() );
        }
        return result;
View Full Code Here

Examples of org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade

        EnvironmentWrapper wrapper = new EnvironmentWrapper(env, requestURI,
                                                   queryString, logger, manager, rawMode, view);
        wrapper.setURI(prefix, uri);

        // The environment is a facade whose delegate can be changed in case of internal redirects
        this.environment = new MutableEnvironmentFacade(wrapper);

        // ...and put information passed from the parent request to the internal request
        if ( null != parameters ) {
            this.environment.getObjectModel().put(ObjectModelHelper.PARENT_CONTEXT, parameters);
        } else {
View Full Code Here

Examples of org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade

        EnvironmentWrapper wrapper = new EnvironmentWrapper(env, requestURI,
                                                   queryString, logger, manager, rawMode, view);
        wrapper.setURI(prefix, uri);
       
        // The environment is a facade whose delegate can be changed in case of internal redirects
        this.environment = new MutableEnvironmentFacade(wrapper);

        // ...and put information passed from the parent request to the internal request
        if ( null != parameters ) {
            this.environment.getObjectModel().put(ObjectModelHelper.PARENT_CONTEXT, parameters);
        } else {
View Full Code Here

Examples of org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade

       
        // Build an environment wrapper
        // If the current env is a facade, change the delegate and continue processing the facade, since
        // we may have other redirects that will in turn also change the facade delegate
       
        MutableEnvironmentFacade facade = environment instanceof MutableEnvironmentFacade ?
            ((MutableEnvironmentFacade)environment) : null;
       
        if (facade != null) {
            // Consider the facade delegate (the real environment)
            environment = facade.getDelegate();
        }
       
        // test if this is a call from flow
        boolean isRedirect = (environment.getObjectModel().remove("cocoon:forward") == null);
        Environment newEnv = new ForwardEnvironmentWrapper(environment, this.manager, uri, getLogger());
        if ( isRedirect ) {
            ((ForwardEnvironmentWrapper)newEnv).setInternalRedirect(true);
        }
       
        if (facade != null) {
            // Change the facade delegate
            facade.setDelegate((EnvironmentWrapper)newEnv);
            newEnv = facade;
        }
       
        // Get the processor that should process this request
        TreeProcessor processor;
View Full Code Here

Examples of org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade

       
        // Build an environment wrapper
        // If the current env is a facade, change the delegate and continue processing the facade, since
        // we may have other redirects that will in turn also change the facade delegate
       
        MutableEnvironmentFacade facade = environment instanceof MutableEnvironmentFacade ?
            ((MutableEnvironmentFacade)environment) : null;
       
        if (facade != null) {
            // Consider the facade delegate (the real environment)
            environment = facade.getDelegate();
        }
       
        Environment newEnv = new ForwardEnvironmentWrapper(environment, this.manager, uri, getLogger());
       
        if (facade != null) {
            // Change the facade delegate
            facade.setDelegate((EnvironmentWrapper)newEnv);
            newEnv = facade;
        }
       
        // Get the processor that should process this request
        TreeProcessor processor;
View Full Code Here

Examples of org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade

        EnvironmentWrapper wrapper = new EnvironmentWrapper(env, requestURI,
                                                   queryString, logger, manager, rawMode, view);
        wrapper.setURI(prefix, uri);
       
        // The environment is a facade whose delegate can be changed in case of internal redirects
        this.environment = new MutableEnvironmentFacade(wrapper);

        // ...and put information passed from the parent request to the internal request
        if ( null != parameters ) {
            this.environment.getObjectModel().put(ObjectModelHelper.PARENT_CONTEXT, parameters);
        } else {
View Full Code Here

Examples of org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade

        // Build an environment wrapper
        // If the current env is a facade, change the delegate and continue processing the facade, since
        // we may have other redirects that will in turn also change the facade delegate

        MutableEnvironmentFacade facade = environment instanceof MutableEnvironmentFacade ?
            ((MutableEnvironmentFacade)environment) : null;

        if (facade != null) {
            // Consider the facade delegate (the real environment)
            environment = facade.getDelegate();
        }

        // test if this is a call from flow
        boolean isRedirect = (environment.getObjectModel().remove("cocoon:forward") == null);
        Environment newEnv = new ForwardEnvironmentWrapper(environment, this.sitemapComponentManager, uri, getLogger());
        if ( isRedirect ) {
            ((ForwardEnvironmentWrapper)newEnv).setInternalRedirect(true);
        }

        if (facade != null) {
            // Change the facade delegate
            facade.setDelegate((EnvironmentWrapper)newEnv);
            newEnv = facade;
        }

        // Get the processor that should process this request
        // (see https://issues.apache.org/jira/browse/COCOON-1990).
        ConcreteTreeProcessor processor = this;
        if (uri.startsWith("cocoon://"))
            processor = ((TreeProcessor)getRootProcessor()).concreteProcessor;

        // Process the redirect
        // No more reset since with TreeProcessorRedirector, we need to pop values from the redirect location
        // context.reset();
        // The following is a fix for bug #26854 and #26571
        final boolean result = processor.process(newEnv, context);
        if ( facade != null ) {
            newEnv = facade.getDelegate();
        }
        if ( ((ForwardEnvironmentWrapper)newEnv).getRedirectURL() != null ) {
            environment.redirect( false, ((ForwardEnvironmentWrapper)newEnv).getRedirectURL() );
        }
        return result;
View Full Code Here

Examples of org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade

        EnvironmentWrapper wrapper = new EnvironmentWrapper(env, requestURI,
                                                   queryString, logger, manager, rawMode, view);
        wrapper.setURI(prefix, uri);

        // The environment is a facade whose delegate can be changed in case of internal redirects
        this.environment = new MutableEnvironmentFacade(wrapper);

        // ...and put information passed from the parent request to the internal request
        if ( null != parameters ) {
            this.environment.getObjectModel().put(ObjectModelHelper.PARENT_CONTEXT, parameters);
        } else {
View Full Code Here

Examples of org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade

        EnvironmentWrapper wrapper = new EnvironmentWrapper(env, requestURI,
                                                   queryString, logger, manager, rawMode, view);
        wrapper.setURI(prefix, uri);
       
        // The environment is a facade whose delegate can be changed in case of internal redirects
        this.environment = new MutableEnvironmentFacade(wrapper);

        // ...and put information passed from the parent request to the internal request
        if ( null != parameters ) {
            this.environment.getObjectModel().put(ObjectModelHelper.PARENT_CONTEXT, parameters);
        } else {
View Full Code Here

Examples of org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade

       
        // Build an environment wrapper
        // If the current env is a facade, change the delegate and continue processing the facade, since
        // we may have other redirects that will in turn also change the facade delegate
       
        MutableEnvironmentFacade facade = environment instanceof MutableEnvironmentFacade ?
            ((MutableEnvironmentFacade)environment) : null;
       
        if (facade != null) {
            // Consider the facade delegate (the real environment)
            environment = facade.getDelegate();
        }
       
        Environment newEnv = new ForwardEnvironmentWrapper(environment, this.manager, uri, getLogger());
       
        if (facade != null) {
            // Change the facade delegate
            facade.setDelegate((EnvironmentWrapper)newEnv);
            newEnv = facade;
        }
       
        // Get the processor that should process this request
        TreeProcessor processor;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.