Could you please elaborate on the use of a "session-expiration-aware" attribute.
Yes of course, [1] explains my goal.
I implemented a class inheriting from [2] HttpSessionBindingListener interface and added it as a session attribute.
So when the session is killed (manually or by "natural" expiration), my component is warned and performs some cleaning action (is the case of [1] deregisters the unique-user-informations from the application context).
Pretty usefull, and for this idea, I must thank Sylvain Wallez :)
[1] http://marc.theaimsgroup.com/?t=108680597000010&r=1&w=2
[2] http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpSessionBindingListener.html
-- Olivier
Thanks Derek
[EMAIL PROTECTED] 2004/07/23 11:07:39 AM >>>
Derek Hohls wrote:
ng
You say: "Notice the authentication action, without it ID will not be available."
What you can also do is store the userID in the session context
at the point of login; its then available even when the <map:act type="auth-protect"> is not used. The only trick
is to remember to "reset" it when the logout is called...
Hi Derek,
Why not just forgetting this attribute ?
All attributes stored in the session are removed when the session is killed, or am I forgetting something ?
The logout action kills the session, as far as I know. I'm using this feature to do some cleaning whith a "session-expiration-aware"
attribute.
-- Olivier
Derek
[EMAIL PROTECTED] 2004/07/22 03:52:59 PM >>>
Hi Derek,
Thank you very much for your reply. It seems like there is a neat alternative solutions. The user name (as well as other authentication
info, like role) can be accessed by referencing the ID element:
<!-- Take submitted form and write it into the RSS file --> <map:match pattern="addNewsItem"> <map:act type="auth-protect"> <map:parameter name="handler" value="portal-handler"/> <map:generate type="jx" src="updateRssQuery.xml"> <map:parameter name="userId" value="{ID}"/> </map:generate> <!-- map:transform type="xmldb"/ --> <map:serialize type="xml"/> </map:act> </map:match>
Notice the authentication action, without it ID will not be
available.
To access this parameter within the JX template use this:
... <author>${cocoon.parameters.userId}</author> ...
However, passing user name as a request parameter is just as good.
Thank you very much once again.
Sincerely, ng.
Derek Hohls wrote:
Nick
FWIW, I am using:
${parameters.getParameter('userID')}
in my JXTemplates to get the userID, after it has been passed as a parameter in the pipelines.
Derek
[EMAIL PROTECTED] 2004/07/22 05:16:44 AM >>>
Hi everybody,
I got stuck trying to pass the User Name into a Portal Engine
pipeline.
The pipeline looks like this:
<!-- Take submitted form and write it into the RSS file --> <map:match pattern="addNewsItem"> <map:act type="auth-protect"> <map:parameter name="handler" value="portal-handler"/>
<map:generate type="jx" src="updateRssQuery.xml">
<!-- map:parameter name="userId" value="${session-context:authentication/ID}"/ -->
<!-- map:transform type="xmldb"/>
<map:serialize type="xml"/>
</map:act>
</map:match>
I can't use Session transformer to get the ID from the
authentication
context (there are chances that some of the namespace declarations
will
be lost). Passing User Name as a request parameter is not very safe either.
I am just checking if anybody has ever got access to the
authentication
context within the JX template by some other means? In other words,
is
there a call similar to ${cocoon.request.getParameter("blah")} that could grant access to the ID parameter within authentication context
or
some other way to get access to the parameter?
Thank you very much for your time.
Sincerely, Nick
---------------------------------------------------------------------
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]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
