Issue Details (XML | Word | Printable)

Key: SHALE-201
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Gary VanMatre
Reporter: Ryan Wynn
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Shale

Support 2 pass symbol replacement

Created: 27/Jun/06 04:36 AM   Updated: 21/Aug/06 11:28 PM
Return to search
Component/s: Clay
Affects Version/s: Nightly
Fix Version/s: 1.0.3

Environment: Linux, Windows


 Description  « Hide
The following illustrates a use case for 2 pass symbol replacement.


Client.html

<span id="id1" jsfid="clay" clayJsfid="Template.html" name="#{person.name}" email="#{person.address.email"} />


Template.html

<body>
       Name: <span id="id2" jsfid="tree" value="@name"/>
      
       Email: <span id="id3" jsfid="tree" value="@email"/>
</body>


Custom component

<component jsfid="tree" extends="panelGroup">
       <element renderId="1" jsfid="outputText">
               <attributes>
                       <set name="value" value="@value"/>
               </attributes>
       </element>
       <validator jsfid="lengthValidator">
               ...
       </validator>
</component>


Currently the nested attribute [value] inside of the 1st child of tree does not realize symbol replacement because the symbol
@value actually points to another symbol, either @name or @email depending on the context.

With 2-pass symbol replacement this attribute would ultimately get the value #{person.name} or #{person.address.email}


Span (id1) - > clay
Symbol Table = { @name=#{person.name} , @email==#{person.address.email} }

Span (id2) -> tree
Symbol Table = { @name=#{person.name} , @email==#{person.address.email} , @value=@name}

tree Child 1
Symbol Table = { @name=#{person.name} , @email==#{person.address.email} , @value=@name}

                      Such that EvalSymbol(@value) -> EvalSymbol(@name) -> #{person.name} , instead of @name



 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
Struts #417663 Wed Jun 28 04:04:20 UTC 2006 gvanmatre Fix for issue SHALE-201 reported by Ryan Wynn.
Files Changed
MODIFY /struts/shale/trunk/shale-clay/src/main/java/org/apache/shale/clay/component/chain/CreateComponentCommand.java
MODIFY /struts/shale/trunk/shale-clay/src/test/java/org/apache/shale/clay/config/SymbolsTestCase.java
MODIFY /struts/shale/trunk/shale-clay/src/main/java/org/apache/shale/clay/component/Clay.java
MODIFY /struts/shale/trunk/shale-clay/src/main/java/org/apache/shale/clay/component/chain/AbstractCommand.java

Gary VanMatre added a comment - 28/Jun/06 11:09 AM
Another great idea Ryan. The SymbolsTestCase contains a couple examples. Thanks for the help.

Gary VanMatre made changes - 28/Jun/06 11:09 AM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 1.0.3 [ 21714 ]
Resolution Fixed [ 1 ]
Assignee Gary VanMatre [ gvanmatre@comcast.net ]
sean schofield made changes - 21/Aug/06 11:28 PM
Fix Version/s 1.0.3-SNAPSHOT [ 21714 ]
Fix Version/s 1.0.3 [ 21750 ]
Jeff Turner made changes - 09/Aug/07 07:17 AM
Workflow Struts [ 38485 ] Struts - editable closed status [ 42258 ]
Antonio Petrelli made changes - 08/Jan/09 08:57 AM
Workflow Struts - editable closed status [ 42258 ] Struts - editable closed status (temporary) [ 46255 ]
Antonio Petrelli made changes - 08/Jan/09 09:08 AM
Workflow Struts - editable closed status (temporary) [ 46255 ] Struts - editable closed status [ 52628 ]