You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2014/12/29 18:23:36 UTC

[1/4] tapestry-5 git commit: Remove createActionLink() method, deprecated in 2008

Repository: tapestry-5
Updated Branches:
  refs/heads/master 2cc30a6bd -> ff08ad572


Remove createActionLink() method, deprecated in 2008


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/4a74819f
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/4a74819f
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/4a74819f

Branch: refs/heads/master
Commit: 4a74819f31434d6f37e065318fc5fa7efe34d034
Parents: 2cc30a6
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Mon Dec 29 08:19:18 2014 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Mon Dec 29 08:19:18 2014 -0800

----------------------------------------------------------------------
 .../tapestry5/ComponentResourcesCommon.java     | 23 --------------------
 .../tapestry5/internal/services/LinkSource.java |  4 +---
 .../structure/ComponentPageElementImpl.java     |  7 ------
 .../InternalComponentResourcesImpl.java         |  6 -----
 .../app1/pages/ActionViaLinkDemo.java           |  7 +-----
 5 files changed, 2 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4a74819f/tapestry-core/src/main/java/org/apache/tapestry5/ComponentResourcesCommon.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/ComponentResourcesCommon.java b/tapestry-core/src/main/java/org/apache/tapestry5/ComponentResourcesCommon.java
index c15e254..e60597a 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/ComponentResourcesCommon.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/ComponentResourcesCommon.java
@@ -1,5 +1,3 @@
-// Copyright 2006-2013 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
@@ -196,27 +194,6 @@ public interface ComponentResourcesCommon extends Locatable
      * the page name and nested component id) will be encoded into a URL. A request for the URL will
      * {@linkplain #triggerEvent(String, Object[], org.apache.tapestry5.ComponentEventCallback)} trigger} the named
      * event on the
-     * component.
-     * 
-     * @param eventType
-     *            the type of event to be triggered. Event types should be Java identifiers (contain only
-     *            letters, numbers and the underscore).
-     * @param forForm
-     *            if true, the link will be used as the eventType for an HTML form submission, which may affect
-     *            what information is encoded into the link
-     * @param context
-     *            additional objects to be encoded into the path portion of the link; each is converted to a
-     *            string and URI encoded
-     * @return link object for the callback
-     * @deprecated Use {@link #createEventLink(String, Object[])} instead
-     */
-    Link createActionLink(String eventType, boolean forForm, Object... context);
-
-    /**
-     * Creates a component event request link as a callback for this component. The event type and context (as well as
-     * the page name and nested component id) will be encoded into a URL. A request for the URL will
-     * {@linkplain #triggerEvent(String, Object[], org.apache.tapestry5.ComponentEventCallback)} trigger} the named
-     * event on the
      * component. This is only used for form submission events, as extra data may be encoded in the form as hidden
      * fields.
      * 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4a74819f/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSource.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSource.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSource.java
index d2868e5..c967c06 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSource.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSource.java
@@ -1,5 +1,3 @@
-// Copyright 2009, 2010, 2011 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
@@ -44,7 +42,7 @@ public interface LinkSource
      * @param context
      *            Additional path data, each value will be converted to a string and appended to the URI @return a
      *            link
-     * @see org.apache.tapestry5.ComponentResources#createActionLink(String, boolean, Object[])
+     * @see org.apache.tapestry5.ComponentResources#createEventLink(String, Object...)
      */
     Link createComponentEventLink(Page page, String nestedId, String eventType, boolean forForm, Object... context);
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4a74819f/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
index abd0258..92988d6 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
@@ -1,5 +1,3 @@
-// Copyright 2006-2014  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
@@ -1243,11 +1241,6 @@ public class ComponentPageElementImpl extends BaseLocatable implements Component
         return elementResources.createComponentEventLink(coreResources, eventType, false, context);
     }
 
-    public Link createActionLink(String eventType, boolean forForm, Object... context)
-    {
-        return elementResources.createComponentEventLink(coreResources, eventType, forForm, context);
-    }
-
     public Link createFormEventLink(String eventType, Object... context)
     {
         return elementResources.createComponentEventLink(coreResources, eventType, true, context);

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4a74819f/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java
index 5d0ac16..9f4aff1 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java
@@ -1,5 +1,3 @@
-// Copyright 2006-2012 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
@@ -208,10 +206,6 @@ public class InternalComponentResourcesImpl extends LockSupport implements Inter
         return element.createEventLink(eventType, context);
     }
 
-    public Link createActionLink(String eventType, boolean forForm, Object... context)
-    {
-        return element.createActionLink(eventType, forForm, context);
-    }
 
     public Link createFormEventLink(String eventType, Object... context)
     {

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4a74819f/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActionViaLinkDemo.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActionViaLinkDemo.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActionViaLinkDemo.java
index a8033e7..dbafd37 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActionViaLinkDemo.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActionViaLinkDemo.java
@@ -1,5 +1,3 @@
-// Copyright 2008, 2009 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
@@ -48,10 +46,7 @@ public class ActionViaLinkDemo
 
     public String getActionURL()
     {
-        // This could be shifted to createEventLink(), but leaving it alone verifys backwards
-        // compatibility to 5.0.14.
-
-        Link link = resources.createActionLink("UpdateMessage", false, "from getActionURL()");
+        Link link = resources.createEventLink("UpdateMessage", false, "from getActionURL()");
 
         return link.toURI();
     }


[4/4] tapestry-5 git commit: Remove long deprecated createPageLink() methods from ComponentResourcesCommon

Posted by hl...@apache.org.
Remove long deprecated createPageLink() methods from ComponentResourcesCommon


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/ff08ad57
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/ff08ad57
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/ff08ad57

Branch: refs/heads/master
Commit: ff08ad572b9faa04c0add703debc53965d6c77c8
Parents: 8caf479
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Mon Dec 29 09:23:21 2014 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Mon Dec 29 09:23:21 2014 -0800

----------------------------------------------------------------------
 .../tapestry5/ComponentResourcesCommon.java     | 37 --------------------
 .../tapestry5/internal/services/LinkSource.java | 29 +++++++--------
 .../structure/ComponentPageElementImpl.java     | 10 ------
 .../InternalComponentResourcesImpl.java         | 10 ------
 .../services/PageRenderLinkSource.java          | 28 ++++++++-------
 .../tapestry5/integration/app1/pages/Index.java | 16 +++++----
 .../integration/app1/pages/PageLinkContext.java |  8 ++---
 .../integration/app1/pages/ReturnTypes.java     | 23 ++++++------
 8 files changed, 54 insertions(+), 107 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ff08ad57/tapestry-core/src/main/java/org/apache/tapestry5/ComponentResourcesCommon.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/ComponentResourcesCommon.java b/tapestry-core/src/main/java/org/apache/tapestry5/ComponentResourcesCommon.java
index e60597a..6d2b20c 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/ComponentResourcesCommon.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/ComponentResourcesCommon.java
@@ -206,41 +206,4 @@ public interface ComponentResourcesCommon extends Locatable
      * @return link object for the callback
      */
     Link createFormEventLink(String eventType, Object... context);
-
-    /**
-     * Creates a page render request link to render a specific page.
-     * 
-     * @param pageName
-     *            the logical name of the page to link to
-     * @param override
-     *            if true, the context is used even if empty (normally, the target page is allowed to passivate,
-     *            providing a context, when the provided context is empty)
-     * @param context
-     *            the activation context for the page. If omitted, the activation context is obtained from the
-     *            target page
-     * @return link for a render request to the targeted page
-     * @deprecated Use {@link org.apache.tapestry5.services.PageRenderLinkSource#createPageRenderLink(String)} or
-     *             {@link org.apache.tapestry5.services.PageRenderLinkSource#createPageRenderLinkWithContext(String, Object[])}
-     *             instead
-     */
-    Link createPageLink(String pageName, boolean override, Object... context);
-
-    /**
-     * Creates a page render request link to render a specific page. Using a page class, rather than a page name, is
-     * more refactoring safe (in the even the page is renamed or moved).
-     * 
-     * @param pageClass
-     *            identifies the page to link to
-     * @param override
-     *            if true, the context is used even if empty (normally, the target page is allowed to passivate,
-     *            providing a context, when the provided context is empty)
-     * @param context
-     *            the activation context for the page. If omitted, the activation context is obtained from the
-     *            target page
-     * @return link for a render request to the targeted page
-     * @deprecated Use {@link org.apache.tapestry5.services.PageRenderLinkSource#createPageRenderLink(Class)} or
-     *             {@link org.apache.tapestry5.services.PageRenderLinkSource#createPageRenderLinkWithContext(Class, Object[])}
-     *             instead
-     */
-    Link createPageLink(Class pageClass, boolean override, Object... context);
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ff08ad57/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSource.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSource.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSource.java
index c967c06..3ec9ef6 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSource.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSource.java
@@ -20,7 +20,7 @@ import org.apache.tapestry5.services.LinkCreationListener2;
 
 /**
  * A source for {@link org.apache.tapestry5.Link} objects.
- * 
+ *
  * @see org.apache.tapestry5.services.LinkCreationListener2
  * @since 5.1.0.0
  */
@@ -30,18 +30,18 @@ public interface LinkSource
     /**
      * Creates a stateful action link. Action links are built for components. Action links are encoded by the current
      * request (that is, bound to the current request's session, if any).
-     * 
+     *
      * @param page
-     *            the page holding the component
+     *         the page holding the component
      * @param nestedId
-     *            the component's qualified id (a sequence of simple ids, separated by dots).
+     *         the component's qualified id (a sequence of simple ids, separated by dots).
      * @param eventType
-     *            the type of event to trigger
+     *         the type of event to trigger
      * @param forForm
-     *            true if the link is for a form, false otherwise
+     *         true if the link is for a form, false otherwise
      * @param context
-     *            Additional path data, each value will be converted to a string and appended to the URI @return a
-     *            link
+     *         Additional path data, each value will be converted to a string and appended to the URI @return a
+     *         link
      * @see org.apache.tapestry5.ComponentResources#createEventLink(String, Object...)
      */
     Link createComponentEventLink(Page page, String nestedId, String eventType, boolean forForm, Object... context);
@@ -54,21 +54,22 @@ public interface LinkSource
      * When the activationContext is an empty array, the targeted page is checked to see if it can provide an activation
      * context. This is accomplished by triggering a "passivate" event on the targeted page. If the override parameter
      * is true, this will not occur (even when the activation context is empty).
-     * 
+     *
      * @param pageName
-     *            name of the page to which a link should be created
+     *         name of the page to which a link should be created
      * @param override
-     *            if true, then the provided activation context is always used even if empty
+     *         if true, then the provided activation context is always used even if empty
      * @param pageActivationContext
-     *            the activation context for the page
+     *         the activation context for the page
      * @return a link
-     * @see org.apache.tapestry5.ComponentResources#createPageLink(String, boolean, Object[])
+     * @see org.apache.tapestry5.services.PageRenderLinkSource#createPageRenderLink(String)
+     * @see org.apache.tapestry5.services.PageRenderLinkSource#createPageRenderLinkWithContext(String, Object[])
      */
     Link createPageRenderLink(String pageName, boolean override, Object... pageActivationContext);
 
     /**
      * Returns the hub, used to register and de-register {@link org.apache.tapestry5.services.LinkCreationListener2}s.
-     * 
+     *
      * @return the hub
      */
     LinkCreationHub getLinkCreationHub();

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ff08ad57/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
index 92988d6..6c34ab8 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
@@ -1246,16 +1246,6 @@ public class ComponentPageElementImpl extends BaseLocatable implements Component
         return elementResources.createComponentEventLink(coreResources, eventType, true, context);
     }
 
-    public Link createPageLink(String pageName, boolean override, Object... context)
-    {
-        return elementResources.createPageRenderLink(pageName, override, context);
-    }
-
-    public Link createPageLink(Class pageClass, boolean override, Object... context)
-    {
-        return elementResources.createPageRenderLink(pageClass, override, context);
-    }
-
     protected RenderPhaseEvent createRenderEvent(RenderQueue queue)
     {
         return new RenderPhaseEvent(new RenderPhaseEventHandler(queue), eventLogger, elementResources);

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ff08ad57/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java
index 9f4aff1..886d773 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java
@@ -212,16 +212,6 @@ public class InternalComponentResourcesImpl extends LockSupport implements Inter
         return element.createFormEventLink(eventType, context);
     }
 
-    public Link createPageLink(String pageName, boolean override, Object... context)
-    {
-        return element.createPageLink(pageName, override, context);
-    }
-
-    public Link createPageLink(Class pageClass, boolean override, Object... context)
-    {
-        return element.createPageLink(pageClass, override, context);
-    }
-
     public void discardPersistentFieldChanges()
     {
         page.discardPersistentFieldChanges();

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ff08ad57/tapestry-core/src/main/java/org/apache/tapestry5/services/PageRenderLinkSource.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/services/PageRenderLinkSource.java b/tapestry-core/src/main/java/org/apache/tapestry5/services/PageRenderLinkSource.java
index 1ff2ab3..6ea42ae 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/services/PageRenderLinkSource.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/services/PageRenderLinkSource.java
@@ -1,5 +1,3 @@
-// Copyright 2009 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
@@ -14,12 +12,11 @@
 
 package org.apache.tapestry5.services;
 
-import org.apache.tapestry5.Link;
 import org.apache.tapestry5.EventContext;
+import org.apache.tapestry5.Link;
 
 /**
- * A service that allows other services to create page render links (which are otherwise created by components, via
- * {@link org.apache.tapestry5.ComponentResources#createPageLink(String, boolean, Object[])}).
+ * A service that allows other services to create page render links.
  *
  * @since 5.1.0.2
  */
@@ -28,7 +25,8 @@ public interface PageRenderLinkSource
     /**
      * Creates a page render link using the page's normal passivation context (if it has one).
      *
-     * @param pageName name of page to create link to
+     * @param pageName
+     *         name of page to create link to
      * @return render link for the page
      */
     Link createPageRenderLink(String pageName);
@@ -36,8 +34,10 @@ public interface PageRenderLinkSource
     /**
      * Creates a page render link using an override of the page's passivation context (possibly an empty one).
      *
-     * @param pageName name of page to create link to
-     * @param context zero or more values to encode as the passiviation context
+     * @param pageName
+     *         name of page to create link to
+     * @param context
+     *         zero or more values to encode as the passiviation context
      * @return render link for the page
      */
     Link createPageRenderLinkWithContext(String pageName, Object... context);
@@ -45,8 +45,10 @@ public interface PageRenderLinkSource
     /**
      * Creates a page render link using an override of the page's passivation context.
      *
-     * @param pageName name of page to create link to
-     * @param eventContext the EventContext to encode as the passiviation context
+     * @param pageName
+     *         name of page to create link to
+     * @param eventContext
+     *         the EventContext to encode as the passiviation context
      * @return render link for the page
      * @since 5.2.0.0
      */
@@ -66,7 +68,8 @@ public interface PageRenderLinkSource
      * page's passivation context (possibly an empty one).
      *
      * @param pageClass
-     * @param context zero or more values to encode as the passiviation context
+     * @param context
+     *         zero or more values to encode as the passiviation context
      * @return render link for the page
      */
     Link createPageRenderLinkWithContext(Class pageClass, Object... context);
@@ -76,7 +79,8 @@ public interface PageRenderLinkSource
      * page's passivation context
      *
      * @param pageClass
-     * @param eventContext the EventContext to encode as the passiviation context
+     * @param eventContext
+     *         the EventContext to encode as the passiviation context
      * @return render link for the page
      * @since 5.2.0.0
      */

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ff08ad57/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
index cdd22ec..f146ec1 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
@@ -21,6 +21,7 @@ import org.apache.tapestry5.annotations.Property;
 import org.apache.tapestry5.ioc.annotations.Inject;
 import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
 import org.apache.tapestry5.ioc.internal.util.InternalUtils;
+import org.apache.tapestry5.services.PageRenderLinkSource;
 import org.apache.tapestry5.services.StreamPageContent;
 
 import java.util.*;
@@ -64,14 +65,14 @@ public class Index
 
                     new Item("MissingRequiredARP", "Missing Query Parameter for @ActivationRequestParameter", "Activating a page with a required @ActivationRequestParameter, but no matching query parameter, is an error."),
 
-                    new Item ("DateFieldValidationDemo", "DateField Validation Demo",
+                    new Item("DateFieldValidationDemo", "DateField Validation Demo",
                             "Use of DateField component when client validation is disabled."),
 
                     new Item("MixinParameters54", "Strict Mixin Parameters", "In the 5.4 DTD, Parameter Mixins must be qualified with the mixin id."),
 
                     new Item("AsyncDemo", "Async Links and Forms Demo", "Async (XHR) Updates without a containing Zone."),
 
-                    new Item ("FormCancelActionDemo", "Form Cancel Action Demo", "FormSupport.addCancel() support"),
+                    new Item("FormCancelActionDemo", "Form Cancel Action Demo", "FormSupport.addCancel() support"),
 
                     new Item("AjaxRadioDemo", "Ajax Radio Demo", "Radio components inside an Ajax form"),
 
@@ -128,7 +129,7 @@ public class Index
 
                     new Item("PACMultipleAnnotationDemo", "PageActivationContext Multiple Demo",
                             "Demonstrates multiple @PageActivationContext fields."),
-                            
+
                     new Item("PublicFieldAccessDemo", "Public Field Access Demo", "Demonstrates TAP5-1222 fix"),
 
                     new Item("ActivationRequestParameterDemo", "ActivationRequestParameter Annotation Demo",
@@ -575,9 +576,9 @@ public class Index
                     new Item("PartialTemplateRendererDemo", "PartialTemplateRenderer Demo", "Shows some examples of rendering blocks and components to a String using PartialTemplateRenderer"),
 
                     new Item("nested/PageThatThrowsException", "Reload on nested page", "Tests a page reload from a nested page's exception report"),
-                    
+
                     new Item("inplacegridinloopdemo", "In-Place Grid in a Loop Demo", "In-place grid in a loop"),
-                    
+
                     new Item("GenericTypeDemo", "Generic bound type demo", "Tests that generic type info is available for generic bindings"),
 
                     new Item("FormFieldClientIdParameterDemo", "Form Field clientId Parameter Demo", "Shows and tests how to explicitly set the id of a form field component"),
@@ -601,6 +602,9 @@ public class Index
     @Inject
     private ComponentResources resources;
 
+    @Inject
+    private PageRenderLinkSource linkSource;
+
     @Property
     private String key;
 
@@ -629,7 +633,7 @@ public class Index
 
     public Link getInjectDemoLink()
     {
-        return resources.createPageLink(InjectDemo.class, false);
+        return linkSource.createPageRenderLink(InjectDemo.class);
     }
 
     public List getDemoContext()

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ff08ad57/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/PageLinkContext.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/PageLinkContext.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/PageLinkContext.java
index 0681984..b893fae 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/PageLinkContext.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/PageLinkContext.java
@@ -1,5 +1,3 @@
-// Copyright 2007, 2008 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
@@ -14,8 +12,8 @@
 
 package org.apache.tapestry5.integration.app1.pages;
 
-import org.apache.tapestry5.ComponentResources;
 import org.apache.tapestry5.ioc.annotations.Inject;
+import org.apache.tapestry5.services.PageRenderLinkSource;
 
 import java.util.Arrays;
 import java.util.List;
@@ -23,7 +21,7 @@ import java.util.List;
 public class PageLinkContext
 {
     @Inject
-    private ComponentResources resources;
+    private PageRenderLinkSource pageRenderLinkSource;
 
     public List getComputedContext()
     {
@@ -42,6 +40,6 @@ public class PageLinkContext
 
     Object onActionFromNullContext()
     {
-        return resources.createPageLink("target", true, new Object[] {null});
+        return pageRenderLinkSource.createPageRenderLinkWithContext("target", new Object[]{null});
     }
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ff08ad57/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ReturnTypes.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ReturnTypes.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ReturnTypes.java
index e876d3d..bdad704 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ReturnTypes.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ReturnTypes.java
@@ -1,5 +1,3 @@
-// Copyright 2007, 2008 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
@@ -14,7 +12,6 @@
 
 package org.apache.tapestry5.integration.app1.pages;
 
-import org.apache.tapestry5.ComponentResources;
 import org.apache.tapestry5.annotations.InjectPage;
 import org.apache.tapestry5.integration.app1.data.Track;
 import org.apache.tapestry5.integration.app1.pages.music.MusicDetails;
@@ -22,14 +19,14 @@ import org.apache.tapestry5.integration.app1.services.MusicLibrary;
 import org.apache.tapestry5.ioc.annotations.Inject;
 import org.apache.tapestry5.services.ComponentEventResultProcessor;
 import org.apache.tapestry5.services.HttpError;
+import org.apache.tapestry5.services.PageRenderLinkSource;
 import org.apache.tapestry5.services.StreamPageContent;
 import org.apache.tapestry5.util.TextStreamResponse;
 
+import javax.servlet.http.HttpServletResponse;
 import java.net.MalformedURLException;
 import java.net.URL;
 
-import javax.servlet.http.HttpServletResponse;
-
 /**
  * Tests the various event handler method return types.
  *
@@ -41,8 +38,8 @@ public class ReturnTypes
     private Index index;
 
     @Inject
-    private ComponentResources resources;
-    
+    private PageRenderLinkSource linkSource;
+
     @Inject
     private MusicLibrary library;
 
@@ -68,7 +65,7 @@ public class ReturnTypes
 
     Object onActionFromLinkReturnValue()
     {
-        return resources.createPageLink("index", false);
+        return linkSource.createPageRenderLink("index");
     }
 
     Object onActionFromStreamReturnValue()
@@ -87,19 +84,19 @@ public class ReturnTypes
     {
         return new URL("http://google.com");
     }
-    
+
     Object onActionFromStreamPageContent()
-    {   
+    {
         return new StreamPageContent(Index.class);
     }
-    
+
     Object onActionFromStreamPageContentWithContext()
     {
         Track track = library.getById(294L);
-        
+
         return new StreamPageContent(MusicDetails.class, track);
     }
-    
+
 
     Object onActionFromHttpError()
     {


[3/4] tapestry-5 git commit: Make a correction to how the event link is created

Posted by hl...@apache.org.
Make a correction to how the event link is created


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/8caf479f
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/8caf479f
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/8caf479f

Branch: refs/heads/master
Commit: 8caf479fd3998b24b0fe5e7c06666c6eff243643
Parents: 91ab2f9
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Mon Dec 29 08:59:53 2014 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Mon Dec 29 08:59:53 2014 -0800

----------------------------------------------------------------------
 .../tapestry5/integration/app1/pages/ActionViaLinkDemo.java    | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/8caf479f/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActionViaLinkDemo.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActionViaLinkDemo.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActionViaLinkDemo.java
index dbafd37..5289cac 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActionViaLinkDemo.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActionViaLinkDemo.java
@@ -29,7 +29,7 @@ public class ActionViaLinkDemo
     Object[]
     onPassivate()
     {
-        return new Object[] { };
+        return new Object[]{};
     }
 
     public String getMessage()
@@ -39,14 +39,12 @@ public class ActionViaLinkDemo
 
     void onUpdateMessage(String message)
     {
-        getActionURL();
-
         this.message = message;
     }
 
     public String getActionURL()
     {
-        Link link = resources.createEventLink("UpdateMessage", false, "from getActionURL()");
+        Link link = resources.createEventLink("UpdateMessage", "from getActionURL()");
 
         return link.toURI();
     }


[2/4] tapestry-5 git commit: Compute year (displayed in page footer) based on Calendar, rather than hard-coded.

Posted by hl...@apache.org.
Compute year (displayed in page footer) based on Calendar, rather than hard-coded.


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/91ab2f9d
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/91ab2f9d
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/91ab2f9d

Branch: refs/heads/master
Commit: 91ab2f9dad9583ac11c812c58840830912442330
Parents: 4a74819
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Mon Dec 29 08:57:31 2014 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Mon Dec 29 08:59:00 2014 -0800

----------------------------------------------------------------------
 .../tapestry5/integration/app1/components/Border.java   | 12 +++++++++---
 .../tapestry5/integration/app1/components/Border.tml    |  2 +-
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/91ab2f9d/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java
index ef117a1..e2d99fe 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java
@@ -1,5 +1,3 @@
-// Copyright 2006-2013 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
@@ -20,6 +18,8 @@ import org.apache.tapestry5.annotations.Property;
 import org.apache.tapestry5.ioc.annotations.Inject;
 import org.apache.tapestry5.services.Request;
 
+import java.util.Calendar;
+
 /**
  * Here's a component with a template, including a t:body element. Really should rename this to "Layout" as that's the
  * T5 naming.
@@ -34,6 +34,13 @@ public class Border
     @Inject
     private ComponentResources resources;
 
+    public static final int year;
+
+    static
+    {
+        year = Calendar.getInstance().get(Calendar.YEAR);
+    }
+
     public String getSecure()
     {
         return request.isSecure() ? "secure" : "insecure";
@@ -45,5 +52,4 @@ public class Border
 
         return true;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/91ab2f9d/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/Border.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/Border.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/Border.tml
index 555d51d..36c8b00 100644
--- a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/Border.tml
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/Border.tml
@@ -55,7 +55,7 @@
         <t:renderobject object="request"/>
 
         <p class="well">
-            &copy; 2008-2013
+            &copy; 2008-${year}
             <a href="http://apache.org/">Apache Software Foundation</a>
         </p>
     </div>


[4/4] tapestry-5 git commit: Remove long deprecated createPageLink() methods from ComponentResourcesCommon

Posted by hl...@apache.org.
Remove long deprecated createPageLink() methods from ComponentResourcesCommon


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/ff08ad57
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/ff08ad57
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/ff08ad57

Branch: refs/heads/master
Commit: ff08ad572b9faa04c0add703debc53965d6c77c8
Parents: 8caf479
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Mon Dec 29 09:23:21 2014 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Mon Dec 29 09:23:21 2014 -0800

----------------------------------------------------------------------
 .../tapestry5/ComponentResourcesCommon.java     | 37 --------------------
 .../tapestry5/internal/services/LinkSource.java | 29 +++++++--------
 .../structure/ComponentPageElementImpl.java     | 10 ------
 .../InternalComponentResourcesImpl.java         | 10 ------
 .../services/PageRenderLinkSource.java          | 28 ++++++++-------
 .../tapestry5/integration/app1/pages/Index.java | 16 +++++----
 .../integration/app1/pages/PageLinkContext.java |  8 ++---
 .../integration/app1/pages/ReturnTypes.java     | 23 ++++++------
 8 files changed, 54 insertions(+), 107 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ff08ad57/tapestry-core/src/main/java/org/apache/tapestry5/ComponentResourcesCommon.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/ComponentResourcesCommon.java b/tapestry-core/src/main/java/org/apache/tapestry5/ComponentResourcesCommon.java
index e60597a..6d2b20c 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/ComponentResourcesCommon.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/ComponentResourcesCommon.java
@@ -206,41 +206,4 @@ public interface ComponentResourcesCommon extends Locatable
      * @return link object for the callback
      */
     Link createFormEventLink(String eventType, Object... context);
-
-    /**
-     * Creates a page render request link to render a specific page.
-     * 
-     * @param pageName
-     *            the logical name of the page to link to
-     * @param override
-     *            if true, the context is used even if empty (normally, the target page is allowed to passivate,
-     *            providing a context, when the provided context is empty)
-     * @param context
-     *            the activation context for the page. If omitted, the activation context is obtained from the
-     *            target page
-     * @return link for a render request to the targeted page
-     * @deprecated Use {@link org.apache.tapestry5.services.PageRenderLinkSource#createPageRenderLink(String)} or
-     *             {@link org.apache.tapestry5.services.PageRenderLinkSource#createPageRenderLinkWithContext(String, Object[])}
-     *             instead
-     */
-    Link createPageLink(String pageName, boolean override, Object... context);
-
-    /**
-     * Creates a page render request link to render a specific page. Using a page class, rather than a page name, is
-     * more refactoring safe (in the even the page is renamed or moved).
-     * 
-     * @param pageClass
-     *            identifies the page to link to
-     * @param override
-     *            if true, the context is used even if empty (normally, the target page is allowed to passivate,
-     *            providing a context, when the provided context is empty)
-     * @param context
-     *            the activation context for the page. If omitted, the activation context is obtained from the
-     *            target page
-     * @return link for a render request to the targeted page
-     * @deprecated Use {@link org.apache.tapestry5.services.PageRenderLinkSource#createPageRenderLink(Class)} or
-     *             {@link org.apache.tapestry5.services.PageRenderLinkSource#createPageRenderLinkWithContext(Class, Object[])}
-     *             instead
-     */
-    Link createPageLink(Class pageClass, boolean override, Object... context);
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ff08ad57/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSource.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSource.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSource.java
index c967c06..3ec9ef6 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSource.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSource.java
@@ -20,7 +20,7 @@ import org.apache.tapestry5.services.LinkCreationListener2;
 
 /**
  * A source for {@link org.apache.tapestry5.Link} objects.
- * 
+ *
  * @see org.apache.tapestry5.services.LinkCreationListener2
  * @since 5.1.0.0
  */
@@ -30,18 +30,18 @@ public interface LinkSource
     /**
      * Creates a stateful action link. Action links are built for components. Action links are encoded by the current
      * request (that is, bound to the current request's session, if any).
-     * 
+     *
      * @param page
-     *            the page holding the component
+     *         the page holding the component
      * @param nestedId
-     *            the component's qualified id (a sequence of simple ids, separated by dots).
+     *         the component's qualified id (a sequence of simple ids, separated by dots).
      * @param eventType
-     *            the type of event to trigger
+     *         the type of event to trigger
      * @param forForm
-     *            true if the link is for a form, false otherwise
+     *         true if the link is for a form, false otherwise
      * @param context
-     *            Additional path data, each value will be converted to a string and appended to the URI @return a
-     *            link
+     *         Additional path data, each value will be converted to a string and appended to the URI @return a
+     *         link
      * @see org.apache.tapestry5.ComponentResources#createEventLink(String, Object...)
      */
     Link createComponentEventLink(Page page, String nestedId, String eventType, boolean forForm, Object... context);
@@ -54,21 +54,22 @@ public interface LinkSource
      * When the activationContext is an empty array, the targeted page is checked to see if it can provide an activation
      * context. This is accomplished by triggering a "passivate" event on the targeted page. If the override parameter
      * is true, this will not occur (even when the activation context is empty).
-     * 
+     *
      * @param pageName
-     *            name of the page to which a link should be created
+     *         name of the page to which a link should be created
      * @param override
-     *            if true, then the provided activation context is always used even if empty
+     *         if true, then the provided activation context is always used even if empty
      * @param pageActivationContext
-     *            the activation context for the page
+     *         the activation context for the page
      * @return a link
-     * @see org.apache.tapestry5.ComponentResources#createPageLink(String, boolean, Object[])
+     * @see org.apache.tapestry5.services.PageRenderLinkSource#createPageRenderLink(String)
+     * @see org.apache.tapestry5.services.PageRenderLinkSource#createPageRenderLinkWithContext(String, Object[])
      */
     Link createPageRenderLink(String pageName, boolean override, Object... pageActivationContext);
 
     /**
      * Returns the hub, used to register and de-register {@link org.apache.tapestry5.services.LinkCreationListener2}s.
-     * 
+     *
      * @return the hub
      */
     LinkCreationHub getLinkCreationHub();

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ff08ad57/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
index 92988d6..6c34ab8 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
@@ -1246,16 +1246,6 @@ public class ComponentPageElementImpl extends BaseLocatable implements Component
         return elementResources.createComponentEventLink(coreResources, eventType, true, context);
     }
 
-    public Link createPageLink(String pageName, boolean override, Object... context)
-    {
-        return elementResources.createPageRenderLink(pageName, override, context);
-    }
-
-    public Link createPageLink(Class pageClass, boolean override, Object... context)
-    {
-        return elementResources.createPageRenderLink(pageClass, override, context);
-    }
-
     protected RenderPhaseEvent createRenderEvent(RenderQueue queue)
     {
         return new RenderPhaseEvent(new RenderPhaseEventHandler(queue), eventLogger, elementResources);

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ff08ad57/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java
index 9f4aff1..886d773 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/InternalComponentResourcesImpl.java
@@ -212,16 +212,6 @@ public class InternalComponentResourcesImpl extends LockSupport implements Inter
         return element.createFormEventLink(eventType, context);
     }
 
-    public Link createPageLink(String pageName, boolean override, Object... context)
-    {
-        return element.createPageLink(pageName, override, context);
-    }
-
-    public Link createPageLink(Class pageClass, boolean override, Object... context)
-    {
-        return element.createPageLink(pageClass, override, context);
-    }
-
     public void discardPersistentFieldChanges()
     {
         page.discardPersistentFieldChanges();

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ff08ad57/tapestry-core/src/main/java/org/apache/tapestry5/services/PageRenderLinkSource.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/services/PageRenderLinkSource.java b/tapestry-core/src/main/java/org/apache/tapestry5/services/PageRenderLinkSource.java
index 1ff2ab3..6ea42ae 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/services/PageRenderLinkSource.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/services/PageRenderLinkSource.java
@@ -1,5 +1,3 @@
-// Copyright 2009 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
@@ -14,12 +12,11 @@
 
 package org.apache.tapestry5.services;
 
-import org.apache.tapestry5.Link;
 import org.apache.tapestry5.EventContext;
+import org.apache.tapestry5.Link;
 
 /**
- * A service that allows other services to create page render links (which are otherwise created by components, via
- * {@link org.apache.tapestry5.ComponentResources#createPageLink(String, boolean, Object[])}).
+ * A service that allows other services to create page render links.
  *
  * @since 5.1.0.2
  */
@@ -28,7 +25,8 @@ public interface PageRenderLinkSource
     /**
      * Creates a page render link using the page's normal passivation context (if it has one).
      *
-     * @param pageName name of page to create link to
+     * @param pageName
+     *         name of page to create link to
      * @return render link for the page
      */
     Link createPageRenderLink(String pageName);
@@ -36,8 +34,10 @@ public interface PageRenderLinkSource
     /**
      * Creates a page render link using an override of the page's passivation context (possibly an empty one).
      *
-     * @param pageName name of page to create link to
-     * @param context zero or more values to encode as the passiviation context
+     * @param pageName
+     *         name of page to create link to
+     * @param context
+     *         zero or more values to encode as the passiviation context
      * @return render link for the page
      */
     Link createPageRenderLinkWithContext(String pageName, Object... context);
@@ -45,8 +45,10 @@ public interface PageRenderLinkSource
     /**
      * Creates a page render link using an override of the page's passivation context.
      *
-     * @param pageName name of page to create link to
-     * @param eventContext the EventContext to encode as the passiviation context
+     * @param pageName
+     *         name of page to create link to
+     * @param eventContext
+     *         the EventContext to encode as the passiviation context
      * @return render link for the page
      * @since 5.2.0.0
      */
@@ -66,7 +68,8 @@ public interface PageRenderLinkSource
      * page's passivation context (possibly an empty one).
      *
      * @param pageClass
-     * @param context zero or more values to encode as the passiviation context
+     * @param context
+     *         zero or more values to encode as the passiviation context
      * @return render link for the page
      */
     Link createPageRenderLinkWithContext(Class pageClass, Object... context);
@@ -76,7 +79,8 @@ public interface PageRenderLinkSource
      * page's passivation context
      *
      * @param pageClass
-     * @param eventContext the EventContext to encode as the passiviation context
+     * @param eventContext
+     *         the EventContext to encode as the passiviation context
      * @return render link for the page
      * @since 5.2.0.0
      */

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ff08ad57/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
index cdd22ec..f146ec1 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
@@ -21,6 +21,7 @@ import org.apache.tapestry5.annotations.Property;
 import org.apache.tapestry5.ioc.annotations.Inject;
 import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
 import org.apache.tapestry5.ioc.internal.util.InternalUtils;
+import org.apache.tapestry5.services.PageRenderLinkSource;
 import org.apache.tapestry5.services.StreamPageContent;
 
 import java.util.*;
@@ -64,14 +65,14 @@ public class Index
 
                     new Item("MissingRequiredARP", "Missing Query Parameter for @ActivationRequestParameter", "Activating a page with a required @ActivationRequestParameter, but no matching query parameter, is an error."),
 
-                    new Item ("DateFieldValidationDemo", "DateField Validation Demo",
+                    new Item("DateFieldValidationDemo", "DateField Validation Demo",
                             "Use of DateField component when client validation is disabled."),
 
                     new Item("MixinParameters54", "Strict Mixin Parameters", "In the 5.4 DTD, Parameter Mixins must be qualified with the mixin id."),
 
                     new Item("AsyncDemo", "Async Links and Forms Demo", "Async (XHR) Updates without a containing Zone."),
 
-                    new Item ("FormCancelActionDemo", "Form Cancel Action Demo", "FormSupport.addCancel() support"),
+                    new Item("FormCancelActionDemo", "Form Cancel Action Demo", "FormSupport.addCancel() support"),
 
                     new Item("AjaxRadioDemo", "Ajax Radio Demo", "Radio components inside an Ajax form"),
 
@@ -128,7 +129,7 @@ public class Index
 
                     new Item("PACMultipleAnnotationDemo", "PageActivationContext Multiple Demo",
                             "Demonstrates multiple @PageActivationContext fields."),
-                            
+
                     new Item("PublicFieldAccessDemo", "Public Field Access Demo", "Demonstrates TAP5-1222 fix"),
 
                     new Item("ActivationRequestParameterDemo", "ActivationRequestParameter Annotation Demo",
@@ -575,9 +576,9 @@ public class Index
                     new Item("PartialTemplateRendererDemo", "PartialTemplateRenderer Demo", "Shows some examples of rendering blocks and components to a String using PartialTemplateRenderer"),
 
                     new Item("nested/PageThatThrowsException", "Reload on nested page", "Tests a page reload from a nested page's exception report"),
-                    
+
                     new Item("inplacegridinloopdemo", "In-Place Grid in a Loop Demo", "In-place grid in a loop"),
-                    
+
                     new Item("GenericTypeDemo", "Generic bound type demo", "Tests that generic type info is available for generic bindings"),
 
                     new Item("FormFieldClientIdParameterDemo", "Form Field clientId Parameter Demo", "Shows and tests how to explicitly set the id of a form field component"),
@@ -601,6 +602,9 @@ public class Index
     @Inject
     private ComponentResources resources;
 
+    @Inject
+    private PageRenderLinkSource linkSource;
+
     @Property
     private String key;
 
@@ -629,7 +633,7 @@ public class Index
 
     public Link getInjectDemoLink()
     {
-        return resources.createPageLink(InjectDemo.class, false);
+        return linkSource.createPageRenderLink(InjectDemo.class);
     }
 
     public List getDemoContext()

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ff08ad57/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/PageLinkContext.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/PageLinkContext.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/PageLinkContext.java
index 0681984..b893fae 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/PageLinkContext.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/PageLinkContext.java
@@ -1,5 +1,3 @@
-// Copyright 2007, 2008 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
@@ -14,8 +12,8 @@
 
 package org.apache.tapestry5.integration.app1.pages;
 
-import org.apache.tapestry5.ComponentResources;
 import org.apache.tapestry5.ioc.annotations.Inject;
+import org.apache.tapestry5.services.PageRenderLinkSource;
 
 import java.util.Arrays;
 import java.util.List;
@@ -23,7 +21,7 @@ import java.util.List;
 public class PageLinkContext
 {
     @Inject
-    private ComponentResources resources;
+    private PageRenderLinkSource pageRenderLinkSource;
 
     public List getComputedContext()
     {
@@ -42,6 +40,6 @@ public class PageLinkContext
 
     Object onActionFromNullContext()
     {
-        return resources.createPageLink("target", true, new Object[] {null});
+        return pageRenderLinkSource.createPageRenderLinkWithContext("target", new Object[]{null});
     }
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ff08ad57/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ReturnTypes.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ReturnTypes.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ReturnTypes.java
index e876d3d..bdad704 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ReturnTypes.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ReturnTypes.java
@@ -1,5 +1,3 @@
-// Copyright 2007, 2008 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
@@ -14,7 +12,6 @@
 
 package org.apache.tapestry5.integration.app1.pages;
 
-import org.apache.tapestry5.ComponentResources;
 import org.apache.tapestry5.annotations.InjectPage;
 import org.apache.tapestry5.integration.app1.data.Track;
 import org.apache.tapestry5.integration.app1.pages.music.MusicDetails;
@@ -22,14 +19,14 @@ import org.apache.tapestry5.integration.app1.services.MusicLibrary;
 import org.apache.tapestry5.ioc.annotations.Inject;
 import org.apache.tapestry5.services.ComponentEventResultProcessor;
 import org.apache.tapestry5.services.HttpError;
+import org.apache.tapestry5.services.PageRenderLinkSource;
 import org.apache.tapestry5.services.StreamPageContent;
 import org.apache.tapestry5.util.TextStreamResponse;
 
+import javax.servlet.http.HttpServletResponse;
 import java.net.MalformedURLException;
 import java.net.URL;
 
-import javax.servlet.http.HttpServletResponse;
-
 /**
  * Tests the various event handler method return types.
  *
@@ -41,8 +38,8 @@ public class ReturnTypes
     private Index index;
 
     @Inject
-    private ComponentResources resources;
-    
+    private PageRenderLinkSource linkSource;
+
     @Inject
     private MusicLibrary library;
 
@@ -68,7 +65,7 @@ public class ReturnTypes
 
     Object onActionFromLinkReturnValue()
     {
-        return resources.createPageLink("index", false);
+        return linkSource.createPageRenderLink("index");
     }
 
     Object onActionFromStreamReturnValue()
@@ -87,19 +84,19 @@ public class ReturnTypes
     {
         return new URL("http://google.com");
     }
-    
+
     Object onActionFromStreamPageContent()
-    {   
+    {
         return new StreamPageContent(Index.class);
     }
-    
+
     Object onActionFromStreamPageContentWithContext()
     {
         Track track = library.getById(294L);
-        
+
         return new StreamPageContent(MusicDetails.class, track);
     }
-    
+
 
     Object onActionFromHttpError()
     {


[3/4] tapestry-5 git commit: Make a correction to how the event link is created

Posted by hl...@apache.org.
Make a correction to how the event link is created


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/8caf479f
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/8caf479f
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/8caf479f

Branch: refs/heads/master
Commit: 8caf479fd3998b24b0fe5e7c06666c6eff243643
Parents: 91ab2f9
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Mon Dec 29 08:59:53 2014 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Mon Dec 29 08:59:53 2014 -0800

----------------------------------------------------------------------
 .../tapestry5/integration/app1/pages/ActionViaLinkDemo.java    | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/8caf479f/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActionViaLinkDemo.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActionViaLinkDemo.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActionViaLinkDemo.java
index dbafd37..5289cac 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActionViaLinkDemo.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ActionViaLinkDemo.java
@@ -29,7 +29,7 @@ public class ActionViaLinkDemo
     Object[]
     onPassivate()
     {
-        return new Object[] { };
+        return new Object[]{};
     }
 
     public String getMessage()
@@ -39,14 +39,12 @@ public class ActionViaLinkDemo
 
     void onUpdateMessage(String message)
     {
-        getActionURL();
-
         this.message = message;
     }
 
     public String getActionURL()
     {
-        Link link = resources.createEventLink("UpdateMessage", false, "from getActionURL()");
+        Link link = resources.createEventLink("UpdateMessage", "from getActionURL()");
 
         return link.toURI();
     }


[2/4] tapestry-5 git commit: Compute year (displayed in page footer) based on Calendar, rather than hard-coded.

Posted by hl...@apache.org.
Compute year (displayed in page footer) based on Calendar, rather than hard-coded.


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/91ab2f9d
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/91ab2f9d
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/91ab2f9d

Branch: refs/heads/master
Commit: 91ab2f9dad9583ac11c812c58840830912442330
Parents: 4a74819
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Mon Dec 29 08:57:31 2014 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Mon Dec 29 08:59:00 2014 -0800

----------------------------------------------------------------------
 .../tapestry5/integration/app1/components/Border.java   | 12 +++++++++---
 .../tapestry5/integration/app1/components/Border.tml    |  2 +-
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/91ab2f9d/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java
index ef117a1..e2d99fe 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java
@@ -1,5 +1,3 @@
-// Copyright 2006-2013 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
@@ -20,6 +18,8 @@ import org.apache.tapestry5.annotations.Property;
 import org.apache.tapestry5.ioc.annotations.Inject;
 import org.apache.tapestry5.services.Request;
 
+import java.util.Calendar;
+
 /**
  * Here's a component with a template, including a t:body element. Really should rename this to "Layout" as that's the
  * T5 naming.
@@ -34,6 +34,13 @@ public class Border
     @Inject
     private ComponentResources resources;
 
+    public static final int year;
+
+    static
+    {
+        year = Calendar.getInstance().get(Calendar.YEAR);
+    }
+
     public String getSecure()
     {
         return request.isSecure() ? "secure" : "insecure";
@@ -45,5 +52,4 @@ public class Border
 
         return true;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/91ab2f9d/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/Border.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/Border.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/Border.tml
index 555d51d..36c8b00 100644
--- a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/Border.tml
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/Border.tml
@@ -55,7 +55,7 @@
         <t:renderobject object="request"/>
 
         <p class="well">
-            &copy; 2008-2013
+            &copy; 2008-${year}
             <a href="http://apache.org/">Apache Software Foundation</a>
         </p>
     </div>