|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.processor.ScriptServiceImpl
public class ScriptServiceImpl
Script service implementation
Constructor Summary | |
---|---|
ScriptServiceImpl()
|
Method Summary | |
---|---|
void |
buildCoreModel(java.util.Map inputMap)
Add core data-model to provided Map |
java.util.Map |
buildDefaultModel(org.alfresco.service.cmr.repository.NodeRef person,
org.alfresco.service.cmr.repository.NodeRef companyHome,
org.alfresco.service.cmr.repository.NodeRef userHome,
org.alfresco.service.cmr.repository.NodeRef script,
org.alfresco.service.cmr.repository.NodeRef document,
org.alfresco.service.cmr.repository.NodeRef space)
Create the default data-model available to scripts as global scope level objects: |
java.lang.Object |
executeScript(org.alfresco.service.cmr.repository.NodeRef scriptRef,
org.alfresco.service.namespace.QName contentProp,
java.util.Map model)
Process a script against the supplied data model. |
java.lang.Object |
executeScript(ScriptLocation location,
java.util.Map model)
Process a script against the supplied data model Uses the most approparite script engine or the default if none found. |
java.lang.Object |
executeScript(java.lang.String scriptClasspath,
java.util.Map model)
Process a script against the supplied data model. |
java.lang.Object |
executeScript(java.lang.String engine,
org.alfresco.service.cmr.repository.NodeRef scriptRef,
org.alfresco.service.namespace.QName contentProp,
java.util.Map model)
Process a script against the supplied data model. |
java.lang.Object |
executeScript(java.lang.String engine,
ScriptLocation location,
java.util.Map model)
Process a script against the supplied data model. |
java.lang.Object |
executeScript(java.lang.String engine,
java.lang.String scriptClasspath,
java.util.Map model)
Process a script against the supplied data model. |
java.lang.Object |
executeScriptString(java.lang.String script,
java.util.Map model)
Process a script against the supplied data model. |
java.lang.Object |
executeScriptString(java.lang.String engine,
java.lang.String script,
java.util.Map model)
Process a script against the supplied data model. |
protected ScriptProcessor |
getScriptProcessor(org.alfresco.service.cmr.repository.NodeRef scriptNode)
Gets a scipt processor based on the node reference of a script |
protected ScriptProcessor |
getScriptProcessor(java.lang.String scriptLocation)
Gets a script processor based on the script location string |
protected ScriptProcessor |
getScriptProcessorImpl(java.lang.String scriptFileName)
Gets a script processor based on the scripts file name |
protected ScriptProcessor |
lookupScriptProcessor(java.lang.String name)
Helper method to lookup the script proecessor based on a name |
void |
registerScriptProcessor(ScriptProcessor scriptProcessor)
Register a script processor |
void |
resetScriptProcessors()
Reset all registered script processors |
void |
setDefaultScriptProcessor(java.lang.String defaultScriptProcessor)
Sets the name of the default script processor |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Set the node service |
void |
setSysAdminParams(SysAdminParams sysAdminParams)
Set the sysAdminParams |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScriptServiceImpl()
Method Detail |
---|
public void setDefaultScriptProcessor(java.lang.String defaultScriptProcessor)
defaultScriptProcessor
- the name of the default script processorpublic void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService
- the node servicepublic void setSysAdminParams(SysAdminParams sysAdminParams)
sysAdminParams
- the sysAdminParamspublic void registerScriptProcessor(ScriptProcessor scriptProcessor)
registerScriptProcessor
in interface ScriptService
scriptProcessor
- the script processor to register with the script servicepublic void resetScriptProcessors()
resetScriptProcessors
in interface ScriptService
public java.lang.Object executeScript(java.lang.String scriptClasspath, java.util.Map model) throws org.alfresco.scripts.ScriptException
ScriptService
executeScript
in interface ScriptService
scriptClasspath
- Script location as qualified classpath namemodel
- Object model to process script against
org.alfresco.scripts.ScriptException
ScriptService.executeScript(java.lang.String, java.util.Map)
public java.lang.Object executeScript(java.lang.String engine, java.lang.String scriptClasspath, java.util.Map model) throws org.alfresco.scripts.ScriptException
ScriptService
executeScript
in interface ScriptService
engine
- the script engine to usescriptClasspath
- Script location as qualified classpath namemodel
- Object model to process script against
org.alfresco.scripts.ScriptException
ScriptService.executeScript(java.lang.String, java.lang.String, java.util.Map)
public java.lang.Object executeScript(org.alfresco.service.cmr.repository.NodeRef scriptRef, org.alfresco.service.namespace.QName contentProp, java.util.Map model) throws org.alfresco.scripts.ScriptException
ScriptService
executeScript
in interface ScriptService
scriptRef
- Script NodeRef locationcontentProp
- QName of the property on the node that contains the content, null can
be passed to indicate the default property of 'cm:content'model
- Object model to process script against
org.alfresco.scripts.ScriptException
ScriptService.executeScript(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName, java.util.Map)
public java.lang.Object executeScript(java.lang.String engine, org.alfresco.service.cmr.repository.NodeRef scriptRef, org.alfresco.service.namespace.QName contentProp, java.util.Map model) throws org.alfresco.scripts.ScriptException
ScriptService
executeScript
in interface ScriptService
engine
- the script engine to usescriptRef
- Script NodeRef locationcontentProp
- QName of the property on the node that contains the content, null can
be passed to indicate the default property of 'cm:content'model
- Object model to process script against
org.alfresco.scripts.ScriptException
ScriptService.executeScript(java.lang.String, org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName, java.util.Map)
public java.lang.Object executeScript(ScriptLocation location, java.util.Map model) throws org.alfresco.scripts.ScriptException
ScriptService
executeScript
in interface ScriptService
location
- object representing the script locationmodel
- Object model to process script against
org.alfresco.scripts.ScriptException
ScriptService.executeScript(org.alfresco.service.cmr.repository.ScriptLocation, java.util.Map)
public java.lang.Object executeScript(java.lang.String engine, ScriptLocation location, java.util.Map model) throws org.alfresco.scripts.ScriptException
ScriptService
executeScript
in interface ScriptService
engine
- the script engine to uselocation
- object representing the script locationmodel
- Object model to process script against
org.alfresco.scripts.ScriptException
ScriptService.executeScript(java.lang.String, org.alfresco.service.cmr.repository.ScriptLocation, java.util.Map)
public java.lang.Object executeScriptString(java.lang.String script, java.util.Map model) throws org.alfresco.scripts.ScriptException
ScriptService
executeScriptString
in interface ScriptService
script
- Script content as a String.model
- Object model to process script against
org.alfresco.scripts.ScriptException
ScriptService.executeScriptString(java.lang.String, java.util.Map)
public java.lang.Object executeScriptString(java.lang.String engine, java.lang.String script, java.util.Map model) throws org.alfresco.scripts.ScriptException
ScriptService
executeScriptString
in interface ScriptService
engine
- the script engine to usescript
- Script content as a String.model
- Object model to process script against
org.alfresco.scripts.ScriptException
ScriptService.executeScriptString(java.lang.String, java.util.Map)
protected ScriptProcessor lookupScriptProcessor(java.lang.String name)
name
- the name of the script processor
protected ScriptProcessor getScriptProcessor(org.alfresco.service.cmr.repository.NodeRef scriptNode)
scriptNode
- the node reference of the script
protected ScriptProcessor getScriptProcessor(java.lang.String scriptLocation)
scriptLocation
- the script location
protected ScriptProcessor getScriptProcessorImpl(java.lang.String scriptFileName)
scriptFileName
- the scripts file name
public void buildCoreModel(java.util.Map inputMap)
ScriptService
buildCoreModel
in interface ScriptService
inputMap
- initial Map of global scope scriptable Node objectsScriptService.buildCoreModel(java.util.Map)
public java.util.Map buildDefaultModel(org.alfresco.service.cmr.repository.NodeRef person, org.alfresco.service.cmr.repository.NodeRef companyHome, org.alfresco.service.cmr.repository.NodeRef userHome, org.alfresco.service.cmr.repository.NodeRef script, org.alfresco.service.cmr.repository.NodeRef document, org.alfresco.service.cmr.repository.NodeRef space)
ScriptService
'companyhome' - the Company Home node
'userhome' - the current user home space node
'person' - the node representing the current user Person
'script' - the node representing the script itself (may not be available)
'document' - document context node (may not be available)
'space' - space context node (may not be available)
buildDefaultModel
in interface ScriptService
person
- The current user Person NodecompanyHome
- The CompanyHome refuserHome
- The User home space refscript
- Optional ref to the script itselfdocument
- Optional ref to a document Nodespace
- Optional ref to a space Node
ScriptService.buildDefaultModel(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |