cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neo99 <ne...@ukonline.co.uk>
Subject SourceWritingTransformer followed by authentication does not write
Date Tue, 16 Nov 2004 19:50:06 GMT
Hello,
I hope someone can point me in the write direction.
I'm trying to create a pipeline where the user is registered and 
authenticated in one go.
After the user submits registration details (username and password) 
using a form, I want to save those details to a userlist and then 
authenticate against that same userlist.

Here is the relevant part of the pipeline I'm using:

<!-- snipet -->
       <!-- new username so register user!-->
       <map:generate src="authentication/docs/usertemplate.xml"/>
       <map:transform src="authentication/stylesheets/create-user.xsl"> 
<!-- create the fragment for the write-source transform -->
             <map:parameter name="name" value="{request-param:username}"/>
             <map:parameter name="password" 
value="{request-param:password}"/>
       </map:transform>
       <map:transform type="write-source"/> <!-- appends registration 
details to userlist.xml -->
       <!-- <map:serialize type="xml"/> --> <!-- test -->   
       <!--Authenticate new user (repeated from above)-->
       <map:act type="auth-login">
             <map:parameter name="handler" value="sitehandler"/> <!-- 
authenticates against userlist.xml -->
             <map:parameter name="parameter_name" 
value="{request-param:username}"/>
             <map:parameter name="parameter_password" 
value="{request-param:password}"/>
             <!--Authentication succeeded-->
             <map:redirect-to uri="{request-param:loginresource}"/>
       </map:act>
       <map:redirect-to uri="nologin"/>
<!-- snipet (end)-->

If I remove the comments from the
<!-- <map:serialize type="xml"/> -->
line. The SourceWritingTransformer works and writes the required 
registration data to the userlist file.

But if I place that line back inside comments, so that authentication 
can take place. The authentication fails, because the 
SourceWritingTransformer has not written the required registration 
details to the userlist file.

Is this the appropriate behaviour for the SourceWritingTransformer? Is 
it only supposed to write to the filesystem when the pipeline reaches a 
<map:serialize>?
Is there a way I can accomplish both writing to a file and using that 
same file within the same pipeline? Or is there another way I should be 
doing this?

This is my first project using Cocoon. I'm using Cocoon 2.1.5.1.

Thank you, in advance!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message