You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Mark Stang <ms...@pingidentity.com> on 2007/01/29 18:40:29 UTC

Programmitically calling validations in T5 (was RE: T5:)

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:hlship@gmail.com]
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 <ms...@pingidentity.com> 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:hlship@gmail.com]
> Sent: Sun 1/28/2007 10:18 PM
> To: Tapestry development
> Subject: Re: T5:
>
> On 1/28/07, Ted Steen <te...@gmail.com> 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: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>
>
>


-- 
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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org



Re: T5: Brandable

Posted by Jesse Kuhnert <jk...@gmail.com>.
I guess I was hinting at the possibility that your different
components aren't defining different behavior so much as they are
defining different resources. (ie property keys / images / etc) If the
actual behavior is different then please ignore...If it's only the
resources that change then I think my observation would still stand..

Though I was speaking from a T4 point of view (not wanting anyone to
think I knew for sure when I don't), from what I've read of T5
everything is much the same in terms of possible functionality /
flexibility with internal tapestry services. (only better / easier /
etc of course)

On 1/29/07, Mark Stang <ms...@pingidentity.com> wrote:
> Jesse,
> The problem wasn't the internals it was how a "library" was defined in the .application file.
>
> I have a component that is say a Support component.  It describes the running Server.  The information in that Component is not just straight HTML, it is other Tapestry Components.  For instance, we put a copyright on the bottom.  For our product it says our company name.  For the OEM version, it says something else.  Now I could go through my entire application and put if "if/else" where ever there is a difference, but how do I go back and maintain them in the future?  Tapestry is based on Components!  Or what if I want to add another OEM partner, do I now have to go back and put in if/else/else?  Tapestry is based on Components!  So, I create two components, how do I tell it which one to use?  I am not going to put in if/else all I should have to do is use a different library.  How do I do that?  The only way is to keep the name the same but have a different location for the .library an d its pieces.  Which means I have to either change the .application file or I have to put out a "bogus" .library file that gets replaced in a build.
>
> What I would like to see happen in T5 is for me not to have to specify in the .application file the location of the .libraries, I would like to have it read each .jar and if it has a .library file, then it is a library.  The problem there is how do we determine the "name" of the library?  For instance, I use "@branded:PingLogo", how does it associate "branded" with a particular .library file?  Either use the name of the .library file or come up with some mechanism for it to determine it automatically.  I don't know, but having to hard-code it in a .application file caused me a lot of grief.  We know create a .library file for each branding and then parse it to generate a .library that has the correct path to the components.
>
> I have a working version based on T3.  Converting to T4 from T3 and then to T5 is to much work.  Therefore, we will either switch to T5 if I can make it work, or abandon it and move to something else.
>
> regards,
>
> Nark
>
>
> Mark J. Stang
> Senior Engineer/Architect
> office: +1 303.468.2900
> mobile: +1 303.507.2833
> Ping Identity
>
>
>
> -----Original Message-----
> From: Jesse Kuhnert [mailto:jkuhnert@gmail.com]
> Sent: Mon 1/29/2007 6:15 PM
> To: Tapestry development
> Subject: Re: T5: Brandable
>
> Looking at it from a t4 viewpoint of services / etc I can't imagine
> this isn't do-able in some way other than having to generate
> .application files and drop in jars. (unless the jars only contain
> resources)
>
> Of course you and Howard know more, just throwing in the idea that you
> have a ~lot~ more access to how the internal works than you did in
> t3..
>
> On 1/29/07, Mark Stang <ms...@pingidentity.com> wrote:
> > Howard,
> > We ship two versions of our product.  The first is a Ping Identity version, says Ping Identity/PingFederate all over it.  The other version is "branded" for our OEM customer to re-sell.  In T3, in order to do this I have two jar files to implement this.  Each is a Tapestry Library.
> >
> > When I have a "branded" component I do something like this:
> >
> >    <span jwcid="@branded:HeaderLogo"/>
> >
> > However, I have had to create hacks to work-around issues like the .application file.  I have a Library refence:
> >
> > <library id="branded" specification-path="/com/pingidentity/component/branded/Branded.library"/>
> >
> > And then I generate a "Branded.library" for each release and copy to the above location.
> >
> > 1 <!DOCTYPE library-specification PUBLIC "-//Apache Software Foundation//Tapestry Specification 3.0//EN" "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd"><library-specification>
> >  2   <library id="common" specification-path="/com/pingidentity/component/common/PingCommon.library"/>
> >  3   <component-type type="About" specification-path="ping/About.jwc"/>
> >  4   <component-type type="Licensing" specification-path="ping/Licensing.jwc"/>
> >  5   <component-type type="HeaderLogo" specification-path="ping/HeaderLogo.jwc"/>
> >  6   <component-type type="LoginHeader" specification-path="ping/LoginHeader.jwc"/>
> >  7   <component-type type="Support" specification-path="ping/Support.jwc"/>
> >  8   <component-type type="Welcome" specification-path="ping/Welcome.jwc"/>
> >  9   <component-type type="AdditionalResources" specification-path="ping/AdditionalResources.jwc"/>
> > 10   <component-type type="PingLogo" specification-path="ping/PingLogo.jwc"/>
> > 11   <component-type type="ConnectionLimit" specification-path="ping/ConnectionLimit.jwc"/>
> > 12   <component-type type="AdditionalAdapters" specification-path="ping/AdditionalAdapters.jwc"/>
> > 13 </library-specification>
> >
> >
> > What I would like in T5 is some support for being able to "brand" components.
> >
> > thanks,
> >
> > Mark
> >
> > Mark J. Stang
> > Senior Engineer/Architect
> > office: +1 303.468.2900
> > mobile: +1 303.507.2833
> > Ping Identity
> >
> >
> >
>
>
> --
> Jesse Kuhnert
> Tapestry/Dojo team member/developer
>
> Open source based consulting work centered around
> dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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


RE: T5: Brandable

Posted by Mark Stang <ms...@pingidentity.com>.
Jesse,
The problem wasn't the internals it was how a "library" was defined in the .application file.

I have a component that is say a Support component.  It describes the running Server.  The information in that Component is not just straight HTML, it is other Tapestry Components.  For instance, we put a copyright on the bottom.  For our product it says our company name.  For the OEM version, it says something else.  Now I could go through my entire application and put if "if/else" where ever there is a difference, but how do I go back and maintain them in the future?  Tapestry is based on Components!  Or what if I want to add another OEM partner, do I now have to go back and put in if/else/else?  Tapestry is based on Components!  So, I create two components, how do I tell it which one to use?  I am not going to put in if/else all I should have to do is use a different library.  How do I do that?  The only way is to keep the name the same but have a different location for the .library an d its pieces.  Which means I have to either change the .application file or I have to put out a "bogus" .library file that gets replaced in a build.

What I would like to see happen in T5 is for me not to have to specify in the .application file the location of the .libraries, I would like to have it read each .jar and if it has a .library file, then it is a library.  The problem there is how do we determine the "name" of the library?  For instance, I use "@branded:PingLogo", how does it associate "branded" with a particular .library file?  Either use the name of the .library file or come up with some mechanism for it to determine it automatically.  I don't know, but having to hard-code it in a .application file caused me a lot of grief.  We know create a .library file for each branding and then parse it to generate a .library that has the correct path to the components.

I have a working version based on T3.  Converting to T4 from T3 and then to T5 is to much work.  Therefore, we will either switch to T5 if I can make it work, or abandon it and move to something else.

regards,

Nark


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



-----Original Message-----
From: Jesse Kuhnert [mailto:jkuhnert@gmail.com]
Sent: Mon 1/29/2007 6:15 PM
To: Tapestry development
Subject: Re: T5: Brandable
 
Looking at it from a t4 viewpoint of services / etc I can't imagine
this isn't do-able in some way other than having to generate
.application files and drop in jars. (unless the jars only contain
resources)

Of course you and Howard know more, just throwing in the idea that you
have a ~lot~ more access to how the internal works than you did in
t3..

On 1/29/07, Mark Stang <ms...@pingidentity.com> wrote:
> Howard,
> We ship two versions of our product.  The first is a Ping Identity version, says Ping Identity/PingFederate all over it.  The other version is "branded" for our OEM customer to re-sell.  In T3, in order to do this I have two jar files to implement this.  Each is a Tapestry Library.
>
> When I have a "branded" component I do something like this:
>
>    <span jwcid="@branded:HeaderLogo"/>
>
> However, I have had to create hacks to work-around issues like the .application file.  I have a Library refence:
>
> <library id="branded" specification-path="/com/pingidentity/component/branded/Branded.library"/>
>
> And then I generate a "Branded.library" for each release and copy to the above location.
>
> 1 <!DOCTYPE library-specification PUBLIC "-//Apache Software Foundation//Tapestry Specification 3.0//EN" "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd"><library-specification>
>  2   <library id="common" specification-path="/com/pingidentity/component/common/PingCommon.library"/>
>  3   <component-type type="About" specification-path="ping/About.jwc"/>
>  4   <component-type type="Licensing" specification-path="ping/Licensing.jwc"/>
>  5   <component-type type="HeaderLogo" specification-path="ping/HeaderLogo.jwc"/>
>  6   <component-type type="LoginHeader" specification-path="ping/LoginHeader.jwc"/>
>  7   <component-type type="Support" specification-path="ping/Support.jwc"/>
>  8   <component-type type="Welcome" specification-path="ping/Welcome.jwc"/>
>  9   <component-type type="AdditionalResources" specification-path="ping/AdditionalResources.jwc"/>
> 10   <component-type type="PingLogo" specification-path="ping/PingLogo.jwc"/>
> 11   <component-type type="ConnectionLimit" specification-path="ping/ConnectionLimit.jwc"/>
> 12   <component-type type="AdditionalAdapters" specification-path="ping/AdditionalAdapters.jwc"/>
> 13 </library-specification>
>
>
> What I would like in T5 is some support for being able to "brand" components.
>
> thanks,
>
> Mark
>
> Mark J. Stang
> Senior Engineer/Architect
> office: +1 303.468.2900
> mobile: +1 303.507.2833
> Ping Identity
>
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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



Re: T5: Brandable

Posted by Jesse Kuhnert <jk...@gmail.com>.
Looking at it from a t4 viewpoint of services / etc I can't imagine
this isn't do-able in some way other than having to generate
.application files and drop in jars. (unless the jars only contain
resources)

Of course you and Howard know more, just throwing in the idea that you
have a ~lot~ more access to how the internal works than you did in
t3..

On 1/29/07, Mark Stang <ms...@pingidentity.com> wrote:
> Howard,
> We ship two versions of our product.  The first is a Ping Identity version, says Ping Identity/PingFederate all over it.  The other version is "branded" for our OEM customer to re-sell.  In T3, in order to do this I have two jar files to implement this.  Each is a Tapestry Library.
>
> When I have a "branded" component I do something like this:
>
>    <span jwcid="@branded:HeaderLogo"/>
>
> However, I have had to create hacks to work-around issues like the .application file.  I have a Library refence:
>
> <library id="branded" specification-path="/com/pingidentity/component/branded/Branded.library"/>
>
> And then I generate a "Branded.library" for each release and copy to the above location.
>
> 1 <!DOCTYPE library-specification PUBLIC "-//Apache Software Foundation//Tapestry Specification 3.0//EN" "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd"><library-specification>
>  2   <library id="common" specification-path="/com/pingidentity/component/common/PingCommon.library"/>
>  3   <component-type type="About" specification-path="ping/About.jwc"/>
>  4   <component-type type="Licensing" specification-path="ping/Licensing.jwc"/>
>  5   <component-type type="HeaderLogo" specification-path="ping/HeaderLogo.jwc"/>
>  6   <component-type type="LoginHeader" specification-path="ping/LoginHeader.jwc"/>
>  7   <component-type type="Support" specification-path="ping/Support.jwc"/>
>  8   <component-type type="Welcome" specification-path="ping/Welcome.jwc"/>
>  9   <component-type type="AdditionalResources" specification-path="ping/AdditionalResources.jwc"/>
> 10   <component-type type="PingLogo" specification-path="ping/PingLogo.jwc"/>
> 11   <component-type type="ConnectionLimit" specification-path="ping/ConnectionLimit.jwc"/>
> 12   <component-type type="AdditionalAdapters" specification-path="ping/AdditionalAdapters.jwc"/>
> 13 </library-specification>
>
>
> What I would like in T5 is some support for being able to "brand" components.
>
> thanks,
>
> Mark
>
> Mark J. Stang
> Senior Engineer/Architect
> office: +1 303.468.2900
> mobile: +1 303.507.2833
> Ping Identity
>
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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


Re: T5: Brandable

Posted by Howard Lewis Ship <hl...@gmail.com>.
I don't know that it would be too different, perhaps:

<t:comp type="branded/HeaderLogo"/>

And the trick will be to mount only a single "branded" library.

On 1/29/07, Mark Stang <ms...@pingidentity.com> wrote:
> Howard,
> We ship two versions of our product.  The first is a Ping Identity version, says Ping Identity/PingFederate all over it.  The other version is "branded" for our OEM customer to re-sell.  In T3, in order to do this I have two jar files to implement this.  Each is a Tapestry Library.
>
> When I have a "branded" component I do something like this:
>
>    <span jwcid="@branded:HeaderLogo"/>
>
> However, I have had to create hacks to work-around issues like the .application file.  I have a Library refence:
>
> <library id="branded" specification-path="/com/pingidentity/component/branded/Branded.library"/>
>
> And then I generate a "Branded.library" for each release and copy to the above location.
>
> 1 <!DOCTYPE library-specification PUBLIC "-//Apache Software Foundation//Tapestry Specification 3.0//EN" "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd"><library-specification>
>  2   <library id="common" specification-path="/com/pingidentity/component/common/PingCommon.library"/>
>  3   <component-type type="About" specification-path="ping/About.jwc"/>
>  4   <component-type type="Licensing" specification-path="ping/Licensing.jwc"/>
>  5   <component-type type="HeaderLogo" specification-path="ping/HeaderLogo.jwc"/>
>  6   <component-type type="LoginHeader" specification-path="ping/LoginHeader.jwc"/>
>  7   <component-type type="Support" specification-path="ping/Support.jwc"/>
>  8   <component-type type="Welcome" specification-path="ping/Welcome.jwc"/>
>  9   <component-type type="AdditionalResources" specification-path="ping/AdditionalResources.jwc"/>
> 10   <component-type type="PingLogo" specification-path="ping/PingLogo.jwc"/>
> 11   <component-type type="ConnectionLimit" specification-path="ping/ConnectionLimit.jwc"/>
> 12   <component-type type="AdditionalAdapters" specification-path="ping/AdditionalAdapters.jwc"/>
> 13 </library-specification>
>
>
> What I would like in T5 is some support for being able to "brand" components.
>
> thanks,
>
> Mark
>
> Mark J. Stang
> Senior Engineer/Architect
> office: +1 303.468.2900
> mobile: +1 303.507.2833
> Ping Identity
>
>
>


-- 
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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


T5: Brandable

Posted by Mark Stang <ms...@pingidentity.com>.
Howard,
We ship two versions of our product.  The first is a Ping Identity version, says Ping Identity/PingFederate all over it.  The other version is "branded" for our OEM customer to re-sell.  In T3, in order to do this I have two jar files to implement this.  Each is a Tapestry Library.  

When I have a "branded" component I do something like this:

   <span jwcid="@branded:HeaderLogo"/>

However, I have had to create hacks to work-around issues like the .application file.  I have a Library refence:

<library id="branded" specification-path="/com/pingidentity/component/branded/Branded.library"/>

And then I generate a "Branded.library" for each release and copy to the above location.

1 <!DOCTYPE library-specification PUBLIC "-//Apache Software Foundation//Tapestry Specification 3.0//EN" "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd"><library-specification>
 2   <library id="common" specification-path="/com/pingidentity/component/common/PingCommon.library"/>
 3   <component-type type="About" specification-path="ping/About.jwc"/>
 4   <component-type type="Licensing" specification-path="ping/Licensing.jwc"/>
 5   <component-type type="HeaderLogo" specification-path="ping/HeaderLogo.jwc"/>
 6   <component-type type="LoginHeader" specification-path="ping/LoginHeader.jwc"/>
 7   <component-type type="Support" specification-path="ping/Support.jwc"/>
 8   <component-type type="Welcome" specification-path="ping/Welcome.jwc"/>
 9   <component-type type="AdditionalResources" specification-path="ping/AdditionalResources.jwc"/>
10   <component-type type="PingLogo" specification-path="ping/PingLogo.jwc"/>
11   <component-type type="ConnectionLimit" specification-path="ping/ConnectionLimit.jwc"/>
12   <component-type type="AdditionalAdapters" specification-path="ping/AdditionalAdapters.jwc"/>
13 </library-specification>


What I would like in T5 is some support for being able to "brand" components.

thanks,

Mark

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


RE: Programmitically calling validations in T5 (was RE: T5:)

Posted by Mark Stang <ms...@pingidentity.com>.
Currently, I "get" my component to display from a "holder" page that has all of my components inside of it (about 150).  Then on the "Frame" page I tell it which component to display, it is the one that matches the current state.  My Frame page has a component:

<span jwcid="@common:CardRenderer"/>

This one "renders" the component that corresponds to the current state.  The CardRenderer is implemented as:

public abstract class CardRenderer
extends AbstractComponent
{
    protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
    {
        Tasklet tasklet = ((Visit)getPage().getVisit()).getCurrentTasklet();
        TaskletState ts = (TaskletState)tasklet.getCurrentState();
        String pageForCard = ts.getPageName();
        IPage cardPage = cycle.getPage(pageForCard);
        String cardName = tasklet.getCurrentState().getStateName();
        BaseComponent component = (BaseComponent)cardPage.getComponent(cardName);
        if (component instanceof PageRenderListener)
        {
            IPage page = component.getPage();
            page.beginPageRender();
        }
        component.render(writer, cycle);
    }
}

So, as long as I can do something similar in T5 I can convert.  If not, I have to re-think T5 or how to implement it.

My real question is how do I, in a T5 manner, access a validation?  In T3, it is implemented in a .jwc and so until it is rendered it doesn't exist with data.

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:hlship@gmail.com]
Sent: Mon 1/29/2007 10:59 AM
To: Tapestry development
Subject: Re: Programmitically calling validations in T5 (was RE: T5:)
 
So the real issue is how do you wire together the connection and the
view (the Tapestry component).  It's very hard for me to say how this
scheme will change during an upgrade from T3 to T5.

On 1/29/07, Mark Stang <ms...@pingidentity.com> wrote:
> 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:hlship@gmail.com]
> 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 <ms...@pingidentity.com> 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:hlship@gmail.com]
> > Sent: Sun 1/28/2007 10:18 PM
> > To: Tapestry development
> > Subject: Re: T5:
> >
> > On 1/28/07, Ted Steen <te...@gmail.com> 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: dev-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: dev-help@tapestry.apache.org
> >
> >
> >
> >
>
>
> --
> 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: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>
>
>


-- 
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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org



Re: Programmitically calling validations in T5 (was RE: T5:)

Posted by Howard Lewis Ship <hl...@gmail.com>.
So the real issue is how do you wire together the connection and the
view (the Tapestry component).  It's very hard for me to say how this
scheme will change during an upgrade from T3 to T5.

On 1/29/07, Mark Stang <ms...@pingidentity.com> wrote:
> 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:hlship@gmail.com]
> 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 <ms...@pingidentity.com> 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:hlship@gmail.com]
> > Sent: Sun 1/28/2007 10:18 PM
> > To: Tapestry development
> > Subject: Re: T5:
> >
> > On 1/28/07, Ted Steen <te...@gmail.com> 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: dev-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: dev-help@tapestry.apache.org
> >
> >
> >
> >
>
>
> --
> 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: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>
>
>


-- 
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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org