Le lundi 04 avril 2005 Ã 11:10 -0700, fadi qutaishat a Ãcrit : > Hi all , >
Hello. > > > I think I getting confused in suing the cocoon session. I think I am > not clear with defining the right configuration for a session inside > a pipeline. Please could some one send me an example on how to use and > configure a session in a pipeline, it would be great if the example > uses the session transformer and loads data from a database for its > context. > > > > I have read the cocoon documentation but I did not manage to > completely implement the concept of the session. Will try to explain what we have done in our app. First of all, if you didn't done this, maybe you could read: http://cocoon.apache.org/2.1/developing/webapps/contexts.html and http://cocoon.apache.org/2.1/developing/webapps/authentication.html First, use of session-fw and auth-fw. We've got a normal auth-fw use. As you must generate a session-fw compatible xml stream in the Âauthenticate pipeline match , you're already have a session context. The database access done in the authentication match (we're using XSP, a login.xsp with esql). Then, the session transformer is used to display information for users. We've got the following match: <map:match pattern="authentification.xdoc"> <map:act type="auth-loggedIn"> <map:parameter name="handler" value="myotishandler"/> <map:act type="auth-protect"> <map:parameter name="handler" value="myotishandler"/> <map:generate src="backend/session.xml"/> <map:transform type="session"/> <map:transform src="xsl/session2xdoc.xsl"/> <map:serialize type="xml"/> </map:act> </map:act> <map:generate type="serverpages" src="backend/login/remplir.xsp"/> <map:transform src="xsl/authxdoc.xsl"/> <map:serialize type="xml"/> </map:match> If the use is logged in, we display the content of backend session.xml (see below for content), with the session-transformer and a xsl transformer. Here is the content of session.xml: <content xmlns:session="http://apache.org/cocoon/session/1.0"> <auth> <title>Authentification</title> <session:getxml context="authentication" path="/"/> </auth> </content> The session tranformer transform this file in a stream like this: <authentication> <ID>Unique ID of the user in the system</ID> <role>rolename</role> <!-- optional --> <data> Any additional optional information can be supplied here. This will be stored in the session for later retrieval </data> </authentication> If the user is not authenticated, we display the login box. Hope this helps. Rgds. > -- AurÃlien DEHAY http://zorel.org http://logicielslibres.info
signature.asc
Description: This is a digitally signed message part