org.alfresco.repo.version
Class VersionableAspect

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

public class VersionableAspect
extends java.lang.Object
implements ContentServicePolicies.OnContentUpdatePolicy, NodeServicePolicies.OnAddAspectPolicy, NodeServicePolicies.OnRemoveAspectPolicy, NodeServicePolicies.OnDeleteNodePolicy, VersionServicePolicies.AfterCreateVersionPolicy

Class containing behaviour for the versionable aspect


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
 
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
 
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
 
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
 
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
 
Field Summary
 
Fields inherited from interface org.alfresco.repo.policy.Policy
NAMESPACE
 
Fields inherited from interface org.alfresco.repo.policy.Policy
NAMESPACE
 
Fields inherited from interface org.alfresco.repo.policy.Policy
NAMESPACE
 
Fields inherited from interface org.alfresco.repo.policy.Policy
NAMESPACE
 
Fields inherited from interface org.alfresco.repo.policy.Policy
NAMESPACE
 
Constructor Summary
VersionableAspect()
           
 
Method Summary
 void afterCreateVersion(NodeRef versionableNode, Version version)
          Called after the version has been created
 void init()
          Initialise the versionable aspect policies
 void onAddAspect(NodeRef nodeRef, QName aspectTypeQName)
          On add aspect policy behaviour
 void onContentUpdate(NodeRef nodeRef, boolean newContent)
          On content update policy bahaviour
 void onCopy(QName sourceClassRef, NodeRef sourceNodeRef, StoreRef destinationStoreRef, boolean copyToNewNode, PolicyScope copyDetails)
          OnCopy behaviour implementation for the version aspect.
 void onDeleteNode(ChildAssociationRef childAssocRef, boolean isNodeArchived)
          Called after a node is deleted.
 void onRemoveAspect(NodeRef nodeRef, QName aspectTypeQName)
          Called after an aspect has been removed from a node
 void setNodeService(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(NodeService nodeService)
Set the node service

Parameters:
nodeService - the node service

init

public void init()
Initialise the versionable aspect policies


onDeleteNode

public void onDeleteNode(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)

onCopy

public void onCopy(QName sourceClassRef,
                   NodeRef sourceNodeRef,
                   StoreRef destinationStoreRef,
                   boolean copyToNewNode,
                   PolicyScope copyDetails)
OnCopy behaviour implementation for the version aspect.

Ensures that the propety values of the version aspect are not copied onto the destination node.

See Also:
CopyServicePolicies.OnCopyNodePolicy.onCopyNode(QName, NodeRef, StoreRef, boolean, PolicyScope)

onAddAspect

public void onAddAspect(NodeRef nodeRef,
                        QName aspectTypeQName)
On add aspect policy behaviour

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

onRemoveAspect

public void onRemoveAspect(NodeRef nodeRef,
                           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(NodeRef nodeRef,
                            boolean newContent)
On content update policy bahaviour

Specified by:
onContentUpdate in interface ContentServicePolicies.OnContentUpdatePolicy
Parameters:
nodeRef - the node reference

afterCreateVersion

public void afterCreateVersion(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)


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