You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stephan Coboos <cr...@gmx.net> on 2003/12/02 08:00:20 UTC
Passing request parameters to resource/flowscript?
Hello,
I have the following sitemap fragment:
...
<map:resources>
<map:resource name="main">
<map:call function="main"/>
</map:resource>
</map:resources>
<map:flow language="javascript">
<map:script src="flows/myScript.js"/>
</map:flow>
<map:pipelines>
<map:pipeline>
<map:match pattern="">
<map:call resource="main"/>
</map:match>
</map:pipeline>
</map:pipelines>
...
In the match section I'm calling the resource 'main' which is calling a
flowscript function itself. But if I do that this way I don't have
access to the request params within the flowscript! How do I activate
passing request parameters thru resources to a flowscript?
Thank you.
Regards
Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Passing request parameters to resource/flowscript?
Posted by Stephan Coboos <cr...@gmx.net>.
Ugo Cei wrote:
> Stephan Coboos wrote:
>
>> In the match section I'm calling the resource 'main' which is calling
>> a flowscript function itself. But if I do that this way I don't have
>> access to the request params within the flowscript! How do I activate
>> passing request parameters thru resources to a flowscript?
>
>
> Did you try the following?
>
> function main() {
>
> var x = cocoon.request.parameterName;
>
> // or
>
> var x = cocoon.request.getParameter("name");
>
> }
Yes, of course! Because if I don't redirect to a resource in the sitemap
and call the function directly all works well. The "error" is very easy
reproducable:
Simply change this pipeline ...
<map:match pattern="">
<map:call function="myFunction"/>
</map:match>
... to this one ...
...
<map:resource name="myResource">
<map:call function="myFunction"/>
</map:resource>
...
<map:match pattern="">
<map:call resource="myResource"/>
</map:match>
...
In the first one cocoon.request... returns the request parameter
correctly in the flowscript. In the second one, nothing will be returned.
What should I do?
Thank you.
Regards
Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Passing request parameters to resource/flowscript?
Posted by Ugo Cei <u....@cbim.it>.
Stephan Coboos wrote:
> In the match section I'm calling the resource 'main' which is calling a
> flowscript function itself. But if I do that this way I don't have
> access to the request params within the flowscript! How do I activate
> passing request parameters thru resources to a flowscript?
Did you try the following?
function main() {
var x = cocoon.request.parameterName;
// or
var x = cocoon.request.getParameter("name");
}
?
Ugo
--
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: u.cei@cbim.it
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org