cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Sparkes <pe...@didm.co.uk>
Subject Re: Session info to pipeline
Date Sun, 11 Dec 2005 00:22:38 GMT
Building on the  "samples\blocks\authentication-fw" sample in 2.1.8 you 
can use something like:

 <map:match pattern="*.htm">
         <map:generate src="xml/{1}.xml"/>
          <!-- add include elements -->
          <map:transform src="stylesheets/include.xsl"/>
           <!-- if this user has logged in get his id and insert it into 
the xml, if not the act is skipped and the cinclude is not actioned -->
            <map:act type="auth-loggedIn">
                    <map:parameter name="handler" value="wlUsers"/>
                    <map:transform type="cinclude"/>
                     <map:transform type="session"/>
             </map:act>
             <map:transform src="stylesheets/xml2htm.xslt"/>
              <map:transform type="encodeURL"/>
              <map:serialize/>
 </map:match>

I also put the cinclude files in a Protected area and use both the following

1.  To get the user's id from the session
<uid xmlns:session="http://apache.org/cocoon/session/1.0">
     <session:getxml context="authentication" path="authentication/id"/>
</uid>

2. To get other user info from database tables(too much to put it all in 
the session) - An xsp esql file which has its own pipeline.

 Peter

>While waiting on some help with the question in my previous email, I
>discovered Martin Man's db-authenticator action in the
>"samples/protected" directory.
>
>Has a nifty descriptor file with a select element, which in turn has a
>"to-session" attribute that lets you send whatever you want to the
>session object from the db, without a lot of arcane futzing.
>
>Any particular disadvantage to using this action?
>
>Is everyone using CForms or what these days?
>
>Joe
>
>
>---------------------------------------------------------------------
>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