Class SlingGlobal
java.lang.Object
org.apache.sling.scripting.javascript.helper.SlingGlobal
- All Implemented Interfaces:
- Serializable,- org.mozilla.javascript.IdFunctionCall
public class SlingGlobal
extends Object
implements Serializable, org.mozilla.javascript.IdFunctionCall
The 
SlingGlobal class provides two interesting new global
 functions which are not part of the ECMAScript standard but which are
 available in the Rhino Shell and which may be of use by JavaScripts:
 - print(args, ...)
- Prints the arguments argsin a single message to the scripts logger available as the global log variable.
- load(args, ...)
- Loads the scripts named as parameters into the current scope one, after
 the other. Usually the script files are read as plain JavaScript files. If
 the file extension happens to be .esp to indicate an ECMAScript
 Server Page, the file is read through an
 EspReader. Failure to read one of the files throws an error.
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionexecIdCall(org.mozilla.javascript.IdFunctionObject f, org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thisObj, Object[] args) static voidinit(org.mozilla.javascript.Scriptable scope, boolean sealed) require(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args) 
- 
Constructor Details- 
SlingGlobalpublic SlingGlobal()
 
- 
- 
Method Details- 
initpublic static void init(org.mozilla.javascript.Scriptable scope, boolean sealed) 
- 
execIdCallpublic Object execIdCall(org.mozilla.javascript.IdFunctionObject f, org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thisObj, Object[] args) - Specified by:
- execIdCallin interface- org.mozilla.javascript.IdFunctionCall
 
- 
require
 
-