public final class ScriptHelper extends Object implements Serializable
| Constructor and Description |
|---|
ScriptHelper() |
| Modifier and Type | Method and Description |
|---|---|
static ScriptModelObject |
getObject(RequestContext context,
String objectTypeId,
String objectId)
Retrieves a model object from the underlying store and hands it back
wrapped as a ScriptModelObject.
|
static org.mozilla.javascript.Scriptable |
toScriptableArray(org.mozilla.javascript.Scriptable scope,
String[] elements)
Converts a given array to a Scriptable array that can be traversed
by the script and Freemarker engines
|
static org.springframework.extensions.webscripts.ScriptableMap |
toScriptableMap(Map<String,Serializable> map)
Converts an existing map to a Scriptable map
|
static org.springframework.extensions.webscripts.ScriptableMap |
toScriptableMap(RequestContext context,
Map<String,ModelObject> objects)
Creates a Scriptable Map for a given map of model objects
|
static org.springframework.extensions.webscripts.ScriptableMap |
toScriptableMap(RequestContext context,
ModelObject[] modelObjects)
Creates a Scriptable Map for a given array of model objects
|
static ScriptModelObject |
toScriptModelObject(RequestContext context,
ModelObject modelObject)
Wraps a ModelObject with a script wrapper to produce a ScriptModelObject
that can be used by the script and Freemarker engines.
|
static Object[] |
toScriptModelObjectArray(RequestContext context,
Map<String,ModelObject> objects)
Converts a map of model objects to an array of ScriptModelObjects
which can be used by the script and Freemarker engines.
|
static Object[] |
toScriptModelObjectArray(RequestContext context,
ModelObject[] modelObjects)
Converts an array of ModelObjects to an array of ScriptModelObjects
which can be used by the script and Freemarker engines.
|
public static org.springframework.extensions.webscripts.ScriptableMap toScriptableMap(RequestContext context, ModelObject[] modelObjects)
context - the contextmodelObjects - the model objectspublic static org.springframework.extensions.webscripts.ScriptableMap toScriptableMap(RequestContext context, Map<String,ModelObject> objects)
context - the contextobjects - a map of model objects (keyed by object id)public static org.springframework.extensions.webscripts.ScriptableMap toScriptableMap(Map<String,Serializable> map)
map - the mappublic static org.mozilla.javascript.Scriptable toScriptableArray(org.mozilla.javascript.Scriptable scope,
String[] elements)
scope - the scopeelements - the elementspublic static ScriptModelObject toScriptModelObject(RequestContext context, ModelObject modelObject)
context - the contextmodelObject - the model objectpublic static Object[] toScriptModelObjectArray(RequestContext context, ModelObject[] modelObjects)
context - the contextmodelObjects - the model objectspublic static Object[] toScriptModelObjectArray(RequestContext context, Map<String,ModelObject> objects)
context - the contextobjects - the model objectspublic static ScriptModelObject getObject(RequestContext context, String objectTypeId, String objectId)
context - RequestContextobjectTypeId - StringobjectId - StringCopyright © 2005–2016 Alfresco Software. All rights reserved.