You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by bu...@apache.org on 2013/02/09 14:20:48 UTC
svn commit: r850012 - in /websites/production/tapestry/content:
cache/main.pageCache supporting-informal-parameters.html version-numbers.html
Author: buildbot
Date: Sat Feb 9 13:20:48 2013
New Revision: 850012
Log:
Production update by buildbot for tapestry
Modified:
websites/production/tapestry/content/cache/main.pageCache
websites/production/tapestry/content/supporting-informal-parameters.html
websites/production/tapestry/content/version-numbers.html
Modified: websites/production/tapestry/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/tapestry/content/supporting-informal-parameters.html
==============================================================================
--- websites/production/tapestry/content/supporting-informal-parameters.html (original)
+++ websites/production/tapestry/content/supporting-informal-parameters.html Sat Feb 9 13:20:48 2013
@@ -66,14 +66,10 @@ table.ScrollbarTable td.ScrollbarNextIco
/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="overriding-exception-reporting.html"><img align="middle" border="0" src="/images/confluence/back_16.gif" width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%"><a shape="rect" href="overriding-exception-reporting.html">Overriding Exception Reporting</a> </td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="cookbook.html"><img align="middle" border="0" src="/images/confluence/up_16.gif" width="8" height="8"></a></sup><a shape="rect" href="cookbook.html">Cookbook</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%"> <a shape="rect" href="component-libraries.html">Component Libraries</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="component-libraries.html"><img align="middle" border=
"0" src="/images/confluence/forwd_16.gif" width="16" height="16"></a></td></tr></table></div>
-<h1><a shape="rect" name="SupportingInformalParameters-SupportingInformalParameters"></a>Supporting Informal Parameters</h1>
+<h2><a shape="rect" name="SupportingInformalParameters-SupportingInformalParameters"></a>Supporting Informal Parameters</h2>
<div class="navmenu" style="float:right; background:#eee; margin:3px; padding:3px"><table class="tableview" width="100%"><tr><th colspan="1" rowspan="1" style="padding: 3px 3px 3px 0px">Related Articles</th></tr><tr><td colspan="1" rowspan="1">
<span class="icon icon-page" title="Page">Page:</span>
- <a shape="rect" href="supporting-informal-parameters.html">Supporting Informal Parameters</a>
-
- </td></tr><tr><td colspan="1" rowspan="1">
- <span class="icon icon-page" title="Page">Page:</span>
<a shape="rect" href="enum-parameter-recipe.html">Enum Parameter Recipe</a>
</td></tr><tr><td colspan="1" rowspan="1">
@@ -84,73 +80,73 @@ table.ScrollbarTable td.ScrollbarNextIco
<span class="icon icon-page" title="Page">Page:</span>
<a shape="rect" href="component-parameters.html">Component Parameters</a>
+ </td></tr><tr><td colspan="1" rowspan="1">
+ <span class="icon icon-page" title="Page">Page:</span>
+ <a shape="rect" href="supporting-informal-parameters.html">Supporting Informal Parameters</a>
+
</td></tr></table>
</div>
-<p>Informal parameters are additional parameters beyond the formal parameters defined for a component using the <a shape="rect" class="external-link" href="http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/annotations/Parameter.html">Parameter</a> annotation.</p>
+<p>Informal parameters are any additional parameters beyond the parameters explicitly defined for a component using the <a shape="rect" class="external-link" href="http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/annotations/Parameter.html">Parameter</a> annotation.</p>
-<p>A component that closely emulates a particular HTML element should also support informal parameters. You'll find that many of the built-in Tapestry components, such as Form, Label and TextField, do exactly that.</p>
+<p>Any component that closely emulates a particular HTML element <em>should</em> support informal parameters. You'll find that many of the built-in Tapestry components, such as Form, Label and TextField, do exactly that.</p>
-<p>Normally, specifying additional parameters for a component, beyond its formal parameters, does nothing: the additional parameters are ignored.</p>
+<p>To support informal parameters, a component class should use either the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/annotations/SupportsInformalParameters.html">SupportsInformalParameters</a> annotation or the RenderInformals mixin. Otherwise, providing informal parameters to a component will do nothing: any additional parameters will be ignored.</p>
-<p>The <a shape="rect" class="external-link" href="http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/annotations/SupportsInformalParameters.html">SupportsInformalParameters</a> annotation is used to identify a component for which informal parameters are to be kept.</p>
+<h3><a shape="rect" name="SupportingInformalParameters-Approach1%3A@SupportsInformalParameters"></a>Approach 1: @SupportsInformalParameters</h3>
-<p>The example is an Img component, a replacement for the <img> tag. Its src parameter will be an asset.</p>
+<p>In the example below we create an Img component, a custom replacement for the <img> tag. Its src parameter will be an asset. We'll use the @SupportsInformalParameters annotation to tell Tapestry that the component should support informal parameters.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
@SupportsInformalParameters
<span class="code-keyword">public</span> class Img
{
- @Parameter(required=<span class="code-keyword">true</span>, allowNull=<span class="code-keyword">false</span>, defaultPrefix=BindingConstants.ASSET)
- <span class="code-keyword">private</span> Asset src;
-
- @Inject
- <span class="code-keyword">private</span> ComponentResources resources;
-
- <span class="code-object">boolean</span> beginRender(MarkupWriter writer)
- {
- writer.element(<span class="code-quote">"img"</span>,
- <span class="code-quote">"src"</span>, src);
+ @Parameter(required=<span class="code-keyword">true</span>, allowNull=<span class="code-keyword">false</span>, defaultPrefix=BindingConstants.ASSET)
+ <span class="code-keyword">private</span> Asset src;
- resources.renderInformalParameters(writer);
+ @Inject
+ <span class="code-keyword">private</span> ComponentResources resources;
- writer.end();
-
- <span class="code-keyword">return</span> <span class="code-keyword">false</span>;
- }
+ <span class="code-object">boolean</span> beginRender(MarkupWriter writer)
+ {
+ writer.element(<span class="code-quote">"img"</span>, <span class="code-quote">"src"</span>, src);
+ resources.renderInformalParameters(writer);
+ writer.end();
+ <span class="code-keyword">return</span> <span class="code-keyword">false</span>;
+ }
}
</pre>
</div></div>
<p>The call to renderInformalParameters() is what converts and outputs the informal parameters. It should occur <em>after</em> your code has rendered attributes into the element (earlier written attributes will <em>not</em> be overwritten by later written attributes).</p>
-<p>Returning false from beginRender() ensures that the body of the component is not rendered, which makes sense for a <img> tag, which has no body.</p>
+<p>Returning false from beginRender() ensures that the body of the component is not rendered, which makes sense for an <img> tag, which has no body.</p>
+
+<h3><a shape="rect" name="SupportingInformalParameters-Approach2%3ARenderInformals"></a>Approach 2: RenderInformals</h3>
-<p>Another option is to use the <a shape="rect" class="external-link" href="http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/corelib/mixins/RenderInformals.html">RenderInformals</a> mixin:</p>
+<p>Another, equivalent, approach is to use the <a shape="rect" class="external-link" href="http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/corelib/mixins/RenderInformals.html">RenderInformals</a> mixin:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
<span class="code-keyword">public</span> class Img
{
- @Parameter(required=<span class="code-keyword">true</span>, allowNull=<span class="code-keyword">false</span>, defaultPrefix=BindingConstants.ASSET)
- <span class="code-keyword">private</span> Asset src;
-
- @Mixin
- <span class="code-keyword">private</span> RenderInformals renderInformals;
+ @Parameter(required=<span class="code-keyword">true</span>, allowNull=<span class="code-keyword">false</span>, defaultPrefix=BindingConstants.ASSET)
+ <span class="code-keyword">private</span> Asset src;
- void beginRender(MarkupWriter writer)
- {
- writer.element(<span class="code-quote">"img"</span>,
- <span class="code-quote">"src"</span>, src);
- }
-
- <span class="code-object">boolean</span> beforeRenderBody(MarkupWriter writer)
- {
- writer.end();
+ @Mixin
+ <span class="code-keyword">private</span> RenderInformals renderInformals;
- <span class="code-keyword">return</span> <span class="code-keyword">false</span>;
- }
+ void beginRender(MarkupWriter writer)
+ {
+ writer.element(<span class="code-quote">"img"</span>, <span class="code-quote">"src"</span>, src);
+ }
+
+ <span class="code-object">boolean</span> beforeRenderBody(MarkupWriter writer)
+ {
+ writer.end();
+ <span class="code-keyword">return</span> <span class="code-keyword">false</span>;
+ }
}
</pre>
</div></div>
Modified: websites/production/tapestry/content/version-numbers.html
==============================================================================
--- websites/production/tapestry/content/version-numbers.html (original)
+++ websites/production/tapestry/content/version-numbers.html Sat Feb 9 13:20:48 2013
@@ -90,7 +90,7 @@
<h1><a shape="rect" name="VersionNumbers-PreviewPackages"></a>Preview Packages</h1>
-<p>A preview package may be created at any time. A tag is created in Subversion to label the exact source from which the preview package is generated. The preview package is built and uploaded to the Apache Nexus. Once uploaded, the master version number (in trunk) should be advanced to the next index number within the same stability series (example: "5.3-alpha-2" to "5.3-alpha-3").</p>
+<p>A preview package may be created at any time. A tag is created in Git to label the exact source from which the preview package is generated. The preview package is built and uploaded to the Apache Nexus. Once uploaded, the master version number (in trunk) should be advanced to the next index number within the same stability series (example: "5.3-alpha-2" to "5.3-alpha-3").</p>
<p>The Apache Nexus URL for the preview package may be distributed on the Tapestry user mailing list. However, preview packages are deleted, not released. This is important ... preview packages are never released to the Maven Central repository, only final releases are distributed via Maven Central.</p>