Author: hlship
Date: Mon Jun 28 17:26:29 2010
New Revision: 958649
URL: http://svn.apache.org/viewvc?rev=958649&view=rev
Log:
TAP5-1195: Rename annotations @QueryParameter and @QueryParameterMapped (both
introduced in 5.2.0) to more mnemonic names
Added:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/ActivationRequestParameter.java
(contents, props changed)
- copied, changed from r958648,
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/QueryParameterMapped.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ActivationRequestParameterWorker.java
(contents, props changed)
- copied, changed from r958648,
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/QueryParameterMappedWorker.java
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ActivationRequestParameterDemo.tml
- copied, changed from r958648,
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/QueryParameterMappedDemo.tml
tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/ActivationRequestParameterMappedTests.groovy
- copied, changed from r958648,
tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/QueryParameterMappedTests.groovy
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActivationRequestParameterDemo.java
(contents, props changed)
- copied, changed from r958648,
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/QueryParameterMappedDemo.java
Removed:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/QueryParameterMapped.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/QueryParameterMappedWorker.java
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/QueryParameterMappedDemo.tml
tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/QueryParameterMappedTests.groovy
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/QueryParameterMappedDemo.java
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/Persist.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/RequestParameter.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
Copied:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/ActivationRequestParameter.java
(from r958648,
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/QueryParameterMapped.java)
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/ActivationRequestParameter.java?p2=tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/ActivationRequestParameter.java&p1=tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/QueryParameterMapped.java&r1=958648&r2=958649&rev=958649&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/QueryParameterMapped.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/ActivationRequestParameter.java
Mon Jun 28 17:26:29 2010
@@ -30,14 +30,12 @@ import org.apache.tapestry5.ioc.annotati
import org.apache.tapestry5.services.ValueEncoderSource;
/**
- * Marks a field of a page (not a component) as persistent within the URL. The
field is mapped
+ * Marks a field of a page (not a component) as persistent within the URL, as
with a page activation context. The field
+ * is mapped
* to a query parameter. When component event or page render links are
generated for the page,
* additional values will be added to the {...@link Link} (via the {...@link
EventConstants#DECORATE_COMPONENT_EVENT_LINK} or
* {...@link EventConstants#DECORATE_PAGE_RENDER_LINK} events).
* <p>
- * Care must be taken that the query parameter name does not clash with a
query parameter name generated for a form
- * field.
- * <p>
* The field may be of any type; a {...@link ValueEncoder} (from the {...@link
ValueEncoderSource}) will be used to convert
* between client-side and server-side representations. Null values are not
added as query parameters (just non-null).
* <p>
@@ -46,7 +44,7 @@ import org.apache.tapestry5.services.Val
* <p>
* This annotation is an alternative to {...@link Persist}.
* <p>
- * Fields annotated with QueryParameterMapped are <em>not</em> considered
persistent (its a process parallel to the one
+ * Fields annotated with ActivationRequestParameter are <em>not</em>
considered persistent (its a process parallel to the one
* related to the {...@link Persist} annotation). Invoking {...@link
ComponentResources#discardPersistentFieldChanges()} will
* <em>not</em> affect annotated fields, only assigning them back to null will.
*
@@ -58,7 +56,7 @@ import org.apache.tapestry5.services.Val
@Documented
@UseWith(
{ PAGE })
-public @interface QueryParameterMapped
+public @interface ActivationRequestParameter
{
/** The name of the query parameter, which defaults to the name of the
field. */
String value() default "";
Propchange:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/ActivationRequestParameter.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/Persist.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/Persist.java?rev=958649&r1=958648&r2=958649&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/Persist.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/Persist.java
Mon Jun 28 17:26:29 2010
@@ -40,7 +40,7 @@ import org.apache.tapestry5.ioc.annotati
*
* @see org.apache.tapestry5.services.MetaDataLocator
* @see org.apache.tapestry5.PersistenceConstants
- * @see QueryParameterMapped
+ * @see ActivationRequestParameter
*/
@Target(FIELD)
@Documented
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/RequestParameter.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/RequestParameter.java?rev=958649&r1=958648&r2=958649&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/RequestParameter.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/RequestParameter.java
Mon Jun 28 17:26:29 2010
@@ -37,7 +37,7 @@ import org.apache.tapestry5.services.Req
* client-side JavaScript adds a query parameter to a request to communicate
some information from the client
* side to the server side.
* <p>
- * Individual fields may also be directly mapped to query parameters using the
{...@link QueryParameterMapped} annotation.
+ * Individual fields may also be directly mapped to query parameters using the
{...@link ActivationRequestParameter} annotation.
*
* @since 5.2.0
* @see OnEventWorker
Copied:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ActivationRequestParameterWorker.java
(from r958648,
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/QueryParameterMappedWorker.java)
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ActivationRequestParameterWorker.java?p2=tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ActivationRequestParameterWorker.java&p1=tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/QueryParameterMappedWorker.java&r1=958648&r2=958649&rev=958649&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/QueryParameterMappedWorker.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ActivationRequestParameterWorker.java
Mon Jun 28 17:26:29 2010
@@ -17,7 +17,7 @@ package org.apache.tapestry5.internal.tr
import org.apache.tapestry5.EventConstants;
import org.apache.tapestry5.Link;
import org.apache.tapestry5.ValueEncoder;
-import org.apache.tapestry5.annotations.QueryParameterMapped;
+import org.apache.tapestry5.annotations.ActivationRequestParameter;
import org.apache.tapestry5.internal.services.ComponentClassCache;
import org.apache.tapestry5.ioc.util.IdAllocator;
import org.apache.tapestry5.model.MutableComponentModel;
@@ -30,10 +30,10 @@ import org.apache.tapestry5.services.*;
* extract query parameters, and hooks the link decoration events to extract
values
* and add them to the {...@link Link}.
*
- * @see QueryParameterMapped
+ * @see ActivationRequestParameter
* @since 5.2.0
*/
-public class QueryParameterMappedWorker implements
ComponentClassTransformWorker
+public class ActivationRequestParameterWorker implements
ComponentClassTransformWorker
{
private final Request request;
@@ -46,7 +46,7 @@ public class QueryParameterMappedWorker
void invoke(Component component, ComponentEvent event);
}
- public QueryParameterMappedWorker(Request request, ComponentClassCache
classCache,
+ public ActivationRequestParameterWorker(Request request,
ComponentClassCache classCache,
ValueEncoderSource valueEncoderSource)
{
this.request = request;
@@ -56,7 +56,7 @@ public class QueryParameterMappedWorker
public void transform(ClassTransformation transformation,
MutableComponentModel model)
{
- for (TransformField field :
transformation.matchFieldsWithAnnotation(QueryParameterMapped.class))
+ for (TransformField field :
transformation.matchFieldsWithAnnotation(ActivationRequestParameter.class))
{
mapFieldToQueryParameter(field, transformation, model);
}
@@ -66,7 +66,7 @@ public class QueryParameterMappedWorker
private void mapFieldToQueryParameter(TransformField field,
ClassTransformation transformation,
MutableComponentModel model)
{
- QueryParameterMapped annotation =
field.getAnnotation(QueryParameterMapped.class);
+ ActivationRequestParameter annotation =
field.getAnnotation(ActivationRequestParameter.class);
String parameterName = getParameterName(field, annotation);
@@ -169,7 +169,7 @@ public class QueryParameterMappedWorker
model.addEventHandler(eventType);
}
- private String getParameterName(TransformField field, QueryParameterMapped
annotation)
+ private String getParameterName(TransformField field,
ActivationRequestParameter annotation)
{
if (annotation.value().equals(""))
return field.getName();
Propchange:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ActivationRequestParameterWorker.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java?rev=958649&r1=958648&r2=958649&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
Mon Jun 28 17:26:29 2010
@@ -588,8 +588,8 @@ public final class TapestryModule
* <dd>Checks for the {...@link PageReset} annotation
* <dt>HeartbeatDeferred
* <dd>Support for the {...@link HeartbeatDeferred} annotation
- * <dt>QueryParameterMapped
- * <dd>Support for the {...@link QueryParameterMapped} annotation
+ * <dt>ActivationRequestParameter
+ * <dd>Support for the {...@link ActivationRequestParameter} annotation
* </dl>
*/
public static void contributeComponentClassTransformWorker(
@@ -609,7 +609,7 @@ public final class TapestryModule
configuration.add("MixinAfter", new MixinAfterWorker());
configuration.add("Component", new ComponentWorker(resolver));
configuration.add("Mixin", new MixinWorker(resolver));
- configuration.addInstance("QueryParameterMapped",
QueryParameterMappedWorker.class, "before:OnEvent");
+ configuration.addInstance("ActivationRequestParameter",
ActivationRequestParameterWorker.class, "before:OnEvent");
configuration.addInstance("OnEvent", OnEventWorker.class);
configuration.add("SupportsInformalParameters", new
SupportsInformalParametersWorker());
configuration.addInstance("InjectPage", InjectPageWorker.class);
Copied:
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ActivationRequestParameterDemo.tml
(from r958648,
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/QueryParameterMappedDemo.tml)
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ActivationRequestParameterDemo.tml?p2=tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ActivationRequestParameterDemo.tml&p1=tapestry/tapestry5/trunk/tapestry-core/src/test/app1/QueryParameterMappedDemo.tml&r1=958648&r2=958649&rev=958649&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/QueryParameterMappedDemo.tml
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ActivationRequestParameterDemo.tml
Mon Jun 28 17:26:29 2010
@@ -1,6 +1,6 @@
<html t:type="Border"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
- <h1>@QueryParameterMapped Demo</h1>
+ <h1>@ActivationRequestParameter Demo</h1>
<dl>
<dt>Click count:</dt>
Copied:
tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/ActivationRequestParameterMappedTests.groovy
(from r958648,
tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/QueryParameterMappedTests.groovy)
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/ActivationRequestParameterMappedTests.groovy?p2=tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/ActivationRequestParameterMappedTests.groovy&p1=tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/QueryParameterMappedTests.groovy&r1=958648&r2=958649&rev=958649&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/QueryParameterMappedTests.groovy
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/ActivationRequestParameterMappedTests.groovy
Mon Jun 28 17:26:29 2010
@@ -18,11 +18,11 @@ import org.apache.tapestry5.corelib.comp
import org.apache.tapestry5.integration.TapestryCoreTestCase
import org.testng.annotations.Test
-class QueryParameterMappedTests extends TapestryCoreTestCase
+class ActivationRequestParameterTests extends TapestryCoreTestCase
{
@Test
void basic_links() {
- clickThru "@QueryParameterMapped Demo"
+ clickThru "ActivationRequestParameter Annotation Demo"
assertText "click-count", ""
assertText "click-count-set", "false"
@@ -43,7 +43,7 @@ class QueryParameterMappedTests extends
@Test
public void form_components_do_not_conflict_with_mapped_field_names() {
- clickThru "@QueryParameterMapped Demo"
+ clickThru "ActivationRequestParameter Annotation Demo"
clickAndWait "link=increment count"
Copied:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActivationRequestParameterDemo.java
(from r958648,
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/QueryParameterMappedDemo.java)
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActivationRequestParameterDemo.java?p2=tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActivationRequestParameterDemo.java&p1=tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/QueryParameterMappedDemo.java&r1=958648&r2=958649&rev=958649&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/QueryParameterMappedDemo.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActivationRequestParameterDemo.java
Mon Jun 28 17:26:29 2010
@@ -19,11 +19,11 @@ import org.apache.tapestry5.PersistenceC
import org.apache.tapestry5.SelectModel;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
-import org.apache.tapestry5.annotations.QueryParameterMapped;
+import org.apache.tapestry5.annotations.ActivationRequestParameter;
import org.apache.tapestry5.internal.OptionModelImpl;
import org.apache.tapestry5.internal.SelectModelImpl;
-public class QueryParameterMappedDemo
+public class ActivationRequestParameterDemo
{
@Property
@@ -34,11 +34,11 @@ public class QueryParameterMappedDemo
private boolean clickCountSet;
@Property
- @QueryParameterMapped
+ @ActivationRequestParameter
private Integer clickCount;
@Property
- @QueryParameterMapped("status-message")
+ @ActivationRequestParameter("status-message")
private String message;
void onActivate()
Propchange:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActivationRequestParameterDemo.java
------------------------------------------------------------------------------
svn:eol-style = native
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=958649&r1=958648&r2=958649&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 Jun 28 17:26:29 2010
@@ -67,8 +67,8 @@ public class Index
private static final List<Item> ITEMS = CollectionFactory
.newList(
- new Item("QueryParameterMappedDemo",
"@QueryParameterMapped Demo",
- "Use of @QueryParameterMapped to encode page state
into query parameters"),
+ new Item("ActivationRequestParameterDemo",
"ActivationRequestParameter Annotation Demo",
+ "Use of @ActivationRequestParameter to encode page
state into query parameters"),
new Item("LibraryMessagesDemo", "Library Messages Demo",
"Demo ability to contribute additional message
catalog resources to the application global catalog."),