1 17 package org.alfresco.repo.action.executer; 18 19 import org.alfresco.repo.action.ActionDefinitionImpl; 20 import org.alfresco.repo.action.ParameterizedItemAbstractBase; 21 import org.alfresco.service.cmr.action.Action; 22 import org.alfresco.service.cmr.action.ActionDefinition; 23 import org.alfresco.service.cmr.repository.NodeRef; 24 25 30 public abstract class ActionExecuterAbstractBase extends ParameterizedItemAbstractBase implements ActionExecuter 31 { 32 35 protected ActionDefinition actionDefinition; 36 37 40 protected boolean publicAction = true; 41 42 45 public void init() 46 { 47 if (this.publicAction == true) 48 { 49 this.runtimeActionService.registerActionExecuter(this); 50 } 51 } 52 53 58 public void setPublicAction(boolean publicAction) 59 { 60 this.publicAction = publicAction; 61 } 62 63 68 public ActionDefinition getActionDefinition() 69 { 70 if (this.actionDefinition == null) 71 { 72 this.actionDefinition = new ActionDefinitionImpl(this.name); 73 ((ActionDefinitionImpl)this.actionDefinition).setTitleKey(getTitleKey()); 74 ((ActionDefinitionImpl)this.actionDefinition).setDescriptionKey(getDescriptionKey()); 75 ((ActionDefinitionImpl)this.actionDefinition).setAdhocPropertiesAllowed(getAdhocPropertiesAllowed()); 76 ((ActionDefinitionImpl)this.actionDefinition).setRuleActionExecutor(this.name); 77 ((ActionDefinitionImpl)this.actionDefinition).setParameterDefinitions(getParameterDefintions()); 78 } 79 return this.actionDefinition; 80 } 81 82 85 public void execute(Action action, NodeRef actionedUponNodeRef) 86 { 87 checkMandatoryProperties(action, getActionDefinition()); 89 90 executeImpl(action, actionedUponNodeRef); 92 } 93 94 100 protected abstract void executeImpl(Action action, NodeRef actionedUponNodeRef); 101 102 103 } 104 | Popular Tags |