org.alfresco.repo.jscript
Class ScriptAction

java.lang.Object
  extended by 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

See Also:
Serialized Form

Nested Class Summary
static class ScriptAction.ScriptableParameterMap
          Scripted Parameter map with modified flag.
 
Field Summary
protected  Action action
          Action state
protected  ActionDefinition actionDef
           
protected  ServiceRegistry services
           
 
Constructor Summary
ScriptAction(ServiceRegistry services, Action action, ActionDefinition actionDef)
          Construct
 
Method Summary
 void execute(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Execute action.
 void execute(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean readOnly, boolean newTxn)
          Execute action, optionally starting a new, potentially read-only transaction.
 void execute(ScriptNode node)
          Execute action.
 void execute(ScriptNode node, boolean readOnly, boolean newTxn)
          Execute action, optionally starting a new, potentially read-only transaction.
 void executeAsynchronously(ScriptNode node)
          Execute action.
protected  void executeAsynchronouslyImpl(ScriptNode node)
           
protected  void executeImpl(ScriptNode node)
           
 java.lang.String getName()
          Returns the action name
 java.util.Map getParameters()
          Return all the properties known about this node.
protected  void performParamConversionForRepo()
           
 void setScope(org.mozilla.javascript.Scriptable scope)
          Set the Scriptable global scope
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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: Scopeable
Set the Scriptable global scope

Specified by:
setScope in interface Scopeable
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 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 upon
newTxn - 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 upon
newTxn - true to start a new, isolated transaction
See Also:
RetryingTransactionHelper.doInTransaction(RetryingTransactionCallback, boolean, boolean)

performParamConversionForRepo

protected void performParamConversionForRepo()


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.