|
|||||||||
| 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 | |
|---|---|
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 |
| 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 registerScriptProcessor(ScriptProcessor scriptProcessor)
registerScriptProcessor in interface ScriptServicescriptProcessor - 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 ScriptServicescriptClasspath - Script location as qualified classpath namemodel - Object model to process script against
org.alfresco.scripts.ScriptExceptionScriptService.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 ScriptServiceengine - the script engine to usescriptClasspath - Script location as qualified classpath namemodel - Object model to process script against
org.alfresco.scripts.ScriptExceptionScriptService.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 ScriptServicescriptRef - 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.ScriptExceptionScriptService.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 ScriptServiceengine - 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.ScriptExceptionScriptService.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 ScriptServicelocation - object representing the script locationmodel - Object model to process script against
org.alfresco.scripts.ScriptExceptionScriptService.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 ScriptServiceengine - the script engine to uselocation - object representing the script locationmodel - Object model to process script against
org.alfresco.scripts.ScriptExceptionScriptService.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 ScriptServicescript - Script content as a String.model - Object model to process script against
org.alfresco.scripts.ScriptExceptionScriptService.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 ScriptServiceengine - the script engine to usescript - Script content as a String.model - Object model to process script against
org.alfresco.scripts.ScriptExceptionScriptService.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 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 ScriptServiceperson - 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 | ||||||||