cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arsen A. Gutsal" <ar...@softsky.com.ua>
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
case.

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"
value="{flow-attribute:customer/*/@id}"/>
                <map:parameter name="email"
value="{flow-attribute:customer/*/email}"/>
                <map:parameter name="pin"
value="{flow-attribute:customer/@pin}"/>
        </map:generate>
        
        <!-- some condition should be here -->
        <map:call resource="sendMail">
                <map:parameter name="from"
value="{global:registrator-email}"/>
                <map:parameter name="to" value="{global:admin-email}"/>
                <map:parameter name="subject" value="New user has been
registered"/>
                <map:parameter name="src"
value="cocoon:/registration_email.jx"/>
        </map:call>
</map:match>

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 
http://www.softsky.biz


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


Mime
View raw message