|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.forms.util.JavaScriptHelper
public class JavaScriptHelper
Helper methods to use JavaScript in various locations of the Cocoon Forms configuration files such as event listeners and bindings.
Constructor Summary | |
---|---|
JavaScriptHelper()
|
Method Summary | |
---|---|
static org.mozilla.javascript.Function |
buildFunction(Element element,
String name,
String[] argumentNames)
Build a function with the content of a DOM element. |
static org.mozilla.javascript.Script |
buildScript(Element element)
Build a script with the content of a DOM element. |
static Object |
callFunction(org.mozilla.javascript.Function func,
Object thisObject,
Object[] arguments,
Map objectModel)
|
static Object |
execScript(org.mozilla.javascript.Script script,
Map values,
Map objectModel)
|
static org.mozilla.javascript.Scriptable |
getParentScope(Map objectModel)
Get a parent scope for building a child scope. |
static org.mozilla.javascript.Scriptable |
getRootScope(Map objectModel)
Get a root scope for building child scopes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JavaScriptHelper()
Method Detail |
---|
public static org.mozilla.javascript.Script buildScript(Element element) throws IOException
element
- the element containing the script
IOException
public static org.mozilla.javascript.Function buildFunction(Element element, String name, String[] argumentNames) throws IOException
element
- the element containing the function bodyname
- the name of the functionargumentNames
- names of the function arguments
IOException
public static org.mozilla.javascript.Scriptable getRootScope(Map objectModel)
public static org.mozilla.javascript.Scriptable getParentScope(Map objectModel)
objectModel
- the object model where the flowscript scope will be searched (can be null
).
public static Object execScript(org.mozilla.javascript.Script script, Map values, Map objectModel) throws org.mozilla.javascript.JavaScriptException
org.mozilla.javascript.JavaScriptException
public static Object callFunction(org.mozilla.javascript.Function func, Object thisObject, Object[] arguments, Map objectModel) throws org.mozilla.javascript.JavaScriptException
org.mozilla.javascript.JavaScriptException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |