Hi,
ok, so I have been using actions thus far to perform things like login, and now discover the beauty and simplicity of flowscript. So why actions? Anyway, I want to convert an action I currently have to check a users login details to flowscript. So my question is, what do I need to do? My user class is of the getter and setter variety and in my sitemap I have the following code to read the user/password details into the action:

<map:match pattern="login">
<map:act type="auth-login">
<map:parameter name="handler" value="beyarecords"/>
<map:parameter name="parameter_name" value="{request-param:user}"/>
<map:parameter name="parameter_password" value="{request-param:pass}"/>
<map:redirect-to uri="registerd_user_area"/>
</map:act>
<!-- authentication failed: -->
<map:redirect-to uri="login.html"/>
</map:match>


I now want to change this code so that it can read the values into a flowscript, which in turn queries a user object ( User user = User.getUser(userName, userPassword) ). If the user does not exist i want the user to be re-directed back to the login page, otherwise they are re-directed to my protected area:

<map:match pattern="registerd_user_area">
<map:act type="auth-protect">
<map:parameter name="handler" value="beyarecords"/>
<map:aggregate element="home">
<map:part src="cocoon:/support/beya-menu"/>
<map:part src="cocoon:/support/contract-summary"/>
<map:part src="context://beyarecords/content/adv-xyz-01.xml"/>
<map:part src="cocoon:/support/banner"/>
</map:aggregate>


<map:transform type="xslt" src="style/home-page.xsl"/>
<map:call resource="serialize"/>
</map:act>
</map:match>


Of course I appreciate that those parts of my sitemap which used the map:act type="auth-protect" would now need to be changed to reflect using a flowscript instead, something like:

<map:call function="userLoggedIn"/>??? In the above instance, how would I still utilise the map:aggregate???


Peter

Reply via email to