Helma Logo
main list history

Version 5 by hannes on 16. May 2008, 10:32

1Helma NG provides a mechanism to bind Javascript functions as callbacks for certain arbitrary events. Events names can be freely assigned. By convention, Helma NG uses event names starting with "on", e.g. "onLogEvent".

Version 4 by hannes on 16. May 2008, 10:05

1Helma NG provides a mechanism to bind Javascript functions as callbacks for certain events. Events names can be freely assigned. By convention, Helma NG uses event names starting with "on", e.g. "onLogEvent". It is possible to register multiple callbacks per event. The addCallback() and removeCallback() methods take a name argument to identify the callback. When a callback event is invoked, all callback functions are sequentially. If no callback is registered invokeCallback returns silently.
2
3It is possible to register multiple callbacks per event. The addCallback() and removeCallback() methods take a name argument to identify the callback. When a callback event is invoked, all callback functions are sequentially. If no callback is registered invokeCallback returns silently.

Version 3 by hannes on 16. May 2008, 10:05

1Helma NG provides a mechanism to bind Javascript functions as callbacks for certain events. Events names can be freely assigned. By convention, and it Helma NG uses event names starting with "on", e.g. "onLogEvent". It is possible to register multiple callbacks per event. The addCallback() and removeCallback() methods take a name argument to identify the callback. When a callback event is invoked, all callback functions are sequentially. If no callback is registered invokeCallback returns silently.

Version 2 by hannes on 16. May 2008, 10:00

11=== Callbacks used by Helma core NG classes and modules

Version 1 by hannes on 16. May 2008, 09:59

1Helma NG provides a mechanism to bind Javascript functions as callbacks for certain events. Events can be freely assigned, and it is possible to register multiple callbacks per event.
3=== Java API
4
5Class *org.helma.javascript.RhinoEngine|http://dev.helma.org/static/ng/api/org/helma/javascript/RhinoEngine.html* provides methods *addCallback()|http://dev.helma.org/static/ng/api/org/helma/javascript/RhinoEngine.html#addCallback(java.lang.String,%20java.lang.String,%20org.mozilla.javascript.Function)*, *removeCallback|http://dev.helma.org/static/ng/api/org/helma/javascript/RhinoEngine.html#removeCallback(java.lang.String,%20java.lang.String)*, and *invokeCallback()|http://dev.helma.org/static/ng/api/org/helma/javascript/RhinoEngine.html#invokeCallback(java.lang.String,%20java.lang.Object,%20java.lang.Object...)* to register, remove, and invoke callbacks.
6
7=== Javascript API
8
9The *helma.rhino module|http://dev.helma.org/trac/helma/browser/helma-ng/trunk/modules/helma/rhino.js* provides *addCallback(), removeCallback(), and invokeCallback() methods|http://dev.helma.org/trac/helma/browser/helma-ng/trunk/modules/helma/rhino.js#L34* to register, remove and invoke callbacks.
10
11=== Callbacks used by Helma core classes and modules
12
13* onInvoke is called by *org.helma.javascript.RhinoEngine|http://dev.helma.org/static/ng/api/org/helma/javascript/RhinoEngine.html* immediately before request evaluation is started with the same arguments as the invocation.
14* onRequest is called by the *helma.simpleweb|http://dev.helma.org/trac/helma/browser/helma-ng/trunk/modules/helma/simpleweb.js* module at the beginning of the handleRequest() method with the Request object as argument.
15* onResponse is called by the *helma.simpleweb|http://dev.helma.org/trac/helma/browser/helma-ng/trunk/modules/helma/simpleweb.js* module at the end of the handleRequest() method with the Response object as argument.
16* onLogEvent is called by *org.helma.util.RhinoAppender|http://dev.helma.org/static/ng/api/org/helma/util/RhinoAppender.html* with the formatted log message as argument and optionally a formatted stack trace as second argument.