[jira] [Commented] (TAP5-2022) Add PropertyAccess.getAnnotation
[ https://issues.apache.org/jira/browse/TAP5-2022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13489219#comment-13489219 ] Hudson commented on TAP5-2022: -- Integrated in tapestry-trunk-freestyle #976 (See [https://builds.apache.org/job/tapestry-trunk-freestyle/976/]) FIXED - TAP5-2022: Add PropertyAccess.getAnnotation (Revision b108e06f4b633d77461dda220a07016ee806c0c7) Result = FAILURE kaosko : Files : * tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/ClassPropertyAdapter.java * tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PropertyAccessImpl.java * tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassPropertyAdapterImpl.java * tapestry-ioc/src/test/groovy/ioc/specs/PropertyAccessImplSpec.groovy * tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/PropertyAccess.java > Add PropertyAccess.getAnnotation > > > Key: TAP5-2022 > URL: https://issues.apache.org/jira/browse/TAP5-2022 > Project: Tapestry 5 > Issue Type: Improvement > Components: tapestry-core >Affects Versions: 5.3.6 >Reporter: Kalle Korhonen >Assignee: Kalle Korhonen >Priority: Minor > Fix For: 5.4 > > > On Sun, Oct 28, 2012 at 5:41 AM, Howard Lewis Ship wrote: > > I can't think of why that's not already present. > > > > On Sat, Oct 27, 2012 at 7:56 PM, Kalle Korhonen > > wrote: > >> We don't seem to have anything for fetching annotations... wouldn't it > >> be nice if you could do PropertyAccess.get(Object instance, String > >> propertyName, Class annotationClass) without > >> having to care whether the annotation is on the getter or on the > >> field? Anybody object to adding it? > >> > >> Kalle -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (TAP5-2022) Add PropertyAccess.getAnnotation
[ https://issues.apache.org/jira/browse/TAP5-2022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kalle Korhonen resolved TAP5-2022. -- Resolution: Fixed Fix Version/s: 5.4 Convenience only, no burning reason to merge to 5.3.x > Add PropertyAccess.getAnnotation > > > Key: TAP5-2022 > URL: https://issues.apache.org/jira/browse/TAP5-2022 > Project: Tapestry 5 > Issue Type: Improvement > Components: tapestry-core >Affects Versions: 5.3.6 >Reporter: Kalle Korhonen >Assignee: Kalle Korhonen >Priority: Minor > Fix For: 5.4 > > > On Sun, Oct 28, 2012 at 5:41 AM, Howard Lewis Ship wrote: > > I can't think of why that's not already present. > > > > On Sat, Oct 27, 2012 at 7:56 PM, Kalle Korhonen > > wrote: > >> We don't seem to have anything for fetching annotations... wouldn't it > >> be nice if you could do PropertyAccess.get(Object instance, String > >> propertyName, Class annotationClass) without > >> having to care whether the annotation is on the getter or on the > >> field? Anybody object to adding it? > >> > >> Kalle -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
git commit: FIXED - TAP5-2022: Add PropertyAccess.getAnnotation - implement convenience for PropertyAccess.getAdapter().getPropertyAdapter().getAnnotation()
Updated Branches: refs/heads/master 015816ed4 -> b108e06f4 FIXED - TAP5-2022: Add PropertyAccess.getAnnotation - implement convenience for PropertyAccess.getAdapter().getPropertyAdapter().getAnnotation() Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/b108e06f Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/b108e06f Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/b108e06f Branch: refs/heads/master Commit: b108e06f4b633d77461dda220a07016ee806c0c7 Parents: 015816e Author: Kalle Korhonen Authored: Thu Nov 1 19:28:25 2012 -0700 Committer: Kalle Korhonen Committed: Thu Nov 1 19:28:25 2012 -0700 -- .../services/ClassPropertyAdapterImpl.java | 15 ++--- .../ioc/internal/services/PropertyAccessImpl.java | 14 ++-- .../ioc/services/ClassPropertyAdapter.java | 14 .../tapestry5/ioc/services/PropertyAccess.java | 20 +++- .../groovy/ioc/specs/PropertyAccessImplSpec.groovy | 24 +++ 5 files changed, 70 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/b108e06f/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassPropertyAdapterImpl.java -- diff --git a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassPropertyAdapterImpl.java b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassPropertyAdapterImpl.java index b96a0c2..7da0728 100644 --- a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassPropertyAdapterImpl.java +++ b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassPropertyAdapterImpl.java @@ -14,18 +14,19 @@ package org.apache.tapestry5.ioc.internal.services; -import org.apache.tapestry5.ioc.internal.util.GenericsUtils; -import org.apache.tapestry5.ioc.internal.util.InternalUtils; -import org.apache.tapestry5.ioc.services.ClassPropertyAdapter; -import org.apache.tapestry5.ioc.services.PropertyAdapter; +import static org.apache.tapestry5.ioc.internal.util.CollectionFactory.newCaseInsensitiveMap; import java.beans.PropertyDescriptor; +import java.lang.annotation.Annotation; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.List; import java.util.Map; -import static org.apache.tapestry5.ioc.internal.util.CollectionFactory.newCaseInsensitiveMap; +import org.apache.tapestry5.ioc.internal.util.GenericsUtils; +import org.apache.tapestry5.ioc.internal.util.InternalUtils; +import org.apache.tapestry5.ioc.services.ClassPropertyAdapter; +import org.apache.tapestry5.ioc.services.PropertyAdapter; public class ClassPropertyAdapterImpl implements ClassPropertyAdapter { @@ -105,6 +106,10 @@ public class ClassPropertyAdapterImpl implements ClassPropertyAdapter adaptorFor(propertyName).set(instance, value); } +public Annotation getAnnotation(Object instance, String propertyName, Class annotationClass) { + return adaptorFor(propertyName).getAnnotation(annotationClass); +} + private PropertyAdapter adaptorFor(String name) { PropertyAdapter pa = adapters.get(name); http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/b108e06f/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PropertyAccessImpl.java -- diff --git a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PropertyAccessImpl.java b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PropertyAccessImpl.java index e37158b..5eb1b3c 100644 --- a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PropertyAccessImpl.java +++ b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PropertyAccessImpl.java @@ -14,14 +14,11 @@ package org.apache.tapestry5.ioc.internal.services; -import org.apache.tapestry5.ioc.internal.util.CollectionFactory; -import org.apache.tapestry5.ioc.services.ClassPropertyAdapter; -import org.apache.tapestry5.ioc.services.PropertyAccess; - import java.beans.BeanInfo; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; +import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Arrays; @@ -29,6 +26,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import org.apache.tapestry5.ioc.internal.util.CollectionFactory; +import org.apache.tapestry5.ioc.services.ClassPropertyAdapter; +import org.apache.tapestry5.ioc.services.PropertyAccess; + @SuppressWarnings("unchecked") public class Prop
[2/2] git commit: Slight refactoring
Slight refactoring Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/97af1283 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/97af1283 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/97af1283 Branch: refs/heads/5.4-js-rewrite Commit: 97af12836cc176ad3380b32588c25d1d9b3f2ad8 Parents: b70bcee Author: Howard M. Lewis Ship Authored: Thu Nov 1 16:51:22 2012 -0700 Committer: Howard M. Lewis Ship Committed: Thu Nov 1 16:51:22 2012 -0700 -- .../apache/tapestry5/services/TapestryModule.java | 11 +-- 1 files changed, 5 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/97af1283/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java -- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java b/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java index 6d5f82c..8dba498 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java @@ -2582,21 +2582,20 @@ public final class TapestryModule /** * Contributes: * + * Core + * Built in messages used by Tapestry's default validators and components * AppCatalog * The Resource defined by {@link SymbolConstants#APPLICATION_CATALOG} - * Core - * Built in messages used by Tapestry's default validators and components (before:AppCatalog) * * * @since 5.2.0 */ -public static void contributeComponentMessagesSource(AssetSource assetSource, +@Contribute(ComponentMessagesSource.class) +public static void setupGlobalMessageCatalog(AssetSource assetSource, @Symbol(SymbolConstants.APPLICATION_CATALOG) Resource applicationCatalog, OrderedConfiguration configuration) { -configuration.add("Core", - assetSource.resourceForPath("org/apache/tapestry5/core.properties"), -"before:AppCatalog"); +configuration.add("Core", assetSource.resourceForPath("org/apache/tapestry5/core.properties")); configuration.add("AppCatalog", applicationCatalog); }
[1/2] git commit: Create a "virtual resource" for decimal format symbols (needed on the client)
Updated Branches: refs/heads/5.4-js-rewrite b70bcee47 -> ac7f26352 Create a "virtual resource" for decimal format symbols (needed on the client) Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/ac7f2635 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/ac7f2635 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/ac7f2635 Branch: refs/heads/5.4-js-rewrite Commit: ac7f26352d6ea96a66bcc097d1249e42eeba07de Parents: 97af128 Author: Howard M. Lewis Ship Authored: Thu Nov 1 17:42:11 2012 -0700 Committer: Howard M. Lewis Ship Committed: Thu Nov 1 17:42:11 2012 -0700 -- .../META-INF/modules/core/validation.coffee|3 +- .../pageload/DefaultComponentResourceLocator.java | 13 ++- .../messages/DecimalFormatMessageResource.java | 97 +++ .../translator/NumericTranslatorSupportImpl.java | 62 +- .../apache/tapestry5/services/TapestryModule.java |8 +- .../java/org/apache/tapestry5/ioc/Resource.java|8 +- 6 files changed, 128 insertions(+), 63 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ac7f2635/tapestry-core/src/main/coffeescript/META-INF/modules/core/validation.coffee -- diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/core/validation.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/core/validation.coffee index 3ff32a5..9bb60c6 100644 --- a/tapestry-core/src/main/coffeescript/META-INF/modules/core/validation.coffee +++ b/tapestry-core/src/main/coffeescript/META-INF/modules/core/validation.coffee @@ -27,4 +27,5 @@ define ["core/spi", "core/events", "core/utils", "core/fields"], memo.error = true return false -configureDecimals: -> \ No newline at end of file +# Export nothing for now +return null \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ac7f2635/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/DefaultComponentResourceLocator.java -- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/DefaultComponentResourceLocator.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/DefaultComponentResourceLocator.java index 327b448..e61c510 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/DefaultComponentResourceLocator.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/DefaultComponentResourceLocator.java @@ -1,4 +1,4 @@ -// Copyright 2011 The Apache Software Foundation +// Copyright 2011, 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. @@ -14,8 +14,6 @@ package org.apache.tapestry5.internal.pageload; -import java.util.List; - import org.apache.tapestry5.func.F; import org.apache.tapestry5.func.Mapper; import org.apache.tapestry5.ioc.Resource; @@ -25,6 +23,9 @@ import org.apache.tapestry5.services.pageload.ComponentResourceLocator; import org.apache.tapestry5.services.pageload.ComponentResourceSelector; import org.apache.tapestry5.services.templates.ComponentTemplateLocator; +import java.util.Arrays; +import java.util.List; + public class DefaultComponentResourceLocator implements ComponentResourceLocator { private ComponentTemplateLocator componentTemplateLocator; @@ -46,6 +47,12 @@ public class DefaultComponentResourceLocator implements ComponentResourceLocator { String baseName = baseResource.getFile(); +// This is the case for some of the "virtual resources" introduced in 5.4 +if (baseName == null) +{ +return Arrays.asList(baseResource.forLocale(selector.locale)); +} + return F.flow(new LocalizedNameGenerator(baseName, selector.locale).iterator()).map(new Mapper() { public Resource map(String element) http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ac7f2635/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/messages/DecimalFormatMessageResource.java -- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/messages/DecimalFormatMessageResource.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/messages/DecimalFormatMessageResource.java new file mode 100644 index 000..070d167 --- /dev/null +++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/messages/DecimalFormatMessageResource.java @@ -0,0 +1,97 @@ +// Copyright 2012 The Apache
[2/2] git commit: Add Element.extendAttribute() to add new words to an attribute
Add Element.extendAttribute() to add new words to an attribute Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/e992792e Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/e992792e Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/e992792e Branch: refs/heads/5.4-js-rewrite Commit: e992792e10988910891326191c632f21ed10b538 Parents: e067e55 Author: Howard M. Lewis Ship Authored: Thu Nov 1 15:31:02 2012 -0700 Committer: Howard M. Lewis Ship Committed: Thu Nov 1 15:31:02 2012 -0700 -- .../java/org/apache/tapestry5/dom/Element.java | 151 ++ .../java/org/apache/tapestry5/dom/DOMTest.java | 70 --- 2 files changed, 149 insertions(+), 72 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/e992792e/tapestry-core/src/main/java/org/apache/tapestry5/dom/Element.java -- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/dom/Element.java b/tapestry-core/src/main/java/org/apache/tapestry5/dom/Element.java index f426630..af3c4a3 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/dom/Element.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/dom/Element.java @@ -1,4 +1,4 @@ -// Copyright 2006, 2007, 2008, 2009, 2010, 2011 The Apache Software Foundation +// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 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. @@ -23,6 +23,7 @@ import org.apache.tapestry5.ioc.util.Stack; import java.io.PrintWriter; import java.util.*; +import java.util.regex.Pattern; /** * An element that will render with a begin tag and attributes, a body, and an end tag. Also acts as a factory for @@ -43,7 +44,9 @@ public final class Element extends Node private final Document document; -private static final String CLASS_ATTRIBUTE = "class"; +private static final Pattern SPACES = Pattern.compile("\\s+"); + +private static final String[] EMPTY_ARRAY = new String[0]; /** * URI of the namespace which contains the element. A quirk in XML is that the element may be in a namespace it @@ -88,9 +91,11 @@ public final class Element extends Node /** * Adds an attribute to the element, but only if the attribute name does not already exist. * - * @param name the name of the attribute to add - * @param value the value for the attribute. A value of null is allowed, and no attribute will be added to the - * element. + * @param name + * the name of the attribute to add + * @param value + * the value for the attribute. A value of null is allowed, and no attribute will be added to the + * element. */ public Element attribute(String name, String value) { @@ -100,10 +105,13 @@ public final class Element extends Node /** * Adds a namespaced attribute to the element, but only if the attribute name does not already exist. * - * @param namespace the namespace to contain the attribute, or null - * @param name the name of the attribute to add - * @param value the value for the attribute. A value of null is allowed, and no attribute will be added to the - * element. + * @param namespace + * the namespace to contain the attribute, or null + * @param name + * the name of the attribute to add + * @param value + * the value for the attribute. A value of null is allowed, and no attribute will be added to the + * element. */ public Element attribute(String namespace, String name, String value) { @@ -159,7 +167,8 @@ public final class Element extends Node /** * Convenience for invoking {@link #attribute(String, String)} multiple times. * - * @param namesAndValues alternating attribute names and attribute values + * @param namesAndValues + * alternating attribute names and attribute values */ public Element attributes(String... namesAndValues) { @@ -179,7 +188,8 @@ public final class Element extends Node * Forces changes to a number of attributes. The new attributes overwrite previous values. Overriding an * attribute's value to null will remove the attribute entirely. * - * @param namesAndValues alternating attribute names and attribute values + * @param namesAndValues + * alternating attribute names and attribute values * @return this element */ public Element forceAttributes(String... namesAndValues) @@ -192,8 +202,10 @@ public final class Elem
[1/2] git commit: Re-implement the client-side "required" validator
Updated Branches: refs/heads/5.4-js-rewrite e067e5519 -> b70bcee47 Re-implement the client-side "required" validator Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/b70bcee4 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/b70bcee4 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/b70bcee4 Branch: refs/heads/5.4-js-rewrite Commit: b70bcee47f1bf3beeae58b0c9e17352768fad29e Parents: e992792 Author: Howard M. Lewis Ship Authored: Thu Nov 1 16:35:09 2012 -0700 Committer: Howard M. Lewis Ship Committed: Thu Nov 1 16:35:09 2012 -0700 -- .../META-INF/modules/core/events.coffee| 50 --- .../META-INF/modules/core/fields.coffee| 41 +++- .../META-INF/modules/core/forms.coffee |9 ++- .../META-INF/modules/core/utils.coffee | 20 ++ .../META-INF/modules/core/validation.coffee| 30 + .../translator/NumericTranslatorSupportImpl.java | 34 +- .../org/apache/tapestry5/services/FormSupport.java | 31 ++--- .../apache/tapestry5/services/TapestryModule.java |2 +- .../tapestry5/validator/AbstractValidator.java |8 ++- .../java/org/apache/tapestry5/validator/Email.java |4 +- .../java/org/apache/tapestry5/validator/Max.java |4 +- .../org/apache/tapestry5/validator/MaxLength.java |4 +- .../java/org/apache/tapestry5/validator/Min.java |4 +- .../org/apache/tapestry5/validator/MinLength.java |4 +- .../java/org/apache/tapestry5/validator/None.java |4 +- .../org/apache/tapestry5/validator/Regexp.java |4 +- .../org/apache/tapestry5/validator/Required.java | 18 - .../apache/tapestry5/validator/RequiredTest.java | 16 +++--- 18 files changed, 215 insertions(+), 72 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/b70bcee4/tapestry-core/src/main/coffeescript/META-INF/modules/core/events.coffee -- diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/core/events.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/core/events.coffee index 2a4b045..89b5290 100644 --- a/tapestry-core/src/main/coffeescript/META-INF/modules/core/events.coffee +++ b/tapestry-core/src/main/coffeescript/META-INF/modules/core/events.coffee @@ -27,18 +27,49 @@ define # Triggered after `validate` (when there are no prior validation exceptions), to allow certain elements # to configure themselves immediately before the form is submitted. This exists primarily for components such -# as FormFragment, which will update a enable or disable a hidden field to match the visibility of the fragment. -# The `core/spi.EventWrapper` for the form element is passed as the memo. +# as FormFragment, which will enable or disable a hidden field to match the visibility of the fragment. +# There is no event memo. prepareForSubmit: "t5:form:prepare-for-submit" + # Events releated to form input fields. Primarily, these events are related to form input validation. + # Validating a field involves three major steps: + # + # * optional - check for a required field that has no value + # * translate - translate a string to another representation, such as `Date`, or a number + # * validate - validate the field against any number of other constraints (such as ranges) + # + # The latter two steps occur only if the field's value is non-blank. A field that is blank but not + # required is considered valid. In each step, if the event listener detects an input validation error, + # it is expected to set the memo's `error`property to true _and_ trigger a `showValidationError' + # event (to present a message specific to the case). field: -# Triggered by the Form on all enclosed elements with the `data-validation` attribute (indicating they are -# interested in participating with user input validation). The memo object passed to the event has an error property -# that can be set to true to indicate a validation error. Individual fields should determine if the field is in -# error and remove or add/update decorations for the validation error (decorations will transition from 5.3 style -# popups to Twitter Bootstrap in the near future). + +# Perform the optionality check. The event memo includes a `value` property. If the field is required +# but the value is blank, then the `error` property should be set to true. +optional: "t5:field:optional" + +# Trigged by the field if there is a field value. The event memo includes the value as the `value` property. +# An event handler may update the event, setting the `translated` property to an alternate formatting,
[jira] [Assigned] (TAP5-2022) Add PropertyAccess.getAnnotation
[ https://issues.apache.org/jira/browse/TAP5-2022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kalle Korhonen reassigned TAP5-2022: Assignee: Kalle Korhonen > Add PropertyAccess.getAnnotation > > > Key: TAP5-2022 > URL: https://issues.apache.org/jira/browse/TAP5-2022 > Project: Tapestry 5 > Issue Type: Improvement > Components: tapestry-core >Affects Versions: 5.3.6 >Reporter: Kalle Korhonen >Assignee: Kalle Korhonen >Priority: Minor > > On Sun, Oct 28, 2012 at 5:41 AM, Howard Lewis Ship wrote: > > I can't think of why that's not already present. > > > > On Sat, Oct 27, 2012 at 7:56 PM, Kalle Korhonen > > wrote: > >> We don't seem to have anything for fetching annotations... wouldn't it > >> be nice if you could do PropertyAccess.get(Object instance, String > >> propertyName, Class annotationClass) without > >> having to care whether the annotation is on the getter or on the > >> field? Anybody object to adding it? > >> > >> Kalle -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
git commit: Remove CoreJavaScriptStack, use ExtensibleJavaScriptStack instead
Updated Branches: refs/heads/5.4-js-rewrite 8131b9a8d -> e067e5519 Remove CoreJavaScriptStack, use ExtensibleJavaScriptStack instead Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/e067e551 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/e067e551 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/e067e551 Branch: refs/heads/5.4-js-rewrite Commit: e067e5519328fd50a29e9dd32b10f59664cc8633 Parents: 8131b9a Author: Howard M. Lewis Ship Authored: Thu Nov 1 14:06:21 2012 -0700 Committer: Howard M. Lewis Ship Committed: Thu Nov 1 14:06:21 2012 -0700 -- .../services/javascript/CoreJavaScriptStack.java | 133 --- .../java/org/apache/tapestry5/services/Core.java |9 +- .../services/javascript/JavaScriptModule.java | 41 +- 3 files changed, 44 insertions(+), 139 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/e067e551/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/CoreJavaScriptStack.java -- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/CoreJavaScriptStack.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/CoreJavaScriptStack.java deleted file mode 100644 index 91899be..000 --- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/CoreJavaScriptStack.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2010-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 -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package org.apache.tapestry5.internal.services.javascript; - -import org.apache.tapestry5.Asset; -import org.apache.tapestry5.func.F; -import org.apache.tapestry5.func.Flow; -import org.apache.tapestry5.func.Mapper; -import org.apache.tapestry5.internal.TapestryInternalUtils; -import org.apache.tapestry5.ioc.services.SymbolSource; -import org.apache.tapestry5.services.AssetSource; -import org.apache.tapestry5.services.javascript.JavaScriptStack; -import org.apache.tapestry5.services.javascript.StylesheetLink; - -import java.util.Collections; -import java.util.List; -import java.util.Locale; - -/** - * JavaScriptStack for core components. - * - * @since 5.2.0 - */ -public class CoreJavaScriptStack implements JavaScriptStack -{ -private final SymbolSource symbolSource; - -private final AssetSource assetSource; - -private final Flow javaScriptStack, stylesheetStack; - -private static final String ROOT = "${tapestry.asset.root}"; - -private static final String[] CORE_JAVASCRIPT = new String[] -{ -// Core scripts added to any page that uses scripting - -// TODO: Only include these two when in compatibility mode ... -// after the t5-* and tapestry libraries have been stripped -// of Scriptaculous code. - -"${tapestry.scriptaculous}/scriptaculous.js", - -"${tapestry.scriptaculous}/effects.js", - -// TODO: Include jQuery based on configuration -// probably be generally available as module "$" - -// TODO: Possibly extract prototype/scriptaculous/jquery from the stack -// (as has been done with Underscore), and convert to a shimmed module. - -ROOT + "/t53-compatibility.js" -}; - -// Because of changes to the logic of how stylesheets get incorporated, the default stylesheet -// was removed, the logic for it is now in TapestryModule.contributeMarkupRenderer(). - -private static final String[] CORE_STYLESHEET = new String[] -{ -"${tapestry.bootstrap-root}/css/bootstrap.css", - -// The following are mostly temporary: - -ROOT + "/tapestry-console.css", - -ROOT + "/t5-alerts.css", - -ROOT + "/tree.css" -}; - -public CoreJavaScriptStack(SymbolSource symbolSource, AssetSource assetSource) -{ -this.symbolSource = symbolSource; -this.assetSource = assetSource; - -Flow coreJavascript = F.flow(CORE_J
[4/5] git commit: No longer automatically import "core" JavaScript stack Mark initializer-oriented methods of JavaScriptStack as deprecated
No longer automatically import "core" JavaScript stack Mark initializer-oriented methods of JavaScriptStack as deprecated Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/9b83cfa8 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/9b83cfa8 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/9b83cfa8 Branch: refs/heads/5.4-js-rewrite Commit: 9b83cfa80fbf3a99267c51619c3294ba0130a326 Parents: 90f4ae1 Author: Howard M. Lewis Ship Authored: Thu Nov 1 13:34:07 2012 -0700 Committer: Howard M. Lewis Ship Committed: Thu Nov 1 13:34:07 2012 -0700 -- 54_RELEASE_NOTES.txt | 15 ++- .../services/ajax/JavaScriptSupportImpl.java | 12 --- .../services/javascript/JavaScriptSupport.java | 23 - .../services/ajax/JavaScriptSupportImplTest.groovy | 73 --- 4 files changed, 32 insertions(+), 91 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/9b83cfa8/54_RELEASE_NOTES.txt -- diff --git a/54_RELEASE_NOTES.txt b/54_RELEASE_NOTES.txt index 7d4e765..2c103eb 100644 --- a/54_RELEASE_NOTES.txt +++ b/54_RELEASE_NOTES.txt @@ -69,7 +69,6 @@ JavaScript Libraries (including stacks) are being replaced with modules. Note th RequireJS, which may mean that global values exported by the libraries are not visible; you should explicitly attach properties to the global JavaScript window object, rather than assume that the context (this) is the window. - ## T5 and Tapestry namespaces all but eliminated Only a limited number of properties exported as the `T5` and `Tapestry` namespaces (on the client) still exist; enough @@ -94,7 +93,6 @@ decide to animate them using whatever library is desired. The event names are de On the client side, the "floating console" is now only used in cases where a native console is not available. - ## Form.clientValidation parameter Prior releases of Tapestry mapped "true" and "false" values for Form.clientValidation to BLUR and NONE. This mapping @@ -104,7 +102,6 @@ Support for validating fields on blur (i.e., when tabbing out of a field) has be the form is submitted, or not at all. The ClientValidation.BLUR enum value has been deprecated and is now treated as SUBMIT. - ## Wait-for-page logic removed Tapestry 5.3 contained code that attempted to prevent Ajax requests until after the page had loaded; this was based @@ -118,6 +115,9 @@ Tapestry now includes a default copy of Twitter Bootstrap in addition to its own file "default.css" automatically included in rendered pages). The Tapestry CSS has been largely eliminated; instead components now refer to standard Bootstrap CSS classes. +The Bootstrap CSS is now only present if the `core` JavaScript stack is imported. You may need to change your application's +layout component to do so explicitly, by adding `@Import(stack="core")` to the class. + ValidationDecorator and ValidationDecoratorFactory are deprecated in 5.4 and will be removed in 5.5. The default implementation of ValidationDecorator now does nothing. All the logic related to presentation of errors has moved to the client, and expects and leverages the Twitter Bootstrap CSS. @@ -135,4 +135,11 @@ div.control-group, which is provided around the editor for each property. ## ClientBehaviorSupport This service, primarily used by built-in components in Tapestry 5.3, is no longer useful in 5.4. The service -still exists, but the methods do nothing, and the service and interface will be removed in 5.5. \ No newline at end of file +still exists, but the methods do nothing, and the service and interface will be removed in 5.5. + +## JavaScriptSupport + +In prior releases, adding _any_ JavaScript to the application would implicitly import the `core` JavaScript stack. +This no longer occurs; in most cases, the core stack is provided automatically by other components. + +You may want to consider adding `@Import(stack="core")` to your applications' main layout component. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/9b83cfa8/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/JavaScriptSupportImpl.java -- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/JavaScriptSupportImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/JavaScriptSupportImpl.java index a5b9875..940503a 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/JavaScriptSupportImpl.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/JavaScriptSupportImpl.java
[5/5] git commit: Rename method for consistency - modules() was incorrect, as other attributes were in the singular
Rename method for consistency - modules() was incorrect, as other attributes were in the singular Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/90f4ae18 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/90f4ae18 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/90f4ae18 Branch: refs/heads/5.4-js-rewrite Commit: 90f4ae18384597c95f92922db794e8c8e83653d5 Parents: b1bd027 Author: Howard M. Lewis Ship Authored: Thu Nov 1 13:18:30 2012 -0700 Committer: Howard M. Lewis Ship Committed: Thu Nov 1 13:18:30 2012 -0700 -- .../org/apache/tapestry5/annotations/Import.java |2 +- .../tapestry5/corelib/base/AbstractField.java |2 +- .../tapestry5/corelib/components/AjaxFormLoop.java |2 +- .../tapestry5/corelib/components/FormFragment.java |2 +- .../tapestry5/corelib/components/LinkSubmit.java |2 +- .../apache/tapestry5/corelib/components/Zone.java |2 +- .../tapestry5/internal/transform/ImportWorker.java |2 +- 7 files changed, 7 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/90f4ae18/tapestry-core/src/main/java/org/apache/tapestry5/annotations/Import.java -- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/annotations/Import.java b/tapestry-core/src/main/java/org/apache/tapestry5/annotations/Import.java index d78b53f..f055d9b 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/annotations/Import.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/annotations/Import.java @@ -81,5 +81,5 @@ public @interface Import * @see JavaScriptSupport#require(String) * @since 5.4 */ -String[] modules() default {}; +String[] module() default {}; } http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/90f4ae18/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractField.java -- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractField.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractField.java index af7a3b0..f47e969 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractField.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractField.java @@ -36,7 +36,7 @@ import java.io.Serializable; * @tapestrydoc */ @SupportsInformalParameters -@Import(modules = "core/fields") +@Import(module = "core/fields") public abstract class AbstractField implements Field { /** http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/90f4ae18/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/AjaxFormLoop.java -- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/AjaxFormLoop.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/AjaxFormLoop.java index 6e0936f..3db5c7e 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/AjaxFormLoop.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/AjaxFormLoop.java @@ -56,7 +56,7 @@ import java.util.Iterator; */ @Events( {EventConstants.ADD_ROW, EventConstants.REMOVE_ROW}) -@Import(modules = "core/ajaxformloop") +@Import(module = "core/ajaxformloop") public class AjaxFormLoop { /** http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/90f4ae18/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java -- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java index 1ffaea3..ea956c4 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java @@ -55,7 +55,7 @@ import org.slf4j.Logger; * @see Form */ @SupportsInformalParameters -@Import(modules = "core/form-fragment") +@Import(module = "core/form-fragment") public class FormFragment implements ClientElement { /** http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/90f4ae18/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/LinkSubmit.java -- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/LinkSubmit.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/LinkSubmit.java index 7970959..6fd1ede 1
[3/5] git commit: Add a reference to ExtensibleJavaScriptStack
Add a reference to ExtensibleJavaScriptStack Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/60268e6d Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/60268e6d Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/60268e6d Branch: refs/heads/5.4-js-rewrite Commit: 60268e6d5c1be0024b582ad350a283d8e3beb130 Parents: 9b83cfa Author: Howard M. Lewis Ship Authored: Thu Nov 1 13:35:44 2012 -0700 Committer: Howard M. Lewis Ship Committed: Thu Nov 1 13:35:44 2012 -0700 -- .../services/javascript/JavaScriptStack.java |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/60268e6d/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/JavaScriptStack.java -- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/JavaScriptStack.java b/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/JavaScriptStack.java index 1106e2d..da60b28 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/JavaScriptStack.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/JavaScriptStack.java @@ -35,6 +35,8 @@ import java.util.List; * Implementations may need to inject the {@link ThreadLocale} service in order to determine the current locale (if any * of the JavaScript library or stylesheet assets are localized). They will generally need to inject the * {@link AssetSource} service as well. + * + * The {@link ExtensibleJavaScriptStack} is the best way to create new stacks. * * @see ThreadLocale * @since 5.2.0 @@ -64,7 +66,7 @@ public interface JavaScriptStack * until the DOM is loaded). As with the other methods, if localization is a factor, the result of this method * should be localized. * - * @deprecated No longer used in Tapestry 5.4; may be removed in a future release. Implementations + * @deprecated Deprecated in Tapestry 5.4; may be removed in a future release. Implementations * may return null. */ String getInitialization();
[1/5] git commit: Add a STACK extension type for use with ExtensibleJavaScriptStack
Updated Branches: refs/heads/5.4-js-rewrite b1bd02711 -> 8131b9a8d Add a STACK extension type for use with ExtensibleJavaScriptStack Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/8131b9a8 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/8131b9a8 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/8131b9a8 Branch: refs/heads/5.4-js-rewrite Commit: 8131b9a8da8b8e99ab7d585c839640a0e1a70840 Parents: 58d8a7a Author: Howard M. Lewis Ship Authored: Thu Nov 1 13:44:19 2012 -0700 Committer: Howard M. Lewis Ship Committed: Thu Nov 1 13:44:19 2012 -0700 -- .../javascript/ExtensibleJavaScriptStack.java | 31 +++ .../services/javascript/StackExtensionType.java| 10 .../ExtensibleJavaScriptStackTest.groovy | 41 +++ 3 files changed, 60 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/8131b9a8/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/ExtensibleJavaScriptStack.java -- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/ExtensibleJavaScriptStack.java b/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/ExtensibleJavaScriptStack.java index a4b07b1..8a71505 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/ExtensibleJavaScriptStack.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/ExtensibleJavaScriptStack.java @@ -1,4 +1,4 @@ -// Copyright 2011 The Apache Software Foundation +// Copyright 2011, 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. @@ -14,9 +14,6 @@ package org.apache.tapestry5.services.javascript; -import java.util.Collections; -import java.util.List; - import org.apache.tapestry5.Asset; import org.apache.tapestry5.func.F; import org.apache.tapestry5.func.Flow; @@ -28,6 +25,8 @@ import org.apache.tapestry5.ioc.annotations.UsesOrderedConfiguration; import org.apache.tapestry5.ioc.internal.util.InternalUtils; import org.apache.tapestry5.services.AssetSource; +import java.util.List; + /** * An extensible implementation of {@link JavaScriptStack} that can be used as the implementation of a service. * The contributions to the service are used to supply the libraries, stylesheets, and initialization for a @@ -35,11 +34,11 @@ import org.apache.tapestry5.services.AssetSource; * {@link ServiceBinder#bind(Class, Class)} and {@link ServiceBindingOptions#withMarker(Class...)} to construct the * service, then use the marker annotation to inject the service when contributing the service into to the * {@link JavaScriptStackSource}. - * + * * A limitation of this implementation is that the contributed assets are not localized at all. - * - * @since 5.3 + * * @see StackExtension + * @since 5.3 */ @UsesOrderedConfiguration(StackExtension.class) public class ExtensibleJavaScriptStack implements JavaScriptStack @@ -50,6 +49,8 @@ public class ExtensibleJavaScriptStack implements JavaScriptStack private final List stylesheets; +private final List stacks; + private final String initialization; private final Predicate by(final StackExtensionType type) @@ -68,7 +69,9 @@ public class ExtensibleJavaScriptStack implements JavaScriptStack public String map(StackExtension element) { return element.value; -}; +} + +; }; private final Mapper stringToAsset = new Mapper() @@ -76,7 +79,9 @@ public class ExtensibleJavaScriptStack implements JavaScriptStack public Asset map(String value) { return assetSource.getExpandedAsset(value); -}; +} + +; }; private final Mapper assetToStylesheetLink = new Mapper() @@ -84,7 +89,9 @@ public class ExtensibleJavaScriptStack implements JavaScriptStack public StylesheetLink map(Asset asset) { return new StylesheetLink(asset); -}; +} + +; }; public ExtensibleJavaScriptStack(AssetSource assetSource, List configuration) @@ -95,6 +102,8 @@ public class ExtensibleJavaScriptStack implements JavaScriptStack libraries = extensions.filter(by(StackExtensionType.LIBRARY)).map(extractValue).map(stringToAsset).toList(); +stacks = extensions.filter(by(StackExtensionType.STACK)).map(extractValue).toList(); + stylesheets = extensions.filter(by(StackExtensionType.STYLESHEET)).map(extractValue).map(stringToAsset) .map(assetToStylesheetLink).toLis
[2/5] git commit: Update documentation, and deprecate one option
Update documentation, and deprecate one option Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/58d8a7a6 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/58d8a7a6 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/58d8a7a6 Branch: refs/heads/5.4-js-rewrite Commit: 58d8a7a617eb3f30d2c2f7ff6ef0965828bd7c28 Parents: 60268e6 Author: Howard M. Lewis Ship Authored: Thu Nov 1 13:39:08 2012 -0700 Committer: Howard M. Lewis Ship Committed: Thu Nov 1 13:39:08 2012 -0700 -- .../services/javascript/StackExtensionType.java| 20 --- 1 files changed, 16 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/58d8a7a6/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StackExtensionType.java -- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StackExtensionType.java b/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StackExtensionType.java index 3562514..6bbb9c8 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StackExtensionType.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StackExtensionType.java @@ -1,4 +1,4 @@ -// Copyright 2011 The Apache Software Foundation +// Copyright 2011, 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. @@ -19,25 +19,37 @@ import org.apache.tapestry5.services.AssetSource; /** * Defines the types of extensions to a JavaScript stack that can be contributed to an extensible JavaScript stack. - * - * @since 5.3 + * * @see StackExtension * @see ExtensibleJavaScriptStack + * @since 5.3 */ public enum StackExtensionType { /** * A JavaScript library. The extension value will be converted using {@link AssetSource#getExpandedAsset(String)}, * meaning that {@linkplain SymbolSource symbols} will be expanded. + * + * @see JavaScriptSupport#importJavaScriptLibrary(org.apache.tapestry5.Asset) + * @see org.apache.tapestry5.services.javascript.JavaScriptStack#getJavaScriptLibraries() */ LIBRARY, /** * A stylesheet. The extension value will be converted using {@link AssetSource#getExpandedAsset(String)}, * meaning that {@linkplain SymbolSource symbols} will be expanded. + * + * @see JavaScriptSupport#importStylesheet(org.apache.tapestry5.Asset) + * @see org.apache.tapestry5.services.javascript.JavaScriptStack#getStylesheets() */ STYLESHEET, -/** Extra JavaScript initialization (rarely used). No symbol expansion takes place. */ +/** + * Extra JavaScript initialization (rarely used). No symbol expansion takes place. + * + * @see JavaScriptSupport#addScript(String, Object...) + * @see org.apache.tapestry5.services.javascript.JavaScriptStack#getInitialization() + * @deprecated Deprecated in 5.4 with no replacement; initialization may be removed in the future. + */ INITIALIZATION; }
[CONF] Apache Tapestry > BeanEditForm Guide
BeanEditForm Guide Page edited by Kalle Korhonen Changes (3) ... {code:java} {code} ... Full Content Using the BeanEditForm Component Tapestry includes a powerful component capable of generating a complete create/edit user interface for a typical JavaBean, BeanEditForm. BeanEditForm analyzes the the properties of the bean, locating just those properties that are readable and writable. It filters down to properties whose type is mapped to a known editor (this is described in more detail below). The default ordering for properties is in the order in which the getter methods for the properties are defined. When a super-class defines editable properties, those are ordered before sub-class properties. Supported Types The default set of property types supported by BeanEditForm: String: as a text field Number: as a text field Enum: as a drop-down list Boolean: as a checkbox Date: as a _javascript_ calendar Calendar: as a _javascript_ calendar Resolving a property type to an editor type involves a search up the inheritance hierarchy: thus the super-type of Integer, Long, BigDecimal, etc. is Number, which uses a text field for data entry. The list of supported property types is extensible (this is documented below). Automatic Object Creation When a page is rendered, the BeanEditForm component will read its object parameter as the JavaBean to edit (with the current properties of the JavaBean becoming the defaults for the various fields). Likewise, when the form is submitted by the user, the object parameter is read and its properties populated from the request. If the object does not exist, it will be created as needed. The type is determined from the property type, which should be a specific type in order for automatic creation to operate properly. The BeanEditForm component will attempt to instantiate a value for the property as necessary, when the form is submitted. This can be a problem when the property type is an interface, rather than an instantiable class. One option is to provide an event handler for the "prepare" or "prepareForSubmit" events to instantiate an instance to receive the submitted information. For a class, Tapestry will select the public constructor with the most parameters. If this is not desirable (for example, if you get an exception), then place the @Inject annotation on the constructor Tapestry should use. Implicit Object Binding If the object parameter is not bound, then an implicit binding to a property of the containing component is made. The bound property will be the BeanEditForm component's id, if such a property exists. Thus you may typically give the BeanEditForm component an id (that matches a property) and not have to bind the object parameter. Non-Visual Properties In some cases, a property may be updatable and of a supported type for editing, but should not be presented to the user for editing: for example, a property that holds the primary key of a database entity. In such a case, the @NonVisual annotation may be applied to the property (either the getter or the setter method). Default Validation Default validation for fields is primary determined by property type. If desired, additional validation may be specified using the @Validate annotation. See Forms and Validation. As of Tapestry 5.2, validation may also be specified via the containing component's property file, using a key in the form of propertyId-validate (eg: myfield-validate=required). Property ordering By default, the order in which properties are presented is as defined above (order of the getter method). This can be overridden using the ReorderProperties class annotation. Default Label Tapestry will attempt to provide a reasonable default label for each field, based on the property name being emitted. The property name is capitalized, and spaces are added before case changes, thus property "name" becomes label "Name" and property "streetAddress" becomes label "Street Address". BeanEditForm also searches for a label for the field in the containing component's message catalog. The message key is the property name suffixed with "-label". If such a label is found, it takes precedence. Property Editor Overrides You may override the editor for any particular property, using the a block parameter to the BeanEditForm component. An editor normally consists of a Label component and some form of field component (such as TextField or TextArea). For example, you may want to selectively use a PasswordField component: "loginCredentials"> for="password"/> "password" value="loginCredentials.password"/> The other fields
[jira] [Commented] (TAP5-2024) tapestry-spring has a dependency tapestry-core
[ https://issues.apache.org/jira/browse/TAP5-2024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13488865#comment-13488865 ] Howard M. Lewis Ship commented on TAP5-2024: This will require the same kind of split that tapestry-hibernate had (into tapestry-hibernate-core for IoC, and tapestry-hibernate, for the web tier). Ideally, we would split into tapestry-spring-ioc, and tapestry-spring-web ... but its easier for people if tapestry-spring retains the web infrastructure, and the part that depends just on tapestry-ioc is split out to a new module. > tapestry-spring has a dependency tapestry-core > -- > > Key: TAP5-2024 > URL: https://issues.apache.org/jira/browse/TAP5-2024 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-spring >Affects Versions: 5.3.6 >Reporter: Mohammad Sarhan > > I want to use the tapestry-ioc and tapestry-spring without using > tapestry-core. > Unfortunately tapestry-spring SpringModuleDef.java has a dependency on > AbstractContributionDef.java and is forced to depend on tapestry-core. > I've seen other dependencies from tapestry-spring on tapestry-core. > Here is what i've found in tapestry-spring/src/main/java/org/apache/tapestry5 > internal/spring/SpringModuleDef.java:import > org.apache.tapestry5.internal.AbstractContributionDef; > spring/SpringModule.java:import > org.apache.tapestry5.services.ApplicationInitializer; > spring/SpringModule.java:import > org.apache.tapestry5.services.ApplicationInitializerFilter; > spring/SpringModule.java:import org.apache.tapestry5.services.Context; > spring/TapestryApplicationContext.java:import > org.apache.tapestry5.TapestryFilter; > spring/TapestrySpringFilter.java:import org.apache.tapestry5.TapestryFilter; -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira