|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.woody.util.JavaScriptHelper
public class JavaScriptHelper
Helper methods to use JavaScript in various locations of the Woody configuration files such as event listeners and bindings.
Constructor Summary | |
---|---|
JavaScriptHelper()
|
Method Summary | |
---|---|
static org.mozilla.javascript.Function |
buildFunction(Element element,
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()
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[] argumentNames) throws IOException
element
- the element containing the function bodyargumentNames
- names of the function arguments
IOException
public static org.mozilla.javascript.Scriptable getRootScope()
public static org.mozilla.javascript.Scriptable getParentScope(Map objectModel)
objectModel
- an objectModel 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 |