You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Thomas UNG <th...@freesbee.fr> on 2007/01/19 19:28:07 UTC

Turbine architechture - some suggestions for intake

Hi all,

The goal of this email is to have your thoughts on the intake tool
improvement suggestions:

1. Extend rules with custom java class So we will have the following in
the xml file:

<field name="password" ..>
  <rule name="extend"
        value="org.turbine.rules.XYZ">system.form.field.mandatory</rule>
</field>

and implement an interface that receives RunData/ServerData, the field
name and the intake group as parameters.

2. The intake tool is commonly known for field validation based on
implementated rules. But it is also great to use it to render
automatically UI forms. For instance, a 'LoginGrp' group is created in
the intake.xml file, the screen class extends an 'Engine' and generates
automatically the form fields described in the intake file and put the
result in the context. (see an example in the attached file). This works
partially for me, there are some missing pieces:

A UI field is composed of
  - a field such as an input (type text, radio, checkbox), an selection,
 textarea ... (1)
  - a field name (handles by the 'displayName' attribute in intake.xml)
  - a warning message when rules are not met (intake rule's content)
  - a hint message to help the user to fill the field  (2)

(1) can we introduce a new attribute in 'group's field' called
'mapToWidgetObject' and 'mapToWidgetObject'?

for a text field, we ll have something like:

<field name="password"
mapToWidgetObject="org.turbine.service.intake.widget.passwordfield"  ..>

the org.turbine.service.intake.widget.passwordfield widget will have the
responsability to render the ui

(2) can we introduce a new attribute in 'group's field' called
'displayHint'?

e.g.
<field name="username" displayName="system.basic.username"
displayHint="system.basic.username.hint" ...>

So below is my wishes list for 2007,
Happy new year to everyone,
Thomas


Re: Turbine architechture - some suggestions for intake

Posted by Thomas Vandahl <tv...@apache.org>.
Thomas UNG wrote:
> 1. Extend rules with custom java class So we will have the following in
> the xml file:
> 
> <field name="password" ..>
>   <rule name="extend"
>         value="org.turbine.rules.XYZ">system.form.field.mandatory</rule>
> </field>
Custom validators are possible already. With them, you can introduce any
rule you like. I'd rather replace the existing validators with the ones
from commons-validator and make the interfaces compatible.

> and implement an interface that receives RunData/ServerData, the field
> name and the intake group as parameters.
What for?

> 2. The intake tool is commonly known for field validation based on
> implementated rules. But it is also great to use it to render
> automatically UI forms. For instance, a 'LoginGrp' group is created in
> the intake.xml file, the screen class extends an 'Engine' and generates
> automatically the form fields described in the intake file and put the
> result in the context. (see an example in the attached file). This works
> partially for me, there are some missing pieces:
This is where Velocity macros shine. Like so:

#macro (intakeTextField $ref)
<input type="text" if($ref.isRequired())class="required"#end
  maxlength="$ref.MaxSize" size="$ref.displaySize" name="$ref.Key"
  id="$ref.Key" value="$!ref.HTMLString" />
#intakeMessage($ref)
#end

> <field name="password"
> mapToWidgetObject="org.turbine.service.intake.widget.passwordfield"  ..>
This is nice for programmers but very difficult for web designers. IMO,
this is not what the MVC concept is about.

> (2) can we introduce a new attribute in 'group's field' called
> 'displayHint'?
> 
> e.g.
> <field name="username" displayName="system.basic.username"
> displayHint="system.basic.username.hint" ...>

In Torque, we just introduced generic options in the XML schema. Maybe I
want to make sure a certain class or event handler or whatever is
attached to a certain field. With a generic concept like this, you can
add whatever you want, be it MVC or not.

> import com.bobo.tools.DojoTool;

Could I have a look at this thingy?

Bye, Thomas.


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org