Jon Stevens wrote:
> 
> so, how are you doing with your code? could you please check in some of what
> you have so that we can all watch you develop? thx.
> 
> -jon


I just checked in the code I have been working on to help retrieve data
from the request.  I have given it the name intake (as in the input to a
turbine, feel free to help with the name.)  It follows the pattern given
in torque.  So you specify the inputs to your application in an xml
file, and then source code is generated which can be used by your
application.

To try it out (similar to standalone torque):

from build: ./build-turbine.sh intake

cd to ../bin/intake/intake
./intake.sh

then since the current examples are from Scarab go to

output/org/tigris/scarab/inputs and look at the generated files.


Note that this is very alpha code and will probably change considerably
as I try to use it in an application, but if you want to help here is
the basic idea:

1.  Use bean-like objects in your actions and templates to process form
parameters and to generate form field names.

2.  These objects can perform some basic input validation such as
maximum length, maximum value, or a regular expression match.  (the mask
uses jakarta-regexp)  As well as checking for the presence of other
parameters from the same group that might be required with a particular
parameter.

3.  Error messages are attached to the specific input.  (This was a
limitation of the current action arrangement where the action only
supplies a general information message.)

4.  So in your template you will use something like

#if ($obj1.isDescriptionSet() && !obj1.isDescriptionValid())
    <font color="red">$obj1.DescriptionMessage</font>
#end
<input type="text" name="$obj1.DescriptionKey"
value="$!obj1.Description">

Then in an action you would would have something like:

Vector inputs1 = InputObject1.getObjects(data.getParameters());
InputObject1 obj = (InputObject1) inputs1.get(0);
if (obj.isDescriptionValid())
{
...
        data.setTemplate(data.getParameters().getString("nextTemplate");
}

John McNally


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to