Package fr.becpg.repo.rule
Class OnPropertyUpdateRuleTrigger
java.lang.Object
org.alfresco.repo.rule.ruletrigger.RuleTriggerAbstractBase
fr.becpg.repo.rule.OnPropertyUpdateRuleTrigger
- All Implemented Interfaces:
org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy,org.alfresco.repo.policy.ClassPolicy,org.alfresco.repo.policy.Policy,org.alfresco.repo.rule.ruletrigger.RuleTrigger
public class OnPropertyUpdateRuleTrigger
extends org.alfresco.repo.rule.ruletrigger.RuleTriggerAbstractBase
implements org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy
On propety update trigger
- Author:
- Roy Wetherall
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
org.alfresco.repo.policy.Policy.Arg -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanShould we consider zero byte content to be the same as no content?private booleanprivate static org.apache.commons.logging.LogThe loggerprivate booleanTrue trigger on new content, false otherwiseprivate org.alfresco.repo.rule.RuntimeRuleServiceRuntime rule serviceprivate booleanTrue trigger parent rules, false otherwiseFields inherited from class org.alfresco.repo.rule.ruletrigger.RuleTriggerAbstractBase
authenticationComponent, contentService, dictionaryService, executeRuleImmediately, nodeService, policyComponent, ruleServiceFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy
ARG_0, ARG_1, ARG_2, QNAMEFields inherited from interface org.alfresco.repo.policy.Policy
NAMESPACEFields inherited from interface org.alfresco.repo.rule.ruletrigger.RuleTrigger
RULE_TRIGGER_NEW_NODES, RULE_TRIGGER_RENAMED_NODES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanhavePropertiesBeenModified(org.alfresco.service.cmr.repository.NodeRef nodeRef, Map<org.alfresco.service.namespace.QName, Serializable> before, Map<org.alfresco.service.namespace.QName, Serializable> after, boolean newNode, boolean newContentOnly) voidonUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef, Map<org.alfresco.service.namespace.QName, Serializable> before, Map<org.alfresco.service.namespace.QName, Serializable> after) Triggers rules if properties have been updatedvoidregisterRuleTrigger.voidsetIgnoreEmptyContent(boolean ignoreEmptyContent) If set to true, then we consider zero byte content to be equivalent to no content.voidsetIgnoreEntityDataList(boolean ignoreEntityDataList) Setter for the fieldignoreEntityDataList.voidsetOnNewContent(boolean onNewContent) If set to true the trigger will fire on new content, otherwise it will fire on content updatevoidsetRuntimeRuleService(org.alfresco.repo.rule.RuntimeRuleService runtimeRuleService) Set the rule servicevoidsetTriggerParentRules(boolean triggerParentRules) Indicates whether the parent rules should be triggered or the rules on the node itselfprivate static org.alfresco.service.cmr.repository.ContentDatatoContentData(Object object) ALF-17483: It's possible that even for a single-valued contentdata property, its definition may have been changed and the previous persisted value is multi-valued, so let's be careful about converting to ContentData.private voidtriggerRules(org.alfresco.service.cmr.repository.NodeRef nodeRef) Methods inherited from class org.alfresco.repo.rule.ruletrigger.RuleTriggerAbstractBase
areRulesEnabled, getIgnoredAspects, getIgnoredTypes, ignoreTrigger, registerRuleType, setAuthenticationComponent, setContentService, setDictionaryService, setExecuteRuleImmediately, setIgnoredAspectsStr, setIgnoredTypeStr, setNodeService, setPolicyComponent, setRuleService, triggerRules
-
Field Details
-
logger
private static org.apache.commons.logging.Log loggerThe logger -
onNewContent
private boolean onNewContentTrue trigger on new content, false otherwise -
ignoreEmptyContent
private boolean ignoreEmptyContentShould we consider zero byte content to be the same as no content? -
ignoreEntityDataList
private boolean ignoreEntityDataList -
triggerParentRules
private boolean triggerParentRulesTrue trigger parent rules, false otherwise -
runtimeRuleService
private org.alfresco.repo.rule.RuntimeRuleService runtimeRuleServiceRuntime rule service
-
-
Constructor Details
-
OnPropertyUpdateRuleTrigger
public OnPropertyUpdateRuleTrigger()
-
-
Method Details
-
setOnNewContent
public void setOnNewContent(boolean onNewContent) If set to true the trigger will fire on new content, otherwise it will fire on content update- Parameters:
onNewContent- indicates whether to fire on content create or update
-
setIgnoreEmptyContent
public void setIgnoreEmptyContent(boolean ignoreEmptyContent) If set to true, then we consider zero byte content to be equivalent to no content.- Parameters:
ignoreEmptyContent- boolean
-
setTriggerParentRules
public void setTriggerParentRules(boolean triggerParentRules) Indicates whether the parent rules should be triggered or the rules on the node itself- Parameters:
triggerParentRules- true trigger parent rules, false otherwise
-
setRuntimeRuleService
public void setRuntimeRuleService(org.alfresco.repo.rule.RuntimeRuleService runtimeRuleService) Set the rule service- Parameters:
runtimeRuleService- aRuntimeRuleServiceobject
-
setIgnoreEntityDataList
public void setIgnoreEntityDataList(boolean ignoreEntityDataList) Setter for the field
ignoreEntityDataList.- Parameters:
ignoreEntityDataList- a boolean
-
registerRuleTrigger
public void registerRuleTrigger()registerRuleTrigger.
- Specified by:
registerRuleTriggerin interfaceorg.alfresco.repo.rule.ruletrigger.RuleTrigger
-
havePropertiesBeenModified
private boolean havePropertiesBeenModified(org.alfresco.service.cmr.repository.NodeRef nodeRef, Map<org.alfresco.service.namespace.QName, Serializable> before, Map<org.alfresco.service.namespace.QName, Serializable> after, boolean newNode, boolean newContentOnly) -
toContentData
ALF-17483: It's possible that even for a single-valued contentdata property, its definition may have been changed and the previous persisted value is multi-valued, so let's be careful about converting to ContentData.- Parameters:
object- property value to convert- Returns:
- a ContentData if one can be extracted
-
onUpdateProperties
public void onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef, Map<org.alfresco.service.namespace.QName, Serializable> before, Map<org.alfresco.service.namespace.QName, Serializable> after) Triggers rules if properties have been updated- Specified by:
onUpdatePropertiesin interfaceorg.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy
-
triggerRules
private void triggerRules(org.alfresco.service.cmr.repository.NodeRef nodeRef) - Parameters:
nodeRef- NodeRef
-