Proposal: open source field validation library/behavior

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Proposal: open source field validation library/behavior

Richard Gaskin
This working group seems an ideal collection of interests to tackle this common problem:

How can we bring field validation and input masking to Rev?

Should it be a behavior, or a library?

Who here would have time/interest to contribute?

Reply | Threaded
Open this post in threaded view
|

Re: Proposal: open source field validation library/behavior

Trevor DeVore
On Feb 25, 2010, at 10:00 AM, richard g wrote:
> This working group seems an ideal collection of interests to tackle  
> this common problem:
>
> How can we bring field validation and input masking to Rev?
>
> Should it be a behavior, or a library?
>
> Who here would have time/interest to contribute?
>

I'm inclined to say a behavior with a plug-in palette that allows you  
to drag/drop validations on a field.

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: http://revolution.bluemangolearning.com
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: open source field validation library/behavior

david bovill
Yes - a behavior!

In my work I use a record "type" for each view - having a record type allows
automatic creation of views, each with an appropriate form of data
validation from a db, or text based schema (like x-forms). Quite a lot of
the above was inspired by Django, and I think a key objective would be to
allow some level of interop with existing frameworks that have tackled the
same issue?

On 25 February 2010 15:02, Trevor DeVore <[hidden email]> wrote:

> On Feb 25, 2010, at 10:00 AM, richard g wrote:
> > This working group seems an ideal collection of interests to tackle
> > this common problem:
> >
> > How can we bring field validation and input masking to Rev?
> >
> > Should it be a behavior, or a library?
> >
> > Who here would have time/interest to contribute?
>


[Non-text portions of this message have been removed]

Reply | Threaded
Open this post in threaded view
|

Re: Proposal: open source field validation library/behavior

Andre Garzia
I think Trevors idea of a behaviour plus a plugin so we could drop behaviours on fields would be a marvelous thing!

I can't stress how much I'd like to see it done! How can I help?

:D

(wow, the first revInterop release in ages)

On Feb 26, 2010, at 6:13 AM, David Bovill wrote:

> Yes - a behavior!
>
> In my work I use a record "type" for each view - having a record type allows
> automatic creation of views, each with an appropriate form of data
> validation from a db, or text based schema (like x-forms). Quite a lot of
> the above was inspired by Django, and I think a key objective would be to
> allow some level of interop with existing frameworks that have tackled the
> same issue?
>
> On 25 February 2010 15:02, Trevor DeVore <[hidden email]> wrote:
>
> > On Feb 25, 2010, at 10:00 AM, richard g wrote:
> > > This working group seems an ideal collection of interests to tackle
> > > this common problem:
> > >
> > > How can we bring field validation and input masking to Rev?
> > >
> > > Should it be a behavior, or a library?
> > >
> > > Who here would have time/interest to contribute?
> >
>
> [Non-text portions of this message have been removed]
>
>



[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/revInterop/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/revInterop/join
    (Yahoo! ID required)

<*> To change settings via email:
    [hidden email]
    [hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply | Threaded
Open this post in threaded view
|

Re: Proposal: open source field validation library/behavior

Richard Gaskin
Looks like we have a consensus toward behaviors over libraries.  

My only interest in suggesting we consider a library is in light of the current limitation that an object can have only one behavior assigned to it, so once you assign it a field validation behavior you lose the possibility of using any other behavior with it.

But it may well be the case that the objects you'd want to use such a behavior for wouldn't likely need anything else, so a behavior it is.

I think the next steps are to define what we want it to do, and then to agree on the names of the properties and accessors needed to make that happen.

We may be able to break this down into two parts:  masking and validation.  One happens as data is entered, the other after data has been entered.

What conventions are used for these in other popular systems?  

What input types should we support?

For things like dates, should this tool also provide a picker?

If so, do we need two, one for single dates and another for ranges?

What other data types might benefit from pickers?


Reply | Threaded
Open this post in threaded view
|

Re: Proposal: open source field validation library/behavior

Tereza Snyder
In reply to this post by Andre Garzia

On Feb 26, 2010, at 7:10 AM, Andre Garzia wrote:

> I think Trevors idea of a behaviour plus a plugin so we could drop behaviours on fields would be a marvelous thing!
>
> I can't stress how much I'd like to see it done! How can I help?


me too,  me too!


--
Tereza Snyder
Califex Software, Inc.
<www.califexsoftware.com>




Reply | Threaded
Open this post in threaded view
|

Re: Proposal: open source field validation library/behavior

Andre Garzia
In reply to this post by Richard Gaskin
If we implement all validations in a single behaviour then we can assign multiple validations to a given field by using a custom property holding which validations we want. For example, a field could have a uValidations property with contents like "nonumbers,onlyalpha" meaning it would accept only alphanumeric characters and the other that would not accept numbers, so in effect this would only accept letters but not numbers or punctuation. We could in the behaviour, loop thru the uValidations of me and check against each case.

Proposed validations:
* only alphanumeric characters
* no numbers
* no spaces
* date only
* time only
* date & time only
* email
* check against SQL injection (if it accepts input from the user and inserts it into a database, specially a remote one, this becomes a biggie)
* max characters
* min characters

As for masking, I have no clue!

Cheers
andre




On Feb 26, 2010, at 10:22 AM, richard g wrote:

> Looks like we have a consensus toward behaviors over libraries.
>
> My only interest in suggesting we consider a library is in light of the current limitation that an object can have only one behavior assigned to it, so once you assign it a field validation behavior you lose the possibility of using any other behavior with it.
>
> But it may well be the case that the objects you'd want to use such a behavior for wouldn't likely need anything else, so a behavior it is.
>
> I think the next steps are to define what we want it to do, and then to agree on the names of the properties and accessors needed to make that happen.
>
> We may be able to break this down into two parts: masking and validation. One happens as data is entered, the other after data has been entered.
>
> What conventions are used for these in other popular systems?
>
> What input types should we support?
>
> For things like dates, should this tool also provide a picker?
>
> If so, do we need two, one for single dates and another for ranges?
>
> What other data types might benefit from pickers?
>
>



[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/revInterop/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/revInterop/join
    (Yahoo! ID required)

<*> To change settings via email:
    [hidden email]
    [hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply | Threaded
Open this post in threaded view
|

Re: Proposal: open source field validation library/behavior

david bovill
In reply to this post by Richard Gaskin
On 26 February 2010 13:22, richard g <[hidden email]> wrote:

> Looks like we have a consensus toward behaviors over libraries.
>
> My only interest in suggesting we consider a library is in light of the
> current limitation that an object can have only one behavior assigned to it,
> so once you assign it a field validation behavior you lose the possibility
> of using any other behavior with it.
>

In practice this would no be an issue for me - virtually all the cases in
which I would use this the field or control would be inside a group, and the
behavior would be attached to the particular control. As it is the groups
that have the view specific logic - it is the groups that I would have my
own custom behaviors attached to and would have no issues with attaching a
behavior to an individual control?


*Is it worth looking out how various open source frameworks do this?*

   - http://docs.djangoproject.com/en/dev/ref/forms/validation/ -- this made
   sense to me in terms of making this compatible with Rev
   - http://framework.zend.com/manual/en/zend.validate.set.html -- not
   looked at in detail, maybe some leaning there?
   - http://www.w3.org/TR/xforms11/#datatypes-xforms - a standard but maybe
   not so useful in practice?


[Non-text portions of this message have been removed]

Reply | Threaded
Open this post in threaded view
|

Re: Proposal: open source field validation library/behavior

Tereza Snyder
In reply to this post by Andre Garzia

On Feb 26, 2010, at 9:29 AM, Andre Garzia wrote:

>
> Proposed validations:
> * only alphanumeric characters
> * no numbers
> * no spaces
> * date only
> * time only
> * date & time only
> * email
> * check against SQL injection (if it accepts input from the user and inserts it into a database, specially a remote one, this becomes a biggie)
> * max characters
> * min characters

I would break it down this way:

* Date
* Time
* Date & Time
* Email
* Text:
    * accept spaces
    * accept numbers
    * accept alphabetic
    * accept cr
    * accept non-alphanumeric [ list ]
    * max chars
    * min chars

Rejecting SQL should be an option

Adding a Boolean callback function for further validation might be a good idea.


t



--

. . .. ... ..... ACT AGAINST ENTROPY! ..... ... .. . .



[Non-text portions of this message have been removed]

Reply | Threaded
Open this post in threaded view
|

Re: Proposal: open source field validation library/behavior

mwieder
In reply to this post by Andre Garzia
Andre-

Friday, February 26, 2010, 7:29:21 AM, you wrote:

> Proposed validations:
> * email

Having been through this one before, let me say that what constitutes
a valid email address is a bit of a gray area, so there may not be a
one-size-fits-all validation technique: what punctuation is allowed /
disallowed? What is a valid TLD? Should we validate numeric ip
addresses?

--
-Mark Wieder
 [hidden email]

--
 Mark Wieder
 ahsoftware@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: open source field validation library/behavior

Richard Gaskin
Here's a link to the Rev forum thread which prompted this project:
http://forums.runrev.com/phpBB2/viewtopic.php?f=6&t=4911

There are a couple links there to other masking filters which may inspire solutions for us.

To keep this moving forward we should identify at least a dozen or so of the most common input types and figure out a useful syntax/property name set for the user to define those.

Once we have that in place I'll take a few minutes to put that into a first draft of the behavior script which we can then modify, refine, and enhance.

Here's a few to get us started:

- number
- integer
- date
- string no longer than n chars
- email address
- URL

What else?


Reply | Threaded
Open this post in threaded view
|

Re: Proposal: open source field validation library/behavior

Tereza Snyder

On Mar 24, 2010, at 7:40 AM, richard g wrote:
> …

> Here's a few to get us started:
>
> - number
> - integer
> - date
> - string no longer than n chars
> - email address
> - URL
>
> What else?

string containing nothing but hex digits
string limited/transformed to upper/lower case
"good" password string (>N chars, mixed case, at least 1 number, at least 1 non-alphanumeric character)

t

--
Tereza Snyder
Califex Software, Inc.
<www.califexsoftware.com>






------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/revInterop/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/revInterop/join
    (Yahoo! ID required)

<*> To change settings via email:
    [hidden email]
    [hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply | Threaded
Open this post in threaded view
|

Re: Proposal: open source field validation library/behavior

Andre Garzia

On Mar 24, 2010, at 10:24 AM, Tereza Snyder wrote:

>
> On Mar 24, 2010, at 7:40 AM, richard g wrote:
>> …
>
>> Here's a few to get us started:
>>
>> - number
>> - integer
>> - date
>> - string no longer than n chars
>> - email address
>> - URL
>>
>> What else?
>
> string containing nothing but hex digits
> string limited/transformed to upper/lower case
> "good" password string (>N chars, mixed case, at least 1 number, at least 1 non-alphanumeric character)

ip entry
time
geo location (latitude, longitude)

>
> t
>
> --
> Tereza Snyder
> Califex Software, Inc.
> <www.califexsoftware.com>
>
>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/revInterop/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/revInterop/join
    (Yahoo! ID required)

<*> To change settings via email:
    [hidden email]
    [hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply | Threaded
Open this post in threaded view
|

Re: Proposal: open source field validation library/behavior

Malte Brill
date is rather complex and has to be split up into multiple formats I guess:

system date (and this one can bite terribly at least on the mac)
english date mm/dd/yyyy
australian date dd/mm/yyyy
continental european date dd.mm.yyyy
mySQL date yyyy-mm-dd hh:mm:ss

time hh:mm
long time hh:mm:ss

date and time (in all of the variations above)

timestamp (the seconds)

Am 24.03.2010 um 15:47 schrieb Andre Garzia:

>
> On Mar 24, 2010, at 10:24 AM, Tereza Snyder wrote:
>
>>
>> On Mar 24, 2010, at 7:40 AM, richard g wrote:
>>> …
>>
>>> Here's a few to get us started:
>>>
>>> - number
>>> - integer
>>> - date
>>> - string no longer than n chars
>>> - email address
>>> - URL
>>>
>>> What else?
>>
>> string containing nothing but hex digits
>> string limited/transformed to upper/lower case
>> "good" password string (>N chars, mixed case, at least 1 number, at least 1 non-alphanumeric character)
>
> ip entry
> time
> geo location (latitude, longitude)
>
>>
>> t
>>
>> --
>> Tereza Snyder
>> Califex Software, Inc.
>> <www.califexsoftware.com>
>>
>>
>>
>>
>>
>>
>> ------------------------------------
>>
>> Yahoo! Groups Links
>>
>>
>>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

--
Malte Brill
CEO derbrill Multimedia
CTO awesome mega mighty games
VAT ID DE223571286
Tel: +49 4331 337 977 7
email: [hidden email]
            [hidden email]



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/revInterop/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/revInterop/join
    (Yahoo! ID required)

<*> To change settings via email:
    [hidden email]
    [hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply | Threaded
Open this post in threaded view
|

Re: Proposal: open source field validation library/behavior

Alain Farmer
In reply to this post by Richard Gaskin
Hello,

You might want to support the same datatypes that FM, mySQL, PHP, XML, XML-Schema, and *others* are using, eg. the ones defined by the W3C. Here's an image that maps them out:

http://www.w3.org/TR/xmlschema-2/type-hierarchy.gif

This is about as universal as you can get. Any tool that handles data should is-likely-to support these datatypes. If we support them then interoperability with just about anything... will be *insured*. :-))

Btw there are established GREP-patterns to identify and parse these datatypes. And Transcript's GREP is compatible with GREP-in-general. Therefore : we can use Rev's GREP to parse and validate such datatypes ... rather easily, I might add. :)

Think about it,  :)

Alain

> [revInterop] Re: Proposal: open source field
> validation library/behavior
> To: [hidden email]
>
> Here's a link to the Rev forum thread
> which prompted this project:
> forums.runrev.com/phpBB2/viewtopic.php?f=6&t=4911
>
> There are a couple links there to other
> masking filters which may inspire solutions
> for us.
>
> To keep this moving forward we should
> identify at least a dozen or so of the
> most common input types and figure out
> a useful syntax/property name set for
> the user to define those.
>
> Once we have that in place I'll take
> a few minutes to put that into a first
> draft of the behavior script which we
> can then modify, refine, and enhance.
>
> Here's a few to get us started:
>
> - number
> - integer
> - date
> - string no longer than n chars
> - email address
> - URL
>
> What else?


      __________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr!

http://www.flickr.com/gift/
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: open source field validation library/behavior

Henk van der Velden
In reply to this post by Tereza Snyder
I'm ready to help as well. Maybe I could start writing some functions?

--- In [hidden email], Tereza Snyder <tereza@...> wrote:

>
>
> On Feb 26, 2010, at 7:10 AM, Andre Garzia wrote:
>
> > I think Trevors idea of a behaviour plus a plugin so we could drop behaviours on fields would be a marvelous thing!
> >
> > I can't stress how much I'd like to see it done! How can I help?
>
>
> me too,  me too!



Reply | Threaded
Open this post in threaded view
|

Re: Proposal: open source field validation library/behavior

Richard Gaskin


--- In [hidden email], "henk.vandervelden" <henk@...> wrote:
>
> I'm ready to help as well. Maybe I could start writing some
> functions?

Please do.  This has been a dormant topic for far longer than something this useful warrants.  I've been wrapped up in client projects, and I imagine others here have had similar commitments.

Proposing a specific function or two might just be the thing we need to kickstart this process.  Thanks for joining in.