cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Olsen <...@sanderman.com>
Subject Re. [C2]Action proposal (long)
Date Tue, 14 Nov 2000 21:52:23 GMT


-----Original Message-----
From: Giacomo Pati [mailto:pati_giacomo@yahoo.com]

>--- Brian Olsen <bro@sanderman.com> wrote:
<snipped already known information/> 

>>>   <action-chain name="secure-data-entry">
>> >    <act type="session-validator"/>
>> >    <act type="admin-authorizer"/>
>> >    <act type="validate-form">
>> >     <parameter name="schema" 
>> >       value="my-path-to-schema-resource.xsd"/>
>> >    </act>
>> >    <act type="save-form"/>
>> >   </action-chain>
>> 
>> It is not just the action that generate state information. The chain
>> itself should also generate some information in case one of the actions
in
>> the chain fail. When the authorization fail I want the make one response
if the form
>> didn't validate I want another one.

> Can you suggest a way to achieve this?

I have thought over this and I like the following sugestions up for
discusion.
I sugest that we add a error tag for use inside the "act" tag. This error
tag is used only when the special error handling is required. Otherwise an
exception is thrown giving control to the handle-error tag.
This tag i sugest has 2 ways of usage. Either the tag carries out the
inclosed commands and breaks or it stores the action type of the action that
failed in one of the environment objects and continues.

An action-chain like the following:
> >   <action-chain name="secure-data-entry">
> >    <act type="session-validator"/>
> >    <act type="admin-authorizer"/>
> >    <act type="validate-form">
> >     <parameter name="schema" 
> >       value="my-path-to-schema-resource.xsd"/>
> >    </act>
> >    <act type="save-form"/>
> >   </action-chain>

Could be called like this with the error-handling
<act chain="secure-data-entry">
  <error name="admin-authorizer" break>
     <act name="TempFormStorage"/>
     <generate src="login.xml"/>
     <transform type="xslt" src="login.xsl"/>
     <serializer type="html"/>   
  </error>
  <error name="validate-form" continue/>
</act>

When the error does not stop the normal way through the sitemap access to
the error is gained using an action/selector pair as shown below.
   <act type="ActionErrorParser">
     <param name="Chain" value="secure-data-entry">
   </act>
   <select type="ActionErrorSelector"/>
     <when test="validate-form">
       <generate src="retryform.xml"/>
     </when> 
   </select>


Best regards
Brian

Brian Olsen
Management Supporter
SanderMan.com,
Røjelskær 11, DK-2840 Holte, Denmark
Mobile: +45 4070 2261, Tel.:+45 4546 9900, Fax.: +45 4546 9966
E-mail: bro@sanderman.com
Please take a look at: www.sanderman.com



-Disclaimer
The information in this e-mail message is intended only for the
addressee. Disclosure or use by others is prohibited. Due to the
electronic transmission of the message, no legal rights can be
obtained from the content.



Mime
View raw message