You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tiles.apache.org by "Mck SembWever (JIRA)" <ji...@apache.org> on 2010/03/10 13:15:27 UTC
[jira] Updated: (TILES-494) Add support for a default value to
attribute's cascade
[ https://issues.apache.org/jira/browse/TILES-494?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mck SembWever updated TILES-494:
--------------------------------
Priority: Trivial (was: Major)
> Add support for a default value to attribute's cascade
> ------------------------------------------------------
>
> Key: TILES-494
> URL: https://issues.apache.org/jira/browse/TILES-494
> Project: Tiles
> Issue Type: Improvement
> Components: tiles-core
> Affects Versions: 2.2.2
> Reporter: Mck SembWever
> Priority: Trivial
>
> Make it possible to specify a default value for attribute@cascade.
> I'm writing definitions for a legacy project and we don't have the luxury of a flat template that directly inserts each defined attribute.
> To have to specify cascade="true" on every put-attribute seems excessive verbosity.
> One solution would be to add a boolean attribute cascadeAttributes to Definition.
> For example:
> <definition name="myapp.homepage" template="/layouts/classic.jsp" cascade-attributes="true">
> <put-attribute name="header" value="/tiles/banner.jsp" />
> <put-attribute name="menu" value="/tiles/common_menu.jsp" />
> <put-attribute name="body" value="/tiles/home_body.jsp" />
> <put-attribute name="footer" value="/tiles/credits.jsp" />
> </definition>
> instead of today's
> <definition name="myapp.homepage" template="/layouts/classic.jsp">
> <put-attribute name="header" value="/tiles/banner.jsp" cascade="true" />
> <put-attribute name="menu" value="/tiles/common_menu.jsp" cascade="true" />
> <put-attribute name="body" value="/tiles/home_body.jsp" cascade="true" />
> <put-attribute name="footer" value="/tiles/credits.jsp" cascade="true" />
> </definition>
> Implementation:
> + add to FillDefinitionRule.begin()
> definition.setCascadeAttributes("true".equals(attributes.getValue("cascade-attributes")));
> + change in PutAttributeRule.begin()
> definition.putAttribute(attributes.getValue("name"), attribute,
> "true".equals(attributes.getValue("cascade")) || definition.getCascadeAttributes());
> + add to Definition the getter and setter methods: getCascadeAttributes and setCascadeAttributes
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.