Examples of Redirector


Examples of org.apache.cocoon.environment.Redirector

        if (getLogger().isInfoEnabled()) {
            getLogger().info("Redirecting to '" + resolvedURI + "' at " + this.getLocation());
        }

        final Redirector redirector = PipelinesNode.getRedirector(env);

        if( this.global )
        {
            redirector.globalRedirect(this.createSession, resolvedURI);
        }
        else if (this.permanent && redirector instanceof PermanentRedirector)
        {
            ((PermanentRedirector)redirector).permanentRedirect(this.createSession, resolvedURI);
        }
        else
        {
            redirector.redirect(this.createSession, resolvedURI);
        }

        return true;
    }
View Full Code Here

Examples of org.apache.cocoon.environment.Redirector

    public Scriptable jsFunction_callAction(String type,
                                            String source,
                                            Scriptable parameters)
        throws Exception
    {
        Redirector redirector = new SitemapRedirector(this.environment);
        SourceResolver resolver = (SourceResolver)this.environment.getObjectModel()
            .get(OBJECT_SOURCE_RESOLVER);
        ComponentManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
        ComponentSelector actionSelector
            = (ComponentSelector)sitemapManager.lookup(Action.ROLE + "Selector");
View Full Code Here

Examples of org.apache.cocoon.environment.Redirector

    public void compose(ComponentManager manager) {
        this.manager = manager;
    }

    public boolean invoke(Environment env, InvokeContext context) throws Exception {
        Redirector redirector = PipelinesNode.getRedirector(env);
       
        List params = null;

        // Resolve parameters
        if (parameters != null) {
            params = resolveList(parameters, manager, context, env.getObjectModel());
        }

        String continuation = continuationId.resolve(context, env.getObjectModel());

        // If the continuation id is not null, it takes precedence over
        // the function call, so we invoke it here.
        if (continuation != null && continuation.length() > 0) {
            interpreter.handleContinuation(continuation, params, env);
            if (!redirector.hasRedirected()) {
                throw new ProcessingException("<map:call continuation> did not send a response, at " + getLocation());
            }
           
            // Success
            return true;
        }

        // We don't have a continuation id passed in <map:call>, so invoke
        // the specified function

        String name = functionName.resolve(context, env.getObjectModel());

        if (name != null && name.length() > 0) {
            interpreter.callFunction(name, params, env);
            if (!redirector.hasRedirected()) {
                throw new ProcessingException("<map:call function='" + name + "'> did not send a response, at " + getLocation());
            }
           
            // Success
            return true;
View Full Code Here

Examples of org.apache.cocoon.environment.Redirector

        if (getLogger().isInfoEnabled()) {
            getLogger().info("Redirecting to '" + resolvedURI + "' at " + this.getLocation());
        }

        final Redirector redirector = PipelinesNode.getRedirector(env);

        if( this.global ) {
            redirector.globalRedirect(this.createSession, resolvedURI);
        } else if (this.permanent && redirector instanceof PermanentRedirector) {
            ((PermanentRedirector)redirector).permanentRedirect(this.createSession, resolvedURI);
        } else {
            redirector.redirect(this.createSession, resolvedURI);
        }

        return true;
    }
View Full Code Here

Examples of org.apache.cocoon.environment.Redirector

        } else {
            args = Collections.EMPTY_LIST;
        }

        // Need redirector in any case
        Redirector redirector = context.getRedirector();

        // If the continuation id is not null, it takes precedence over
        // the function call, so we invoke it here.
        String continuation = continuationId.resolve(context, env.getObjectModel());
        if (continuation != null && continuation.length() > 0) {
            try {
                interpreter.handleContinuation(continuation, args, redirector);
            } catch (Exception e) {
                throw ProcessingException.throwLocated("Sitemap: error calling continuation", e, getLocation());
            }
            if (!redirector.hasRedirected()) {
                throw new ProcessingException("Sitemap: continuation did not send a response", getLocation());
            }
            return true;
        }

        // We don't have a continuation id passed in <map:call>, so invoke
        // the specified function
        String name = functionName.resolve(context, objectModel);
        if (name != null && name.length() > 0) {
            try {
                interpreter.callFunction(name, args, redirector);
            } catch (Exception e) {
                throw ProcessingException.throwLocated("Sitemap: error calling function '" + name + "'", e, getLocation());
            }
            if (!redirector.hasRedirected()) {
                throw new ProcessingException("Sitemap: function '" + name + "' did not send a response", getLocation());
            }
            return true;
        }
View Full Code Here

Examples of org.apache.cocoon.environment.Redirector

            this.sitemapExecutor.enterSitemap(this, environment.getObjectModel(), this.wrappingProcessor.source.getURI());

            // and now process
            EnvironmentHelper.enterProcessor(this, environment);
            final Redirector oldRedirector = context.getRedirector();
            try {
                // Build a redirector
                TreeProcessorRedirector redirector = new TreeProcessorRedirector(environment, context);
                context.setRedirector(redirector);
                context.service(this.manager);
View Full Code Here

Examples of org.apache.cocoon.environment.Redirector

                newParams.merge(callerParams);
                resolvedParams = newParams;
            }
        }

        Redirector redirector = context.getRedirector();
        SourceResolver resolver = EnvironmentHelper.getCurrentProcessor().getSourceResolver();

        try {
            Action action = (Action) getComponent();
            Map actionResult;
            try {
                actionResult = this.executor.invokeAction(this,
                                                          objectModel,
                                                          action,
                                                          redirector,
                                                          resolver,
                                                          resolvedSource,
                                                          resolvedParams);
            } finally {
                releaseComponent(action);
            }

            if (redirector.hasRedirected()) {
                return true;
            }

            if (actionResult != null) {
                // Action succeeded : process children if there are some, with the action result
View Full Code Here

Examples of org.apache.cocoon.environment.Redirector

                                               env.getObjectModel(),
                                               resolvedURI,
                                               this.createSession,
                                               this.global,
                                               this.permanent);
        final Redirector redirector = context.getRedirector();

        if (this.global) {
            redirector.globalRedirect(this.createSession, resolvedURI);
        } else if (this.permanent && redirector instanceof PermanentRedirector) {
            ((PermanentRedirector) redirector).permanentRedirect(this.createSession, resolvedURI);
        } else {
            redirector.redirect(this.createSession, resolvedURI);
        }

        return true;
    }
View Full Code Here

Examples of org.apache.cocoon.environment.Redirector

            CocoonComponentManager.enterEnvironment(environment, this.sitemapComponentManager, this);

            Map objectModel = environment.getObjectModel();

            Object oldResolver = objectModel.get(ProcessingNode.OBJECT_SOURCE_RESOLVER);
              final Redirector oldRedirector = context.getRedirector();

              // Build a redirector
              TreeProcessorRedirector redirector = new TreeProcessorRedirector(environment, context);
              setupLogger(redirector);
              context.setRedirector(redirector);
View Full Code Here

Examples of org.apache.cocoon.environment.Redirector

    public Scriptable jsFunction_callAction(String type,
                                            String source,
                                            Scriptable parameters)
        throws Exception
    {
        Redirector redirector = new SitemapRedirector(this.environment);
        SourceResolver resolver = (SourceResolver)this.environment.getObjectModel()
            .get(OBJECT_SOURCE_RESOLVER);
        ComponentManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
        ComponentSelector actionSelector
            = (ComponentSelector)sitemapManager.lookup(Action.ROLE + "Selector");
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.