Class Scripting
- java.lang.Object
-
- org.nuxeo.ecm.webengine.scripting.Scripting
-
public class Scripting extends Object
- Author:
- Bogdan Stefanescu
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
_runScript(ScriptFile script, Map<String,Object> args)
static CompiledScript
compileScript(ScriptEngine engine, File file)
CompiledScript
getCompiledScript(ScriptEngine engine, File file)
ScriptEngineManager
getEngineManager()
Lazy init scripting manager to avoid loading script engines when no scripting is used.boolean
isScript(String ext)
Object
runScript(ScriptFile script)
Object
runScript(ScriptFile script, Map<String,Object> args)
-
-
-
Method Detail
-
compileScript
public static CompiledScript compileScript(ScriptEngine engine, File file) throws ScriptException
- Throws:
ScriptException
-
getEngineManager
public ScriptEngineManager getEngineManager()
Lazy init scripting manager to avoid loading script engines when no scripting is used.Javax Scripting is not used by default in WebWengine, we are using directly the Groovy engine. This also fixes an annoying pb on Mac in java5 due to AppleScripting which is failing to register.
- Returns:
- the scriptMgr
-
runScript
public Object runScript(ScriptFile script) throws ScriptException
- Throws:
ScriptException
-
runScript
public Object runScript(ScriptFile script, Map<String,Object> args) throws ScriptException
- Throws:
ScriptException
-
_runScript
protected Object _runScript(ScriptFile script, Map<String,Object> args) throws ScriptException
- Throws:
ScriptException
-
getCompiledScript
public CompiledScript getCompiledScript(ScriptEngine engine, File file) throws ScriptException
- Throws:
ScriptException
-
-