cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Howard <coc...@leverageweb.com>
Subject Re: Problem with reading parameters from sitemap in flowscript
Date Tue, 23 Sep 2003 02:47:39 GMT
Chris Wilkes wrote:
> Hi All,
> 
>   I'm trying to read in a parameter set in my sitemap in a flowscript:
> 
>   SITEMAP
>   <map:match pattern="ldap/*" type="wildcard">
>     <map:call function="displayuid">
>       <map:parameter name="Uid" value="chris"/>
>       <map:parameter name="Testing" value="blah"/>
>     </map:call>
>     <map:generate src="documents/displayldap.jxt" type="jxt"/>
>     <map:serialize type="html"/>
>   </map:match>
> 
>   FLOWSCRIPT
>   function displayuid() {
>     var e = cocoon.parameters;
>     for ( var i in e) {
>       cocoon.log.debug("MYPARAM name: '" + i +
>         "' value: '" + cocoon.request.getParameter(i) + "'");
>     }
>   }

You've mixed two different types of "parameter".  Your sitemap is 
sending what are normally called "sitemap parameters" which you are 
correctly referencing with cocoon.parameters.  But you are then trying 
to obtain their value from the request - where they can't be found.

In the example above, change cocoon.request.getParameter(i) to e[i] 
(javascript associative array) and you've got what you're looking for.

There are other ways to reference those parameters, but this went back 
and forth a little during implementation and I can't remember where it 
left off.  I don't think though that there is a getxxx style accessor 
method defined at this point.

Geoff

> And all I'm getting in my flow debug log is:
>   MYPARAM name: 'Uid' value: 'null'
>   MYPARAM name: 'Testing' value: 'null'
> Am I reading the flow script API docs
>   http://cocoon.apache.org/2.1/userdocs/flow/api.html
> incorrectly?  I've tried all manner of the getParameter and can't figure
> it out.
> 
> Am I missing something?
> 
> Chris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 
> 



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


Mime
View raw message