cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sonny Sukumar" <ahimsad...@hotmail.com>
Subject Re: Reg exp validation with Woody?
Date Tue, 02 Sep 2003 19:57:28 GMT

Thanks for the info on using regexp with Woody.  One other lingering concern 
in my mind is this:

If I move the form validation logic out from a backend Java class to Woody, 
then how do I thoroughly test that I wrote all the reg exps and other 
validation rules correctly?  I mean, is there a way to write out tests and 
keep them around for regression testing purposes?

Would something like HttpUnit be used to do such testing?  I haven't tried 
it ...

Thanks for any info,

Sonny

>From: Bruno Dumon <bruno@outerthought.org>
>Reply-To: users@cocoon.apache.org
>To: users@cocoon.apache.org
>Subject: Re: Reg exp validation with Woody?
>Date: Mon, 01 Sep 2003 09:57:21 +0200
>
>On Mon, 2003-09-01 at 02:00, Sonny Sukumar wrote:
> > I'm looking for a solution to generate forms for every page of a 
>checkout
> > process on an e-commerce site, and so I started looking at Woody.  I 
>realize
> > it's a work in progress, but I figure if there's a sample of its use in
> > Cocoon 2.1 (which I'm using), it might just be able to do the job.
> >
> > But I'm wondering if I can do field validation with it using regular
> > expressions.
>
>Yep you can. The following is taken from the "form1" example of Woody:
>
>   <wd:field id="ipaddress" required="true">
>     <wd:label>Please enter your IP address</wd:label>
>     <wd:datatype base="string">
>       <wd:validation>
>         <wd:regexp
>pattern="^([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])$">
>           <wd:failmessage>Invalid IP address.</wd:failmessage>
>         </wd:regexp>
>       </wd:validation>
>     </wd:datatype>
>   </wd:field>
>
> >   I looked at this Wiki page and the one it links to on
> > validation syntax, and I didn't see anything about it:
> >
> > http://wiki.cocoondev.org/Wiki.jsp?page=WoodyNotes
>
>It's documented over here:
>
>http://wiki.cocoondev.org/Wiki.jsp?page=WoodyReference
>
>just search for "regexp".
>
>--
>Bruno Dumon                             http://outerthought.org/
>Outerthought - Open Source, Java & XML Competence Support Center
>bruno@outerthought.org                          bruno@apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>

_________________________________________________________________
MSN 8: Get 6 months for $9.95/month. http://join.msn.com/?page=dept/dialup


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


Mime
View raw message