cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <>
Subject Re: Passing a parameter to flow from sitemap
Date Wed, 18 Jan 2006 14:31:28 GMT

Thanks - this helps me move a step forward - I now have:

<map:call function="main">
  <map:parameter name="userid" value="{session-attr:userID}"/>
  <map:parameter name="test" value="foo"/>

and in the flowscript I have:

function main {
  var thisUser = cocoon.parameters["userid"];
  var thisTest = cocoon.parameters["test"];

Now thisTest shows up with the value passed to it,
but thisUser does not?
You say I need to create a session ... but my understanding
is that the authentication action (which I use) creates such a 
session;  certainly when I call a stylesheet with:

<map:transform src="stylesheets/test.xsl">
  <map:parameter name="userid"  value="{session-attr:userID}"/>

the userid IS passed correctly and can be displayed.

How to explain why the same parameter is not passed to


>>> 2006/01/18 03:54:16 PM >>>
First of all you have to make sure there is a session object. You can create one with cocoon.session

or with session actions I believe.

To pass dynamic parameters to flowscript, add the map:parameter to the map:call statements:

<map:call function="myfunc">
<map:parameter name="myvar" value="{session-attr:myattr}" />

And not to the map:script command!

In flowscript you will need the following:

function myfunc {
var myvar = cocoon.parameters["myvar"];
// or
var myvar = cocoon.parameter.myvar;


This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
CSIR E-mail Legal Notice 
CSIR Copyright, Terms and Conditions 
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.

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

View raw message