You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mathias Wiegard <Ma...@student.uni-ulm.de> on 2003/11/02 21:19:20 UTC

default value for session-context in the sitemap

Hi,
I have a login-pipeline that is used by the cocoon authentication framework.
The user should be able to select there his user interface language of the
application. That language ist stored in the authentication context
(authentication/data/ui_lang) or -if the login fails - in the temporary
context. The value in the temporary context shoud be used to reshow the
login-page with the values of the former try. So far so good. Now, I want to
have the locale-variable provided by the locale-action as default selection.
There is a xslt where this language is used as param to implement the right
language selection in the select-field. One constraint of this all is that I
only want to explictely use input modules and nothing like the
"use-request-parameters=true"-thing to document my "flow".
My first approach was to define to parameters on the sitemap:
...
<map:transform src="style/login.xsl" type="xslt">
<map:parameter name="resource" value="{request-param:resource}"/>
<map:parameter name="message"
value="{session-context:temporary/data/message}"/>
<!-- HERE!!! -->   
<map:parameter name="default_ui_lang" value="{locale}"/>
<map:parameter name="ui_lang"
value="{session-context:temporary/data/ui_lang}"/>
</map:transform/>

In the xsl file I tried to set the "ui_lang" value as default to
"default_ui_lang":
<xsl:param name="default_ui_lang"/>
<xsl:param name="ui_lang"><xsl:value-of
select="$default_ui_lang"/></xsl:param>

I noticed that this will never happen, even when the context (first call of
the page) is not there. I seems that the transformer gets an empty string
and doesn'nt use the default. Ok, it IS logical, from the view of the
sitemap....
But my urgent question is: how I can set a ?$%)ยงยง$% default value?? I tried
to use the "chain"-module but I failed to use the "session-context" module
inside.

By the way: the language example is only one case where I have to have such
a default value for a context value...
Thanks for your help to prevent me from freakin' out.. :(
Mat


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