Package org.alfresco.repo.jscript
Class ScriptAction
- java.lang.Object
-
- org.alfresco.repo.jscript.ScriptAction
-
- All Implemented Interfaces:
java.io.Serializable,Scopeable
- Direct Known Subclasses:
ScriptRenditionDefinition,ScriptReplicationDefinition
public class ScriptAction extends java.lang.Object implements java.io.Serializable, Scopeable
Scriptable Action- Author:
- davidc
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classScriptAction.ScriptableParameterMap<K,V>Scripted Parameter map with modified flag.
-
Field Summary
Fields Modifier and Type Field Description protected ActionactionAction stateprotected ActionDefinitionactionDefprotected ServiceRegistryservices
-
Constructor Summary
Constructors Constructor Description ScriptAction(ServiceRegistry services, Action action, ActionDefinition actionDef)Construct
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(ScriptNode node)Execute action.voidexecute(ScriptNode node, boolean readOnly, boolean newTxn)Execute action, optionally starting a new, potentially read-only transaction.voidexecute(org.alfresco.service.cmr.repository.NodeRef nodeRef)Execute action.voidexecute(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean readOnly, boolean newTxn)Execute action, optionally starting a new, potentially read-only transaction.voidexecuteAsynchronously(ScriptNode node)Execute action.protected voidexecuteAsynchronouslyImpl(ScriptNode node)protected voidexecuteImpl(ScriptNode node)java.lang.StringgetName()Returns the action namejava.util.Map<java.lang.String,java.io.Serializable>getParameters()Return all the properties known about this node.protected voidperformParamConversionForRepo()voidsetScope(org.mozilla.javascript.Scriptable scope)Set the Scriptable global scope
-
-
-
Field Detail
-
action
protected Action action
Action state
-
actionDef
protected ActionDefinition actionDef
-
services
protected ServiceRegistry services
-
-
Constructor Detail
-
ScriptAction
public ScriptAction(ServiceRegistry services, Action action, ActionDefinition actionDef)
Construct- Parameters:
action- Alfresco action
-
-
Method Detail
-
setScope
public void setScope(org.mozilla.javascript.Scriptable scope)
Description copied from interface:ScopeableSet the Scriptable global scope- Specified by:
setScopein interfaceScopeable- Parameters:
scope- relative global scope- See Also:
Scopeable.setScope(org.mozilla.javascript.Scriptable)
-
getName
public java.lang.String getName()
Returns the action name- Returns:
- action name
-
getParameters
public java.util.Map<java.lang.String,java.io.Serializable> getParameters()
Return all the properties known about this node. The Map returned implements the Scriptable interface to allow access to the properties via JavaScript associative array access. This means properties of a node can be access thus:node.properties["name"]- Returns:
- Map of properties for this Node.
-
execute
public void execute(ScriptNode node)
Execute action. The existing transaction will be joined.- Parameters:
node- the node to execute action upon
-
executeAsynchronously
public void executeAsynchronously(ScriptNode node)
Execute action. The existing transaction will be joined.- Parameters:
node- the node to execute action upon
-
executeImpl
protected void executeImpl(ScriptNode node)
-
executeAsynchronouslyImpl
protected void executeAsynchronouslyImpl(ScriptNode node)
-
execute
public void execute(ScriptNode node, boolean readOnly, boolean newTxn)
Execute action, optionally starting a new, potentially read-only transaction.- Parameters:
node- the node to execute action uponnewTxn- true to start a new, isolated transaction- See Also:
RetryingTransactionHelper.doInTransaction(RetryingTransactionCallback, boolean, boolean)
-
execute
public void execute(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Execute action. The existing transaction will be joined.- Parameters:
nodeRef- the node to execute action upon
-
execute
public void execute(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean readOnly, boolean newTxn)Execute action, optionally starting a new, potentially read-only transaction.- Parameters:
nodeRef- the node to execute action uponnewTxn- true to start a new, isolated transaction- See Also:
RetryingTransactionHelper.doInTransaction(RetryingTransactionCallback, boolean, boolean)
-
performParamConversionForRepo
protected void performParamConversionForRepo()
-
-