You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Luca Morandini <lu...@tin.it> on 2003/05/17 15:55:09 UTC
Flow and Sitemap variables
Gentle folks,
Is there any way to use the value of a flow script variable in the sitemap ?
In other words, I'd like to pass the "msg" variable with the
sendPageAndWait function of a flow script, like:
sendPageAndWait("login-error.html", {"msg" : msg});
...and be able to use "msg" in the sitemap, like:
<map:match name="wildcard" pattern="login-error.html">
<map:generate type="file" src="login-error.xml"/>
<map:transform type="xalan" src="login-html.xsl">
<map:parameter name="msg" value="?????"/> <!-- HOW TO FILL THIS VALUE
? -->
</map:transform>
<map:serialize type="html"/>
</mao:match>
Yes, I could use XSP or the JPathTransformer... but I'd rather having
all "global" variables in the sitemap/flow.
I suppose this to be the work of an input module... hmmm...
TIA,
------------------------------------------
Luca Morandini
GIS Consultant
lmorandini@ieee.org
http://space.virgilio.it/kumora/index.html
------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: Flow and Sitemap variables
Posted by Luca Morandini <lu...@tin.it>.
Tony Collen wrote:
> I haven't done this, but from what I gather, if you call
> cocoon.createSession() in your Flow, the top-level variables will be
> shared via session variables, so then it is just a matter of using an
> inputModule to pull out the session variables.
>
Your idea makes perfect sense, but, when I tried to figure out which
session variables were created, the xsp-session:get-attribute-names tag
gave me a pretty cryptic result:
<page>
<xsp-session:attribute-names>
<xsp-session:attribute-name>
JavaScript GLOBAL SCOPE
</xsp-session:attribute-name>
</xsp-session:attribute-names>
</page>
having said that, how can I extract my variables ?
Regards,
------------------------------------------
Luca Morandini
GIS Consultant
lmorandini@ieee.org
http://space.virgilio.it/kumora/index.html
------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: Flow and Sitemap variables
Posted by Tony Collen <tc...@neuagency.com>.
On Sat, 17 May 2003, Luca Morandini wrote:
> Gentle folks,
>
> Is there any way to use the value of a flow script variable in the sitemap ?
>
> In other words, I'd like to pass the "msg" variable with the
> sendPageAndWait function of a flow script, like:
>
> sendPageAndWait("login-error.html", {"msg" : msg});
>
> ...and be able to use "msg" in the sitemap, like:
>
> <map:match name="wildcard" pattern="login-error.html">
> <map:generate type="file" src="login-error.xml"/>
> <map:transform type="xalan" src="login-html.xsl">
> <map:parameter name="msg" value="?????"/> <!-- HOW TO FILL THIS VALUE
> ? -->
> </map:transform>
> <map:serialize type="html"/>
> </mao:match>
>
> Yes, I could use XSP or the JPathTransformer... but I'd rather having
> all "global" variables in the sitemap/flow.
Hi Luca,
I haven't done this, but from what I gather, if you call
cocoon.createSession() in your Flow, the top-level variables will be
shared via session variables, so then it is just a matter of using an
inputModule to pull out the session variables.
Tony
--
Tony Collen
ICQ: 12410567
--
Cocoon: Internet Glue (A weblog about Apache Cocoon)
http://manero.org/weblog/
--
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org