cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From macie...@tiger.com.pl
Subject RE: [C2]Action proposal (long)
Date Mon, 13 Nov 2000 10:50:59 GMT
On 10 Nov 2000, at 5:29, Giacomo Pati wrote:

On 10 Nov 2000, at 5:29, Giacomo Pati wrote:

> --- Brian Olsen <bro@sanderman.com> wrote:
> ...
> > >   <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?
> 

Why not to let actions throw exceptions and catch them in sitemap:

<act type="secure-data-entry">
    <act type="parse-input-and-make-information-available">
        ...
    </act>
    <handle exception="invalid-user">
        <generate src="..."/>
    </handle>
    <handle exception="no-database-connection">
        <generate src="..."/>
    </handle>
    ...
</act>

Or more general at matcher/pipeline level:

<pipeline>
    <match type="uri" pattern="myapp/**">
        ...
        <handle exception="no-database-connection">
            <generate src="..."/>
            ...
        </handle>
    </match>
    <handle exception="invalid-user">
        <generate src="..."/>
        ...
    </handle>
</pipeline>

A general machinery for handling exceptions in sitemap?

Maciek Kaminski
maciejka@tiger.com.pl

Mime
View raw message