[jira] Updated: (TAP5-223) add PropertiesFileSymbolProvider
[ https://issues.apache.org/jira/browse/TAP5-223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship updated TAP5-223: -- Assignee: (was: Howard M. Lewis Ship) > add PropertiesFileSymbolProvider > > > Key: TAP5-223 > URL: https://issues.apache.org/jira/browse/TAP5-223 > Project: Tapestry 5 > Issue Type: New Feature > Components: tapestry-ioc >Affects Versions: 5.0.15 >Reporter: Neeme Praks > Attachments: PropertiesFileSymbolProvider.patch.txt, TAP5-223.txt > > > add a possibility to resolve symbols from properties file > (PropertiesFileSymbolProvider). > For reference, see: > http://thread.gmane.org/gmane.comp.java.tapestry.user/65656 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (TAP5-73) JavaScript libraries should be automatically packed/minimalized
[ https://issues.apache.org/jira/browse/TAP5-73?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship updated TAP5-73: - Assignee: (was: Howard M. Lewis Ship) > JavaScript libraries should be automatically packed/minimalized > --- > > Key: TAP5-73 > URL: https://issues.apache.org/jira/browse/TAP5-73 > Project: Tapestry 5 > Issue Type: New Feature >Affects Versions: 5.0.15 >Reporter: Howard M. Lewis Ship > > Tapestry should catch downloads of JavaScript libraries, and should "pack" > the JavaScript ... remove comments and unecessary whitespace. I believe Dojo > has a library to do this, it may even shorten variable names (!). > A smart implementation of this would manage to cache the compressed JS, and > notice when the uncompressed version changed. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (TAP5-153) Way to simulate annotations on classes, fields and methods
[ https://issues.apache.org/jira/browse/TAP5-153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship updated TAP5-153: -- Assignee: (was: Howard M. Lewis Ship) > Way to simulate annotations on classes, fields and methods > -- > > Key: TAP5-153 > URL: https://issues.apache.org/jira/browse/TAP5-153 > Project: Tapestry 5 > Issue Type: New Feature >Affects Versions: 5.0.15 >Reporter: Howard M. Lewis Ship > > In many organizations, it is not possible to place annotations directly on > entity fields (the dependency on tapestry5-annotations.jar is not allowed for > the entities). It would be nice if there was a way that annotations could > still be associated with entity classes, fields and methods. I'm envisioning > this as one or more configurations into which annotations could be defined, > plus an easy way (a service) used to create psuedo annotations. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (TAP5-496) Change If and Unless to render thier template element if provided (i.e., when using t:type) as well as informal parameters
[ https://issues.apache.org/jira/browse/TAP5-496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship updated TAP5-496: -- Assignee: (was: Howard M. Lewis Ship) > Change If and Unless to render thier template element if provided (i.e., when > using t:type) as well as informal parameters > -- > > Key: TAP5-496 > URL: https://issues.apache.org/jira/browse/TAP5-496 > Project: Tapestry 5 > Issue Type: Improvement > Components: tapestry-core >Affects Versions: 5.0.18 >Reporter: Folke Behrens >Priority: Minor > > I use a lot of dummy texts in my template to see what the page will actually > look like when rendered. To filter out these fragments I created a "Dummy" > component whose setupRender method always returns "false". > I don't know if this is efficient but it would be nice to have something like > this already in T5's component library. > More efficient would be a special marker XML attribute that the template > parser recognizes. Maybe something like a t:test attribute which is works > like If the contained expression evaluations to > false or null the marked element is filtered. > > conditional item > dummy item > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (TAP5-36) Only the last of multiple t:parameter components with the same name in the same grid are rendered, without an error message.
[ https://issues.apache.org/jira/browse/TAP5-36?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship updated TAP5-36: - Assignee: (was: Howard M. Lewis Ship) > Only the last of multiple t:parameter components with the same name in the > same grid are rendered, without an error message. > > > Key: TAP5-36 > URL: https://issues.apache.org/jira/browse/TAP5-36 > Project: Tapestry 5 > Issue Type: Bug >Affects Versions: 5.0.15 > Environment: Windows XP SP 2, Jetty Launcher 5.1.12, Maven 2.0.9, > Hibernate 3.2.2, Eclipse 3.3.2, FireFox 2.0.0.15, IE7 >Reporter: Daniel >Priority: Minor > > If two parameters are specified with the same name inside a grid component > (for example) in a tml file, Tapestry seems to ignore the first one and > render only the second. > Can Tapestry throw an exception when there is a conflict between identically > named parameter components? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (TAP5-27) Improve exception message for default field validation when value parameter is not bound.
[ https://issues.apache.org/jira/browse/TAP5-27?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship updated TAP5-27: - Assignee: (was: Howard M. Lewis Ship) > Improve exception message for default field validation when value parameter > is not bound. > - > > Key: TAP5-27 > URL: https://issues.apache.org/jira/browse/TAP5-27 > Project: Tapestry 5 > Issue Type: Bug >Affects Versions: 5.0.15 > Environment: Windows XP, Java 1.6, Tapestry 5.0.11, Eclipse 3.3.2, > Maven 2.0.9, Run-Jetty-Run >Reporter: Daniel >Priority: Minor > > The exception that was generated was an IllegalArgumentException with the > message,"Parameter annotationProvider was null." thrown from: > org.apache.tapestry.ioc.internal.util.Defense.notNull(Defense.java:37) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (TAP5-310) DateField error message "Date is not parsable" should be localizable
[ https://issues.apache.org/jira/browse/TAP5-310?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship updated TAP5-310: -- Assignee: (was: Howard M. Lewis Ship) > DateField error message "Date is not parsable" should be localizable > > > Key: TAP5-310 > URL: https://issues.apache.org/jira/browse/TAP5-310 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-core >Affects Versions: 5.0.15 >Reporter: Konstantin Miklevskiy >Priority: Minor > > DateField component localization problem > catch (ParseException ex) > { > tracker.recordError(this, "Date value is not parseable."); > return; > } > "Date value is not parseable" message should be read from properties file. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Assigned: (TAP5-507) Comments between the DOCTYPE and the root element now cause render errors
[ https://issues.apache.org/jira/browse/TAP5-507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship reassigned TAP5-507: - Assignee: Howard M. Lewis Ship > Comments between the DOCTYPE and the root element now cause render errors > - > > Key: TAP5-507 > URL: https://issues.apache.org/jira/browse/TAP5-507 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-core >Affects Versions: 5.1.0.0 >Reporter: Howard M. Lewis Ship >Assignee: Howard M. Lewis Ship >Priority: Critical > > This is related to the change to a StAX parser. > [ERROR] pages.Index Render queue error in > CompositeRenderCommand[Comment[Design by Free CSS Templates > http://www.freecsstemplates.org > Released for free under a Creative Commons Attribution 2.5 License > Name : Radiance > Description: Fixed-width design for blogs and small websites. > Version: 1.0 > Released : 20071007], Start[http://www.w3.org/1999/xhtml html], > DefineNamespace[ http://www.w3.org/1999/xhtml], > Start[http://www.w3.org/1999/xhtml head], Start[http://www.w3.org/1999/xhtml > title], Text[Tapestry360: SVN Admin], End, End, > Start[http://www.w3.org/1999/xhtml body], Comment[start header], > Start[http://www.w3.org/1999/xhtml div], AttributeNS[ id "logo"], > Start[http://www.w3.org/1999/xhtml h1], Start[http://www.w3.org/1999/xhtml > a], AttributeNS[ href "http://tapestry.formos.com";], AttributeNS[ shape > "rect"], Text[Tapestry360: SVN Admin], End, End, > Start[http://www.w3.org/1999/xhtml p], Text[ > Subversion self adminstration for > ], Start[http://www.w3.org/1999/xhtml a], AttributeNS[ href > "http://tapestry.formos.com/";], AttributeNS[ shape "rect"], > Text[Tapestry360], End, Text[ > projects. > ], End, End, Start[http://www.w3.org/1999/xhtml div], AttributeNS[ id > "menu"], Start[http://www.w3.org/1999/xhtml ul]]: This markup writer does not > have a current element. The current element is established with the first > call to element() and is maintained across subsequent calls. > java.lang.IllegalStateException: This markup writer does not have a current > element. The current element is established with the first call to element() > and is maintained across subsequent calls. > at > org.apache.tapestry5.internal.services.MarkupWriterImpl.ensureCurrentElement(MarkupWriterImpl.java:133) > at > org.apache.tapestry5.internal.services.MarkupWriterImpl.comment(MarkupWriterImpl.java:187) > at > org.apache.tapestry5.internal.structure.CommentPageElement.render(CommentPageElement.java:38) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (TAP5-504) Tapestry's template parser should identify and convert the src attribute to use a context Asset
[ https://issues.apache.org/jira/browse/TAP5-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672358#action_12672358 ] Robert Zeigler commented on TAP5-504: - I'm with Fernando on this one; don't hijack the img tag. A central tenet of tapestry template processing is that anything that is /not/ a component or expansion is passed-through unmodified. Having act like violates that tenet; the fewer exceptions we have, the better. Again, this is Fernando's suggestion, but making a dedicated image component is a less confusing solution to this problem; you get the benefit of auto-translation of the "src" parameter, and the benefit of template coimprehension, since is clearly a component. > Tapestry's template parser should identify and convert the > src attribute to use a context Asset > > > Key: TAP5-504 > URL: https://issues.apache.org/jira/browse/TAP5-504 > Project: Tapestry 5 > Issue Type: New Feature > Components: tapestry-core >Affects Versions: 5.1.0.0 >Reporter: Howard M. Lewis Ship > > Currently, if you have: >
[jira] Created: (TAP5-510) Improve code coverage of JSON unit tests
Improve code coverage of JSON unit tests Key: TAP5-510 URL: https://issues.apache.org/jira/browse/TAP5-510 Project: Tapestry 5 Issue Type: Task Components: tapestry-core Affects Versions: 5.1.0.0 Reporter: Howard M. Lewis Ship The JSON library code is a modified version of code from JSON.org that arrived without a substantial test suite; the code coverage is spotty. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r743058 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry5/ main/java/org/apache/tapestry5/dom/ main/java/org/apache/tapestry5/internal/services/ main/java/or
Author: hlship Date: Tue Feb 10 18:58:33 2009 New Revision: 743058 URL: http://svn.apache.org/viewvc?rev=743058&view=rev Log: TAP5-507: Comments between the DOCTYPE and the root element now cause render errors Added: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/preamble_content.txt Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/Asset2.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/dom/Document.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/dom/Element.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/MarkupWriterImpl.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/AssetPathConverter.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/MarkupWriterImplTest.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/Asset2.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/Asset2.java?rev=743058&r1=743057&r2=743058&view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/Asset2.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/Asset2.java Tue Feb 10 18:58:33 2009 @@ -21,14 +21,13 @@ * the invariance of the binding from the asset (and assumes variant unless the asset object implements this * interface). * - * @see org.apache.tapestry5.services.AssetPathConverter#isInvariant() * @since 5.1.0.0 */ public interface Asset2 extends Asset { /** * Returns true if the Asset is invariant (meaning that it returns the same value from {...@link Asset#toClientURL()} - * at all times}. Assets that are used as binding values will be cached more aggresively by Tapestry is they are + * at all times}. Assets that are used as binding values will be cached more aggresively by Tapestry as they are * invariant. * * @return true if invariant Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/dom/Document.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/dom/Document.java?rev=743058&r1=743057&r2=743058&view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/dom/Document.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/dom/Document.java Tue Feb 10 18:58:33 2009 @@ -19,6 +19,7 @@ import java.io.PrintWriter; import java.util.Collections; +import java.util.List; import java.util.Map; /** @@ -44,6 +45,11 @@ private final String encoding; +/** + * Non-element content that comes between the DOCTYPE and the root element. + */ +private List preamble; + public Document(MarkupModel model) { this(model, null); @@ -145,6 +151,12 @@ dtd.toMarkup(writer); } +if (preamble != null) +{ +for (Node n : preamble) +n.toMarkup(this, writer, namespaceURIToPrefix); +} + Map initialNamespaceMap = CollectionFactory.newMap(); initialNamespaceMap.put("xml", "http://www.w3.org/XML/1998/namespace";); @@ -203,4 +215,61 @@ { rootElement.visit(visitor); } + +private T newChild(T child) +{ +if (preamble == null) +preamble = CollectionFactory.newList(); + +preamble.add(child); + +return child; +} + +/** + * Adds the comment and returns this document for further construction. + * + * @since 5.1.0.0 + */ +public Document comment(String text) +{ +newChild(new Comment(this, text)); + +return this; +} + +/** + * Adds the raw text and returns this document for further construction. + * + * @since 5.1.0.0 + */ +public Document raw(String text) +{ +newChild(new Raw(this, text)); + +return this; +} + +/** + * Adds and returns a new text node (the text node is returned so that {...@link Text#write(String)} or [...@link {...@link + * Text#writef(String, Object[])} may be invoked . + * + * @param text initial text for the node + * @return the new Text node + */ +public Text text(String text) +{ +return newChild(new Text(this, text)); +} + +/** + * Adds and returns a new CDATA node. + * + * @param content the content to be rendered by the node + * @return the newly created node + */ +public CData cdata(String content) +{ +
[jira] Closed: (TAP5-507) Comments between the DOCTYPE and the root element now cause render errors
[ https://issues.apache.org/jira/browse/TAP5-507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship closed TAP5-507. - Resolution: Fixed Fix Version/s: 5.1.0.0 > Comments between the DOCTYPE and the root element now cause render errors > - > > Key: TAP5-507 > URL: https://issues.apache.org/jira/browse/TAP5-507 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-core >Affects Versions: 5.1.0.0 >Reporter: Howard M. Lewis Ship >Assignee: Howard M. Lewis Ship >Priority: Critical > Fix For: 5.1.0.0 > > > This is related to the change to a StAX parser. > [ERROR] pages.Index Render queue error in > CompositeRenderCommand[Comment[Design by Free CSS Templates > http://www.freecsstemplates.org > Released for free under a Creative Commons Attribution 2.5 License > Name : Radiance > Description: Fixed-width design for blogs and small websites. > Version: 1.0 > Released : 20071007], Start[http://www.w3.org/1999/xhtml html], > DefineNamespace[ http://www.w3.org/1999/xhtml], > Start[http://www.w3.org/1999/xhtml head], Start[http://www.w3.org/1999/xhtml > title], Text[Tapestry360: SVN Admin], End, End, > Start[http://www.w3.org/1999/xhtml body], Comment[start header], > Start[http://www.w3.org/1999/xhtml div], AttributeNS[ id "logo"], > Start[http://www.w3.org/1999/xhtml h1], Start[http://www.w3.org/1999/xhtml > a], AttributeNS[ href "http://tapestry.formos.com";], AttributeNS[ shape > "rect"], Text[Tapestry360: SVN Admin], End, End, > Start[http://www.w3.org/1999/xhtml p], Text[ > Subversion self adminstration for > ], Start[http://www.w3.org/1999/xhtml a], AttributeNS[ href > "http://tapestry.formos.com/";], AttributeNS[ shape "rect"], > Text[Tapestry360], End, Text[ > projects. > ], End, End, Start[http://www.w3.org/1999/xhtml div], AttributeNS[ id > "menu"], Start[http://www.w3.org/1999/xhtml ul]]: This markup writer does not > have a current element. The current element is established with the first > call to element() and is maintained across subsequent calls. > java.lang.IllegalStateException: This markup writer does not have a current > element. The current element is established with the first call to element() > and is maintained across subsequent calls. > at > org.apache.tapestry5.internal.services.MarkupWriterImpl.ensureCurrentElement(MarkupWriterImpl.java:133) > at > org.apache.tapestry5.internal.services.MarkupWriterImpl.comment(MarkupWriterImpl.java:187) > at > org.apache.tapestry5.internal.structure.CommentPageElement.render(CommentPageElement.java:38) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Assigned: (TAP5-496) Change If and Unless to render thier template element if provided (i.e., when using t:type) as well as informal parameters
[ https://issues.apache.org/jira/browse/TAP5-496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship reassigned TAP5-496: - Assignee: Howard M. Lewis Ship > Change If and Unless to render thier template element if provided (i.e., when > using t:type) as well as informal parameters > -- > > Key: TAP5-496 > URL: https://issues.apache.org/jira/browse/TAP5-496 > Project: Tapestry 5 > Issue Type: Improvement > Components: tapestry-core >Affects Versions: 5.0.18 >Reporter: Folke Behrens >Assignee: Howard M. Lewis Ship >Priority: Minor > > I use a lot of dummy texts in my template to see what the page will actually > look like when rendered. To filter out these fragments I created a "Dummy" > component whose setupRender method always returns "false". > I don't know if this is efficient but it would be nice to have something like > this already in T5's component library. > More efficient would be a special marker XML attribute that the template > parser recognizes. Maybe something like a t:test attribute which is works > like If the contained expression evaluations to > false or null the marked element is filtered. > > conditional item > dummy item > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r743077 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry5/corelib/base/ main/java/org/apache/tapestry5/corelib/components/ main/resources/org/apache/tapestry
Author: hlship Date: Tue Feb 10 19:43:28 2009 New Revision: 743077 URL: http://svn.apache.org/viewvc?rev=743077&view=rev Log: TAP5-496: Change If and Unless to render thier template element if provided (i.e., when using t:type) as well as informal parameters Added: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractConditional.java Removed: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/corelib/components/IfTest.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/corelib/components/UnlessTest.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/If.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Unless.java tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/ExceptionDisplay.tml Added: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractConditional.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractConditional.java?rev=743077&view=auto == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractConditional.java (added) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractConditional.java Tue Feb 10 19:43:28 2009 @@ -0,0 +1,90 @@ +// Copyright 2009 The Apache Software Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.corelib.base; + +import org.apache.tapestry5.BindingConstants; +import org.apache.tapestry5.Block; +import org.apache.tapestry5.ComponentResources; +import org.apache.tapestry5.MarkupWriter; +import org.apache.tapestry5.annotations.Parameter; +import org.apache.tapestry5.annotations.SupportsInformalParameters; +import org.apache.tapestry5.ioc.annotations.Inject; + +/** + * Base class for {...@link org.apache.tapestry5.corelib.components.If} and {...@link org.apache.tapestry5.corelib.components.Unless}. + * Will render its body or the block from its else parameter. If it renders anything and it has an element name, then + * it renders the element and its informal parameters. + */ +...@supportsinformalparameters +public abstract class AbstractConditional +{ +@Inject +private ComponentResources resources; + +/** + * Performs the test via the parameters; return true to render the body of the component, false to render the else + * block (or nothing). + * + * @return true to render body + */ +protected abstract boolean test(); + +/** + * An alternate {...@link org.apache.tapestry5.Block} to render if {...@link #test()} is false. The default, null, means + * render nothing in that situation. + */ +@Parameter(name = "else", defaultPrefix = BindingConstants.LITERAL) +private Block elseBlock; + +private boolean renderTag; + +/** + * Returns null if the {...@link #test()} is true, which allows normal rendering (of the body). If the test parameter + * is false, returns the else parameter (this may also be null). + */ +Object beginRender(MarkupWriter writer) +{ +Block toRender = test() ? resources.getBody() : elseBlock; + +String elementName = resources.getElementName(); + +renderTag = toRender != null && elementName != null; + +if (renderTag) +{ +writer.element(elementName); +resources.renderInformalParameters(writer); +} + +return toRender; +} + +/** + * If {...@link #test()} is true, then the body is rendered, otherwise not. The component does not have a template or + * do any other rendering besides its body. + */ +boolean beforeRenderBody() +{ +return false; +} + +void afterRenderBody(MarkupWriter writer) +{ +if (renderTag) +writer.end(); +} + + +} Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/If.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/If.java?rev=743077&r1=743076&r2=743077&view=diff ===
[jira] Closed: (TAP5-496) Change If and Unless to render thier template element if provided (i.e., when using t:type) as well as informal parameters
[ https://issues.apache.org/jira/browse/TAP5-496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship closed TAP5-496. - Resolution: Fixed Fix Version/s: 5.1.0.0 > Change If and Unless to render thier template element if provided (i.e., when > using t:type) as well as informal parameters > -- > > Key: TAP5-496 > URL: https://issues.apache.org/jira/browse/TAP5-496 > Project: Tapestry 5 > Issue Type: Improvement > Components: tapestry-core >Affects Versions: 5.0.18 >Reporter: Folke Behrens >Assignee: Howard M. Lewis Ship >Priority: Minor > Fix For: 5.1.0.0 > > > I use a lot of dummy texts in my template to see what the page will actually > look like when rendered. To filter out these fragments I created a "Dummy" > component whose setupRender method always returns "false". > I don't know if this is efficient but it would be nice to have something like > this already in T5's component library. > More efficient would be a special marker XML attribute that the template > parser recognizes. Maybe something like a t:test attribute which is works > like If the contained expression evaluations to > false or null the marked element is filtered. > > conditional item > dummy item > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (TAP5-508) Same reporting behaviour between unchecked and checked Exceptions
[ https://issues.apache.org/jira/browse/TAP5-508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] manuel aldana updated TAP5-508: --- Attachment: uncheckExceptionSwallowedIfChainingUsed.png Yes, I still think it is inconsistent behaviour (error page should be transparent, whether user threw a checked or an unchecked exception himself). Even worse, when using exception-chaining it happens that unchecked application exception is not shown at all and is being swallowed (see screenshot uncheckExceptionSwallowedIfChainingUsed.png). I tend to use unchecked exception in my application and use exception chaining a lot. I remember that I was quite confused that my application exception did not show up on the error page. Reason seems to be that first top-level exception is filtered in error page. The easiest fix was to use this last RuntimeException wrap. Is this fix really an issue? What speaks against it? > Same reporting behaviour between unchecked and checked Exceptions > - > > Key: TAP5-508 > URL: https://issues.apache.org/jira/browse/TAP5-508 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-core >Affects Versions: 5.0.18 >Reporter: manuel aldana >Priority: Trivial > Fix For: 5.1.0.0 > > Attachments: TAP509.patch, uncheckedExceptionTypeNotPrinted.png, > uncheckExceptionSwallowedIfChainingUsed.png > > > Unchecked exceptions are reported differently on Exception reporting page. > This should be changed, because many applications have convention to use an > unchecked exception hierachy. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (TAP5-508) Same reporting behaviour between unchecked and checked Exceptions
[ https://issues.apache.org/jira/browse/TAP5-508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672394#action_12672394 ] Filip S. Adamsen commented on TAP5-508: --- Okay, I see now. I just tried chaining 3 runtime exception and as you said, only the innermost one was shown. That's odd, and certainly not what I would expect. I still don't like wrapping the whole thing in another exception, though. I believe fixing the root cause (no pun intended) is the way to go instead. > Same reporting behaviour between unchecked and checked Exceptions > - > > Key: TAP5-508 > URL: https://issues.apache.org/jira/browse/TAP5-508 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-core >Affects Versions: 5.0.18 >Reporter: manuel aldana >Priority: Trivial > Fix For: 5.1.0.0 > > Attachments: TAP509.patch, uncheckedExceptionTypeNotPrinted.png, > uncheckExceptionSwallowedIfChainingUsed.png > > > Unchecked exceptions are reported differently on Exception reporting page. > This should be changed, because many applications have convention to use an > unchecked exception hierachy. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Assigned: (TAP5-165) Components which use PrimaryKeyEncoder should be changed to use ValueEncoder, and PrimaryKeyEncoder should be eliminated.
[ https://issues.apache.org/jira/browse/TAP5-165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship reassigned TAP5-165: - Assignee: Howard M. Lewis Ship > Components which use PrimaryKeyEncoder should be changed to use ValueEncoder, > and PrimaryKeyEncoder should be eliminated. > - > > Key: TAP5-165 > URL: https://issues.apache.org/jira/browse/TAP5-165 > Project: Tapestry 5 > Issue Type: Improvement >Affects Versions: 5.0.16 > Environment: any >Reporter: Robert Zeigler >Assignee: Howard M. Lewis Ship >Priority: Minor > > While working on an application, I noticed that my objects were being > serialized "weird" into a form by the loop component. I realized that I > hadn't provided the primary key encoder, and once I did things worked as > expected. That got me to thinking that it would be nice if the Loop > component, and other components that rely on PrimaryKeyEncoders, could check > to see if there is an encoder available for the value-type, if none is > explicitly bound by the user. That way, module-authors could provide > PrimaryKeyEncoders that makes things work "like magic". > For example, tapestry-hibernate could contribute PrimaryKeyEncoders for each > entity type so that the objects are automatically, and properly, encoded into > forms. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (TAP5-165) Components which use PrimaryKeyEncoder should be changed to use ValueEncoder, and PrimaryKeyEncoder should be eliminated.
[ https://issues.apache.org/jira/browse/TAP5-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672438#action_12672438 ] Robert Zeigler commented on TAP5-165: - The irony of this issue is that Loop originally used ValueEncoder. Now that 5.0 has hit "final" (5.0.18), I'm not sure changing this is the right thing to do. For better or worse, we've introduced the PKE interface and parameter to the masses. So perhaps PKE=>ValueEncoder coercion is the best bet. Alternatively, my original summary may still hold: if there was a PrimaryKeyEncoderSource, just like ValueEncoderSource, then module and application authors could still make the appropriate contributions and not have to worry about specifying the PKE when using Loop. The two strategies could be combined: Loop uses PKESource to lookup the PKE; the PKE has a tapestry-contributed fallback mapping that checks for ValueEncoders for the specified type. The tricky thing is determining the type from the source collection, but the same heuristics used by Grid can be applied to Loop. > Components which use PrimaryKeyEncoder should be changed to use ValueEncoder, > and PrimaryKeyEncoder should be eliminated. > - > > Key: TAP5-165 > URL: https://issues.apache.org/jira/browse/TAP5-165 > Project: Tapestry 5 > Issue Type: Improvement >Affects Versions: 5.0.16 > Environment: any >Reporter: Robert Zeigler >Assignee: Howard M. Lewis Ship >Priority: Minor > > While working on an application, I noticed that my objects were being > serialized "weird" into a form by the loop component. I realized that I > hadn't provided the primary key encoder, and once I did things worked as > expected. That got me to thinking that it would be nice if the Loop > component, and other components that rely on PrimaryKeyEncoders, could check > to see if there is an encoder available for the value-type, if none is > explicitly bound by the user. That way, module-authors could provide > PrimaryKeyEncoders that makes things work "like magic". > For example, tapestry-hibernate could contribute PrimaryKeyEncoders for each > entity type so that the objects are automatically, and properly, encoded into > forms. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (TAP5-165) Components which use PrimaryKeyEncoder should be changed to use ValueEncoder, and PrimaryKeyEncoder should be eliminated.
[ https://issues.apache.org/jira/browse/TAP5-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672455#action_12672455 ] Howard M. Lewis Ship commented on TAP5-165: --- This is coming along well, but I'm having trouble with the automatic coercion from PrimaryKeyEncoder to ValueEncoder. The problem is using reflection to dig out the key type, which is very necessary. > Components which use PrimaryKeyEncoder should be changed to use ValueEncoder, > and PrimaryKeyEncoder should be eliminated. > - > > Key: TAP5-165 > URL: https://issues.apache.org/jira/browse/TAP5-165 > Project: Tapestry 5 > Issue Type: Improvement >Affects Versions: 5.0.16 > Environment: any >Reporter: Robert Zeigler >Assignee: Howard M. Lewis Ship >Priority: Minor > > While working on an application, I noticed that my objects were being > serialized "weird" into a form by the loop component. I realized that I > hadn't provided the primary key encoder, and once I did things worked as > expected. That got me to thinking that it would be nice if the Loop > component, and other components that rely on PrimaryKeyEncoders, could check > to see if there is an encoder available for the value-type, if none is > explicitly bound by the user. That way, module-authors could provide > PrimaryKeyEncoders that makes things work "like magic". > For example, tapestry-hibernate could contribute PrimaryKeyEncoders for each > entity type so that the objects are automatically, and properly, encoded into > forms. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (TAP5-511) I have a form in a zone that refers to that zone to refresh content. When there are 3 or less form elements, the form is submitted as an ajax request. When I add a fourth el
I have a form in a zone that refers to that zone to refresh content. When there are 3 or less form elements, the form is submitted as an ajax request. When I add a fourth element (textarea, textfield, radio, hidden), the form submits as a non-ajax request --- Key: TAP5-511 URL: https://issues.apache.org/jira/browse/TAP5-511 Project: Tapestry 5 Issue Type: Bug Components: tapestry-core Affects Versions: 5.1.0.0 Reporter: Mike Taylor I have a form in a zone that refers to that zone to refresh content. When there are 3 or less form elements, the form is submitted as an ajax request and updates the referred zone. When I add a fourth element (textarea, textfield, radio, hidden -- does not matter what type), the form submits as a non-ajax request and refreshes the entire page, not just the zone. I've tried all sorts of combinations, and it all hinges upon the number of elements in the form -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (TAP5-165) Components which use PrimaryKeyEncoder should be changed to use ValueEncoder, and PrimaryKeyEncoder should be eliminated.
[ https://issues.apache.org/jira/browse/TAP5-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672468#action_12672468 ] Howard M. Lewis Ship commented on TAP5-165: --- The problem is the way generics are implemented. The key type is lost to type erasure. I wish PKE had one more method on it: key type. I may have to add it. > Components which use PrimaryKeyEncoder should be changed to use ValueEncoder, > and PrimaryKeyEncoder should be eliminated. > - > > Key: TAP5-165 > URL: https://issues.apache.org/jira/browse/TAP5-165 > Project: Tapestry 5 > Issue Type: Improvement >Affects Versions: 5.0.16 > Environment: any >Reporter: Robert Zeigler >Assignee: Howard M. Lewis Ship >Priority: Minor > > While working on an application, I noticed that my objects were being > serialized "weird" into a form by the loop component. I realized that I > hadn't provided the primary key encoder, and once I did things worked as > expected. That got me to thinking that it would be nice if the Loop > component, and other components that rely on PrimaryKeyEncoders, could check > to see if there is an encoder available for the value-type, if none is > explicitly bound by the user. That way, module-authors could provide > PrimaryKeyEncoders that makes things work "like magic". > For example, tapestry-hibernate could contribute PrimaryKeyEncoders for each > entity type so that the objects are automatically, and properly, encoded into > forms. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r743195 - in /tapestry/tapestry5/trunk: src/site/ src/site/apt/ tapestry-core/src/main/java/org/apache/tapestry5/ tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/ tapes
Author: hlship Date: Wed Feb 11 02:22:17 2009 New Revision: 743195 URL: http://svn.apache.org/viewvc?rev=743195&view=rev Log: TAP5-165: Components which use PrimaryKeyEncoder should be changed to use ValueEncoder, and PrimaryKeyEncoder should be deprecated Added: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/util/PrimaryKeyEncoder2ValueEncoder.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/util/PrimaryKeyEncoder2ValueEncoderTest.java Modified: tapestry/tapestry5/trunk/src/site/apt/upgrade.apt tapestry/tapestry5/trunk/src/site/site.xml tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/EventConstants.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/PrimaryKeyEncoder.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/AjaxFormLoop.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/GridRows.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Loop.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/util/DefaultPrimaryKeyEncoder.java tapestry/tapestry5/trunk/tapestry-core/src/test/app1/GridFormEncoderDemo.tml tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DateFieldAjaxFormLoop.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/FormInjectorDemo.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/GridFormEncoderDemo.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ToDoList.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/util/DefaultPrimaryKeyEncoderTest.java Modified: tapestry/tapestry5/trunk/src/site/apt/upgrade.apt URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/src/site/apt/upgrade.apt?rev=743195&r1=743194&r2=743195&view=diff == --- tapestry/tapestry5/trunk/src/site/apt/upgrade.apt (original) +++ tapestry/tapestry5/trunk/src/site/apt/upgrade.apt Wed Feb 11 02:22:17 2009 @@ -15,6 +15,24 @@ Release 5.1.0.0 +* Primary Key Encoder + + <> + + The {{{apidocs/org/apache/tapestry5/PrimaryKeyEncoder.html}PrimaryKeyEncoder}} + interface has been deprecated and will be removed in a later release. + See {{{https://issues.apache.org/jira/browse/TAP5-165}TAP5-165}} for the rationale. + + You may see type coercion errors on pages where you have specified the encoder parameter of + the Grid, Loop or AjaxFormLoop components as a PrimaryKeyEncoder. + These errors indicate that Tapestry was unable to automatically convert your PrimaryKeyEncoder instance into + a {{{apidocs/org/apache/tapestry5/ValueEncoder.html}ValueEncoder}}. Generally, the only change is to invoke the new constructor for + {{{apdiocs/org/apache/tapestry5/util/DefaultPrimaryKeyEncoder.html}DefaultPrimaryKeyEncoder}}, to identify + the type of key used. + + If you don't use DefaultPrimaryKeyEncoder, you will see compile errors about the new method, getKeyType(). + You will have to change your code to implement that new method. + * Performance Improvements As part of the changes related to @@ -28,10 +46,11 @@ * Tapestry/Spring There have been some significant changes to the {{{tapestry-spring/}tapestry-spring}} module, to - support injection of Tapestry services into Springbeans. + support injection of Tapestry services into Spring beans. You may find you need to add some new configuration + to revert to the Tapestry 5.0 behavior. * Session Persisted Objects - + Tapestry is now more aggressive about automatically re-storing any session persisted object back into the session at the end of the request (this used to only apply to application state objects). See the {{{guide/persist.html}persistent page data}} notes for more details. @@ -39,7 +58,8 @@ * Module Classes Many questionable practices in Tapestry module classes that used to produce warnings - have been changed to fail early with exceptions. The rationale is that the warnings would be ignored, + have been changed to fail early (that is, throw exceptions). The rationale is that the warnings + are almost always ignored, resulting in more difficult to diagnose runtime errors. Extra public m
[jira] Updated: (TAP5-165) Components which use PrimaryKeyEncoder should be changed to use ValueEncoder, and PrimaryKeyEncoder should be deprecated
[ https://issues.apache.org/jira/browse/TAP5-165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship updated TAP5-165: -- Summary: Components which use PrimaryKeyEncoder should be changed to use ValueEncoder, and PrimaryKeyEncoder should be deprecated (was: Components which use PrimaryKeyEncoder should be changed to use ValueEncoder, and PrimaryKeyEncoder should be eliminated.) > Components which use PrimaryKeyEncoder should be changed to use ValueEncoder, > and PrimaryKeyEncoder should be deprecated > > > Key: TAP5-165 > URL: https://issues.apache.org/jira/browse/TAP5-165 > Project: Tapestry 5 > Issue Type: Improvement >Affects Versions: 5.0.16 > Environment: any >Reporter: Robert Zeigler >Assignee: Howard M. Lewis Ship >Priority: Minor > > While working on an application, I noticed that my objects were being > serialized "weird" into a form by the loop component. I realized that I > hadn't provided the primary key encoder, and once I did things worked as > expected. That got me to thinking that it would be nice if the Loop > component, and other components that rely on PrimaryKeyEncoders, could check > to see if there is an encoder available for the value-type, if none is > explicitly bound by the user. That way, module-authors could provide > PrimaryKeyEncoders that makes things work "like magic". > For example, tapestry-hibernate could contribute PrimaryKeyEncoders for each > entity type so that the objects are automatically, and properly, encoded into > forms. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Closed: (TAP5-165) Components which use PrimaryKeyEncoder should be changed to use ValueEncoder, and PrimaryKeyEncoder should be deprecated
[ https://issues.apache.org/jira/browse/TAP5-165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship closed TAP5-165. - Resolution: Fixed Fix Version/s: 5.1.0.0 > Components which use PrimaryKeyEncoder should be changed to use ValueEncoder, > and PrimaryKeyEncoder should be deprecated > > > Key: TAP5-165 > URL: https://issues.apache.org/jira/browse/TAP5-165 > Project: Tapestry 5 > Issue Type: Improvement >Affects Versions: 5.0.16 > Environment: any >Reporter: Robert Zeigler >Assignee: Howard M. Lewis Ship >Priority: Minor > Fix For: 5.1.0.0 > > > While working on an application, I noticed that my objects were being > serialized "weird" into a form by the loop component. I realized that I > hadn't provided the primary key encoder, and once I did things worked as > expected. That got me to thinking that it would be nice if the Loop > component, and other components that rely on PrimaryKeyEncoders, could check > to see if there is an encoder available for the value-type, if none is > explicitly bound by the user. That way, module-authors could provide > PrimaryKeyEncoders that makes things work "like magic". > For example, tapestry-hibernate could contribute PrimaryKeyEncoders for each > entity type so that the objects are automatically, and properly, encoded into > forms. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.