cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: svn commit: r325889 - /cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml
Date Mon, 17 Oct 2005 15:17:32 GMT
Bruno Dumon wrote:
> On Mon, 2005-10-17 at 16:50 +0200, Leszek Gawron wrote:
>   
>> bruno@apache.org wrote:
>>     
>>> Author: bruno
>>> Date: Mon Oct 17 06:24:48 2005
>>> New Revision: 325889
>>>
>>> URL: http://svn.apache.org/viewcvs?rev=325889&view=rev
>>> Log:
>>> Convert some Jexl expressions to JXPath so that they work also when used without
javascript-flow.
>>>
>>> Modified:
>>>     cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml
>>>
>>> Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml
>>> URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml?rev=325889&r1=325888&r2=325889&view=diff
>>> ==============================================================================
>>> --- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml
(original)
>>> +++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml
Mon Oct 17 06:24:48 2005
>>> @@ -87,7 +87,7 @@
>>>        <jx:if test="${cformsHelper.pushRepeater(id, false)}">
>>>          <jx:set var="repeater" value="${cformsHelper.peekWidget()}"/>
>>>          <jx:forEach varStatus="repeaterLoop" begin="0" end="${repeater.getSize()
- 1}">
>>> -          <jx:if test="${cformsHelper.pushContainer(java.lang.Integer.toString(repeaterLoop.index))}">
>>> +          <jx:if test="#{pushContainer($cformsHelper, java.lang.Integer.toString($repeaterLoop/index))}">
>>>       
>> I do not get it: why do you think this change is necessary? Does it 
>> break when used with JEXL ?
>>     
>
> It breaks when the template is not executed via a sendPage call from
> rhino flowscript (e.g. from an apple, or a directly called pipeline).
>
> This is because jexl in itself does not allow to call static methods
> like java.lang.Integer.toString. The "java" is a special variable
> inserted into the jexl context by the jx template generator, and is only
> available when called from flow (since it is a rhino object). It would
> be possible to make something equivalent for when not using rhino, but
> the above is a quicker solution.
>   

Weird...

Actually, I'm more and more annoyed by Jexl: JXTemplate is the *only* 
place in Cocoon where Jexl is used, and I would love to see it replaced 
by JavaScript expressions. Script/expression language consistency 
throughout Cocoon...

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Mime
View raw message