Hi all,

Am Montag, den 10.03.2008, 09:39 +0100 schrieb Carsten Ziegeler:
> Bertrand Delacretaz wrote:
> > Hi Carsten,
> > 
> > On Wed, Mar 5, 2008 at 3:23 PM, Carsten Ziegeler <[EMAIL PROTECTED]> wrote:
> >> ...If you think of scripting parts of your application it might be
> >>  useful to group several methods into one script (for instance a
> >>  javascript script) and execute exactly one method out of this script....
> > 
> > Sounds interesting, but can you give an example of how that would be used?
> > 
> Sure :)
> 
> For instance if you want to script server side form validation or script 
> some rule processing for business logic or script a workflow step etc.
> 
> I think to support this we just need some minor changes:
> a) the eval method of the SlingScript needs a return value (Object)

The ScriptEngine.eval method already is defined to return an Object. We
just would have to forward this value.

> b) We need a convention to pass the method name and the method 
> parameters to the script engine
> c) Check for the new info mentioned in b) and if available don't execute 
> the whole script, but just the single method.

The problem with calling a method (or function) is that there will
probably not be a script file to be "compiled" and a method called on it
but rather some already existing functions or objects in the
ScriptEngine scope on which we call a function or method....

Probably we need to enter the arena of direct ScriptEngine use here ??

I am not in favor of defining special hacks into e.g. the SlingBindings
object to support this.

Regards
Felix

Reply via email to