1 17 package org.alfresco.repo.action.executer; 18 19 import java.util.List ; 20 21 import org.alfresco.model.ContentModel; 22 import org.alfresco.service.cmr.action.Action; 23 import org.alfresco.service.cmr.action.ParameterDefinition; 24 import org.alfresco.service.cmr.repository.NodeRef; 25 import org.alfresco.service.cmr.repository.NodeService; 26 import org.alfresco.service.cmr.version.VersionService; 27 28 33 public class CreateVersionActionExecuter extends ActionExecuterAbstractBase 34 { 35 38 public static final String NAME = "create-version"; 39 40 public NodeService nodeService; 41 42 public VersionService versionService; 43 44 public void setNodeService(NodeService nodeService) 45 { 46 this.nodeService = nodeService; 47 } 48 49 public void setVersionService(VersionService versionService) 50 { 51 this.versionService = versionService; 52 } 53 54 57 public void executeImpl(Action ruleAction, NodeRef actionedUponNodeRef) 58 { 59 if (this.nodeService.exists(actionedUponNodeRef) == true && 60 this.nodeService.hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE) == true) 61 { 62 this.versionService.createVersion(actionedUponNodeRef, null); 64 } 65 } 66 67 70 @Override 71 protected void addParameterDefintions(List <ParameterDefinition> paramList) 72 { 73 } 74 75 } 76 | Popular Tags |