Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.webengine.scripting
Class Scripting

java.lang.Object
  extended by org.nuxeo.ecm.webengine.scripting.Scripting

public class Scripting
extends java.lang.Object

Author:
Bogdan Stefanescu

Constructor Summary
Scripting(WebLoader loader)
           
 
Method Summary
static javax.script.CompiledScript compileScript(javax.script.ScriptEngine engine, java.io.File file)
           
 javax.script.CompiledScript getCompiledScript(javax.script.ScriptEngine engine, java.io.File file)
           
 javax.script.ScriptEngineManager getEngineManager()
          Lazy init scripting manager to avoid loading script engines when no scripting is used.
 boolean isScript(java.lang.String ext)
           
 java.lang.Object runScript(ScriptFile script)
           
 java.lang.Object runScript(ScriptFile script, java.util.Map<java.lang.String,java.lang.Object> args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scripting

public Scripting(WebLoader loader)
Method Detail

compileScript

public static javax.script.CompiledScript compileScript(javax.script.ScriptEngine engine,
                                                        java.io.File file)
                                                 throws javax.script.ScriptException
Throws:
javax.script.ScriptException

getEngineManager

public javax.script.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

isScript

public boolean isScript(java.lang.String ext)

runScript

public java.lang.Object runScript(ScriptFile script)
                           throws java.lang.Exception
Throws:
java.lang.Exception

runScript

public java.lang.Object runScript(ScriptFile script,
                                  java.util.Map<java.lang.String,java.lang.Object> args)
                           throws java.lang.Exception
Throws:
java.lang.Exception

getCompiledScript

public javax.script.CompiledScript getCompiledScript(javax.script.ScriptEngine engine,
                                                     java.io.File file)
                                              throws javax.script.ScriptException
Throws:
javax.script.ScriptException

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.