Page: 
http://wiki.cocoondev.org/Wiki.jsp?page=HibernateAndTheAuthenticationFramework 
, version: 1 on Fri Jun 13 13:12:57 2003 by HugoBurm

New page created:
+ !Hibernate and the authentication framework
+ 
+ This is the third (and final?) chapter in my Hibernate trilogy.
+ 
+ I assume you had a quick look at part 1 and 2, and you are familiar with the 
Cocoon documentation about the authentication and session framework.
+ 
+ I wrote a generator for the Cocoon pipeline that gives you the option to use 
the Hibernate classes
+ (see [the flow 
examples|http://wiki.cocoondev.org/Wiki.jsp?page=XMLFormJXFormHibernateAndFlowscript])
 for user authentication with the Cocoon authentication framework. If you 
already walked through these Hibernate examples, be aware that I applied a 
"minor" modification to the user table: the login name is no longer the primary 
key. It will take some time to update the other examples.
+ 
+ The source is in the attachment. Change the package name to whatever you 
want, but make sure you use consistent names everywhere.
+ 
+ The goal is to create a pipeline that replaces the authentication pipeline in 
the example which uses a flat-file approach.
+ 
+ 
+ This is from the /samples :\\
+ {{
+   <map:pipeline internal-only="true">\\
+     <!-- This is the authentication respource -->\\
+       <map:match pattern="authenticate">\\
+           <map:generate src="docs/userlist.xml"/>\\
+           <map:transform src="stylesheets/authenticate.xsl">\\
+               <map:parameter name="use-request-parameters" value="true"/>\\
+           </map:transform>\\
+           <map:serialize type="xml"/>\\
+       </map:match>\\
+   </map:pipeline>\\
+ }}  \\
+   
+ Replace it with:\\
+ {{
+  <map:pipeline internal-only="true">\\
+      <!-- This is the authentication respource -->\\
+                <map:match pattern="authenticate">\\
+                               <map:generate type="auth" src=""/>\\
+                   <map:serialize  type="xml"/>\\
+                </map:match>\\
+  </map:pipeline>\\
+ }} \\
+  
+ The "auth" generator must be declared in your sitemap:\\
+ {{
+  <map:generators default="file">\\
+       <map:generator name="auth" 
src="nl.datagram.cocoon.generation.AuthGen"/>\\
+  </map:generators>\\
+ }}\\
+  
+ And of course the compiled AuthGen class must be somewhere in your classpath 
( e.g. WEB-INF/classes) 
+ 
+ Oops. Almost forgot: I am using two request variables (name and password) in 
my login resource (the two fields of the login page). So the part of the 
sitemap that performs auth service (the target of the login form) typically 
contains two lines:\\
+ {{
+            <map:parameter name="parameter_name" 
value="{request-param:name}"/>\\
+            <map:parameter name="parameter_password" 
value="{request-param:password}"/>\\
+ }}\\
+ These parameter names are hard coded in the generator (some room for 
improvement here).
+ 
+ A goodie of the generator: the user bean is stored in the session. 
+ So if your protected resource is a JXTemplate that contains something like:\\
+ {{
+    Welcome ${session.getAttribute("usr").firstName} 
${session.getAttribute("usr").lastName}\\
+ }}
+ , the user will be welcomed with his own name.
+  
+  
+ 
+  
+  
+ 
+ 


Page: http://wiki.cocoondev.org/Wiki.jsp?page=LenyaCMSScreens , version: 4 on 
Fri Jun 13 13:49:54 2003 by 195.226.6.75

+ Currently, the following Lenya CSS classes are defined:
+ 
+ *Boxes
+ **div.lenya-box
+ **div.lenya-box-title
+ **div.lenya-box-body
+ *Forms
+ **.lenya-pad
+ **.lenya-table 
+ **td.lenya-entry-caption
+ **.lenya-form-element
+ *Tables
+ **table.lenya-table
+ **table.lenya-table-noborder
+ **table.lenya-table th
+ **table.lenya-table td
+ **table.lenya-table-noborder td
+ *Tabs
+ **.lenya-tab
+ **.lenya-tablink
+ *Antlog
+ **.lenya-ant-bannercell
+ **table.lenya-ant-status
+ **.lenya-ant-error
+ **.lenya-ant-warn
+ **.lenya-ant-info
+ **.lenya-ant-debug
+ **.lenya-ant-failed
+ **.lenya-ant-complete
+ **.lenya-ant-a td
+ **.lenya-ant-b td
+ *Misc
+ **.lenya-body
+ **.lenya-project-logo
+ **td.lenya-content
+ **td.lenya-sidebar
+ **td.lenya-frontpage
+ **.lenya-page-title
+ **.lenya-page-subtitle
+ **.lenya-publication-item
+ **.lenya-sidebar a
+ **.lenya-sidebar-heading
+ 


Reply via email to