You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Howard Lewis Ship <hl...@gmail.com> on 2010/12/20 22:36:38 UTC
Re: svn commit: r1051293 - in /tapestry/tapestry5/trunk/tapestry-core/src:
main/java/org/apache/tapestry5/corelib/components/ test/app1/ test/conf/
test/java/org/apache/tapestry5/integration/app1/ test/java/org/apache/tapestry5/integration/app1/pages
I think it is time to update the version numbers for trunk to 5.3.0-SNAPSHOT
On Mon, Dec 20, 2010 at 1:12 PM, <da...@apache.org> wrote:
> Author: dadams
> Date: Mon Dec 20 21:12:29 2010
> New Revision: 1051293
>
> URL: http://svn.apache.org/viewvc?rev=1051293&view=rev
> Log:
> (closed TAP5-1378) Allow Delegate component to be used for creating
> in-template components
>
> Added:
> tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
>
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
> Modified:
>
> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
> tapestry/tapestry5/trunk/tapestry-core/src/test/conf/ (props changed)
>
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
>
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
>
> Modified:
> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
> URL:
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java?rev=1051293&r1=1051292&r2=1051293&view=diff
>
> ==============================================================================
> ---
> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
> (original)
> +++
> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
> Mon Dec 20 21:12:29 2010
> @@ -15,12 +15,25 @@
> package org.apache.tapestry5.corelib.components;
>
> import org.apache.tapestry5.Block;
> +import org.apache.tapestry5.ComponentResources;
> +import org.apache.tapestry5.annotations.InjectContainer;
> import org.apache.tapestry5.annotations.Parameter;
> +import org.apache.tapestry5.annotations.SupportsInformalParameters;
> +import org.apache.tapestry5.ioc.annotations.Inject;
> +import org.apache.tapestry5.runtime.Component;
>
> /**
> * A component that does not do any rendering of its own, but will delegate
> to some other object that can do rendering.
> * This other object may be a component or a {@link Block} (among other
> things).
> + * <p>
> + * This component may also be used to create inline components. For each
> informal parameter the value will be stored as a
> + * render variable. To create an inline component, create a block
> + * and use Delegate multiple times in the template to render the block
> passing parameters to Delegate. In the block body
> + * reference the render variables using the "var:" binding prefix and the
> name of the parameter.
> + * <p>
> + * Note that the default binding prefix for parameter values is "literal".
> */
> +@SupportsInformalParameters
> public class Delegate
> {
> /**
> @@ -30,8 +43,16 @@ public class Delegate
> @Parameter(required = true)
> private Object to;
>
> - Object beginRender()
> - {
> + @Inject private ComponentResources resources;
> + @InjectContainer private Component container;
> +
> + Object beginRender()
> + {
> + for(String name : resources.getInformalParameterNames()) {
> + Object value = resources.getInformalParameter(name,
> Object.class);
> + container.getComponentResources().storeRenderVariable(name,
> value);
> + }
> +
> return to;
> }
> }
>
> Added:
> tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
> URL:
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml?rev=1051293&view=auto
>
> ==============================================================================
> --- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
> (added)
> +++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
> Mon Dec 20 21:12:29 2010
> @@ -0,0 +1,11 @@
> +<t:border xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
> xmlns:p="tapestry:parameter">
> + <h1>Inline Components using Delegate</h1>
> +
> + <t:delegate to="block:block1" />
> + <t:delegate to="block:block2" firstName="Steve" lastName="Rogers"
> />
> + <t:delegate to="block:block2" firstName="Bruce" lastName="Banner"
> />
> +
> + <t:block id="block1"><span id="block1">block 1</span></t:block>
> + <t:block id="block2"><p class="superhero">${var:firstName}
> ${var:lastName}</p></t:block>
> +</t:border>
> +
>
> Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/conf/
>
> ------------------------------------------------------------------------------
> --- svn:ignore (added)
> +++ svn:ignore Mon Dec 20 21:12:29 2010
> @@ -0,0 +1 @@
> +testng-custom.xml
>
> Modified:
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
> URL:
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java?rev=1051293&r1=1051292&r2=1051293&view=diff
>
> ==============================================================================
> ---
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
> (original)
> +++
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
> Mon Dec 20 21:12:29 2010
> @@ -81,4 +81,16 @@ public class GeneralComponentTests exten
>
> assertText("//td[@class='t-location-content t-location-current']",
> "<t:unavailablecomponent/>");
> }
> +
> + /** TAP5-1378 */
> + @Test public void using_delegate_for_inline_components() {
> + clickThru("Inline Delegate");
> +
> + // no params
> + assertText("block1", "block 1");
> +
> + // multiple renders w/ multiple parameters
> + assertText("xpath=(//p[@class='superhero'])[1]", "Steve Rogers");
> + assertText("xpath=(//p[@class='superhero'])[2]", "Bruce Banner");
> + }
> }
>
> Added:
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
> URL:
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java?rev=1051293&view=auto
>
> ==============================================================================
> ---
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
> (added)
> +++
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
> Mon Dec 20 21:12:29 2010
> @@ -0,0 +1,19 @@
> +// Copyright 2006, 2007, 2008, 2009, 2010 The Apache Software Foundation
> +//
> +// Licensed under the Apache License, Version 2.0 (the "License");
> +// you may not use this file except in compliance with the License.
> +// You may obtain a copy of the License at
> +//
> +// http://www.apache.org/licenses/LICENSE-2.0
> +//
> +// Unless required by applicable law or agreed to in writing, software
> +// distributed under the License is distributed on an "AS IS" BASIS,
> +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> +// See the License for the specific language governing permissions and
> +// limitations under the License.
> +
> +package org.apache.tapestry5.integration.app1.pages;
> +
> +public class DelegateInline {
> +
> +}
>
> Modified:
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
> URL:
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java?rev=1051293&r1=1051292&r2=1051293&view=diff
>
> ==============================================================================
> ---
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
> (original)
> +++
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
> Mon Dec 20 21:12:29 2010
> @@ -356,6 +356,8 @@ public class Index
> "Actions can exist on pages other than the
> active page, via Blocks."),
>
> new Item("unlessdemo", "Unless Demo", "use of the
> Unless component"),
> +
> + new Item("delegateinline", "Inline Delegate", "Using
> the delegate component to create inline components"),
>
> new Item("MagicValueEncoder", "Magic ValueEncoder
> Demo",
> "Automatic creation of ValueEncoder using the
> TypeCoercer"),
>
>
>
--
Howard M. Lewis Ship
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to learn
how I can get you up and productive in Tapestry fast!
(971) 678-5210
http://howardlewisship.com
Re: svn commit: r1051293 - in /tapestry/tapestry5/trunk/tapestry-core/src:
main/java/org/apache/tapestry5/corelib/components/ test/app1/ test/conf/
test/java/org/apache/tapestry5/integration/app1/ test/java/org/apache/tapestry5/integration/app1/pages
Posted by Howard Lewis Ship <hl...@gmail.com>.
It is valid, but I'd prefer that you update the version numbers in trunk to
5.3.0-SNAPSHOT and be sure to include appropriate @since JavaDoc
annotations.
My plate is pretty full on other stuff, and I'm personally trying to focus
on documentation (the rest of the tutorial, for starters) when I have the
cycles.
On Mon, Dec 20, 2010 at 3:23 PM, Dan Adams <mr...@gmail.com> wrote:
> Hey guys. Sorry if I checked this is at the wrong point in the cycle. I
> have
> a commit I'm about to do for TAP-742 (component rendering tracing). It
> should be totally backward compatible though.
>
> On Mon, Dec 20, 2010 at 5:19 PM, Howard Lewis Ship <hl...@gmail.com>
> wrote:
>
> > Your always free to commit whatever you like. I do hope the emphasis
> will
> > stay on documentation for the next few weeks, however. That's what I
> intend
> > to do, before launching into active 5.3 development.
> >
> > On Mon, Dec 20, 2010 at 1:58 PM, Josh Canfield <joshcanfield@gmail.com
> > >wrote:
> >
> > > Cool. I'd love to start checking in generics support. Does this mean
> > > I'm free to do that?
> > >
> > > On Mon, Dec 20, 2010 at 1:36 PM, Howard Lewis Ship <hl...@gmail.com>
> > > wrote:
> > > > I think it is time to update the version numbers for trunk to
> > > 5.3.0-SNAPSHOT
> > > >
> > > > On Mon, Dec 20, 2010 at 1:12 PM, <da...@apache.org> wrote:
> > > >
> > > >> Author: dadams
> > > >> Date: Mon Dec 20 21:12:29 2010
> > > >> New Revision: 1051293
> > > >>
> > > >> URL: http://svn.apache.org/viewvc?rev=1051293&view=rev
> > > >> Log:
> > > >> (closed TAP5-1378) Allow Delegate component to be used for creating
> > > >> in-template components
> > > >>
> > > >> Added:
> > > >>
> > >
> tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
> > > >>
> > > >>
> > >
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
> > > >> Modified:
> > > >>
> > > >>
> > >
> >
> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
> > > >> tapestry/tapestry5/trunk/tapestry-core/src/test/conf/ (props
> > > changed)
> > > >>
> > > >>
> > >
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
> > > >>
> > > >>
> > >
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
> > > >>
> > > >> Modified:
> > > >>
> > >
> >
> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
> > > >> URL:
> > > >>
> > >
> >
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java?rev=1051293&r1=1051292&r2=1051293&view=diff
> > > >>
> > > >>
> > >
> >
> ==============================================================================
> > > >> ---
> > > >>
> > >
> >
> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
> > > >> (original)
> > > >> +++
> > > >>
> > >
> >
> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
> > > >> Mon Dec 20 21:12:29 2010
> > > >> @@ -15,12 +15,25 @@
> > > >> package org.apache.tapestry5.corelib.components;
> > > >>
> > > >> import org.apache.tapestry5.Block;
> > > >> +import org.apache.tapestry5.ComponentResources;
> > > >> +import org.apache.tapestry5.annotations.InjectContainer;
> > > >> import org.apache.tapestry5.annotations.Parameter;
> > > >> +import org.apache.tapestry5.annotations.SupportsInformalParameters;
> > > >> +import org.apache.tapestry5.ioc.annotations.Inject;
> > > >> +import org.apache.tapestry5.runtime.Component;
> > > >>
> > > >> /**
> > > >> * A component that does not do any rendering of its own, but will
> > > delegate
> > > >> to some other object that can do rendering.
> > > >> * This other object may be a component or a {@link Block} (among
> > other
> > > >> things).
> > > >> + * <p>
> > > >> + * This component may also be used to create inline components. For
> > > each
> > > >> informal parameter the value will be stored as a
> > > >> + * render variable. To create an inline component, create a block
> > > >> + * and use Delegate multiple times in the template to render the
> > block
> > > >> passing parameters to Delegate. In the block body
> > > >> + * reference the render variables using the "var:" binding prefix
> and
> > > the
> > > >> name of the parameter.
> > > >> + * <p>
> > > >> + * Note that the default binding prefix for parameter values is
> > > "literal".
> > > >> */
> > > >> +@SupportsInformalParameters
> > > >> public class Delegate
> > > >> {
> > > >> /**
> > > >> @@ -30,8 +43,16 @@ public class Delegate
> > > >> @Parameter(required = true)
> > > >> private Object to;
> > > >>
> > > >> - Object beginRender()
> > > >> - {
> > > >> + @Inject private ComponentResources resources;
> > > >> + @InjectContainer private Component container;
> > > >> +
> > > >> + Object beginRender()
> > > >> + {
> > > >> + for(String name : resources.getInformalParameterNames()) {
> > > >> + Object value = resources.getInformalParameter(name,
> > > >> Object.class);
> > > >> +
> > > container.getComponentResources().storeRenderVariable(name,
> > > >> value);
> > > >> + }
> > > >> +
> > > >> return to;
> > > >> }
> > > >> }
> > > >>
> > > >> Added:
> > > >>
> > tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
> > > >> URL:
> > > >>
> > >
> >
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml?rev=1051293&view=auto
> > > >>
> > > >>
> > >
> >
> ==============================================================================
> > > >> ---
> > > tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
> > > >> (added)
> > > >> +++
> > > tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
> > > >> Mon Dec 20 21:12:29 2010
> > > >> @@ -0,0 +1,11 @@
> > > >> +<t:border xmlns:t="
> > > http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
> > > >> xmlns:p="tapestry:parameter">
> > > >> + <h1>Inline Components using Delegate</h1>
> > > >> +
> > > >> + <t:delegate to="block:block1" />
> > > >> + <t:delegate to="block:block2" firstName="Steve"
> > > lastName="Rogers"
> > > >> />
> > > >> + <t:delegate to="block:block2" firstName="Bruce"
> > > lastName="Banner"
> > > >> />
> > > >> +
> > > >> + <t:block id="block1"><span id="block1">block
> > 1</span></t:block>
> > > >> + <t:block id="block2"><p class="superhero">${var:firstName}
> > > >> ${var:lastName}</p></t:block>
> > > >> +</t:border>
> > > >> +
> > > >>
> > > >> Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/conf/
> > > >>
> > > >>
> > >
> >
> ------------------------------------------------------------------------------
> > > >> --- svn:ignore (added)
> > > >> +++ svn:ignore Mon Dec 20 21:12:29 2010
> > > >> @@ -0,0 +1 @@
> > > >> +testng-custom.xml
> > > >>
> > > >> Modified:
> > > >>
> > >
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
> > > >> URL:
> > > >>
> > >
> >
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java?rev=1051293&r1=1051292&r2=1051293&view=diff
> > > >>
> > > >>
> > >
> >
> ==============================================================================
> > > >> ---
> > > >>
> > >
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
> > > >> (original)
> > > >> +++
> > > >>
> > >
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
> > > >> Mon Dec 20 21:12:29 2010
> > > >> @@ -81,4 +81,16 @@ public class GeneralComponentTests exten
> > > >>
> > > >> assertText("//td[@class='t-location-content
> > > t-location-current']",
> > > >> "<t:unavailablecomponent/>");
> > > >> }
> > > >> +
> > > >> + /** TAP5-1378 */
> > > >> + @Test public void using_delegate_for_inline_components() {
> > > >> + clickThru("Inline Delegate");
> > > >> +
> > > >> + // no params
> > > >> + assertText("block1", "block 1");
> > > >> +
> > > >> + // multiple renders w/ multiple parameters
> > > >> + assertText("xpath=(//p[@class='superhero'])[1]", "Steve
> > > Rogers");
> > > >> + assertText("xpath=(//p[@class='superhero'])[2]", "Bruce
> > > Banner");
> > > >> + }
> > > >> }
> > > >>
> > > >> Added:
> > > >>
> > >
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
> > > >> URL:
> > > >>
> > >
> >
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java?rev=1051293&view=auto
> > > >>
> > > >>
> > >
> >
> ==============================================================================
> > > >> ---
> > > >>
> > >
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
> > > >> (added)
> > > >> +++
> > > >>
> > >
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
> > > >> Mon Dec 20 21:12:29 2010
> > > >> @@ -0,0 +1,19 @@
> > > >> +// Copyright 2006, 2007, 2008, 2009, 2010 The Apache Software
> > > Foundation
> > > >> +//
> > > >> +// Licensed under the Apache License, Version 2.0 (the "License");
> > > >> +// you may not use this file except in compliance with the License.
> > > >> +// You may obtain a copy of the License at
> > > >> +//
> > > >> +// http://www.apache.org/licenses/LICENSE-2.0
> > > >> +//
> > > >> +// Unless required by applicable law or agreed to in writing,
> > software
> > > >> +// distributed under the License is distributed on an "AS IS"
> BASIS,
> > > >> +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> > > >> implied.
> > > >> +// See the License for the specific language governing permissions
> > and
> > > >> +// limitations under the License.
> > > >> +
> > > >> +package org.apache.tapestry5.integration.app1.pages;
> > > >> +
> > > >> +public class DelegateInline {
> > > >> +
> > > >> +}
> > > >>
> > > >> Modified:
> > > >>
> > >
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
> > > >> URL:
> > > >>
> > >
> >
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java?rev=1051293&r1=1051292&r2=1051293&view=diff
> > > >>
> > > >>
> > >
> >
> ==============================================================================
> > > >> ---
> > > >>
> > >
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
> > > >> (original)
> > > >> +++
> > > >>
> > >
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
> > > >> Mon Dec 20 21:12:29 2010
> > > >> @@ -356,6 +356,8 @@ public class Index
> > > >> "Actions can exist on pages other than
> the
> > > >> active page, via Blocks."),
> > > >>
> > > >> new Item("unlessdemo", "Unless Demo", "use of
> the
> > > >> Unless component"),
> > > >> +
> > > >> + new Item("delegateinline", "Inline Delegate",
> > > "Using
> > > >> the delegate component to create inline components"),
> > > >>
> > > >> new Item("MagicValueEncoder", "Magic
> ValueEncoder
> > > >> Demo",
> > > >> "Automatic creation of ValueEncoder
> using
> > > the
> > > >> TypeCoercer"),
> > > >>
> > > >>
> > > >>
> > > >
> > > >
> > > > --
> > > > Howard M. Lewis Ship
> > > >
> > > > Creator of Apache Tapestry
> > > >
> > > > The source for Tapestry training, mentoring and support. Contact me
> to
> > > learn
> > > > how I can get you up and productive in Tapestry fast!
> > > >
> > > > (971) 678-5210
> > > > 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
> >
> > Creator of Apache Tapestry
> >
> > The source for Tapestry training, mentoring and support. Contact me to
> > learn
> > how I can get you up and productive in Tapestry fast!
> >
> > (971) 678-5210
> > http://howardlewisship.com
> >
>
--
Howard M. Lewis Ship
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to learn
how I can get you up and productive in Tapestry fast!
(971) 678-5210
http://howardlewisship.com
Re: svn commit: r1051293 - in /tapestry/tapestry5/trunk/tapestry-core/src:
main/java/org/apache/tapestry5/corelib/components/ test/app1/ test/conf/
test/java/org/apache/tapestry5/integration/app1/ test/java/org/apache/tapestry5/integration/app1/pages
Posted by Dan Adams <mr...@gmail.com>.
Hey guys. Sorry if I checked this is at the wrong point in the cycle. I have
a commit I'm about to do for TAP-742 (component rendering tracing). It
should be totally backward compatible though.
On Mon, Dec 20, 2010 at 5:19 PM, Howard Lewis Ship <hl...@gmail.com> wrote:
> Your always free to commit whatever you like. I do hope the emphasis will
> stay on documentation for the next few weeks, however. That's what I intend
> to do, before launching into active 5.3 development.
>
> On Mon, Dec 20, 2010 at 1:58 PM, Josh Canfield <joshcanfield@gmail.com
> >wrote:
>
> > Cool. I'd love to start checking in generics support. Does this mean
> > I'm free to do that?
> >
> > On Mon, Dec 20, 2010 at 1:36 PM, Howard Lewis Ship <hl...@gmail.com>
> > wrote:
> > > I think it is time to update the version numbers for trunk to
> > 5.3.0-SNAPSHOT
> > >
> > > On Mon, Dec 20, 2010 at 1:12 PM, <da...@apache.org> wrote:
> > >
> > >> Author: dadams
> > >> Date: Mon Dec 20 21:12:29 2010
> > >> New Revision: 1051293
> > >>
> > >> URL: http://svn.apache.org/viewvc?rev=1051293&view=rev
> > >> Log:
> > >> (closed TAP5-1378) Allow Delegate component to be used for creating
> > >> in-template components
> > >>
> > >> Added:
> > >>
> > tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
> > >>
> > >>
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
> > >> Modified:
> > >>
> > >>
> >
> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
> > >> tapestry/tapestry5/trunk/tapestry-core/src/test/conf/ (props
> > changed)
> > >>
> > >>
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
> > >>
> > >>
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
> > >>
> > >> Modified:
> > >>
> >
> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
> > >> URL:
> > >>
> >
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java?rev=1051293&r1=1051292&r2=1051293&view=diff
> > >>
> > >>
> >
> ==============================================================================
> > >> ---
> > >>
> >
> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
> > >> (original)
> > >> +++
> > >>
> >
> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
> > >> Mon Dec 20 21:12:29 2010
> > >> @@ -15,12 +15,25 @@
> > >> package org.apache.tapestry5.corelib.components;
> > >>
> > >> import org.apache.tapestry5.Block;
> > >> +import org.apache.tapestry5.ComponentResources;
> > >> +import org.apache.tapestry5.annotations.InjectContainer;
> > >> import org.apache.tapestry5.annotations.Parameter;
> > >> +import org.apache.tapestry5.annotations.SupportsInformalParameters;
> > >> +import org.apache.tapestry5.ioc.annotations.Inject;
> > >> +import org.apache.tapestry5.runtime.Component;
> > >>
> > >> /**
> > >> * A component that does not do any rendering of its own, but will
> > delegate
> > >> to some other object that can do rendering.
> > >> * This other object may be a component or a {@link Block} (among
> other
> > >> things).
> > >> + * <p>
> > >> + * This component may also be used to create inline components. For
> > each
> > >> informal parameter the value will be stored as a
> > >> + * render variable. To create an inline component, create a block
> > >> + * and use Delegate multiple times in the template to render the
> block
> > >> passing parameters to Delegate. In the block body
> > >> + * reference the render variables using the "var:" binding prefix and
> > the
> > >> name of the parameter.
> > >> + * <p>
> > >> + * Note that the default binding prefix for parameter values is
> > "literal".
> > >> */
> > >> +@SupportsInformalParameters
> > >> public class Delegate
> > >> {
> > >> /**
> > >> @@ -30,8 +43,16 @@ public class Delegate
> > >> @Parameter(required = true)
> > >> private Object to;
> > >>
> > >> - Object beginRender()
> > >> - {
> > >> + @Inject private ComponentResources resources;
> > >> + @InjectContainer private Component container;
> > >> +
> > >> + Object beginRender()
> > >> + {
> > >> + for(String name : resources.getInformalParameterNames()) {
> > >> + Object value = resources.getInformalParameter(name,
> > >> Object.class);
> > >> +
> > container.getComponentResources().storeRenderVariable(name,
> > >> value);
> > >> + }
> > >> +
> > >> return to;
> > >> }
> > >> }
> > >>
> > >> Added:
> > >>
> tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
> > >> URL:
> > >>
> >
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml?rev=1051293&view=auto
> > >>
> > >>
> >
> ==============================================================================
> > >> ---
> > tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
> > >> (added)
> > >> +++
> > tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
> > >> Mon Dec 20 21:12:29 2010
> > >> @@ -0,0 +1,11 @@
> > >> +<t:border xmlns:t="
> > http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
> > >> xmlns:p="tapestry:parameter">
> > >> + <h1>Inline Components using Delegate</h1>
> > >> +
> > >> + <t:delegate to="block:block1" />
> > >> + <t:delegate to="block:block2" firstName="Steve"
> > lastName="Rogers"
> > >> />
> > >> + <t:delegate to="block:block2" firstName="Bruce"
> > lastName="Banner"
> > >> />
> > >> +
> > >> + <t:block id="block1"><span id="block1">block
> 1</span></t:block>
> > >> + <t:block id="block2"><p class="superhero">${var:firstName}
> > >> ${var:lastName}</p></t:block>
> > >> +</t:border>
> > >> +
> > >>
> > >> Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/conf/
> > >>
> > >>
> >
> ------------------------------------------------------------------------------
> > >> --- svn:ignore (added)
> > >> +++ svn:ignore Mon Dec 20 21:12:29 2010
> > >> @@ -0,0 +1 @@
> > >> +testng-custom.xml
> > >>
> > >> Modified:
> > >>
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
> > >> URL:
> > >>
> >
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java?rev=1051293&r1=1051292&r2=1051293&view=diff
> > >>
> > >>
> >
> ==============================================================================
> > >> ---
> > >>
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
> > >> (original)
> > >> +++
> > >>
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
> > >> Mon Dec 20 21:12:29 2010
> > >> @@ -81,4 +81,16 @@ public class GeneralComponentTests exten
> > >>
> > >> assertText("//td[@class='t-location-content
> > t-location-current']",
> > >> "<t:unavailablecomponent/>");
> > >> }
> > >> +
> > >> + /** TAP5-1378 */
> > >> + @Test public void using_delegate_for_inline_components() {
> > >> + clickThru("Inline Delegate");
> > >> +
> > >> + // no params
> > >> + assertText("block1", "block 1");
> > >> +
> > >> + // multiple renders w/ multiple parameters
> > >> + assertText("xpath=(//p[@class='superhero'])[1]", "Steve
> > Rogers");
> > >> + assertText("xpath=(//p[@class='superhero'])[2]", "Bruce
> > Banner");
> > >> + }
> > >> }
> > >>
> > >> Added:
> > >>
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
> > >> URL:
> > >>
> >
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java?rev=1051293&view=auto
> > >>
> > >>
> >
> ==============================================================================
> > >> ---
> > >>
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
> > >> (added)
> > >> +++
> > >>
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
> > >> Mon Dec 20 21:12:29 2010
> > >> @@ -0,0 +1,19 @@
> > >> +// Copyright 2006, 2007, 2008, 2009, 2010 The Apache Software
> > Foundation
> > >> +//
> > >> +// Licensed under the Apache License, Version 2.0 (the "License");
> > >> +// you may not use this file except in compliance with the License.
> > >> +// You may obtain a copy of the License at
> > >> +//
> > >> +// http://www.apache.org/licenses/LICENSE-2.0
> > >> +//
> > >> +// Unless required by applicable law or agreed to in writing,
> software
> > >> +// distributed under the License is distributed on an "AS IS" BASIS,
> > >> +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> > >> implied.
> > >> +// See the License for the specific language governing permissions
> and
> > >> +// limitations under the License.
> > >> +
> > >> +package org.apache.tapestry5.integration.app1.pages;
> > >> +
> > >> +public class DelegateInline {
> > >> +
> > >> +}
> > >>
> > >> Modified:
> > >>
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
> > >> URL:
> > >>
> >
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java?rev=1051293&r1=1051292&r2=1051293&view=diff
> > >>
> > >>
> >
> ==============================================================================
> > >> ---
> > >>
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
> > >> (original)
> > >> +++
> > >>
> >
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
> > >> Mon Dec 20 21:12:29 2010
> > >> @@ -356,6 +356,8 @@ public class Index
> > >> "Actions can exist on pages other than the
> > >> active page, via Blocks."),
> > >>
> > >> new Item("unlessdemo", "Unless Demo", "use of the
> > >> Unless component"),
> > >> +
> > >> + new Item("delegateinline", "Inline Delegate",
> > "Using
> > >> the delegate component to create inline components"),
> > >>
> > >> new Item("MagicValueEncoder", "Magic ValueEncoder
> > >> Demo",
> > >> "Automatic creation of ValueEncoder using
> > the
> > >> TypeCoercer"),
> > >>
> > >>
> > >>
> > >
> > >
> > > --
> > > Howard M. Lewis Ship
> > >
> > > Creator of Apache Tapestry
> > >
> > > The source for Tapestry training, mentoring and support. Contact me to
> > learn
> > > how I can get you up and productive in Tapestry fast!
> > >
> > > (971) 678-5210
> > > 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
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn
> how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
Re: svn commit: r1051293 - in /tapestry/tapestry5/trunk/tapestry-core/src:
main/java/org/apache/tapestry5/corelib/components/ test/app1/ test/conf/
test/java/org/apache/tapestry5/integration/app1/ test/java/org/apache/tapestry5/integration/app1/pages
Posted by Howard Lewis Ship <hl...@gmail.com>.
Your always free to commit whatever you like. I do hope the emphasis will
stay on documentation for the next few weeks, however. That's what I intend
to do, before launching into active 5.3 development.
On Mon, Dec 20, 2010 at 1:58 PM, Josh Canfield <jo...@gmail.com>wrote:
> Cool. I'd love to start checking in generics support. Does this mean
> I'm free to do that?
>
> On Mon, Dec 20, 2010 at 1:36 PM, Howard Lewis Ship <hl...@gmail.com>
> wrote:
> > I think it is time to update the version numbers for trunk to
> 5.3.0-SNAPSHOT
> >
> > On Mon, Dec 20, 2010 at 1:12 PM, <da...@apache.org> wrote:
> >
> >> Author: dadams
> >> Date: Mon Dec 20 21:12:29 2010
> >> New Revision: 1051293
> >>
> >> URL: http://svn.apache.org/viewvc?rev=1051293&view=rev
> >> Log:
> >> (closed TAP5-1378) Allow Delegate component to be used for creating
> >> in-template components
> >>
> >> Added:
> >>
> tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
> >>
> >>
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
> >> Modified:
> >>
> >>
> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
> >> tapestry/tapestry5/trunk/tapestry-core/src/test/conf/ (props
> changed)
> >>
> >>
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
> >>
> >>
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
> >>
> >> Modified:
> >>
> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
> >> URL:
> >>
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java?rev=1051293&r1=1051292&r2=1051293&view=diff
> >>
> >>
> ==============================================================================
> >> ---
> >>
> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
> >> (original)
> >> +++
> >>
> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
> >> Mon Dec 20 21:12:29 2010
> >> @@ -15,12 +15,25 @@
> >> package org.apache.tapestry5.corelib.components;
> >>
> >> import org.apache.tapestry5.Block;
> >> +import org.apache.tapestry5.ComponentResources;
> >> +import org.apache.tapestry5.annotations.InjectContainer;
> >> import org.apache.tapestry5.annotations.Parameter;
> >> +import org.apache.tapestry5.annotations.SupportsInformalParameters;
> >> +import org.apache.tapestry5.ioc.annotations.Inject;
> >> +import org.apache.tapestry5.runtime.Component;
> >>
> >> /**
> >> * A component that does not do any rendering of its own, but will
> delegate
> >> to some other object that can do rendering.
> >> * This other object may be a component or a {@link Block} (among other
> >> things).
> >> + * <p>
> >> + * This component may also be used to create inline components. For
> each
> >> informal parameter the value will be stored as a
> >> + * render variable. To create an inline component, create a block
> >> + * and use Delegate multiple times in the template to render the block
> >> passing parameters to Delegate. In the block body
> >> + * reference the render variables using the "var:" binding prefix and
> the
> >> name of the parameter.
> >> + * <p>
> >> + * Note that the default binding prefix for parameter values is
> "literal".
> >> */
> >> +@SupportsInformalParameters
> >> public class Delegate
> >> {
> >> /**
> >> @@ -30,8 +43,16 @@ public class Delegate
> >> @Parameter(required = true)
> >> private Object to;
> >>
> >> - Object beginRender()
> >> - {
> >> + @Inject private ComponentResources resources;
> >> + @InjectContainer private Component container;
> >> +
> >> + Object beginRender()
> >> + {
> >> + for(String name : resources.getInformalParameterNames()) {
> >> + Object value = resources.getInformalParameter(name,
> >> Object.class);
> >> +
> container.getComponentResources().storeRenderVariable(name,
> >> value);
> >> + }
> >> +
> >> return to;
> >> }
> >> }
> >>
> >> Added:
> >> tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
> >> URL:
> >>
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml?rev=1051293&view=auto
> >>
> >>
> ==============================================================================
> >> ---
> tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
> >> (added)
> >> +++
> tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
> >> Mon Dec 20 21:12:29 2010
> >> @@ -0,0 +1,11 @@
> >> +<t:border xmlns:t="
> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
> >> xmlns:p="tapestry:parameter">
> >> + <h1>Inline Components using Delegate</h1>
> >> +
> >> + <t:delegate to="block:block1" />
> >> + <t:delegate to="block:block2" firstName="Steve"
> lastName="Rogers"
> >> />
> >> + <t:delegate to="block:block2" firstName="Bruce"
> lastName="Banner"
> >> />
> >> +
> >> + <t:block id="block1"><span id="block1">block 1</span></t:block>
> >> + <t:block id="block2"><p class="superhero">${var:firstName}
> >> ${var:lastName}</p></t:block>
> >> +</t:border>
> >> +
> >>
> >> Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/conf/
> >>
> >>
> ------------------------------------------------------------------------------
> >> --- svn:ignore (added)
> >> +++ svn:ignore Mon Dec 20 21:12:29 2010
> >> @@ -0,0 +1 @@
> >> +testng-custom.xml
> >>
> >> Modified:
> >>
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
> >> URL:
> >>
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java?rev=1051293&r1=1051292&r2=1051293&view=diff
> >>
> >>
> ==============================================================================
> >> ---
> >>
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
> >> (original)
> >> +++
> >>
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
> >> Mon Dec 20 21:12:29 2010
> >> @@ -81,4 +81,16 @@ public class GeneralComponentTests exten
> >>
> >> assertText("//td[@class='t-location-content
> t-location-current']",
> >> "<t:unavailablecomponent/>");
> >> }
> >> +
> >> + /** TAP5-1378 */
> >> + @Test public void using_delegate_for_inline_components() {
> >> + clickThru("Inline Delegate");
> >> +
> >> + // no params
> >> + assertText("block1", "block 1");
> >> +
> >> + // multiple renders w/ multiple parameters
> >> + assertText("xpath=(//p[@class='superhero'])[1]", "Steve
> Rogers");
> >> + assertText("xpath=(//p[@class='superhero'])[2]", "Bruce
> Banner");
> >> + }
> >> }
> >>
> >> Added:
> >>
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
> >> URL:
> >>
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java?rev=1051293&view=auto
> >>
> >>
> ==============================================================================
> >> ---
> >>
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
> >> (added)
> >> +++
> >>
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
> >> Mon Dec 20 21:12:29 2010
> >> @@ -0,0 +1,19 @@
> >> +// Copyright 2006, 2007, 2008, 2009, 2010 The Apache Software
> Foundation
> >> +//
> >> +// Licensed under the Apache License, Version 2.0 (the "License");
> >> +// you may not use this file except in compliance with the License.
> >> +// You may obtain a copy of the License at
> >> +//
> >> +// http://www.apache.org/licenses/LICENSE-2.0
> >> +//
> >> +// Unless required by applicable law or agreed to in writing, software
> >> +// distributed under the License is distributed on an "AS IS" BASIS,
> >> +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> >> implied.
> >> +// See the License for the specific language governing permissions and
> >> +// limitations under the License.
> >> +
> >> +package org.apache.tapestry5.integration.app1.pages;
> >> +
> >> +public class DelegateInline {
> >> +
> >> +}
> >>
> >> Modified:
> >>
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
> >> URL:
> >>
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java?rev=1051293&r1=1051292&r2=1051293&view=diff
> >>
> >>
> ==============================================================================
> >> ---
> >>
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
> >> (original)
> >> +++
> >>
> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
> >> Mon Dec 20 21:12:29 2010
> >> @@ -356,6 +356,8 @@ public class Index
> >> "Actions can exist on pages other than the
> >> active page, via Blocks."),
> >>
> >> new Item("unlessdemo", "Unless Demo", "use of the
> >> Unless component"),
> >> +
> >> + new Item("delegateinline", "Inline Delegate",
> "Using
> >> the delegate component to create inline components"),
> >>
> >> new Item("MagicValueEncoder", "Magic ValueEncoder
> >> Demo",
> >> "Automatic creation of ValueEncoder using
> the
> >> TypeCoercer"),
> >>
> >>
> >>
> >
> >
> > --
> > Howard M. Lewis Ship
> >
> > Creator of Apache Tapestry
> >
> > The source for Tapestry training, mentoring and support. Contact me to
> learn
> > how I can get you up and productive in Tapestry fast!
> >
> > (971) 678-5210
> > 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
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to learn
how I can get you up and productive in Tapestry fast!
(971) 678-5210
http://howardlewisship.com
Re: svn commit: r1051293 - in /tapestry/tapestry5/trunk/tapestry-core/src:
main/java/org/apache/tapestry5/corelib/components/ test/app1/ test/conf/
test/java/org/apache/tapestry5/integration/app1/ test/java/org/apache/tapestry5/integration/app1/pages
Posted by Josh Canfield <jo...@gmail.com>.
Cool. I'd love to start checking in generics support. Does this mean
I'm free to do that?
On Mon, Dec 20, 2010 at 1:36 PM, Howard Lewis Ship <hl...@gmail.com> wrote:
> I think it is time to update the version numbers for trunk to 5.3.0-SNAPSHOT
>
> On Mon, Dec 20, 2010 at 1:12 PM, <da...@apache.org> wrote:
>
>> Author: dadams
>> Date: Mon Dec 20 21:12:29 2010
>> New Revision: 1051293
>>
>> URL: http://svn.apache.org/viewvc?rev=1051293&view=rev
>> Log:
>> (closed TAP5-1378) Allow Delegate component to be used for creating
>> in-template components
>>
>> Added:
>> tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
>>
>> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
>> Modified:
>>
>> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
>> tapestry/tapestry5/trunk/tapestry-core/src/test/conf/ (props changed)
>>
>> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
>>
>> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
>>
>> Modified:
>> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
>> URL:
>> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java?rev=1051293&r1=1051292&r2=1051293&view=diff
>>
>> ==============================================================================
>> ---
>> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
>> (original)
>> +++
>> tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Delegate.java
>> Mon Dec 20 21:12:29 2010
>> @@ -15,12 +15,25 @@
>> package org.apache.tapestry5.corelib.components;
>>
>> import org.apache.tapestry5.Block;
>> +import org.apache.tapestry5.ComponentResources;
>> +import org.apache.tapestry5.annotations.InjectContainer;
>> import org.apache.tapestry5.annotations.Parameter;
>> +import org.apache.tapestry5.annotations.SupportsInformalParameters;
>> +import org.apache.tapestry5.ioc.annotations.Inject;
>> +import org.apache.tapestry5.runtime.Component;
>>
>> /**
>> * A component that does not do any rendering of its own, but will delegate
>> to some other object that can do rendering.
>> * This other object may be a component or a {@link Block} (among other
>> things).
>> + * <p>
>> + * This component may also be used to create inline components. For each
>> informal parameter the value will be stored as a
>> + * render variable. To create an inline component, create a block
>> + * and use Delegate multiple times in the template to render the block
>> passing parameters to Delegate. In the block body
>> + * reference the render variables using the "var:" binding prefix and the
>> name of the parameter.
>> + * <p>
>> + * Note that the default binding prefix for parameter values is "literal".
>> */
>> +@SupportsInformalParameters
>> public class Delegate
>> {
>> /**
>> @@ -30,8 +43,16 @@ public class Delegate
>> @Parameter(required = true)
>> private Object to;
>>
>> - Object beginRender()
>> - {
>> + @Inject private ComponentResources resources;
>> + @InjectContainer private Component container;
>> +
>> + Object beginRender()
>> + {
>> + for(String name : resources.getInformalParameterNames()) {
>> + Object value = resources.getInformalParameter(name,
>> Object.class);
>> + container.getComponentResources().storeRenderVariable(name,
>> value);
>> + }
>> +
>> return to;
>> }
>> }
>>
>> Added:
>> tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
>> URL:
>> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml?rev=1051293&view=auto
>>
>> ==============================================================================
>> --- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
>> (added)
>> +++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DelegateInline.tml
>> Mon Dec 20 21:12:29 2010
>> @@ -0,0 +1,11 @@
>> +<t:border xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
>> xmlns:p="tapestry:parameter">
>> + <h1>Inline Components using Delegate</h1>
>> +
>> + <t:delegate to="block:block1" />
>> + <t:delegate to="block:block2" firstName="Steve" lastName="Rogers"
>> />
>> + <t:delegate to="block:block2" firstName="Bruce" lastName="Banner"
>> />
>> +
>> + <t:block id="block1"><span id="block1">block 1</span></t:block>
>> + <t:block id="block2"><p class="superhero">${var:firstName}
>> ${var:lastName}</p></t:block>
>> +</t:border>
>> +
>>
>> Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/conf/
>>
>> ------------------------------------------------------------------------------
>> --- svn:ignore (added)
>> +++ svn:ignore Mon Dec 20 21:12:29 2010
>> @@ -0,0 +1 @@
>> +testng-custom.xml
>>
>> Modified:
>> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
>> URL:
>> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java?rev=1051293&r1=1051292&r2=1051293&view=diff
>>
>> ==============================================================================
>> ---
>> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
>> (original)
>> +++
>> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GeneralComponentTests.java
>> Mon Dec 20 21:12:29 2010
>> @@ -81,4 +81,16 @@ public class GeneralComponentTests exten
>>
>> assertText("//td[@class='t-location-content t-location-current']",
>> "<t:unavailablecomponent/>");
>> }
>> +
>> + /** TAP5-1378 */
>> + @Test public void using_delegate_for_inline_components() {
>> + clickThru("Inline Delegate");
>> +
>> + // no params
>> + assertText("block1", "block 1");
>> +
>> + // multiple renders w/ multiple parameters
>> + assertText("xpath=(//p[@class='superhero'])[1]", "Steve Rogers");
>> + assertText("xpath=(//p[@class='superhero'])[2]", "Bruce Banner");
>> + }
>> }
>>
>> Added:
>> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
>> URL:
>> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java?rev=1051293&view=auto
>>
>> ==============================================================================
>> ---
>> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
>> (added)
>> +++
>> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DelegateInline.java
>> Mon Dec 20 21:12:29 2010
>> @@ -0,0 +1,19 @@
>> +// Copyright 2006, 2007, 2008, 2009, 2010 The Apache Software Foundation
>> +//
>> +// Licensed under the Apache License, Version 2.0 (the "License");
>> +// you may not use this file except in compliance with the License.
>> +// You may obtain a copy of the License at
>> +//
>> +// http://www.apache.org/licenses/LICENSE-2.0
>> +//
>> +// Unless required by applicable law or agreed to in writing, software
>> +// distributed under the License is distributed on an "AS IS" BASIS,
>> +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>> implied.
>> +// See the License for the specific language governing permissions and
>> +// limitations under the License.
>> +
>> +package org.apache.tapestry5.integration.app1.pages;
>> +
>> +public class DelegateInline {
>> +
>> +}
>>
>> Modified:
>> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
>> URL:
>> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java?rev=1051293&r1=1051292&r2=1051293&view=diff
>>
>> ==============================================================================
>> ---
>> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
>> (original)
>> +++
>> tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
>> Mon Dec 20 21:12:29 2010
>> @@ -356,6 +356,8 @@ public class Index
>> "Actions can exist on pages other than the
>> active page, via Blocks."),
>>
>> new Item("unlessdemo", "Unless Demo", "use of the
>> Unless component"),
>> +
>> + new Item("delegateinline", "Inline Delegate", "Using
>> the delegate component to create inline components"),
>>
>> new Item("MagicValueEncoder", "Magic ValueEncoder
>> Demo",
>> "Automatic creation of ValueEncoder using the
>> TypeCoercer"),
>>
>>
>>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to learn
> how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org