Howard,
The API is a Composite Pattern of State Machines.  A connection is loaded from 
an XML file.  At that point it is passed to the top level state machine.  Each 
state populates itself and if necessary it creates child state machines and 
they populate themselves.  Each State has an associated View which is a 
Tapestry Component.  As the user progresses through the GUI/State Machines, the 
States display themselves using their Tapestry Component.  There is a Tapestry 
Page called Frame that displays the current Tapestry Component.

When I load a connection, I call the top level error checking method and it 
walks the composite pattern looking for any errors.  We pass along a 
ValidationDelegate which gets populated:

public void appendErrors(ValidationDelegate delegate, BaseComponent component)

If an error is found:
delegate.setFormComponent(null);
delegate.record(getMessage("Connection_id_in_use"), 
ValidationConstraint.REQUIRED);

When we are done, we have a list of errors all through the connection.  We then 
walk down to where the error occurred and display the component and the errors 
found.

The problem with Validators, at least in 3.x is I have no way execute them as 
they are part of a component at the .jwc level and not the .java level.

HTH,

regards,

Mark

Mark J. Stang
Senior Engineer/Architect
office: +1 303.468.2900
mobile: +1 303.507.2833
Ping Identity



-----Original Message-----
From: Howard Lewis Ship [mailto:[EMAIL PROTECTED]
Sent: Mon 1/29/2007 10:20 AM
To: Tapestry development
Subject: Re: T5:
 
What does the API for a connection look like?

So ... you want to iterate over all the pages of the applilcation, and
over all the components of those pages, looking for a specific type of
component?

Interestingly, that's now much more possible than in T4.  The caseless
URL stuff works by building a master index of all the page and
component classes at startup, this could give us the ability to
identify the names of all the pages (or anyway, all the potential
pages).

I'd appreciate more information, however. If this can be identified as
a valid and universal use case, it may be possible to let the
framework do the heavy lifting, by providing a way to annotate the
methods of the components that need to be referenced.

One of my many goals for T5 is to ensure that Tapestry doesn't get in your way.

On 1/29/07, Mark Stang <[EMAIL PROTECTED]> wrote:
> Howard, et. al.,
> I am not quite sure how to request this.  In Tapestry 3.0x, I don't use the 
> Tapestry Validation.  I create what we call a connection.  At times, I need 
> to, programmatically, check the connection for errors.  I do this by asking 
> all of the parts of a component if they have any errors.  The problem with 
> validators has been that they only get called by Tapestry.  How could I tell 
> Tapestry to walk all of my pages/components and validate them?  Which brings 
> up the issue of they don't exist except in pools until they are displayed.  
> So, the only way to "activate" them is to display every page and have it 
> rendered.
>
> Thoughts?
>
> thanks,
>
> Mark
>
> Mark J. Stang
> Senior Engineer/Architect
> office: +1 303.468.2900
> mobile: +1 303.507.2833
> Ping Identity
>
>
>
> -----Original Message-----
> From: Howard Lewis Ship [mailto:[EMAIL PROTECTED]
> Sent: Sun 1/28/2007 10:18 PM
> To: Tapestry development
> Subject: Re: T5:
>
> On 1/28/07, Ted Steen <[EMAIL PROTECTED]> wrote:
> > It is really nice to be able to do input validation declarative for
> > the simple, and most common case, and in onValidate() programmatically
> > perform the more complex validation.
> >
>
> And that is the intention!
>
> Also, the ability to just ask the Form to record errors simplifies the
> code signficantly. You almost never need to think about the
> ValidationTracker object (which is a persistent field of the Form
> component).
>
> --
> Howard M. Lewis Ship
> TWD Consulting, Inc.
> Independent J2EE / Open-Source Java Consultant
> Creator and PMC Chair, Apache Tapestry
> Creator, Apache HiveMind
>
> Professional Tapestry training, mentoring, support
> and project work.  http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>


-- 
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to