1 17 package org.alfresco.repo.rule.ruletrigger; 18 19 import java.util.HashSet ; 20 import java.util.Set ; 21 22 import org.alfresco.repo.policy.PolicyComponent; 23 import org.alfresco.repo.security.authentication.AuthenticationComponent; 24 import org.alfresco.service.cmr.repository.NodeRef; 25 import org.alfresco.service.cmr.repository.NodeService; 26 import org.alfresco.service.cmr.rule.RuleType; 27 28 33 public abstract class RuleTriggerAbstractBase implements RuleTrigger 34 { 35 38 private Set <RuleType> ruleTypes = new HashSet <RuleType>(); 39 40 43 protected PolicyComponent policyComponent; 44 45 48 protected NodeService nodeService; 49 50 53 54 protected AuthenticationComponent authenticationComponent; 55 56 62 public void setPolicyComponent(PolicyComponent policyComponent) 63 { 64 this.policyComponent = policyComponent; 65 } 66 67 73 public void setNodeService(NodeService nodeService) 74 { 75 this.nodeService = nodeService; 76 } 77 78 81 82 public void setAuthenticationComponent(AuthenticationComponent authenticationComponent) 83 { 84 this.authenticationComponent = authenticationComponent; 85 } 86 87 90 public void registerRuleType(RuleType ruleType) 91 { 92 this.ruleTypes.add(ruleType); 93 } 94 95 104 protected void triggerRules(NodeRef nodeRef, NodeRef actionedUponNodeRef) 105 { 106 for (RuleType ruleType : this.ruleTypes) 107 { 108 ruleType.triggerRuleType(nodeRef, actionedUponNodeRef); 109 } 110 } 111 } 112 | Popular Tags |