[jira] [Created] (TAP5-1624) Add support for overriding default TypeCoercer's coercions
Add support for overriding default TypeCoercer's coercions -- Key: TAP5-1624 URL: https://issues.apache.org/jira/browse/TAP5-1624 Project: Tapestry 5 Issue Type: Improvement Components: tapestry-core Reporter: Denis Stepanov Right now it is imposible to implement TAP5-1446 without changes in Tapestry. It will probably require to add new service TypeCoercerOverride, TyprCoercerImpl will use it to override all tuples with equal sourceType and targetType. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
svn commit: r1163619 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry5/corelib/components/ main/java/org/apache/tapestry5/internal/services/ test/app1/ test/java/org/apa
Author: robertdzeigler Date: Wed Aug 31 13:42:51 2011 New Revision: 1163619 URL: http://svn.apache.org/viewvc?rev=1163619view=rev Log: TAP5-1620: Tml parsing expression error TAP5-1448: Example for org.apache.tapestry5.corelib.components.Errors uses invalid xml Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ExpressionInJsFunction.tml tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ExpressionInJsFunction.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.xdoc tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.xdoc URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.xdoc?rev=1163619r1=1163618r2=1163619view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.xdoc (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.xdoc Wed Aug 31 13:42:51 2011 @@ -15,7 +15,7 @@ t:form -t:errors +t:errors/ t:label for=search/ t:textfield t:id=search/ @@ -36,4 +36,4 @@ /section /body -/document \ No newline at end of file +/document Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java?rev=1163619r1=1163618r2=1163619view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java Wed Aug 31 13:42:51 2011 @@ -130,6 +130,10 @@ public class SaxTemplateParser // but invalid expansion. private static final Pattern EXPANSION_PATTERN = Pattern.compile(\\$\\{\\s*(((?!\\$\\{).)*)\\s*}); +private static final char EXPANSION_STRING_DELIMITTER='\''; +private static final char OPEN_BRACE='{'; +private static final char CLOSE_BRACE='}'; +//private static final Pattern EXPANSION_PATTERN = Pattern.compile(\\$\\{\\); private static final SetString MUST_BE_ROOT = CollectionFactory.newSet(extend, container); @@ -1090,7 +1094,6 @@ public class SaxTemplateParser // TAPESTRY-2028 means that the whitespace has likely been stripped out // of the text // already anyway. - while (matcher.find()) { int matchStart = matcher.start(); @@ -1098,19 +1101,66 @@ public class SaxTemplateParser if (matchStart != startx) { String prefix = text.substring(startx, matchStart); - tokenAccumulator.add(new TextToken(prefix, textStartLocation)); } // Group 1 includes the real text of the expansion, with whitespace // around the // expression (but inside the curly braces) excluded. - +// But note that we run into a problem. The original +// EXPANSION_PATTERN used a reluctant quantifier to match the +// smallest instance of ${} possible. But if you have ${'}'} or +// ${{'key': 'value'}} (maps, cf TAP5-1605) then you run into issues +// b/c the expansion becomes {'key': 'value' which is wrong. +// A fix to use greedy matching with negative lookahead to prevent +// ${...}...${...} all matching a single expansion is close, but +// has issues when an expansion is used inside a javascript function +// (see TAP5-1620). The solution is to use the greedy +// EXPANSION_PATTERN as before to bound the search for a single +// expansion, then check for {} consistency, ignoring opening and +// closing braces that occur within '' (the property expression +// language doesn't support for strings). That should include: +// 'This string has a } in it' and 'This string has a { in it.' +// Note also that the property expression language doesn't support +// escaping the string character ('), so we don't
[jira] [Updated] (TAP5-1448) Example for org.apache.tapestry5.corelib.components.Errors uses invalid xml
[ https://issues.apache.org/jira/browse/TAP5-1448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robert Zeigler updated TAP5-1448: - Summary: Example for org.apache.tapestry5.corelib.components.Errors uses invalid xml (was: buggy example for org.apache.tapestry5.corelib.components.Errors) Example for org.apache.tapestry5.corelib.components.Errors uses invalid xml --- Key: TAP5-1448 URL: https://issues.apache.org/jira/browse/TAP5-1448 Project: Tapestry 5 Issue Type: Bug Components: documentation Affects Versions: 5.2, 5.1 Reporter: Pallinger Péter Assignee: Robert Zeigler Priority: Trivial Attachments: 1448.txt The tag t:errors isn't closed. It should be t:errors/t:errors. You can look at it here http://tapestry.apache.org/tapestry5.2-dev/tapestry-core/ref/org/apache/tapestry5/corelib/components/Errors.html -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (TAP5-1448) Example for org.apache.tapestry5.corelib.components.Errors uses invalid xml
[ https://issues.apache.org/jira/browse/TAP5-1448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robert Zeigler closed TAP5-1448. Resolution: Fixed Fix Version/s: 5.3 Example for org.apache.tapestry5.corelib.components.Errors uses invalid xml --- Key: TAP5-1448 URL: https://issues.apache.org/jira/browse/TAP5-1448 Project: Tapestry 5 Issue Type: Bug Components: documentation Affects Versions: 5.2, 5.1 Reporter: Pallinger Péter Assignee: Robert Zeigler Priority: Trivial Fix For: 5.3 Attachments: 1448.txt The tag t:errors isn't closed. It should be t:errors/t:errors. You can look at it here http://tapestry.apache.org/tapestry5.2-dev/tapestry-core/ref/org/apache/tapestry5/corelib/components/Errors.html -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (TAP5-1620) Tml parsing expression error
[ https://issues.apache.org/jira/browse/TAP5-1620?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robert Zeigler closed TAP5-1620. Resolution: Fixed Fix Version/s: 5.3 Tml parsing expression error Key: TAP5-1620 URL: https://issues.apache.org/jira/browse/TAP5-1620 Project: Tapestry 5 Issue Type: Bug Components: tapestry-core Affects Versions: 5.3 Reporter: Denis Stepanov Assignee: Robert Zeigler Fix For: 5.3 script jQuery(function(){ registerAutorefresh(${refresh}); }); /script Caused by: java.lang.RuntimeException: Error parsing property expression 'refresh});': Unable to parse input at character position 10. at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.parse(PropertyConduitSourceImpl.java:1441) ~[tapestry-core-5.3-alpha-13.jar:na] at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.build(PropertyConduitSourceImpl.java:1309) ~[tapestry-core-5.3-alpha-13.jar:na] at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.create(PropertyConduitSourceImpl.java:1274) ~[tapestry-core-5.3-alpha-13.jar:na] at $PropertyConduitSource_123d98bd5e9eaa20.create(Unknown Source) ~[na:na] at org.apache.tapestry5.internal.bindings.PropBindingFactory.newBinding(PropBindingFactory.java:49) ~[tapestry-core-5.3-alpha-13.jar:na] at $BindingFactory_123d98bd5e9eaa21.newBinding(Unknown Source) ~[na:na] at $BindingFactory_123d98bd5e9eaa18.newBinding(Unknown Source) ~[na:na] at org.apache.tapestry5.internal.services.BindingSourceImpl.newBinding(BindingSourceImpl.java:78) ~[tapestry-core-5.3-alpha-13.jar:na] ... 94 common frames omitted Caused by: java.lang.RuntimeException: Unable to parse input at character position 10 at org.apache.tapestry5.internal.antlr.BaseLexer.reportError(BaseLexer.java:50) ~[tapestry-core-5.3-alpha-13.jar:na] at org.antlr.runtime.Lexer.nextToken(Lexer.java:94) ~[antlr.jar:na] at org.antlr.runtime.CommonTokenStream.fillBuffer(CommonTokenStream.java:119) ~[antlr.jar:na] at org.antlr.runtime.CommonTokenStream.LT(CommonTokenStream.java:238) ~[antlr.jar:na] at org.apache.tapestry5.internal.antlr.PropertyExpressionParser.start(PropertyExpressionParser.java:98) ~[tapestry-core-5.3-alpha-13.jar:na] at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.parse(PropertyConduitSourceImpl.java:1437) ~[tapestry-core-5.3-alpha-13.jar:na] ... 101 common frames omitted Caused by: org.antlr.runtime.NoViableAltException: null at org.antlr.runtime.DFA.noViableAlt(DFA.java:158) ~[antlr.jar:na] at org.antlr.runtime.DFA.predict(DFA.java:116) ~[antlr.jar:na] at org.apache.tapestry5.internal.antlr.PropertyExpressionLexer.mTokens(PropertyExpressionLexer.java:1273) ~[tapestry-core-5.3-alpha-13.jar:na] at org.antlr.runtime.Lexer.nextToken(Lexer.java:84) ~[antlr.jar:na] ... 105 common frames omitted -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
svn commit: r1163658 - in /tapestry/tapestry5/trunk/tapestry-core: build.gradle src/main/java/org/apache/tapestry5/VersionUtils.java
Author: mlusetti Date: Wed Aug 31 15:10:32 2011 New Revision: 1163658 URL: http://svn.apache.org/viewvc?rev=1163658view=rev Log: fix the announced tapestry version Modified: tapestry/tapestry5/trunk/tapestry-core/build.gradle tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/VersionUtils.java Modified: tapestry/tapestry5/trunk/tapestry-core/build.gradle URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/build.gradle?rev=1163658r1=1163657r2=1163658view=diff == --- tapestry/tapestry5/trunk/tapestry-core/build.gradle (original) +++ tapestry/tapestry5/trunk/tapestry-core/build.gradle Wed Aug 31 15:10:32 2011 @@ -55,7 +55,7 @@ task generateProjectProperties(dependsOn doLast { outputDir.mkdirs() -outputFile version=${version}; +outputFile version=${project.version}; println Generating $outputFile } } Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/VersionUtils.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/VersionUtils.java?rev=1163658r1=1163657r2=1163658view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/VersionUtils.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/VersionUtils.java Wed Aug 31 15:10:32 2011 @@ -1,4 +1,4 @@ -// Copyright 2007, 2008 The Apache Software Foundation +// Copyright 2007, 2008, 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. @@ -26,9 +26,9 @@ public class VersionUtils { /** - * Reads a version number from a properties file on the classpath. These files are generally created by Maven. For - * example, tapestry-core's properties file is codeMETA-INF/maven/org.apache.tapestry/tapestry-core/pom.properties/code. - * The Maven generated properties files include the artifact id and group id as well as the version. + * Reads a version number from a properties file on the classpath. These files are generally created by Gradle. For + * example, tapestry-core's properties file is codeMETA-INF/gradle/org.apache.tapestry/tapestry-core/pom.properties/code. + * The Gradle generated properties files include the version and possibly others properties. * p/ * The resource is located using the Thread's context class loader. * @@ -62,7 +62,7 @@ public class VersionUtils String version = properties.getProperty(version); -// Since the file, if it exists, is created by Maven and will have the key, I can't see +// Since the file, if it exists, is created by Gradle and will have the key, I can't see // how version would EVER be null, unless there's a problem reading the properties. if (version != null) result = version;
[jira] [Commented] (TAP5-1448) Example for org.apache.tapestry5.corelib.components.Errors uses invalid xml
[ https://issues.apache.org/jira/browse/TAP5-1448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13094637#comment-13094637 ] Hudson commented on TAP5-1448: -- Integrated in tapestry-trunk-freestyle #497 (See [https://builds.apache.org/job/tapestry-trunk-freestyle/497/]) TAP5-1620: Tml parsing expression error TAP5-1448: Example for org.apache.tapestry5.corelib.components.Errors uses invalid xml robertdzeigler : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVNview=revrev=1163619 Files : * /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.xdoc * /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java * /tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ExpressionInJsFunction.tml * /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java * /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ExpressionInJsFunction.java * /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java Example for org.apache.tapestry5.corelib.components.Errors uses invalid xml --- Key: TAP5-1448 URL: https://issues.apache.org/jira/browse/TAP5-1448 Project: Tapestry 5 Issue Type: Bug Components: documentation Affects Versions: 5.2, 5.1 Reporter: Pallinger Péter Assignee: Robert Zeigler Priority: Trivial Fix For: 5.3 Attachments: 1448.txt The tag t:errors isn't closed. It should be t:errors/t:errors. You can look at it here http://tapestry.apache.org/tapestry5.2-dev/tapestry-core/ref/org/apache/tapestry5/corelib/components/Errors.html -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TAP5-1620) Tml parsing expression error
[ https://issues.apache.org/jira/browse/TAP5-1620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13094636#comment-13094636 ] Hudson commented on TAP5-1620: -- Integrated in tapestry-trunk-freestyle #497 (See [https://builds.apache.org/job/tapestry-trunk-freestyle/497/]) TAP5-1620: Tml parsing expression error TAP5-1448: Example for org.apache.tapestry5.corelib.components.Errors uses invalid xml robertdzeigler : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVNview=revrev=1163619 Files : * /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.xdoc * /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java * /tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ExpressionInJsFunction.tml * /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java * /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ExpressionInJsFunction.java * /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java Tml parsing expression error Key: TAP5-1620 URL: https://issues.apache.org/jira/browse/TAP5-1620 Project: Tapestry 5 Issue Type: Bug Components: tapestry-core Affects Versions: 5.3 Reporter: Denis Stepanov Assignee: Robert Zeigler Fix For: 5.3 script jQuery(function(){ registerAutorefresh(${refresh}); }); /script Caused by: java.lang.RuntimeException: Error parsing property expression 'refresh});': Unable to parse input at character position 10. at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.parse(PropertyConduitSourceImpl.java:1441) ~[tapestry-core-5.3-alpha-13.jar:na] at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.build(PropertyConduitSourceImpl.java:1309) ~[tapestry-core-5.3-alpha-13.jar:na] at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.create(PropertyConduitSourceImpl.java:1274) ~[tapestry-core-5.3-alpha-13.jar:na] at $PropertyConduitSource_123d98bd5e9eaa20.create(Unknown Source) ~[na:na] at org.apache.tapestry5.internal.bindings.PropBindingFactory.newBinding(PropBindingFactory.java:49) ~[tapestry-core-5.3-alpha-13.jar:na] at $BindingFactory_123d98bd5e9eaa21.newBinding(Unknown Source) ~[na:na] at $BindingFactory_123d98bd5e9eaa18.newBinding(Unknown Source) ~[na:na] at org.apache.tapestry5.internal.services.BindingSourceImpl.newBinding(BindingSourceImpl.java:78) ~[tapestry-core-5.3-alpha-13.jar:na] ... 94 common frames omitted Caused by: java.lang.RuntimeException: Unable to parse input at character position 10 at org.apache.tapestry5.internal.antlr.BaseLexer.reportError(BaseLexer.java:50) ~[tapestry-core-5.3-alpha-13.jar:na] at org.antlr.runtime.Lexer.nextToken(Lexer.java:94) ~[antlr.jar:na] at org.antlr.runtime.CommonTokenStream.fillBuffer(CommonTokenStream.java:119) ~[antlr.jar:na] at org.antlr.runtime.CommonTokenStream.LT(CommonTokenStream.java:238) ~[antlr.jar:na] at org.apache.tapestry5.internal.antlr.PropertyExpressionParser.start(PropertyExpressionParser.java:98) ~[tapestry-core-5.3-alpha-13.jar:na] at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.parse(PropertyConduitSourceImpl.java:1437) ~[tapestry-core-5.3-alpha-13.jar:na] ... 101 common frames omitted Caused by: org.antlr.runtime.NoViableAltException: null at org.antlr.runtime.DFA.noViableAlt(DFA.java:158) ~[antlr.jar:na] at org.antlr.runtime.DFA.predict(DFA.java:116) ~[antlr.jar:na] at org.apache.tapestry5.internal.antlr.PropertyExpressionLexer.mTokens(PropertyExpressionLexer.java:1273) ~[tapestry-core-5.3-alpha-13.jar:na] at org.antlr.runtime.Lexer.nextToken(Lexer.java:84) ~[antlr.jar:na] ... 105 common frames omitted -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (TAP5-1599) Upgrade Selenium to 2.3.1
[ https://issues.apache.org/jira/browse/TAP5-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship closed TAP5-1599. -- Resolution: Fixed Fix Version/s: 5.3 Upgrade Selenium to 2.3.1 - Key: TAP5-1599 URL: https://issues.apache.org/jira/browse/TAP5-1599 Project: Tapestry 5 Issue Type: Bug Components: tapestry-test Reporter: Mark Shead Assignee: Howard M. Lewis Ship Fix For: 5.3 Attachments: PATCH-TAP5-1599 The current version of Selenium only works with older browsers. Selenium 2.3.1 is almost a drop in replacement and will allow tests to be run with Firefox 5. At least on my setup, Selenium 2.3.1 is not significantly slower and is sometimes faster than the current version. Below are the test times running on Ubuntu 11.04. Firefox 5: 5.3 Selenium 2 Gradle 6:47 6:42 Using Firefox 3.6: 5.2.6 Selenium 1 Maven 6:14 5.3 with Selenium 1 Gradle 7:05 7:14 5.3 Selenium 2 Gradle 7:26 8:01 -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
svn commit: r1163885 - /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/ValueEncoder.java
Author: bobharner Date: Thu Sep 1 01:04:42 2011 New Revision: 1163885 URL: http://svn.apache.org/viewvc?rev=1163885view=rev Log: More javadocs on ValueEncoder. No code changes. Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/ValueEncoder.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/ValueEncoder.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/ValueEncoder.java?rev=1163885r1=1163884r2=1163885view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/ValueEncoder.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/ValueEncoder.java Thu Sep 1 01:04:42 2011 @@ -15,15 +15,51 @@ package org.apache.tapestry5; /** - * Used to convert server side values to client-side strings. This is used when generating a {@link - * org.apache.tapestry5.EventContext} as part of a URL, or when components (such as {@link - * org.apache.tapestry5.corelib.components.Select}) generated other client-side strings. + * A ValueEncoder is used to convert server side objects to unique client-side + * strings (typically IDs) and back. This mechanism is widely used in Tapestry + * to allow you to work more seamlessly with objects rather than manually + * managing the encoding and decoding process throughout your application. + * + * Tapestry uses a ValueEncoder when generating an + * {@link org.apache.tapestry5.EventContext} as part of a URL, and when + * components (such as {@link org.apache.tapestry5.corelib.components.Select}) + * need to generate unique client-side strings to be rendered within form + * elements. * p/ - * Often a custom implementation is needed for entity type objects, where the {@link #toClient(Object)} method extracts - * a primary key, and the {@link #toValue(String)} re-acquires the corresponding entity object. - * + * Tapestry can automatically generate ValueEncoders for enums as well as + * Collections of any object types for which a coercion can be found from a + * formatted String, such as primitives, primitive wrappers, Dates, Calendars, + * name=value strings, and any types for which a custom coercion has been + * contributed. + * p/ + * Custom ValueEncoder implementations will need to be supplied for entity type + * objects. In such cases the {@link #toClient(Object)} method typically returns + * an object's database primary key, and the {@link #toValue(String)} + * re-acquires the corresponding entity object, perhaps by doing a database + * lookup by that ID. + * p/ + * Some optional modules, such as Tapestry's own Hibernate and JPA modules, can + * automatically create a ValueEncoder for each of your entity types and then + * configure Tapestry to use them whenever a ValueEncoder is needed for those + * types. If you don't use one of those modules, you can still configure + * Tapestry to automatically use your custom ValueEncoder implementations by + * having your ValueEncoder implement the + * {@link org.apache.tapestry5.services.ValueEncoderFactory} interface and then + * contributing a ValueEncoderSource that adds your encoder, like this, in your + * application's module class: + * +* pre + * public static void contributeValueEncoderSource( + * MappedConfigurationlt;Classlt;Colorgt;, ValueEncoderFactorylt;Colorgt;gt; configuration) + * { + * configuration.addInstance(Color.class, ColorEncoder.class); + * } + * /pre + * * @see SelectModel * @see org.apache.tapestry5.services.ValueEncoderSource + * @see org.apache.tapestry5.services.services.ValueEncoderFactory + * @see org.apache.tapestry5.annotations.PageActivationContext.java */ public interface ValueEncoderV {