cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilja Smoli" <i...@frontdesk.ee>
Subject Re: session context
Date Mon, 14 Feb 2005 15:57:28 GMT
Thanks Jan!
I got the idea now...
Little problem that this ( {ID} ) will work only in pipeline which exactly
uses auth handler..
Cause I have a bunch of pages to protect , I have one pipeline with
"protect" which uses then internal pipelines, but I think i can handle this
problem..
Other question is can you please point me out on this:
I want to have like this (really common for webapps :-) ): after user login,
have a session with user data (names, adresses etc...). This I can do using
this "auth fw" and put everithing in session contexts. Problem actually in
retrieving this data... Like to add parameters to links etc...
For docs I use xml, transformed through xsl...
For example I need a link like
<a href=edit_form?username=get username from session>Edit profile</a>

Where it is better to do this?
In xsl like:
<xsl:template match="editProfileLink">
Here goes html code for this link with added params from session
  </xsl:template>

or directly in xml doc?
Im confused about this :)
thx in advance...


"Jan Hoskens" <jh@schaubroeck.be> wrote in message
news:4210BFFC.5050306@schaubroeck.be...
> 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" <Bastian.Bowe@astrium.eads.net> wrote in message
> >
news:7579CAECCAF7D211B9600008C79139D8097D9845@exdssfdh01.south.de.astrium.corp...
> >
> >>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:ilja@frontdesk.ee]
> >>>Sent: Monday, February 14, 2005 2:33 PM
> >>>To: users@cocoon.apache.org
> >>>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: users-unsubscribe@cocoon.apache.org
> >>>For additional commands, e-mail: users-help@cocoon.apache.org
> >>>
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >




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


Mime
View raw message