Package org.apache.cocoon.sitemap

Examples of org.apache.cocoon.sitemap.SitemapRedirector


    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


      throws Exception {

        // Recompose context (and pipelines) to the local component manager
        context.recompose(this.manager);

        SitemapRedirector redirector = new SitemapRedirector(env);

        Map objectModel = env.getObjectModel();

        Object oldResolver = objectModel.get(OBJECT_SOURCE_RESOLVER);
        Object oldRedirector = env.getAttribute(REDIRECTOR_ATTR);
View Full Code Here

    public final boolean invoke(Environment env, InvokeContext context)
      throws Exception {

        // Prepare data needed by the action
        Map               objectModel    = env.getObjectModel();
        SitemapRedirector redirector     = PipelinesNode.getRedirector(env);
        SourceResolver    resolver       = getSourceResolver(objectModel);
        List              mapStack       = context.getMapStack();
        String            resolvedSource = source.resolve(mapStack);
        Parameters        resolvedParams = MapStackResolver.buildParameters(this.parameters, mapStack);

        Map actionResult;

        // If action is ThreadSafe, avoid select() and try/catch block (faster !)
        if (this.threadSafeAction != null) {
            actionResult = this.threadSafeAction.act(
                redirector, resolver, objectModel, resolvedSource, resolvedParams );

        } else {
            Action action = (Action)this.selector.select(this.componentName);
            try {
                actionResult = action.act(
                redirector, resolver, objectModel, resolvedSource, resolvedParams );

            } finally {
                this.selector.release(action);
            }
        }

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

        if (actionResult == null) {
            // Action failed
View Full Code Here

     */
    public final Map call(Environment env, InvokeContext context, Parameters params) throws Exception {

        // Prepare data needed by the actions
        Map               objectModel    = env.getObjectModel();
        SitemapRedirector redirector     = PipelinesNode.getRedirector(env);
        SourceResolver    resolver       = getSourceResolver(objectModel);
        List              mapStack       = context.getMapStack();

        String cocoonAction = env.getAction();

View Full Code Here

    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

       
        // Design note : creating the SourceResolver could also have been done
        // in TreeProcessor.invoke(), but doing it here ensures we use the local
        // component manager used by all other nodes.
        EnvironmentSourceResolver resolver = new EnvironmentSourceResolver(this.manager, env);
        SitemapRedirector redirector = new SitemapRedirector(env);
       
        Map objectModel = env.getObjectModel();
       
        Object oldResolver = objectModel.get(OBJECT_SOURCE_RESOLVER);
        Object oldRedirector = env.getAttribute(REDIRECTOR_ATTR);
View Full Code Here

       
        // Design note : creating the SourceResolver could also have been done
        // in TreeProcessor.invoke(), but doing it here ensures we use the local
        // component manager used by all other nodes.
        EnvironmentSourceResolver resolver = new EnvironmentSourceResolver(this.manager, env);
        SitemapRedirector redirector = new SitemapRedirector(env);
       
        Map objectModel = env.getObjectModel();
       
        Object oldResolver = objectModel.get(OBJECT_SOURCE_RESOLVER);
        Object oldRedirector = env.getAttribute(REDIRECTOR_ATTR);
View Full Code Here

     */
    public final Map call(Environment env, InvokeContext context, String source, Parameters params) throws Exception {
       
        // Prepare data needed by the actions
        Map               objectModel    = env.getObjectModel();
        SitemapRedirector redirector     = PipelinesNode.getRedirector(env);
        SourceResolver    resolver       = getSourceResolver(objectModel);
       
        String cocoonAction = env.getAction();
       
        Map result = null;
View Full Code Here

    public final boolean invoke(Environment env, InvokeContext context)
      throws Exception {
       
        // Prepare data needed by the action
        Map               objectModel    = env.getObjectModel();
        SitemapRedirector redirector     = PipelinesNode.getRedirector(env);
        SourceResolver    resolver       = getSourceResolver(objectModel);
        List              mapStack       = context.getMapStack();
        String            resolvedSource = source.resolve(mapStack);
        Parameters        resolvedParams = MapStackResolver.buildParameters(this.parameters, mapStack);
       
        Map actionResult;
       
        // If action is ThreadSafe, avoid select() and try/catch block (faster !)
        if (this.threadSafeAction != null) {
            actionResult = this.threadSafeAction.act(
                redirector, resolver, objectModel, resolvedSource, resolvedParams );
           
        } else {
            Action action = (Action)this.selector.select(this.componentName);
            try {
                actionResult = action.act(
                redirector, resolver, objectModel, resolvedSource, resolvedParams );
               
            } finally {
                this.selector.release(action);
            }
        }
       
        if (redirector.hasRedirected()) {
            return true;
        }
       
        if (actionResult == null) {
            // Action failed
View Full Code Here

    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

Related Classes of org.apache.cocoon.sitemap.SitemapRedirector

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.