cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arsen A. Gutsal" <>
Subject sitemap conditions handling
Date Tue, 05 Jul 2005 14:13:33 GMT
What's the best way to handle conditions in sitemap?
I'd prefer sitemap, not flowscipt.

So, I've the script, which store user to database.
After user is successfully stored, email should be sent to him with his
login/password and operation status. Everything works fine except I
can't catch session attribute set to ERROR and do not send email in that

Sitemap looks like:

<map:match pattern="*-success">
        <!-- flow-attribute:customer should be set! -->
        <map:generate type="xquery" src="xq/update_customer.xq">
                <map:parameter name="id"
                <map:parameter name="email"
                <map:parameter name="pin"
        <!-- some condition should be here -->
        <map:call resource="sendMail">
                <map:parameter name="from"
                <map:parameter name="to" value="{global:admin-email}"/>
                <map:parameter name="subject" value="New user has been
                <map:parameter name="src"

So, email should *not* be sent if record was not added to DB in xquery
generator (some session attribute was set to ERROR). I tried to put
map:select with parameter-selector-test and check "ERROR" value, but it
does not work.
Of course I can move sendmail action to another pipeline and then call
it from XSLT (when generating the page). So, if error was set I'll not
call this pipeline. But this is an incorrect way I guess (to mix
visualizing with actioning).  

Arsen A. Gutsal

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message