Hi,

I was also 'agonizing' how to get the user Id in a typical site map without using 
{../../../ID} !

After digging around the source, I have 2 ideas
1) Modify DefaultContextManager in Session framework to store each Session Context 
into the Session using their context name as the Session Attribute. In this way we 
might be able to use
        {session:[EMAIL PROTECTED]'authentication']/authentication/ID}
        However this may not be possible as this gives up the ability to protect the 
reserved Session Context such as Request, Response etc.
2) Write a SessionContext Input Module to read out the attributes. We might then be 
able to do this
        {session-context:authentication:/authentication/ID}

Until that is available, here is my solution to your problem.

Add this to your sitemap's set of actions

    <map:action logger="sitemap.action.session-propagator" name="session-prop" 
src="org.apache.cocoon.acting.SessionPropagatorAction"/>

Add this right inside your existing auth-login action

     <map:act type="session-prop">
        <map:parameter name="userid" value="{ID}"/>
         <map:parameter name="password" value="{password}"/>
     </map:act>

When you need the user ID just use

     <map:parameter name="userid" value="{session-attr:userid}"/>

The session propagation action writes the ID and password emitted by the auth-login 
action into session attributes. You can then access the value using session-attr input 
module.

Cheers,
Edison

On Fri, 13 Jun 2003 13:50:38 +0200, Markus Schulze wrote:
>Hello,
>
>is it possible to retrieve session values created by the LoginAction
>(context="authentication") with the Session-Attr Input Module?
>
>eg.:
>
><map:transform type="xslt" src="style/main.xsl" label="raw"> <map:parameter
>name="myauth" value=" {session-attr:authentication/authentication/ID}"/>
><map:parameter name="date" value="{date:date}"/> </map:transform>
>
>As I already successfully tried, I can use the session-transformer to retrieve
>the values in my main.xsl with <session:getxml context="authentication"
>path="/authentication/ID"> but I want to use this value in  an xsl:variable in
>the style sheet. This does not seem to be possible, since the session
>transformer has to be applied after the xsl-transformation.
>
>Any ideas somebody?
>
>Markus Schulze
>
>
>
>
>
>--------------------------------------------------------------------- To
>unsubscribe, e-mail: [EMAIL PROTECTED] For additional
>commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to