Package org.alfresco.repo.version
Class VersionableAspect
java.lang.Object
org.alfresco.repo.version.VersionableAspect
- All Implemented Interfaces:
ContentServicePolicies.OnContentUpdatePolicy,CopyServicePolicies.OnCopyNodePolicy,DictionaryListener,NodeServicePolicies.BeforeAddAspectPolicy,NodeServicePolicies.OnAddAspectPolicy,NodeServicePolicies.OnDeleteNodePolicy,NodeServicePolicies.OnRemoveAspectPolicy,NodeServicePolicies.OnUpdatePropertiesPolicy,ClassPolicy,Policy,VersionServicePolicies.AfterCreateVersionPolicy
public class VersionableAspect
extends Object
implements ContentServicePolicies.OnContentUpdatePolicy, NodeServicePolicies.BeforeAddAspectPolicy, NodeServicePolicies.OnAddAspectPolicy, NodeServicePolicies.OnRemoveAspectPolicy, NodeServicePolicies.OnDeleteNodePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, VersionServicePolicies.AfterCreateVersionPolicy, CopyServicePolicies.OnCopyNodePolicy, 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
FieldsFields inherited from interface org.alfresco.repo.content.ContentServicePolicies.OnContentUpdatePolicy
QNAMEFields inherited from interface org.alfresco.repo.copy.CopyServicePolicies.OnCopyNodePolicy
ARG_0, ARG_1, QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeAddAspectPolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnAddAspectPolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnDeleteNodePolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnRemoveAspectPolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy
ARG_0, ARG_1, ARG_2, QNAMEFields inherited from interface org.alfresco.repo.version.VersionServicePolicies.AfterCreateVersionPolicy
QNAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterCreateVersion(NodeRef versionableNode, Version version) Called after the version has been createdvoidvoidvoidbeforeAddAspect(NodeRef nodeRef, QName aspectTypeQName) Before add aspect policy behaviourgetCopyCallback(QName classRef, CopyDetails copyDetails) Called for all types and aspects before copying a node.voidinit()Initialise the versionable aspect policiesvoidonAddAspect(NodeRef nodeRef, QName aspectTypeQName) On add aspect policy behaviourvoidonContentUpdate(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(ChildAssociationRef childAssocRef, boolean isNodeArchived) Called after a node is deleted.voidvoidonRemoveAspect(NodeRef nodeRef, QName aspectTypeQName) Called after an aspect has been removed from a nodevoidonUpdateProperties(NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, 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(DictionaryDAO dictionaryDAO) Sets the dictionary DAO.voidsetExcludedOnUpdateProps(List<String> excludedOnUpdateProps) voidsetLockService(LockService lockService) Set the lock servicevoidsetNamespacePrefixResolver(NamespacePrefixResolver namespacePrefixResolver) Sets the namespace prefix resolver.voidsetNodeService(NodeService nodeService) Set the node servicevoidsetPolicyComponent(PolicyComponent policyComponent) Set the policy componentvoidsetVersionService(VersionService versionService) Set the version service
-
Field Details
-
logger
protected static org.apache.commons.logging.Log logger
-
-
Constructor Details
-
VersionableAspect
public VersionableAspect()
-
-
Method Details
-
setPolicyComponent
Set the policy component- Parameters:
policyComponent- the policy component
-
setVersionService
Set the version service- Parameters:
versionService- the version service
-
setNodeService
Set the node service- Parameters:
nodeService- the node service
-
setLockService
Set the lock service- Parameters:
lockService- the lock service
-
setDictionaryDAO
Sets the dictionary DAO.- Parameters:
dictionaryDAO- the dictionary DAO
-
setNamespacePrefixResolver
Sets the namespace prefix resolver.- Parameters:
namespacePrefixResolver- the namespace prefix resolver
-
getExcludedOnUpdateProps
- Returns:
- Returns the current list of properties that do not trigger versioning
-
setExcludedOnUpdateProps
- Parameters:
excludedOnUpdateProps- the list of properties that force versioning to ignore changes
-
init
public void init()Initialise the versionable aspect policies -
onDeleteNode
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:
-
getCopyCallback
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:
-
beforeAddAspect
Before add aspect policy behaviour- Specified by:
beforeAddAspectin interfaceNodeServicePolicies.BeforeAddAspectPolicy- Parameters:
nodeRef- NodeRefaspectTypeQName- QName
-
onAddAspect
On add aspect policy behaviour- Specified by:
onAddAspectin interfaceNodeServicePolicies.OnAddAspectPolicy- Parameters:
nodeRef- NodeRefaspectTypeQName- QName
-
onRemoveAspect
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:
-
onContentUpdate
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(NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, 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
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:
-
onDictionaryInit
public void onDictionaryInit()- Specified by:
onDictionaryInitin interfaceDictionaryListener
-
afterDictionaryInit
public void afterDictionaryInit()- Specified by:
afterDictionaryInitin interfaceDictionaryListener
-
afterDictionaryDestroy
public void afterDictionaryDestroy()- Specified by:
afterDictionaryDestroyin interfaceDictionaryListener
-