You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Antonio Gallardo <ag...@agssa.net> on 2004/06/21 05:23:09 UTC

[Forms] Using commons-validator

Hi:

Can we switch to the usage of commons-validator instead of developing our
own code?

http://jakarta.apache.org/commons/validator/

WDYT?

Best Regards,

Antonio Gallardo

Re: [Forms] Using commons-validator

Posted by Ugo Cei <u....@cbim.it>.
Leszek Gawron wrote:
> Ugo Cei wrote:
> 
>> Il giorno 21/giu/04, alle 05:23, Antonio Gallardo ha scritto:
>>
>>> Can we switch to the usage of commons-validator instead of developing 
>>> our
>>> own code?
>>
>> Without having ever looked at CV, I feel this could be a good thing.
>>
>>     Ugo
>>
> Looks like what cocoon has is much more complex

As I wrote, I haven't examined CV enough to see if it's good enough for 
us or not. But in case its design is sensible and there's a real 
community using and supporting it, I'd rather contribute to it than 
maintain our own validation package. Let's not reinvent the wheel once 
more, unless it's absolutely necessary.

Just my 0.02€,

	Ugo


Re: [Forms] Using commons-validator

Posted by Leszek Gawron <lg...@mobilebox.pl>.
Ugo Cei wrote:
> Il giorno 21/giu/04, alle 05:23, Antonio Gallardo ha scritto:
> 
>> Can we switch to the usage of commons-validator instead of developing our
>> own code?
> 
> 
> Without having ever looked at CV, I feel this could be a good thing.
> 
>     Ugo
> 
Looks like what cocoon has is much more complex

All Classes
Arg
CreditCardValidator
CreditCardValidator.CreditCardType
DateValidator
EmailValidator
Field
Flags
Form
FormSet
GenericTypeValidator
GenericValidator
Msg
UrlValidator
Validator
ValidatorAction
ValidatorException
ValidatorResources
ValidatorResult
ValidatorResults
ValidatorUtils
Var



-- 
Leszek Gawron                                      lgawron@mobilebox.pl

Re: [Forms] Using commons-validator

Posted by Ugo Cei <ug...@apache.org>.
Il giorno 21/giu/04, alle 05:23, Antonio Gallardo ha scritto:

> Can we switch to the usage of commons-validator instead of developing 
> our
> own code?

Without having ever looked at CV, I feel this could be a good thing.

	Ugo

-- 
Ugo Cei - http://beblogging.com/

Re: [Forms] Using commons-validator

Posted by Sylvain Wallez <sy...@apache.org>.
Antonio Gallardo wrote:

>Hi:
>
>Can we switch to the usage of commons-validator instead of developing our
>own code?
>
>http://jakarta.apache.org/commons/validator/
>
>WDYT?
>  
>

Except CreditCardValidator and EmailValidator, I'm not sure the Java 
part or commons-validator brings much to the CForms picture. It does 
check integer, floats, checks, etc, but doesn't provide the 
corresponding parsed value, which CForms provides through its datatypes 
and their convertors.

The JS part is worth considering carefully, though, as client-side 
validation is something that we must add to CForms.

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Re: [Forms] Using commons-validator

Posted by Antonio Gallardo <ag...@agssa.net>.
Antonio Gallardo dijo:
> Hi:
>
> Can we switch to the usage of commons-validator instead of developing our
> own code?
>
> http://jakarta.apache.org/commons/validator/

I am back. I know the last mail cannot sold the idea of commons-validators.

I will try to explain a little more:

1-The commons-validator mission is to build validators and this is not our
mission in Cocoon. We can benefit of using commons validators. As a sample
I just reviewed our EmailValidator vs. the commons-validator and the last
verify better the mails than our current implementation. For example we
don't check for umlauts inside an email as commons-validator do.

2-One of the dreams in forms is to (optionally) allow client side
validation to avoid unnecesary roundtrips to the server. I noted inside
commons-validators, there is a lot of scripts already done to validate the
input at client side:

http://cvs.apache.org/viewcvs.cgi/jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/

This can be useful to us to rewrite some demo of forms using them.

Size: Just 45.8 kB

Dependencies:

1-commons-collections (already in lib/core)
2-commons-logging (in cocoon: in lib/optional)
2-commons-beanutils (in cocoon: scratchpad/lib)
3-commons-digester (in cocoon: scratchpad/lib)

In that way we will not increase the distribution by using this library.

The other libraries in scratchpad can also be useful in other places of
the same forms block:

commons-beanutils
=================

Can the useful for the binding. We had last year some interesting post
that need to be digested again (with our current experience):

http://marc.theaimsgroup.com/?t=106761394400006&r=1&w=2

commons-digester
================

Perhaps can help in parsing the forms files. I am not sure here.

Best Regards,

Antonio Gallardo