cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <>
Subject [ANNOUNCE] actions and modules for flow
Date Tue, 02 Jul 2002 09:18:34 GMT
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.


  var x = act("request", "", {"parameters":"true", "default.dest":"invalid.html"});


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.


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

OutputModules are supported completely. Three functions exist that
allow setting of attributes, rolling back, and committing attributes:

	  outputSet(type, attribute, value);



E.g. :

  outputSet("attribute", "dest", x.dest);
  outputSet("attribute", "a", x.a);
  outputSet("attribute", "x", x);

Have fun :-)

C h r i s t i a n       H a u l
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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

View raw message