Package org.apache.cocoon.acting

Examples of org.apache.cocoon.acting.Action


     * @param parameters Action parameters.
     */
    public final Map act(String type, String source, Parameters parameters) {

        ComponentSelector selector = null;
        Action action = null;
        SourceResolver resolver = null;

        Map result = null;
        try {
            selector = (ComponentSelector) this.manager.lookup(Action.ROLE +
                "Selector");
            assertNotNull("Test lookup of action selector", selector);

            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
            assertNotNull("Test lookup of source resolver", resolver);

            assertNotNull("Test if action name is not null", type);
            action = (Action) selector.select(type);
            assertNotNull("Test lookup of action", action);

            result = action.act(redirector, new SourceResolverAdapter(resolver, this.manager),
                                objectmodel, source, parameters);

        } catch (ComponentException ce) {
            getLogger().error("Could not retrieve generator", ce);
            fail("Could not retrieve generator: " + ce.toString());
View Full Code Here


        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);
            }
View Full Code Here

        SourceResolver resolver = (SourceResolver)this.environment.getObjectModel()
            .get(OBJECT_SOURCE_RESOLVER);
        ComponentManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
        ComponentSelector actionSelector
            = (ComponentSelector)sitemapManager.lookup(Action.ROLE + "Selector");
        Action action = (Action)actionSelector.select(type);
        Map result = null;
        try {
            result = action.act(redirector,
                                resolver,
                                this.environment.getObjectModel(),
                                source,
                                jsobjectToParameters(parameters));
        } finally {
View Full Code Here

        // the one from the environment.

        for (int i = 0; i < types.length; i++) {

            Map actionResult;
            Action action;

            String actionName = actionNames[i];
            String source = sources[i].resolve(context, objectModel);
            if (actionName == null || actionName.equals(cocoonAction)) {

                Parameters actionParams = VariableResolver.buildParameters(parameters[i], context, objectModel);
                if (actionParams == Parameters.EMPTY_PARAMETERS) {
                    actionParams = params;
                } else {
                    actionParams.merge(params);
                }

                // If action is ThreadSafe, avoid select() and try/catch block (faster !)
                if ((action = this.threadSafeActions[i]) != null) {

                    actionResult = action.act(
                        redirector, resolver, objectModel, source, actionParams);

                } else {

                    action = (Action)this.selector.select(this.types[i]);
                    try {
                        actionResult = action.act(
                            redirector, resolver, objectModel, source, actionParams);
                    } finally {
                        this.selector.release(action);
                    }
                }
View Full Code Here

        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);
            }
View Full Code Here

        // the one from the environment.

        for (int i = 0; i < types.length; i++) {

            Map actionResult;
            Action action;

            String actionName = actionNames[i];
            String source = sources[i].resolve(mapStack);
            if (actionName == null || actionName.equals(cocoonAction)) {

                // If action is ThreadSafe, avoid select() and try/catch block (faster !)
                if ((action = this.threadSafeActions[i]) != null) {

                    actionResult = action.act(
                        redirector, resolver, objectModel, source, params);

                } else {

                    action = (Action)this.selector.select(this.types[i]);
                    try {
                        actionResult = action.act(
                            redirector, resolver, objectModel, source, params);
                    } finally {
                        this.selector.release(action);
                    }
                }
View Full Code Here

     * @param parameters Action parameters.
     */
    public final Map act(String type, String source, Parameters parameters) {

        ComponentSelector selector = null;
        Action action = null;
        SourceResolver resolver = null;

        Map result = null;
        try {
            selector = (ComponentSelector) this.manager.lookup(Action.ROLE +
                "Selector");
            assertNotNull("Test lookup of action selector", selector);

            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
            assertNotNull("Test lookup of source resolver", resolver);

            assertNotNull("Test if action name is not null", type);
            action = (Action) selector.select(type);
            assertNotNull("Test lookup of action", action);

            result = action.act(redirector, new SourceResolverAdapter(resolver, this.manager),
                                objectmodel, source, parameters);

        } catch (ComponentException ce) {
            getLogger().error("Could not retrieve generator", ce);
            fail("Could not retrieve generator: " + ce.toString());
View Full Code Here

        // 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);
            }
        }
View Full Code Here

     * @param parameters Action parameters.
     */
    public final Map act(String type, String source, Parameters parameters) throws Exception {

        ComponentSelector selector = null;
        Action action = null;
        SourceResolver resolver = null;

        Map result = null;
        try {
            selector = (ComponentSelector) this.manager.lookup(Action.ROLE +
                "Selector");
            assertNotNull("Test lookup of action selector", selector);

            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
            assertNotNull("Test lookup of source resolver", resolver);

            assertNotNull("Test if action name is not null", type);
            action = (Action) selector.select(type);
            assertNotNull("Test lookup of action", action);

            result = action.act(redirector, new SourceResolverAdapter(resolver, this.manager),
                                objectmodel, source, parameters);

        } catch (ComponentException ce) {
            getLogger().error("Could not retrieve action", ce);
            fail("Could not retrieve action: " + ce.toString());
View Full Code Here

     * @param parameters Action parameters.
     */
    public final Map act(String type, String source, Parameters parameters) {

        ComponentSelector selector = null;
        Action action = null;
        SourceResolver resolver = null;

        Map result = null;
        try {
            selector = (ComponentSelector) this.manager.lookup(Action.ROLE +
                "Selector");
            assertNotNull("Test lookup of action selector", selector);

            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
            assertNotNull("Test lookup of source resolver", resolver);

            assertNotNull("Test if action name is not null", type);
            action = (Action) selector.select(type);
            assertNotNull("Test lookup of action", action);

            result = action.act(redirector, new SourceResolverAdapter(resolver, this.manager),
                                objectmodel, source, parameters);

        } catch (ComponentException ce) {
            getLogger().error("Could not retrieve generator", ce);
            fail("Could not retrieve generator: " + ce.toString());
View Full Code Here

TOP

Related Classes of org.apache.cocoon.acting.Action

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.