When the user is authenticated, you can use {ID} and {ROLE} in your sitemap:

<!-- taken from 
http://cocoon.apache.org/2.1/developing/webapps/authentication.html
at the bottom -->

<map:match pattern"protected">
  <map:act type="auth-protect">  <!-- protect the resource -->
    <map:parameter name="handler" value="myhandler"/>

    <!-- Append the ID of the user to the file name -->
    <map:generate src="resource_{ID}.xml"/>
    <map:transform src="toHTML"/>
    <map:serialize/>

  </map:act>
</map:match>

Pass it to an xsl stylesheet:
<map:transform src="mysheet.xsl">
<map:parameter name="login" value="{ID}" />
</map:transform>

and in your stylesheet declare at toplevel:

<xsl:stylesheet...>
<xsl:param name="login"/>


If needed: there are ways to get session xml in flowscript or jxtemplates, just give a sign if you need these (they are somewhere on the mail archives too).


Kind regards,
Jan

Ilja Smoli wrote:
Thx for reply
But as I understood authentication fw stores session object as xml
and i can not get attributes using {session:} :(


"Bowe, Bastian" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

Never used session. But can't you use {session:username} as a
<map:parameter/> for your <map:transform type="xsl"/> ?


-----Original Message-----
From: Ilja Smoli [mailto:[EMAIL PROTECTED]
Sent: Monday, February 14, 2005 2:33 PM
To: [email protected]
Subject: session context


Hi I use authentification framework in cocoon 2.1.5... I know that to get data out of session I can use <session:getxml... tag But what if i need this in XSL stylesheet? Or for example in my xml page where i want to put some value from session to link as query parameter? Smth like: ------------------------------- <?xml version="1.0"?> <page> <title>Home</title> <content> <center> <a href='edit-form-person?user=HERE must go username from session'>Edit profile</a><br/> ................

Thx in advance...




--------------------------------------------------------------------- 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]




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



Reply via email to