Have now updated the diff to include test cases.

I am wondering why evaluation tests are done in the implementations instead of 
at tiles-core where it's defined? This means there's a lot of duplicated tests 
for a method that's not been overridden.

> On 12 Jun 2015, at 14:12, Brett Ryan <brett.r...@johnsands.com.au> wrote:
> 
> Alrighty, I've implemented the support just the way I want it, and wondered 
> if I could contribute it back.
> 
> What I've done is created a new interface (ExpressionAware) which provides 
> the following method:
> 
>    void evaluateExpressions(AttributeEvaluator, Request)
> 
> This is then called from AbstractAttributeEvaluator.evaluate(Attribute, 
> Request) which then allows the implementor to update expression values or do 
> set new properties etc. I've implemented this in the MenuItem class to 
> replace its values when called.
> 
> I'm yet to write unit-tests, I've tested with the MenuItem and it's working 
> perfectly.
> 
> You could take this further by instead of Attribute being wired into the 
> expression awareness in core, it could also implement ExpressionAware to 
> further abstract the expression evaluation.
> 
> If the type is enumerable each item will also have its expressions evaluated 
> (as is the case with MenuItem.
> 
> Patch attached
> 
> 
>> On 7 Jun 2015, at 06:15, BR Brett Ryan (3456) <brett.r...@johnsands.com.au> 
>> wrote:
>> 
>> 
>>>> I see that the MenuItem support is now in tiles-compat, is there an
>>>> alternate (better?) way of achieving this?
>>> 
>>> 
>>> Have you looked into the SimpleMenuItem code?
>>> I'd take a stub at implementing what you need there from scratch – it's
>>> pretty simple stuff there.
>> 
>> I did, and was thinking about doing it, but I couldn't find what it was that 
>> performs the EL evaluation. I must admit, it was a Thursday afternoon and I 
>> was about to head home so I didn't look terribly hard ;)I'll give it a 
>> better look.
> 

Reply via email to