org.alfresco.repo.version
Class VersionableAspect

java.lang.Object
  extended by org.alfresco.repo.version.VersionableAspect
All Implemented Interfaces:
ContentServicePolicies.OnContentUpdatePolicy, CopyServicePolicies.OnCopyNodePolicy, org.alfresco.repo.dictionary.DictionaryListener, NodeServicePolicies.OnAddAspectPolicy, NodeServicePolicies.OnDeleteNodePolicy, NodeServicePolicies.OnRemoveAspectPolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, ClassPolicy, Policy, VersionServicePolicies.AfterCreateVersionPolicy

public class VersionableAspect
extends java.lang.Object
implements ContentServicePolicies.OnContentUpdatePolicy, NodeServicePolicies.OnAddAspectPolicy, NodeServicePolicies.OnRemoveAspectPolicy, NodeServicePolicies.OnDeleteNodePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, VersionServicePolicies.AfterCreateVersionPolicy, CopyServicePolicies.OnCopyNodePolicy, org.alfresco.repo.dictionary.DictionaryListener

Class containing behaviour for the versionable aspect


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
 
Field Summary
 
Fields inherited from interface org.alfresco.repo.content.ContentServicePolicies.OnContentUpdatePolicy
QNAME
 
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnAddAspectPolicy
QNAME
 
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnRemoveAspectPolicy
QNAME
 
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnDeleteNodePolicy
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
 
Fields inherited from interface org.alfresco.repo.copy.CopyServicePolicies.OnCopyNodePolicy
ARG_0, ARG_1, QNAME
 
Fields inherited from interface org.alfresco.repo.policy.Policy
NAMESPACE
 
Constructor Summary
VersionableAspect()
           
 
Method Summary
 void afterCreateVersion(org.alfresco.service.cmr.repository.NodeRef versionableNode, Version version)
          Called after the version has been created
 void afterDictionaryDestroy()
           
 void afterDictionaryInit()
           
 CopyBehaviourCallback getCopyCallback(org.alfresco.service.namespace.QName classRef, CopyDetails copyDetails)
          Called for all types and aspects before copying a node.
 java.util.List 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, java.util.Map before, java.util.Map 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 setEnableAutoVersioning(boolean enableAutoVersioning)
          Set whether the aspect-associated behaviour should be enabled or disabled.
 void setExcludedOnUpdateProps(java.util.List excludedOnUpdateProps)
           
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersionableAspect

public VersionableAspect()
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

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 getExcludedOnUpdateProps()
Returns:
Returns the current list of properties that do not trigger versioning

setExcludedOnUpdateProps

public void setExcludedOnUpdateProps(java.util.List excludedOnUpdateProps)
Parameters:
excludedOnUpdateProps - the list of properties that force versioning to ignore changes

setEnableAutoVersioning

public void setEnableAutoVersioning(boolean enableAutoVersioning)
Set whether the aspect-associated behaviour should be enabled or disabled. This is only used during initialization.

Parameters:
enableAutoVersioning - true to enable the aspect behaviour otherwise false

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.OnDeleteNodePolicy
Called 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:
onDeleteNode in interface NodeServicePolicies.OnDeleteNodePolicy
Parameters:
childAssocRef - the primary parent-child association of the deleted node
isNodeArchived - 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.OnCopyNodePolicy
Called for all types and aspects before copying a node.

Specified by:
getCopyCallback in interface CopyServicePolicies.OnCopyNodePolicy
Parameters:
classRef - the type or aspect qualified name
copyDetails - the details of the impending copy
Returns:
Returns the VersionableAspectCopyBehaviourCallback
See Also:
CopyServicePolicies

onAddAspect

public void onAddAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                        org.alfresco.service.namespace.QName aspectTypeQName)
On add aspect policy behaviour

Specified by:
onAddAspect in interface NodeServicePolicies.OnAddAspectPolicy
Parameters:
nodeRef -
aspectTypeQName -

onRemoveAspect

public void onRemoveAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                           org.alfresco.service.namespace.QName aspectTypeQName)
Description copied from interface: NodeServicePolicies.OnRemoveAspectPolicy
Called after an aspect has been removed from a node

Specified by:
onRemoveAspect in interface NodeServicePolicies.OnRemoveAspectPolicy
Parameters:
nodeRef - the node from which the aspect will be removed
aspectTypeQName - 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:
onContentUpdate in interface ContentServicePolicies.OnContentUpdatePolicy
Parameters:
nodeRef - the node reference

onUpdateProperties

public void onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                               java.util.Map before,
                               java.util.Map 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:
onUpdateProperties in interface NodeServicePolicies.OnUpdatePropertiesPolicy
Parameters:
nodeRef - reference to the updated node
before - the node's properties before the change
after - 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.AfterCreateVersionPolicy
Called after the version has been created

Specified by:
afterCreateVersion in interface VersionServicePolicies.AfterCreateVersionPolicy
Parameters:
versionableNode - the node that has been versioned
version - 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:
onDictionaryInit in interface org.alfresco.repo.dictionary.DictionaryListener

afterDictionaryInit

public void afterDictionaryInit()
Specified by:
afterDictionaryInit in interface org.alfresco.repo.dictionary.DictionaryListener

afterDictionaryDestroy

public void afterDictionaryDestroy()
Specified by:
afterDictionaryDestroy in interface org.alfresco.repo.dictionary.DictionaryListener


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.