Class RuleTriggerAbstractBase
- java.lang.Object
-
- org.alfresco.repo.rule.ruletrigger.RuleTriggerAbstractBase
-
- All Implemented Interfaces:
RuleTrigger
- Direct Known Subclasses:
BeforeDeleteChildAssociationRuleTrigger,CreateNodeRuleTrigger,OnCreateChildAssociationRuleTrigger,OnMoveNodeRuleTrigger,OnPropertyUpdateRuleTrigger,RestoreNodeRuleTrigger,SingleAssocRefPolicyRuleTrigger,SingleNodeRefPolicyRuleTrigger
public abstract class RuleTriggerAbstractBase extends java.lang.Object implements RuleTrigger
Rule trigger abstract base- Author:
- Roy Wetherall
-
-
Field Summary
Fields Modifier and Type Field Description protected AuthenticationComponentauthenticationComponentprotected ContentServicecontentServiceprotected org.alfresco.service.cmr.dictionary.DictionaryServicedictionaryServiceprotected booleanexecuteRuleImmediatelyIndicates whether the rule should be executed immediately or at the end of the transaction.protected org.alfresco.service.cmr.repository.NodeServicenodeServiceprotected PolicyComponentpolicyComponentprotected RuleServiceruleService-
Fields inherited from interface org.alfresco.repo.rule.ruletrigger.RuleTrigger
RULE_TRIGGER_NEW_NODES, RULE_TRIGGER_RENAMED_NODES
-
-
Constructor Summary
Constructors Constructor Description RuleTriggerAbstractBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanareRulesEnabled()Helper method to allow triggers to check if rules are enabled or disabled (ALF-10839: Eliminate rule discovery overhead on property update when rules have been disabled)java.util.Set<org.alfresco.service.namespace.QName>getIgnoredAspects()java.util.Set<org.alfresco.service.namespace.QName>getIgnoredTypes()protected booleanignoreTrigger(org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)Indicate whether the trigger should be ignored or notvoidregisterRuleType(RuleType ruleType)Registration of an interested rule typevoidsetAuthenticationComponent(AuthenticationComponent authenticationComponent)Set the authenticationComponentvoidsetContentService(ContentService contentService)Set the content servicevoidsetDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)Set the dictionary servicevoidsetExecuteRuleImmediately(boolean executeRuleImmediately)Sets the values that indicates whether the rule should be executed immediately or not.voidsetIgnoredAspectsStr(java.util.List<java.lang.String> ignoredAspects)Converting String Aspects from Spring context to QNamesvoidsetIgnoredTypeStr(java.util.List<java.lang.String> ignoredTypes)Converting String ignored Types from Spring context to QNamesvoidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)Set the node servicevoidsetPolicyComponent(PolicyComponent policyComponent)Set the policy componentvoidsetRuleService(RuleService ruleService)Set the RuleService to assist with enabled/disabled checkprotected voidtriggerRules(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)Trigger the rules that relate to any interested rule types for the node references passed.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.alfresco.repo.rule.ruletrigger.RuleTrigger
registerRuleTrigger
-
-
-
-
Field Detail
-
policyComponent
protected PolicyComponent policyComponent
-
nodeService
protected org.alfresco.service.cmr.repository.NodeService nodeService
-
contentService
protected ContentService contentService
-
authenticationComponent
protected AuthenticationComponent authenticationComponent
-
dictionaryService
protected org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService
-
ruleService
protected RuleService ruleService
-
executeRuleImmediately
protected boolean executeRuleImmediately
Indicates whether the rule should be executed immediately or at the end of the transaction. By default this is false as all rules are executed at the end of the transaction.
-
-
Method Detail
-
setPolicyComponent
public void setPolicyComponent(PolicyComponent policyComponent)
Set the policy component
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Set the node service
-
setContentService
public void setContentService(ContentService contentService)
Set the content service
-
setAuthenticationComponent
public void setAuthenticationComponent(AuthenticationComponent authenticationComponent)
Set the authenticationComponent
-
setDictionaryService
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Set the dictionary service
-
setRuleService
public void setRuleService(RuleService ruleService)
Set the RuleService to assist with enabled/disabled check
-
setExecuteRuleImmediately
public void setExecuteRuleImmediately(boolean executeRuleImmediately)
Sets the values that indicates whether the rule should be executed immediately or not.- Parameters:
executeRuleImmediately- true execute the rule immediaely, false otherwise
-
registerRuleType
public void registerRuleType(RuleType ruleType)
Registration of an interested rule type- Specified by:
registerRuleTypein interfaceRuleTrigger- Parameters:
ruleType- the rule type
-
triggerRules
protected void triggerRules(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)Trigger the rules that relate to any interested rule types for the node references passed.- Parameters:
nodeRef- the node reference who rules are to be triggeredactionedUponNodeRef- the node reference that will be actioned upon by the rules
-
areRulesEnabled
protected boolean areRulesEnabled()
Helper method to allow triggers to check if rules are enabled or disabled (ALF-10839: Eliminate rule discovery overhead on property update when rules have been disabled)- Returns:
- true if rules are enabled
-
ignoreTrigger
protected boolean ignoreTrigger(org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
Indicate whether the trigger should be ignored or not- Parameters:
actionedUponNodeRef- actioned upon node reference- Returns:
- boolean true if the trigger should be ignored, false otherwise
-
getIgnoredAspects
public java.util.Set<org.alfresco.service.namespace.QName> getIgnoredAspects()
-
setIgnoredAspectsStr
public void setIgnoredAspectsStr(java.util.List<java.lang.String> ignoredAspects)
Converting String Aspects from Spring context to QNames- Parameters:
ignoredAspects- List of ignoredAspects
-
getIgnoredTypes
public java.util.Set<org.alfresco.service.namespace.QName> getIgnoredTypes()
-
setIgnoredTypeStr
public void setIgnoredTypeStr(java.util.List<java.lang.String> ignoredTypes)
Converting String ignored Types from Spring context to QNames- Parameters:
ignoredTypes-
-
-