Back in March, :( , I send a small proposal for doing
a method of input verification that is tied into
Peer generation. After a few threads of conversion, it was
okay'd to submit.. life got crazy and I never did commit it.
So I just want to review what I want to do so that people
know what my intentions are.
>From an api point of view I want to do this:
InputValidator iv = peer.getInputValidator(SomeColumn);
if ( iv.isValid(input)) {
}
else {
}
The implementaion is really lightweight and handles a majority
of form validation needs (for me anyway).
Note this is not at all meant to subplant intake, just to
provide an alternative mechanism. If you use intake, your
code will not be blotted by this at all.
Now the only hook into turbine is the following:
change the database.dtd
-----------------------
add one extra attribute to the column:
verificationClass CDATA #IMPLIED
e.g.
<column name="email" required="true" size="25" type="VARCHAR"
verificationClass="org.apache.turbine.om.input.email" />
change Column.java
----------------
get/set Methods for verficationClass
change BasePeer.java
--------------------
Add the Methods
getInputVerifier(String columnName)
setInputVerifier(String columnName, String className)
change Peer.vm
--------------
to make use of it all during Peer generation
add om.inputValidator package (or is there a more appropriate place?)
------------------------------
// here's the interface for an InputVerifier
public boolean isValid(String input);
public void checkInput(String value) throws FormInputException;
public String getErrorMessage(String input);
public String getJavaScript();
public String getExpectedFormat();
mike
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]