Sylvain Wallez wrote:
I like your approach _MUCH_BETTER_... I think we should consider it for most
of the stuff we make visible to the flow, rather than passing the real Java
instances to Rhino (obviously removing the construction part when needed)...
Mmmh, I don't like it much, as AFAIU it will require too much often to write some glue code for things that could be written in JS only...
Sylvain
Either way is fine with me. It was just a suggestion. You might want to look at what I had to do to integrate with XMLForm:
http://cvs.apache.org/viewcvs.cgi/*checkout*/cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/xmlForm.js?rev=1.3&content-type=text/plain
In order to communicate with XMLFormTransformer and to handle restarting continuations, this script needs access to:
cocoon.session cocoon.componentManager cocoon.environment.objectModel cocoon.forwardTo()
Why do you need direct access to the objectModel?
My 'script kid' alarm is ringing.
Stefano.