cocoon-users mailing list archives

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

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"/>
</map:call>

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
flow??

Thanks
Derek

>>> Geert.Josten@daidalos.nl 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}" />
</map:call>

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;
...
}

Cheers,
Geert




-- 
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
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html 
 
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html 
 
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
HelpDesk@csir.co.za.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message