public class VersionableAspect extends Object implements ContentServicePolicies.OnContentUpdatePolicy, NodeServicePolicies.BeforeAddAspectPolicy, NodeServicePolicies.OnAddAspectPolicy, NodeServicePolicies.OnRemoveAspectPolicy, NodeServicePolicies.OnDeleteNodePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, VersionServicePolicies.AfterCreateVersionPolicy, CopyServicePolicies.OnCopyNodePolicy, org.alfresco.repo.dictionary.DictionaryListener
Policy.Arg
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
logger |
QNAME
QNAME
QNAME
QNAME
QNAME
ARG_0, ARG_1, ARG_2, QNAME
QNAME
ARG_0, ARG_1, QNAME
Constructor and Description |
---|
VersionableAspect() |
Modifier and Type | Method and Description |
---|---|
void |
afterCreateVersion(org.alfresco.service.cmr.repository.NodeRef versionableNode,
Version version)
Called after the version has been created
|
void |
afterDictionaryDestroy() |
void |
afterDictionaryInit() |
void |
beforeAddAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.namespace.QName aspectTypeQName)
Before add aspect policy behaviour
|
CopyBehaviourCallback |
getCopyCallback(org.alfresco.service.namespace.QName classRef,
CopyDetails copyDetails)
Called for all types and aspects before copying a node.
|
List<String> |
getExcludedOnUpdateProps() |
void |
init()
Initialise the versionable aspect policies
|
void |
onAddAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.namespace.QName aspectTypeQName)
On add aspect policy behaviour
|
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)
|
void |
onDeleteNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef,
boolean isNodeArchived)
Called after a node is deleted.
|
void |
onDictionaryInit() |
void |
onRemoveAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.namespace.QName aspectTypeQName)
Called after an aspect has been removed from a node
|
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)
On update properties policy behaviour
If applicable and "cm:autoVersionOnUpdateProps" is TRUE then version the node on properties update (even if no content updates)
|
void |
setDictionaryDAO(org.alfresco.repo.dictionary.DictionaryDAO dictionaryDAO)
Sets the dictionary DAO.
|
void |
setExcludedOnUpdateProps(List<String> excludedOnUpdateProps) |
void |
setLockService(LockService lockService)
Set the lock service
|
void |
setNamespacePrefixResolver(org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver)
Sets the namespace prefix resolver.
|
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Set the node service
|
void |
setPolicyComponent(PolicyComponent policyComponent)
Set the policy component
|
void |
setVersionService(VersionService versionService)
Set the version service
|
public void setPolicyComponent(PolicyComponent policyComponent)
policyComponent
- the policy componentpublic void setVersionService(VersionService versionService)
versionService
- the version servicepublic void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService
- the node servicepublic void setLockService(LockService lockService)
lockService
- the lock servicepublic void setDictionaryDAO(org.alfresco.repo.dictionary.DictionaryDAO dictionaryDAO)
dictionaryDAO
- the dictionary DAOpublic void setNamespacePrefixResolver(org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver)
namespacePrefixResolver
- the namespace prefix resolverpublic List<String> getExcludedOnUpdateProps()
public void setExcludedOnUpdateProps(List<String> excludedOnUpdateProps)
excludedOnUpdateProps
- the list of properties that force versioning to ignore changespublic void init()
public void onDeleteNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef, boolean isNodeArchived)
NodeServicePolicies.OnDeleteNodePolicy
onDeleteNode
in interface NodeServicePolicies.OnDeleteNodePolicy
childAssocRef
- the primary parent-child association of the deleted nodeisNodeArchived
- indicates whether the node has been archived rather than purgedNodeServicePolicies.OnDeleteNodePolicy.onDeleteNode(org.alfresco.service.cmr.repository.ChildAssociationRef, boolean)
public CopyBehaviourCallback getCopyCallback(org.alfresco.service.namespace.QName classRef, CopyDetails copyDetails)
CopyServicePolicies.OnCopyNodePolicy
getCopyCallback
in interface CopyServicePolicies.OnCopyNodePolicy
classRef
- the type or aspect qualified namecopyDetails
- the details of the impending copyCopyServicePolicies
public void beforeAddAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName aspectTypeQName)
beforeAddAspect
in interface NodeServicePolicies.BeforeAddAspectPolicy
nodeRef
- NodeRefaspectTypeQName
- QNamepublic void onAddAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName aspectTypeQName)
onAddAspect
in interface NodeServicePolicies.OnAddAspectPolicy
nodeRef
- NodeRefaspectTypeQName
- QNamepublic void onRemoveAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName aspectTypeQName)
NodeServicePolicies.OnRemoveAspectPolicy
onRemoveAspect
in interface NodeServicePolicies.OnRemoveAspectPolicy
nodeRef
- the node from which the aspect will be removedaspectTypeQName
- the type of the aspectNodeServicePolicies.OnRemoveAspectPolicy.onRemoveAspect(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName)
public void onContentUpdate(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean newContent)
onContentUpdate
in interface ContentServicePolicies.OnContentUpdatePolicy
nodeRef
- the node referencepublic 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)
onUpdateProperties
in interface NodeServicePolicies.OnUpdatePropertiesPolicy
nodeRef
- reference to the updated nodebefore
- the node's properties before the changeafter
- the node's properties after the changepublic void afterCreateVersion(org.alfresco.service.cmr.repository.NodeRef versionableNode, Version version)
VersionServicePolicies.AfterCreateVersionPolicy
afterCreateVersion
in interface VersionServicePolicies.AfterCreateVersionPolicy
versionableNode
- the node that has been versionedversion
- the created versionVersionServicePolicies.OnCreateVersionPolicy.onCreateVersion(org.alfresco.service.namespace.QName, org.alfresco.service.cmr.repository.NodeRef, java.util.Map, org.alfresco.repo.policy.PolicyScope)
public void onDictionaryInit()
onDictionaryInit
in interface org.alfresco.repo.dictionary.DictionaryListener
public void afterDictionaryInit()
afterDictionaryInit
in interface org.alfresco.repo.dictionary.DictionaryListener
public void afterDictionaryDestroy()
afterDictionaryDestroy
in interface org.alfresco.repo.dictionary.DictionaryListener
Copyright © 2005–2017 Alfresco Software. All rights reserved.