Package org.alfresco.repo.version
Class VersionableAspect
- java.lang.Object
-
- org.alfresco.repo.version.VersionableAspect
-
- All Implemented Interfaces:
ContentServicePolicies.OnContentUpdatePolicy,CopyServicePolicies.OnCopyNodePolicy,org.alfresco.repo.dictionary.DictionaryListener,NodeServicePolicies.BeforeAddAspectPolicy,NodeServicePolicies.OnAddAspectPolicy,NodeServicePolicies.OnDeleteNodePolicy,NodeServicePolicies.OnRemoveAspectPolicy,NodeServicePolicies.OnUpdatePropertiesPolicy,ClassPolicy,Policy,VersionServicePolicies.AfterCreateVersionPolicy
public class VersionableAspect extends java.lang.Object implements ContentServicePolicies.OnContentUpdatePolicy, NodeServicePolicies.BeforeAddAspectPolicy, NodeServicePolicies.OnAddAspectPolicy, NodeServicePolicies.OnRemoveAspectPolicy, NodeServicePolicies.OnDeleteNodePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, VersionServicePolicies.AfterCreateVersionPolicy, CopyServicePolicies.OnCopyNodePolicy, org.alfresco.repo.dictionary.DictionaryListener
Class containing behaviour for the versionable aspect- Author:
- Roy Wetherall, janv
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.commons.logging.Loglogger-
Fields inherited from interface org.alfresco.repo.content.ContentServicePolicies.OnContentUpdatePolicy
QNAME
-
Fields inherited from interface org.alfresco.repo.copy.CopyServicePolicies.OnCopyNodePolicy
ARG_0, ARG_1, QNAME
-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeAddAspectPolicy
QNAME
-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnAddAspectPolicy
QNAME
-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnDeleteNodePolicy
QNAME
-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnRemoveAspectPolicy
QNAME
-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy
ARG_0, ARG_1, ARG_2, QNAME
-
Fields inherited from interface org.alfresco.repo.version.VersionServicePolicies.AfterCreateVersionPolicy
QNAME
-
-
Constructor Summary
Constructors Constructor Description VersionableAspect()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterCreateVersion(org.alfresco.service.cmr.repository.NodeRef versionableNode, Version version)Called after the version has been createdvoidafterDictionaryDestroy()voidafterDictionaryInit()voidbeforeAddAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName aspectTypeQName)Before add aspect policy behaviourCopyBehaviourCallbackgetCopyCallback(org.alfresco.service.namespace.QName classRef, CopyDetails copyDetails)Called for all types and aspects before copying a node.java.util.List<java.lang.String>getExcludedOnUpdateProps()voidinit()Initialise the versionable aspect policiesvoidonAddAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName aspectTypeQName)On add aspect policy behaviourvoidonContentUpdate(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean newContent)On content update policy behaviour If applicable and "cm:autoVersion" is TRUE then version the node on content update (even if no property updates)voidonDeleteNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef, boolean isNodeArchived)Called after a node is deleted.voidonDictionaryInit()voidonRemoveAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName aspectTypeQName)Called after an aspect has been removed from a nodevoidonUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> before, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> after)On update properties policy behaviour If applicable and "cm:autoVersionOnUpdateProps" is TRUE then version the node on properties update (even if no content updates)voidsetDictionaryDAO(org.alfresco.repo.dictionary.DictionaryDAO dictionaryDAO)Sets the dictionary DAO.voidsetExcludedOnUpdateProps(java.util.List<java.lang.String> excludedOnUpdateProps)voidsetLockService(LockService lockService)Set the lock servicevoidsetNamespacePrefixResolver(org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver)Sets the namespace prefix resolver.voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)Set the node servicevoidsetPolicyComponent(PolicyComponent policyComponent)Set the policy componentvoidsetVersionService(VersionService versionService)Set the version service
-
-
-
Method Detail
-
setPolicyComponent
public void setPolicyComponent(PolicyComponent policyComponent)
Set the policy component- Parameters:
policyComponent- the policy component
-
setVersionService
public void setVersionService(VersionService versionService)
Set the version service- Parameters:
versionService- the version service
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Set the node service- Parameters:
nodeService- the node service
-
setLockService
public void setLockService(LockService lockService)
Set the lock service- Parameters:
lockService- the lock service
-
setDictionaryDAO
public void setDictionaryDAO(org.alfresco.repo.dictionary.DictionaryDAO dictionaryDAO)
Sets the dictionary DAO.- Parameters:
dictionaryDAO- the dictionary DAO
-
setNamespacePrefixResolver
public void setNamespacePrefixResolver(org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver)
Sets the namespace prefix resolver.- Parameters:
namespacePrefixResolver- the namespace prefix resolver
-
getExcludedOnUpdateProps
public java.util.List<java.lang.String> getExcludedOnUpdateProps()
- Returns:
- Returns the current list of properties that do not trigger versioning
-
setExcludedOnUpdateProps
public void setExcludedOnUpdateProps(java.util.List<java.lang.String> excludedOnUpdateProps)
- Parameters:
excludedOnUpdateProps- the list of properties that force versioning to ignore changes
-
init
public void init()
Initialise the versionable aspect policies
-
onDeleteNode
public void onDeleteNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef, boolean isNodeArchived)Description copied from interface:NodeServicePolicies.OnDeleteNodePolicyCalled after a node is deleted. The reference given is for an association which has been deleted and cannot be used to retrieve node or associaton information from any of the services.- Specified by:
onDeleteNodein interfaceNodeServicePolicies.OnDeleteNodePolicy- Parameters:
childAssocRef- the primary parent-child association of the deleted nodeisNodeArchived- indicates whether the node has been archived rather than purged- See Also:
NodeServicePolicies.OnDeleteNodePolicy.onDeleteNode(org.alfresco.service.cmr.repository.ChildAssociationRef, boolean)
-
getCopyCallback
public CopyBehaviourCallback getCopyCallback(org.alfresco.service.namespace.QName classRef, CopyDetails copyDetails)
Description copied from interface:CopyServicePolicies.OnCopyNodePolicyCalled for all types and aspects before copying a node.- Specified by:
getCopyCallbackin interfaceCopyServicePolicies.OnCopyNodePolicy- Parameters:
classRef- the type or aspect qualified namecopyDetails- the details of the impending copy- Returns:
- Returns the CopyBehaviourCallback
- See Also:
CopyServicePolicies
-
beforeAddAspect
public void beforeAddAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName aspectTypeQName)Before add aspect policy behaviour- Specified by:
beforeAddAspectin interfaceNodeServicePolicies.BeforeAddAspectPolicy- Parameters:
nodeRef- NodeRefaspectTypeQName- QName
-
onAddAspect
public void onAddAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName aspectTypeQName)On add aspect policy behaviour- Specified by:
onAddAspectin interfaceNodeServicePolicies.OnAddAspectPolicy- Parameters:
nodeRef- NodeRefaspectTypeQName- QName
-
onRemoveAspect
public void onRemoveAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName aspectTypeQName)Description copied from interface:NodeServicePolicies.OnRemoveAspectPolicyCalled after an aspect has been removed from a node- Specified by:
onRemoveAspectin interfaceNodeServicePolicies.OnRemoveAspectPolicy- Parameters:
nodeRef- the node from which the aspect will be removedaspectTypeQName- the type of the aspect- See Also:
NodeServicePolicies.OnRemoveAspectPolicy.onRemoveAspect(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName)
-
onContentUpdate
public void onContentUpdate(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean newContent)On content update policy behaviour If applicable and "cm:autoVersion" is TRUE then version the node on content update (even if no property updates)- Specified by:
onContentUpdatein interfaceContentServicePolicies.OnContentUpdatePolicy- Parameters:
nodeRef- the node reference
-
onUpdateProperties
public void onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> before, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> after)On update properties policy behaviour If applicable and "cm:autoVersionOnUpdateProps" is TRUE then version the node on properties update (even if no content updates)- Specified by:
onUpdatePropertiesin interfaceNodeServicePolicies.OnUpdatePropertiesPolicy- Parameters:
nodeRef- reference to the updated nodebefore- the node's properties before the changeafter- the node's properties after the change- Since:
- 3.2
-
afterCreateVersion
public void afterCreateVersion(org.alfresco.service.cmr.repository.NodeRef versionableNode, Version version)Description copied from interface:VersionServicePolicies.AfterCreateVersionPolicyCalled after the version has been created- Specified by:
afterCreateVersionin interfaceVersionServicePolicies.AfterCreateVersionPolicy- Parameters:
versionableNode- the node that has been versionedversion- the created version- See Also:
VersionServicePolicies.OnCreateVersionPolicy.onCreateVersion(org.alfresco.service.namespace.QName, org.alfresco.service.cmr.repository.NodeRef, java.util.Map, org.alfresco.repo.policy.PolicyScope)
-
onDictionaryInit
public void onDictionaryInit()
- Specified by:
onDictionaryInitin interfaceorg.alfresco.repo.dictionary.DictionaryListener
-
afterDictionaryInit
public void afterDictionaryInit()
- Specified by:
afterDictionaryInitin interfaceorg.alfresco.repo.dictionary.DictionaryListener
-
afterDictionaryDestroy
public void afterDictionaryDestroy()
- Specified by:
afterDictionaryDestroyin interfaceorg.alfresco.repo.dictionary.DictionaryListener
-
-