cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Man <>
Subject [c2] [patch] validator action feature
Date Fri, 27 Apr 2001 18:59:27 GMT
hi all,
	attached is a patch that enables new functionality in form and session
validator. it is a new way to specify which parameters to validate and
hopefully it cleans a little bit sitemap and introduces more flexibile syntax
(comparsion of parameters and comparsion to strings is possible, now just
specify what to implement more...)

<map:act type="session-validator">
    <parameter name="descriptor" value="context://desc.xml"/>
    <parameter name="validate-set" value="is-logged-in"/>

where desc.xml contains
    <parameter name="username" type="string" nullable="no"/>
    <parameter name="role" type="string" nullable="no"/>

    <constraint-set name="is-logged-in">
        <validate name="username"/>
        <validate name="role"/>

    <constraint-set name="is-logged-in-admin-role">
        <validate name="username"/>
        <validate name="role" equals-to="admin"/>

    <constraint-set name="do-new-passwords-match">
        <validate name="newpass"/>
        <validate name="renewpass" equals-to-admin="newpass"/>

martin man

"Only dead fish swims with a stream"
gpg_key_fingerprint: 2CC0 4AF6 92DA 5CBF 5F09  7BCB 6202 7024 6E06 0223

View raw message