cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: accessing sitemap parameters in a flow script
Date Sat, 23 Aug 2003 09:15:54 GMT
Stefano Mazzocchi wrote:

>
> On Wednesday, Aug 20, 2003, at 11:27 Europe/Rome, Sylvain Wallez wrote:
>
>> Stefano Mazzocchi wrote:
>>
>>> On Friday, Aug 15, 2003, at 23:49 Europe/Rome, Sylvain Wallez wrote:
>>
>>
>> <snip/>
>>
>>>> And this really demonstrates how dangerous can be this translation 
>>>> to positional parameter ;-)
>>>
>>>
>>>
>>> why don't we fix this, then?
>>
>>
>> Well, positional parameters have been there since day one in 
>> FlowScript, and many of the existing flows, including Cocoon's own 
>> flow libraries such as XMLForm and Woody rely on this feature.
>
>
> Can you explain how? I've personally used flow without thinking of 
> variable positioning, it just happened to be ordered correctly. I can 
> easily see people pissed off by discoverying this "feature" after 
> hours of cursing! 


And this is what will happen if they put their variables with the right 
name but in the wrong order !

>> So we can't remove it abruptly.
>
>
> If we match by variable name rather than by position, it would work 
> anyway.
>
> ... but I have the feeling I'm missing a big point here. 


Yeah : the point is that parameters are passed as Object[] to a JS 
function. The names given both in the sitemap parameters and the JS 
function parameters are therefore unusable for parameter passing. Only 
their position counts. See FOM_JavaScriptInterpreter.callFunction (line 
553) : "funArgs" is a Object[].

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com



Mime
View raw message