You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2014/06/03 19:51:49 UTC
[1/4] git commit: Advance version number to 5.4-beta-9
Repository: tapestry-5
Updated Branches:
refs/heads/master 69e672d05 -> 940722a74
Advance version number to 5.4-beta-9
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/d49ddd60
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/d49ddd60
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/d49ddd60
Branch: refs/heads/master
Commit: d49ddd604f4387b8d0c0f42ccee75191967a6fa1
Parents: 69e672d
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Jun 3 09:31:35 2014 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Jun 3 09:31:35 2014 -0700
----------------------------------------------------------------------
build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d49ddd60/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 1ad0100..f4bb670 100755
--- a/build.gradle
+++ b/build.gradle
@@ -36,7 +36,7 @@ project.version = tapestryVersion()
def tapestryVersion() {
def major = "5.4"
- def minor = "-beta-8"
+ def minor = "-beta-9"
// When building on the CI server, make sure -SNAPSHOT is appended, as it is a nightly build.
// When building normally, or for a release, no suffix is desired.
[4/4] git commit: Advance version number to 5.4-beta-11
Posted by hl...@apache.org.
Advance version number to 5.4-beta-11
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/940722a7
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/940722a7
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/940722a7
Branch: refs/heads/master
Commit: 940722a74e3ec2fc316163ab9c44e7f949186e1c
Parents: 326786c
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Jun 3 10:51:49 2014 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Jun 3 10:51:49 2014 -0700
----------------------------------------------------------------------
build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/940722a7/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 03853ac..70999c3 100755
--- a/build.gradle
+++ b/build.gradle
@@ -36,7 +36,7 @@ project.version = tapestryVersion()
def tapestryVersion() {
def major = "5.4"
- def minor = "-beta-10"
+ def minor = "-beta-11"
// When building on the CI server, make sure -SNAPSHOT is appended, as it is a nightly build.
// When building normally, or for a release, no suffix is desired.
[2/4] git commit: Add a few extension hooks into the Form component
Posted by hl...@apache.org.
Add a few extension hooks into the Form component
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/20288583
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/20288583
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/20288583
Branch: refs/heads/master
Commit: 20288583b5bfa7a65b7093911db0a5ad8e1c40c8
Parents: d49ddd6
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Jun 3 10:14:20 2014 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Jun 3 10:14:20 2014 -0700
----------------------------------------------------------------------
.../tapestry5/corelib/components/Form.java | 70 ++++++++++++++++++--
1 file changed, 64 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/20288583/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java
index 1347484..8625439 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java
@@ -19,7 +19,9 @@ import org.apache.tapestry5.corelib.internal.ComponentActionSink;
import org.apache.tapestry5.corelib.internal.FormSupportImpl;
import org.apache.tapestry5.corelib.internal.InternalFormSupport;
import org.apache.tapestry5.dom.Element;
-import org.apache.tapestry5.internal.*;
+import org.apache.tapestry5.internal.BeanValidationContext;
+import org.apache.tapestry5.internal.BeanValidationContextImpl;
+import org.apache.tapestry5.internal.InternalConstants;
import org.apache.tapestry5.internal.services.FormControlNameManager;
import org.apache.tapestry5.internal.services.HeartbeatImpl;
import org.apache.tapestry5.internal.util.AutofocusValidationDecorator;
@@ -128,7 +130,7 @@ public class Form implements ClientElement, FormValidationControl
* <a href="https://issues.apache.org/jira/browse/TAP5-1808">TAP5-1801</a>.
*/
@Parameter("defaultTracker")
- private ValidationTracker tracker;
+ protected ValidationTracker tracker;
@Inject
@Symbol(SymbolConstants.FORM_CLIENT_LOGIC_ENABLED)
@@ -388,8 +390,7 @@ public class Form implements ClientElement, FormValidationControl
try
{
value = URLDecoder.decode(value, "UTF-8");
- }
- catch (UnsupportedEncodingException e)
+ } catch (UnsupportedEncodingException e)
{
logger.error(String.format(
"Enable to decode parameter value for parameter %s in form %s",
@@ -472,6 +473,8 @@ public class Form implements ClientElement, FormValidationControl
{"unchecked", "InfiniteLoopStatement"})
Object onAction(EventContext context) throws IOException
{
+ beforeProcessSubmit(context);
+
tracker.clear();
formSupport = new FormSupportImpl(resources, validationId);
@@ -520,7 +523,11 @@ public class Form implements ClientElement, FormValidationControl
fireValidateEvent(EventConstants.VALIDATE, context, eventCallback);
if (eventCallback.isAborted())
+ {
return true;
+ }
+
+ afterValidate();
// Let the listeners know about overall success or failure. Most
// listeners fall into
@@ -552,6 +559,8 @@ public class Form implements ClientElement, FormValidationControl
resources.triggerContextEvent(EventConstants.SUBMIT, context, eventCallback);
+ afterSuccessOrFailure();
+
if (eventCallback.isAborted())
{
return true;
@@ -585,6 +594,52 @@ public class Form implements ClientElement, FormValidationControl
}
}
+ /**
+ * A hook invoked from {@link #onAction(org.apache.tapestry5.EventContext)} after the
+ * {@link org.apache.tapestry5.EventConstants#SUBMIT} or {@link org.apache.tapestry5.EventConstants#FAILURE} event has been triggered.
+ * <p/>
+ * This method will be invoked regardless of whether the submit or failure event was aborted.
+ * <p/>
+ * This implementation does nothing.
+ *
+ * @since 5.4
+ */
+
+ protected void afterSuccessOrFailure()
+ {
+
+ }
+
+ /**
+ * A hook invoked from {@link #onAction(org.apache.tapestry5.EventContext)} before any other setup.
+ * <p/>
+ * This implementation does nothing.
+ *
+ * @param context
+ * as passed to {@code onAction()}
+ * @since 5.4
+ */
+ protected void beforeProcessSubmit(EventContext context)
+ {
+
+ }
+
+ /**
+ * A hook invoked from {@link #onAction(org.apache.tapestry5.EventContext)} after the
+ * {@link org.apache.tapestry5.EventConstants#VALIDATE} event has been triggered, and
+ * before the {@link #tracker} has been {@linkplain org.apache.tapestry5.ValidationTracker#clear() cleared}.
+ * <p/>
+ * Only invoked if the valiate event did not abort (that is, the no event handler method returned a value).
+ * <p/>
+ * This implementation does nothing.
+ *
+ * @since 5.4
+ */
+ protected void afterValidate()
+ {
+
+ }
+
private boolean isFormCancelled()
{
// The "cancel" query parameter is reserved for this purpose; if it is present then the form was canceled on the
@@ -672,7 +727,10 @@ public class Form implements ClientElement, FormValidationControl
// Actions are a mix of ordinary actions and cancel actions. Filter out one set or the other
// based on whether the form was submitted or cancelled.
- if (forFormCancel != cancelAction) { continue; }
+ if (forFormCancel != cancelAction)
+ {
+ continue;
+ }
component = source.getComponent(componentId);
@@ -765,7 +823,7 @@ public class Form implements ClientElement, FormValidationControl
} catch (RuntimeException ex)
{
logger.error(
- String.format("Unable to obtrain form control names to preallocate: %s",
+ String.format("Unable to obtain form control names to preallocate: %s",
ExceptionUtils.toMessage(ex)), ex);
}
}
[3/4] git commit: Advance version number to 5.4-beta-10
Posted by hl...@apache.org.
Advance version number to 5.4-beta-10
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/326786c8
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/326786c8
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/326786c8
Branch: refs/heads/master
Commit: 326786c8b739e8b093794710d20a7a28631813da
Parents: 2028858
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Jun 3 10:15:05 2014 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Jun 3 10:15:05 2014 -0700
----------------------------------------------------------------------
build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/326786c8/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index f4bb670..03853ac 100755
--- a/build.gradle
+++ b/build.gradle
@@ -36,7 +36,7 @@ project.version = tapestryVersion()
def tapestryVersion() {
def major = "5.4"
- def minor = "-beta-9"
+ def minor = "-beta-10"
// When building on the CI server, make sure -SNAPSHOT is appended, as it is a nightly build.
// When building normally, or for a release, no suffix is desired.
[2/4] git commit: Add a few extension hooks into the Form component
Posted by hl...@apache.org.
Add a few extension hooks into the Form component
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/20288583
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/20288583
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/20288583
Branch: refs/heads/master
Commit: 20288583b5bfa7a65b7093911db0a5ad8e1c40c8
Parents: d49ddd6
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Jun 3 10:14:20 2014 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Jun 3 10:14:20 2014 -0700
----------------------------------------------------------------------
.../tapestry5/corelib/components/Form.java | 70 ++++++++++++++++++--
1 file changed, 64 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/20288583/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java
index 1347484..8625439 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java
@@ -19,7 +19,9 @@ import org.apache.tapestry5.corelib.internal.ComponentActionSink;
import org.apache.tapestry5.corelib.internal.FormSupportImpl;
import org.apache.tapestry5.corelib.internal.InternalFormSupport;
import org.apache.tapestry5.dom.Element;
-import org.apache.tapestry5.internal.*;
+import org.apache.tapestry5.internal.BeanValidationContext;
+import org.apache.tapestry5.internal.BeanValidationContextImpl;
+import org.apache.tapestry5.internal.InternalConstants;
import org.apache.tapestry5.internal.services.FormControlNameManager;
import org.apache.tapestry5.internal.services.HeartbeatImpl;
import org.apache.tapestry5.internal.util.AutofocusValidationDecorator;
@@ -128,7 +130,7 @@ public class Form implements ClientElement, FormValidationControl
* <a href="https://issues.apache.org/jira/browse/TAP5-1808">TAP5-1801</a>.
*/
@Parameter("defaultTracker")
- private ValidationTracker tracker;
+ protected ValidationTracker tracker;
@Inject
@Symbol(SymbolConstants.FORM_CLIENT_LOGIC_ENABLED)
@@ -388,8 +390,7 @@ public class Form implements ClientElement, FormValidationControl
try
{
value = URLDecoder.decode(value, "UTF-8");
- }
- catch (UnsupportedEncodingException e)
+ } catch (UnsupportedEncodingException e)
{
logger.error(String.format(
"Enable to decode parameter value for parameter %s in form %s",
@@ -472,6 +473,8 @@ public class Form implements ClientElement, FormValidationControl
{"unchecked", "InfiniteLoopStatement"})
Object onAction(EventContext context) throws IOException
{
+ beforeProcessSubmit(context);
+
tracker.clear();
formSupport = new FormSupportImpl(resources, validationId);
@@ -520,7 +523,11 @@ public class Form implements ClientElement, FormValidationControl
fireValidateEvent(EventConstants.VALIDATE, context, eventCallback);
if (eventCallback.isAborted())
+ {
return true;
+ }
+
+ afterValidate();
// Let the listeners know about overall success or failure. Most
// listeners fall into
@@ -552,6 +559,8 @@ public class Form implements ClientElement, FormValidationControl
resources.triggerContextEvent(EventConstants.SUBMIT, context, eventCallback);
+ afterSuccessOrFailure();
+
if (eventCallback.isAborted())
{
return true;
@@ -585,6 +594,52 @@ public class Form implements ClientElement, FormValidationControl
}
}
+ /**
+ * A hook invoked from {@link #onAction(org.apache.tapestry5.EventContext)} after the
+ * {@link org.apache.tapestry5.EventConstants#SUBMIT} or {@link org.apache.tapestry5.EventConstants#FAILURE} event has been triggered.
+ * <p/>
+ * This method will be invoked regardless of whether the submit or failure event was aborted.
+ * <p/>
+ * This implementation does nothing.
+ *
+ * @since 5.4
+ */
+
+ protected void afterSuccessOrFailure()
+ {
+
+ }
+
+ /**
+ * A hook invoked from {@link #onAction(org.apache.tapestry5.EventContext)} before any other setup.
+ * <p/>
+ * This implementation does nothing.
+ *
+ * @param context
+ * as passed to {@code onAction()}
+ * @since 5.4
+ */
+ protected void beforeProcessSubmit(EventContext context)
+ {
+
+ }
+
+ /**
+ * A hook invoked from {@link #onAction(org.apache.tapestry5.EventContext)} after the
+ * {@link org.apache.tapestry5.EventConstants#VALIDATE} event has been triggered, and
+ * before the {@link #tracker} has been {@linkplain org.apache.tapestry5.ValidationTracker#clear() cleared}.
+ * <p/>
+ * Only invoked if the valiate event did not abort (that is, the no event handler method returned a value).
+ * <p/>
+ * This implementation does nothing.
+ *
+ * @since 5.4
+ */
+ protected void afterValidate()
+ {
+
+ }
+
private boolean isFormCancelled()
{
// The "cancel" query parameter is reserved for this purpose; if it is present then the form was canceled on the
@@ -672,7 +727,10 @@ public class Form implements ClientElement, FormValidationControl
// Actions are a mix of ordinary actions and cancel actions. Filter out one set or the other
// based on whether the form was submitted or cancelled.
- if (forFormCancel != cancelAction) { continue; }
+ if (forFormCancel != cancelAction)
+ {
+ continue;
+ }
component = source.getComponent(componentId);
@@ -765,7 +823,7 @@ public class Form implements ClientElement, FormValidationControl
} catch (RuntimeException ex)
{
logger.error(
- String.format("Unable to obtrain form control names to preallocate: %s",
+ String.format("Unable to obtain form control names to preallocate: %s",
ExceptionUtils.toMessage(ex)), ex);
}
}
[4/4] git commit: Advance version number to 5.4-beta-11
Posted by hl...@apache.org.
Advance version number to 5.4-beta-11
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/940722a7
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/940722a7
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/940722a7
Branch: refs/heads/master
Commit: 940722a74e3ec2fc316163ab9c44e7f949186e1c
Parents: 326786c
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Jun 3 10:51:49 2014 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Jun 3 10:51:49 2014 -0700
----------------------------------------------------------------------
build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/940722a7/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 03853ac..70999c3 100755
--- a/build.gradle
+++ b/build.gradle
@@ -36,7 +36,7 @@ project.version = tapestryVersion()
def tapestryVersion() {
def major = "5.4"
- def minor = "-beta-10"
+ def minor = "-beta-11"
// When building on the CI server, make sure -SNAPSHOT is appended, as it is a nightly build.
// When building normally, or for a release, no suffix is desired.
[3/4] git commit: Advance version number to 5.4-beta-10
Posted by hl...@apache.org.
Advance version number to 5.4-beta-10
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/326786c8
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/326786c8
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/326786c8
Branch: refs/heads/master
Commit: 326786c8b739e8b093794710d20a7a28631813da
Parents: 2028858
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Jun 3 10:15:05 2014 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Jun 3 10:15:05 2014 -0700
----------------------------------------------------------------------
build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/326786c8/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index f4bb670..03853ac 100755
--- a/build.gradle
+++ b/build.gradle
@@ -36,7 +36,7 @@ project.version = tapestryVersion()
def tapestryVersion() {
def major = "5.4"
- def minor = "-beta-9"
+ def minor = "-beta-10"
// When building on the CI server, make sure -SNAPSHOT is appended, as it is a nightly build.
// When building normally, or for a release, no suffix is desired.