You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Harish Krishnaswamy <hk...@comcast.net> on 2003/09/23 06:43:27 UTC
[VOTE] for PatternValidator
Hi,
The pattern validator entails the following changes:
1. Added methods contains() and getEscapedPatternString() to RegexpMatcher
2. New interface PatternDelegate, implementations of which will handle
pattern matching for the PatternValidator
3. New script PatternValidator.script, script specification for pattern
validation in javascript
4. New class PatternValidator that will allow a pattern matcher of
user's choice but uses the RegexpMatcher by default. It will contribute
the PatternValidator script for javascript validation when enabled and
will allow users to override this with a custom implementation
5. New Enum PATTERN_MISMATCH added to ValidationConstraint
6. New message "pattern-not-matched={0} does not fulfill the required
pattern {1}." added to ValidationString.properties
The following tests have been added:
1. TestRegexpMatcher enhanced with tests for contains and
getEscapedPatternString
2. New TestCase class TestPatternValidator added
Please vote.
Thanks,
Harish
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
[Result] Re: [VOTE] for PatternValidator
Posted by Harish Krishnaswamy <hk...@comcast.net>.
Howard Lewis Ship: +1
Erik Hatcher: +1
David Solis: +1
Geoff Longman: +1
Richard Lewis-Shell: +1
Harish Krishnaswamy: +1
MindBridge: +0 (No Vote)
Tsvetelin Saykov: +0 (No Vote)
Neil Clayton: +0 (No Vote)
I think that warrants a commit. I shall commit it over the weekend. So what needs to be updated on a commit, "What's New" page?
-Harish
Harish Krishnaswamy wrote:
> Hi,
>
> The pattern validator entails the following changes:
>
> 1. Added methods contains() and getEscapedPatternString() to
> RegexpMatcher
> 2. New interface PatternDelegate, implementations of which will handle
> pattern matching for the PatternValidator
> 3. New script PatternValidator.script, script specification for
> pattern validation in javascript
> 4. New class PatternValidator that will allow a pattern matcher of
> user's choice but uses the RegexpMatcher by default. It will
> contribute the PatternValidator script for javascript validation when
> enabled and will allow users to override this with a custom
> implementation
> 5. New Enum PATTERN_MISMATCH added to ValidationConstraint
> 6. New message "pattern-not-matched={0} does not fulfill the required
> pattern {1}." added to ValidationString.properties
>
> The following tests have been added:
>
> 1. TestRegexpMatcher enhanced with tests for contains and
> getEscapedPatternString
> 2. New TestCase class TestPatternValidator added
>
> Please vote.
>
> Thanks,
> Harish
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Re: [VOTE] for PatternValidator
Posted by Richard Lewis-Shell <rl...@mac.com>.
Richard Lewis-Shell: +1
Harish Krishnaswamy wrote:
> Hi,
>
> The pattern validator entails the following changes:
>
> 1. Added methods contains() and getEscapedPatternString() to RegexpMatcher
> 2. New interface PatternDelegate, implementations of which will handle
> pattern matching for the PatternValidator
> 3. New script PatternValidator.script, script specification for pattern
> validation in javascript
> 4. New class PatternValidator that will allow a pattern matcher of
> user's choice but uses the RegexpMatcher by default. It will contribute
> the PatternValidator script for javascript validation when enabled and
> will allow users to override this with a custom implementation
> 5. New Enum PATTERN_MISMATCH added to ValidationConstraint
> 6. New message "pattern-not-matched={0} does not fulfill the required
> pattern {1}." added to ValidationString.properties
>
> The following tests have been added:
>
> 1. TestRegexpMatcher enhanced with tests for contains and
> getEscapedPatternString
> 2. New TestCase class TestPatternValidator added
>
> Please vote.
>
> Thanks,
> Harish
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Re: It is annoying that Form's getLink() is private
Posted by Colin Sampaleanu <co...@exis.com>.
I'm not clear on how implementing my own IForm interface wouldn't be a
lot more work (and in fact how I would use it). So if I can subclass
Form and override ILink, all I have to add to it is this:
public abstract String getActionOverride();
private ILink getLink(IRequestCycle cycle, String actionId)
{
if (getActionOverride() != null)
return new StaticLink(getActionOverride());
return super.getLink(cycle, actionId);
}
then I create a new .jwc file which is a copy of the Form.jwc but adds:
<parameter name="actionOverride"
type="java.lang.String"
required="no"
direction="in">
<description>
Provides an override to set the action link directly. Used mainly
for j_security_check.
</description>
</parameter>
and that's it (this raises the question, btw, if you can extend an
existing .jwc file, which would be even simpler, but I presume that's
not possible).
As for the input field names, j_username and j_password, they are set on
the actual template html and the .page file for the login page, that has
nothing to do with the Form component.
I actually have this working, but unfortunately I've had to completely
copy the contents of Form and make a whole new class, since I couldn't
override getLink().
In any case, I think there is enough of a case for allowing the action
to be overriden on the standard Form and pointing somewhere else other
than into Tapestry, so that you can use it as an output only mechanism
(as far as Tapestry is concerned). You can then take advantage of the
richer rendering and client-side Javascript, etc...
Regards,
Colin
Howard M. Lewis Ship wrote:
>You could create your own implementation of the IForm interface.
>
>Don't you need to name the input fields specially for j_security_check?
>
>--
>Howard M. Lewis Ship
>Creator, Tapestry: Java Web Components
>http://jakarta.apache.org/tapestry
>http://jakarta.apache.org/commons/sandbox/hivemind/
>http://javatapestry.blogspot.com
>
>
>
>>-----Original Message-----
>>From: Colin Sampaleanu [mailto:colinml1@exis.com]
>>Sent: Tuesday, September 23, 2003 4:14 PM
>>To: Tapestry development
>>Subject: It is annoying that Form's getLink() is private
>>
>>
>>I want to make a subclass of Form which allows the developer
>>to specify
>>the value of the html form element's 'action' attribute
>>directly. This
>>is so that I can can create a login form for j2ee container
>>authentication and still use Tapestry's Form class and
>>components like
>>ValidField to output the form to the page. If I do not subclass Form,
>>then I have no control over the contents of the 'action'
>>link. I need to
>>set the action link to '.../j_security_check'.
>>
>>Is there any chance getLink() in Form could be made protected
>>instead of
>>private?
>>
>>Optionally, Form could be modifed to have an optional new property
>>called 'actionoverride'. If it exists, then getLink() would
>>build a link
>>from that. This is what I was planning to do in my subclass of Form
>>actually.
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
RE: It is annoying that Form's getLink() is private
Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
You could create your own implementation of the IForm interface.
Don't you need to name the input fields specially for j_security_check?
--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com
> -----Original Message-----
> From: Colin Sampaleanu [mailto:colinml1@exis.com]
> Sent: Tuesday, September 23, 2003 4:14 PM
> To: Tapestry development
> Subject: It is annoying that Form's getLink() is private
>
>
> I want to make a subclass of Form which allows the developer
> to specify
> the value of the html form element's 'action' attribute
> directly. This
> is so that I can can create a login form for j2ee container
> authentication and still use Tapestry's Form class and
> components like
> ValidField to output the form to the page. If I do not subclass Form,
> then I have no control over the contents of the 'action'
> link. I need to
> set the action link to '.../j_security_check'.
>
> Is there any chance getLink() in Form could be made protected
> instead of
> private?
>
> Optionally, Form could be modifed to have an optional new property
> called 'actionoverride'. If it exists, then getLink() would
> build a link
> from that. This is what I was planning to do in my subclass of Form
> actually.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
It is annoying that Form's getLink() is private
Posted by Colin Sampaleanu <co...@exis.com>.
I want to make a subclass of Form which allows the developer to specify
the value of the html form element's 'action' attribute directly. This
is so that I can can create a login form for j2ee container
authentication and still use Tapestry's Form class and components like
ValidField to output the form to the page. If I do not subclass Form,
then I have no control over the contents of the 'action' link. I need to
set the action link to '.../j_security_check'.
Is there any chance getLink() in Form could be made protected instead of
private?
Optionally, Form could be modifed to have an optional new property
called 'actionoverride'. If it exists, then getLink() would build a link
from that. This is what I was planning to do in my subclass of Form
actually.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Re: [VOTE] for PatternValidator
Posted by Geoff Longman <gl...@intelligentworks.com>.
+1
Geoff Longman
----- Original Message -----
From: "Harish Krishnaswamy" <hk...@comcast.net>
To: "Tapestry development" <ta...@jakarta.apache.org>
Sent: Tuesday, September 23, 2003 12:43 AM
Subject: [VOTE] for PatternValidator
> Hi,
>
> The pattern validator entails the following changes:
>
> 1. Added methods contains() and getEscapedPatternString() to RegexpMatcher
> 2. New interface PatternDelegate, implementations of which will handle
> pattern matching for the PatternValidator
> 3. New script PatternValidator.script, script specification for pattern
> validation in javascript
> 4. New class PatternValidator that will allow a pattern matcher of
> user's choice but uses the RegexpMatcher by default. It will contribute
> the PatternValidator script for javascript validation when enabled and
> will allow users to override this with a custom implementation
> 5. New Enum PATTERN_MISMATCH added to ValidationConstraint
> 6. New message "pattern-not-matched={0} does not fulfill the required
> pattern {1}." added to ValidationString.properties
>
> The following tests have been added:
>
> 1. TestRegexpMatcher enhanced with tests for contains and
> getEscapedPatternString
> 2. New TestCase class TestPatternValidator added
>
> Please vote.
>
> Thanks,
> Harish
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Re: Autocomplete textboxes
Posted by Colin Sampaleanu <co...@exis.com>.
In my tests, it works in Mozilla (probably any version, but I tried
Windows), and IE Windows.
Erik Hatcher wrote:
> didn't seem to work for either Safari or IE on Mac OS X.
>
>
> On Tuesday, September 23, 2003, at 10:13 AM, Colin Sampaleanu wrote:
>
>> This might be sweet to get into Tapestry. Lot's of browser specifc
>> JavaScript (no real other way to do it), but it would of course all
>> be hidden from the Tapestry developer.
>>
>> http://simon.incutio.com/code/js/autocomplete/
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Re: Autocomplete textboxes
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
didn't seem to work for either Safari or IE on Mac OS X.
On Tuesday, September 23, 2003, at 10:13 AM, Colin Sampaleanu wrote:
> This might be sweet to get into Tapestry. Lot's of browser specifc
> JavaScript (no real other way to do it), but it would of course all be
> hidden from the Tapestry developer.
>
> http://simon.incutio.com/code/js/autocomplete/
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Autocomplete textboxes
Posted by Colin Sampaleanu <co...@exis.com>.
This might be sweet to get into Tapestry. Lot's of browser specifc
JavaScript (no real other way to do it), but it would of course all be
hidden from the Tapestry developer.
http://simon.incutio.com/code/js/autocomplete/
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Re: [VOTE] for PatternValidator
Posted by Harish Krishnaswamy <hk...@comcast.net>.
I shall take a look.
-Harish
Erik Hatcher wrote:
> +1
>
> I've done some work with Commons Validator in the e-mail address
> validation error and its a bit more complex than just a simple regex
> match though. Check the test cases for that code to see the examples
> it tries.
>
> Erik
>
> On Tuesday, September 23, 2003, at 12:43 AM, Harish Krishnaswamy wrote:
>
>> Hi,
>>
>> The pattern validator entails the following changes:
>>
>> 1. Added methods contains() and getEscapedPatternString() to
>> RegexpMatcher
>> 2. New interface PatternDelegate, implementations of which will
>> handle pattern matching for the PatternValidator
>> 3. New script PatternValidator.script, script specification for
>> pattern validation in javascript
>> 4. New class PatternValidator that will allow a pattern matcher of
>> user's choice but uses the RegexpMatcher by default. It will
>> contribute the PatternValidator script for javascript validation when
>> enabled and will allow users to override this with a custom
>> implementation
>> 5. New Enum PATTERN_MISMATCH added to ValidationConstraint
>> 6. New message "pattern-not-matched={0} does not fulfill the required
>> pattern {1}." added to ValidationString.properties
>>
>> The following tests have been added:
>>
>> 1. TestRegexpMatcher enhanced with tests for contains and
>> getEscapedPatternString
>> 2. New TestCase class TestPatternValidator added
>>
>> Please vote.
>>
>> Thanks,
>> Harish
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Re: [VOTE] for PatternValidator
Posted by Harish Krishnaswamy <hk...@comcast.net>.
Just took a look at the EmailValidator and its test cases in commons, I
am certainly not a Regexp expert and so I don't see why those special
characters cannot be expressed as regular expressions. Also
PatternValidator is a generic pattern validator that can be supplemented
with special pattern matchers for specific instances as previously
mentioned. Let me know what you think.
-Harish
Erik Hatcher wrote:
> +1
>
> I've done some work with Commons Validator in the e-mail address
> validation error and its a bit more complex than just a simple regex
> match though. Check the test cases for that code to see the examples
> it tries.
>
> Erik
>
> On Tuesday, September 23, 2003, at 12:43 AM, Harish Krishnaswamy wrote:
>
>> Hi,
>>
>> The pattern validator entails the following changes:
>>
>> 1. Added methods contains() and getEscapedPatternString() to
>> RegexpMatcher
>> 2. New interface PatternDelegate, implementations of which will
>> handle pattern matching for the PatternValidator
>> 3. New script PatternValidator.script, script specification for
>> pattern validation in javascript
>> 4. New class PatternValidator that will allow a pattern matcher of
>> user's choice but uses the RegexpMatcher by default. It will
>> contribute the PatternValidator script for javascript validation when
>> enabled and will allow users to override this with a custom
>> implementation
>> 5. New Enum PATTERN_MISMATCH added to ValidationConstraint
>> 6. New message "pattern-not-matched={0} does not fulfill the required
>> pattern {1}." added to ValidationString.properties
>>
>> The following tests have been added:
>>
>> 1. TestRegexpMatcher enhanced with tests for contains and
>> getEscapedPatternString
>> 2. New TestCase class TestPatternValidator added
>>
>> Please vote.
>>
>> Thanks,
>> Harish
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Re: [VOTE] for PatternValidator
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
+1
I've done some work with Commons Validator in the e-mail address
validation error and its a bit more complex than just a simple regex
match though. Check the test cases for that code to see the examples
it tries.
Erik
On Tuesday, September 23, 2003, at 12:43 AM, Harish Krishnaswamy wrote:
> Hi,
>
> The pattern validator entails the following changes:
>
> 1. Added methods contains() and getEscapedPatternString() to
> RegexpMatcher
> 2. New interface PatternDelegate, implementations of which will handle
> pattern matching for the PatternValidator
> 3. New script PatternValidator.script, script specification for
> pattern validation in javascript
> 4. New class PatternValidator that will allow a pattern matcher of
> user's choice but uses the RegexpMatcher by default. It will
> contribute the PatternValidator script for javascript validation when
> enabled and will allow users to override this with a custom
> implementation
> 5. New Enum PATTERN_MISMATCH added to ValidationConstraint
> 6. New message "pattern-not-matched={0} does not fulfill the required
> pattern {1}." added to ValidationString.properties
>
> The following tests have been added:
>
> 1. TestRegexpMatcher enhanced with tests for contains and
> getEscapedPatternString
> 2. New TestCase class TestPatternValidator added
>
> Please vote.
>
> Thanks,
> Harish
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
RE: [VOTE] for PatternValidator
Posted by David Solis <ds...@legosoft.com.mx>.
David Solis: +1
> -----Original Message-----
> From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net]
> Sent: Monday, September 22, 2003 11:43 PM
> To: Tapestry development
> Subject: [VOTE] for PatternValidator
>
> Hi,
>
> The pattern validator entails the following changes:
>
> 1. Added methods contains() and getEscapedPatternString() to
RegexpMatcher
> 2. New interface PatternDelegate, implementations of which will handle
> pattern matching for the PatternValidator
> 3. New script PatternValidator.script, script specification for
pattern
> validation in javascript
> 4. New class PatternValidator that will allow a pattern matcher of
> user's choice but uses the RegexpMatcher by default. It will
contribute
> the PatternValidator script for javascript validation when enabled and
> will allow users to override this with a custom implementation
> 5. New Enum PATTERN_MISMATCH added to ValidationConstraint
> 6. New message "pattern-not-matched={0} does not fulfill the required
> pattern {1}." added to ValidationString.properties
>
> The following tests have been added:
>
> 1. TestRegexpMatcher enhanced with tests for contains and
> getEscapedPatternString
> 2. New TestCase class TestPatternValidator added
>
> Please vote.
>
> Thanks,
> Harish
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
RE: [VOTE] for PatternValidator
Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Howard Lewis Ship: +1
--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com
> -----Original Message-----
> From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net]
> Sent: Tuesday, September 23, 2003 12:43 AM
> To: Tapestry development
> Subject: [VOTE] for PatternValidator
>
>
> Hi,
>
> The pattern validator entails the following changes:
>
> 1. Added methods contains() and getEscapedPatternString() to
> RegexpMatcher 2. New interface PatternDelegate,
> implementations of which will handle
> pattern matching for the PatternValidator
> 3. New script PatternValidator.script, script specification
> for pattern
> validation in javascript
> 4. New class PatternValidator that will allow a pattern matcher of
> user's choice but uses the RegexpMatcher by default. It will
> contribute
> the PatternValidator script for javascript validation when
> enabled and
> will allow users to override this with a custom
> implementation 5. New Enum PATTERN_MISMATCH added to
> ValidationConstraint 6. New message "pattern-not-matched={0}
> does not fulfill the required
> pattern {1}." added to ValidationString.properties
>
> The following tests have been added:
>
> 1. TestRegexpMatcher enhanced with tests for contains and
> getEscapedPatternString
> 2. New TestCase class TestPatternValidator added
>
> Please vote.
>
> Thanks,
> Harish
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org