cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: [ANNOUNCE] actions and modules for flow
Date Tue, 02 Jul 2002 10:45:17 GMT
Why do I have the feeling this is going to kick ourselves in the butt
big time?

Unfortunately, it's just a feeling, not really an alarm ringing... but
think I'll have to play with this.

Christian Haul wrote:
> I've just added support for Actions, InputModules, and OutputModules
> to the JavaScript implementation of the flow component.
> =======
> With this it is possible to call any action that is configured in the
> sitemap (or any ancestor sitemap) with the following syntax:
>                 var x = act(type, src, parameters);
> With "type" being the short-hand for the action (c.f. @type in
> <map:act/>), "src" being the location of the action (c.f. @src in
> <map:act/>), and "parameters" being an associative JavaScript array
> containing the parameters that are passed to the action.
>          *  All three parameters must be present.  *
> The result of the action call is a java.util.Map wrapped to a
> JavaScript associative array. If the action returned "null", this
> array will be "null" as well. The array has a pseudo property "length"
> and all values can be accessed by index in the same order as an
> Iterator over the keySet() would do.
>  Example:
>   var x = act("request", "", {"parameters":"true", "default.dest":"invalid.html"});
>  Caveat:
> Some actions make use of the Redirector object passed to the action. I
> have currently no idea how this could be incorporated into the flow in
> a sane way. *Thus it is currently ignored.* Repeat: redirections done
> by an action through the Redirector object are ignored.

Yes. I've always thought that having a redirector in the actions was a
pretty nasty hack. Now that the flow has much better infrastructure for
redirection, it's good to ignore it.
> =======
> InputModules can just be called with the inputValue function:
>        var z = inputValue(type, parameter);
> E.g. :
>        var z = inputValue("request", "dest");
> This is mapped to a call to getAttribute() of the InputModule known to
> the ComponentManager as "request". Note that obtaining an array of
> values or an enumeration of all available parameters is at this point
> not supported.
> The returned value is *not* wrapped for JavaScript but is of the very
> type returned by the input module. Hence it exposes all the usual
> methods.
> OutputModules are supported completely. Three functions exist that
> allow setting of attributes, rolling back, and committing attributes:
>           outputSet(type, attribute, value);
>           outputRollback(type);
>           outputCommit(type);
> E.g. :
>   outputSet("attribute", "dest", x.dest);
>   outputSet("attribute", "a", x.a);
>   outputSet("attribute", "x", x);
>   outputCommit("attribute");
> Have fun :-)

Chris, I have another strong feeling: without at least a sample and a
few lines of documentation about all this and what it is supposed to
achieve, nobody will ever use it, nor even give you feedback. So I'd
strongly suggest you to invest a few hours and provide them.

Anyway, thanks much for your effort on this :)

Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<>                             Friedrich Nietzsche

To unsubscribe, e-mail:
For additional commands, email:

View raw message