You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jan Hoskens <jh...@schaubroeck.be> on 2005/01/06 13:46:06 UTC
Sessioncontext/authenticationcontext + JX
Hi,
As I'm trying to reduce/replace my XSP pages (mainly) by switching to
flow/jx I was experimenting on how I could grab some information from a
sessioncontext and my authenticationcontext. I had an "Info" XSP page
with a pipeline that's used by my overal page layout (think of user info
that's visible at all times or are adapted while progressing through the
site). In that page I called the <xsp-session-fw:...> sheet to
accomplish this.
To replace my xsp (I want to stick with jx/flow now) I thought of some
possibilities like:
- write an action and set a variable (eg in request) containing an xml
structure that will be included in the overal layout
- write a transformer/generator to create the xml structure.
- the info pipeline calls a flow to extract the info vars and a jx
infopage includes these variables in an xml structure.
But at the end, I stumbled upon this (using jexl in a jx page):
${cocoon.session.getAttribute("org.apache.cocoon.webapps.session.context.SessionContext").get("mycontextname").getValueOfNode("mypath")}
${cocoon.session.getAttribute("org.apache.cocoon.webapps.authentication.components.DefaultAuthenticationManager/UserStatus").getHandler("VbAuthenticationHandler").getUserId()}
which works fine and I can use this in my overal page layout as this is
a jx page with includes to fetch the actual page. (so I'm having one
pipeline, the "info-pipe", less than usual)
Now I'm posting this for several reasons:
1) you may have the same problem fetching the
sessioncontext/authentication, so this may be interesting for you to use.
2) I'm wondering if I'm forgetting something here that makes this
construction hazardous.
3) and finally: maybe it's interesting to have another variable
"cocoon.sessioncontext" available to be able to create constructions
such as: ${cocoon.sessioncontext.mycontextname.somepath} and maybe the
same for authentication (but that one's a block, so I'm not sure).
Does this make any sense?
Any comments are welcome!
Kind Regards,
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org