cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Berens (JIRA)" <>
Subject [jira] Commented: (COCOON-1811) [PATCH] Flow Script: Allow dynamic loading of JavaScript objects even when scope is locked
Date Mon, 03 Apr 2006 13:38:34 GMT
    [ ] 

Rob Berens commented on COCOON-1811:

Loading the myObject class in the scope if the loadscript() function would leave us with the
serious limitation that the statement:

Object anObject = new myObject()

only makes sense within the loadScript() function.
And therefore upon reuse of that class in another function we have to reload it again.

Note that my original patch is completely in line with the behaviour of the put method for
native java classes for which it is also allowed to be created in the global scope at any

> [PATCH] Flow Script: Allow dynamic loading of JavaScript objects even when scope is locked
> ------------------------------------------------------------------------------------------
>          Key: COCOON-1811
>          URL:
>      Project: Cocoon
>         Type: Improvement

>   Components: Blocks: Forms
>     Versions: 2.2-dev (Current SVN), 2.1.9-dev (current SVN)
>     Reporter: Rob Berens
>     Priority: Minor
>  Attachments: FOM_JavaScriptInterpreter.txt
> Currently it is not possible to add variables to the scope of a FOM_JavaScriptInterpreter,
unless the scope is not locked yet or when still in the main loading process or when loading
native java classes. Therefore it is not possible to dynamically load JavaScript classes like
the one below:.
> -------------------------------
> function myObject() {                // at this point the current
> implementation throws the exception
>      // constructor for myObject
> }
> myObject.prototype.myMethod = function() {
>     // implementation of myMethod
> }
> -------------------------------
> from within a script fragment like this one:
> -------------------------------
> function loadScript() {
>     var scriptURI = "determineScriptURIFromRequest";
>     cocoon.load(scriptURI);
> }
> -------------------------------
> The attached patch solves this by allowing also objects of the type org.mozilla.javascript.Function
to be loaded into a locked scope.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message