Just to clarify: what I added was the "cocoon.parameters" property that contains a map of the parameters passed from the sitemap. The parameters are also passed positionally to the function as before. So if you want to access a named parameter you can do this:
<map:call function="myFlow">
<map:parameter name="x" value = y"/>
...


function myFlow() {
   var x = cocoon.parameters.x;
}


The same functionality is in the original flow implementation.


Do we want something different?

Chris

Christopher Oliver wrote:

Sylvain Wallez wrote:

Reinhard Pötz wrote:

+1 on everything but [B] :

 [B] Functions provided by scripts can be called within the sitemap
     using:
          <map:call function="[yourFunction]">
       <map:parameter name="x" value="y"/>[2]
     </map:call>
           There are no special restrictions where you can put
     it within <map:pipeline .../> (e.g. put it within action elements)


As pointed out recently by Jeremy, <map:parameters> inside a <map:call> are currently passed as positional arguments to the JS function, which can be very confusing since the sitemap syntax uses named parameters. Jeremy also proposed these parameters to be passed as a single Map-like object to the function.


So I'm +1 for the syntax but I'd like the parameters to be passed by named.


Uh, I already added this. Sorry, forgot to mention.

Chris






Reply via email to