cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastien Arbogast <sebastien.arbog...@gmail.com>
Subject Flowscript function calls parameters
Date Fri, 13 May 2005 18:32:06 GMT
I've noticed something weird with sitemap and flowscript.
I had made a syntax error in one of my matchers :

<map:match pattern="internal/repository">
  <map:call function="displayRepositoryDetails()"/>
</map:match>

Notice the two parenthesis after the name of the function parameter.
Of course it's wrong as the function parameter is supposed to contain
only the name of the function. But the thing is that when I ran my
application to this point, the exception thrown showed that
"displayRepositoryDetails()() was not found", which seems to mean that
the flowscript call is made from the sitemap parameter is simply a
concatenation of the function name appended by "()".
So my question is : wouldn't it possible to use another syntaxt for
passing parameters, something like :

<map:match pattern="edit-user">
  <map:call function="editUser({request:/username})"/>
</map:match>

with a natural flowscript function like this :

function editUser(username){...}

Instead of the current less natural syntax which looks like that :

<map:match pattern="edit-user">
  <map:call function="editUser">
    <map:parameter name="username" value="{request:/username}"/>
  </map:call>
</map:match>

function editUser(){
  var username= cocoon.parameters["username"];
}

I know nothing about the technical feasability of that,it's more a
curious question because I would find this syntax much more practical.

WDYT ?

-- 
Sebastien ARBOGAST

Mime
View raw message