org.alfresco.repo.node.integrity
Class IncompleteNodeTagger

java.lang.Object
  extended by org.alfresco.repo.transaction.TransactionListenerAdapter
      extended by org.alfresco.repo.node.integrity.IncompleteNodeTagger
All Implemented Interfaces:
NodeServicePolicies.OnAddAspectPolicy, NodeServicePolicies.OnCreateAssociationPolicy, NodeServicePolicies.OnCreateChildAssociationPolicy, NodeServicePolicies.OnCreateNodePolicy, NodeServicePolicies.OnDeleteAssociationPolicy, NodeServicePolicies.OnDeleteChildAssociationPolicy, NodeServicePolicies.OnRemoveAspectPolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, AssociationPolicy, ClassPolicy, Policy, TransactionListener

public class IncompleteNodeTagger
extends TransactionListenerAdapter
implements NodeServicePolicies.OnCreateNodePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, NodeServicePolicies.OnAddAspectPolicy, NodeServicePolicies.OnRemoveAspectPolicy, NodeServicePolicies.OnCreateChildAssociationPolicy, NodeServicePolicies.OnDeleteChildAssociationPolicy, NodeServicePolicies.OnCreateAssociationPolicy, NodeServicePolicies.OnDeleteAssociationPolicy

Component that tags incomplete nodes.


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.node.NodeServicePolicies.OnCreateNodePolicy
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.node.NodeServicePolicies.OnAddAspectPolicy
QNAME
 
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnRemoveAspectPolicy
QNAME
 
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnCreateChildAssociationPolicy
QNAME
 
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnDeleteChildAssociationPolicy
QNAME
 
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnCreateAssociationPolicy
QNAME
 
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnDeleteAssociationPolicy
QNAME
 
Fields inherited from interface org.alfresco.repo.policy.Policy
NAMESPACE
 
Constructor Summary
IncompleteNodeTagger()
           
 
Method Summary
 void beforeCommit(boolean readOnly)
          Process all the nodes that require checking within the transaction.
 void init()
          Registers the system-level policy behaviours
 void onAddAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName aspectTypeQName)
          Called after an aspect has been added to a node
 void onCreateAssociation(org.alfresco.service.cmr.repository.AssociationRef nodeAssocRef)
          Called after a regular node association is created.
 void onCreateChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef, boolean isNew)
          Called after a node child association has been created.
 void onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
          Called when a new node has been created.
 void onDeleteAssociation(org.alfresco.service.cmr.repository.AssociationRef nodeAssocRef)
          Called after a regular node association is deleted.
 void onDeleteChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
          Called after a node child association has been deleted.
 void onRemoveAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName aspectTypeQName)
          Recheck the node as an aspect was removed.
 void onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.Map before, java.util.Map after)
          Called after a node's properties have been changed.
 void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
           
 void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
           
 void setPolicyComponent(PolicyComponent policyComponent)
           
 void setPropertiesToIgnore(java.util.List propertiesToIgnore)
           
 void setStoresToIgnore(java.util.List storesToIgnore)
           
 
Methods inherited from class org.alfresco.repo.transaction.TransactionListenerAdapter
afterCommit, afterRollback, beforeCompletion, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IncompleteNodeTagger

public IncompleteNodeTagger()
Method Detail

setPolicyComponent

public void setPolicyComponent(PolicyComponent policyComponent)
Parameters:
policyComponent - the component to register behaviour with

setDictionaryService

public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Parameters:
dictionaryService - the dictionary against which to confirm model details

setNodeService

public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Parameters:
nodeService - the node service to use for browsing node structures

setStoresToIgnore

public void setStoresToIgnore(java.util.List storesToIgnore)
Parameters:
storesToIgnore - stores (eg. workspace://version2Store) which will be ignored by IncompleteNodeTagger. Note: assumes associations are within a store.

setPropertiesToIgnore

public void setPropertiesToIgnore(java.util.List propertiesToIgnore)
Parameters:
propertiesToIgnore - a list of property fully-qualified names to ignore

init

public void init()
Registers the system-level policy behaviours


onCreateNode

public void onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
Called when a new node has been created.

Specified by:
onCreateNode in interface NodeServicePolicies.OnCreateNodePolicy
Parameters:
childAssocRef - the created child association reference

onUpdateProperties

public void onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                               java.util.Map before,
                               java.util.Map after)
Called after a node's properties have been changed.

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

onAddAspect

public void onAddAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                        org.alfresco.service.namespace.QName aspectTypeQName)
Called after an aspect has been added to a node

Save the node for checking of properties. The incomplete aspect is not processed.

Specified by:
onAddAspect in interface NodeServicePolicies.OnAddAspectPolicy
Parameters:
nodeRef - the node to which the aspect was added
aspectTypeQName - the type of the aspect

onRemoveAspect

public void onRemoveAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                           org.alfresco.service.namespace.QName aspectTypeQName)
Recheck the node as an aspect was removed.

Specified by:
onRemoveAspect in interface NodeServicePolicies.OnRemoveAspectPolicy
Parameters:
nodeRef - the node from which the aspect will be removed
aspectTypeQName - the type of the aspect

onCreateChildAssociation

public void onCreateChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef,
                                     boolean isNew)
Called after a node child association has been created.

This only saves the node for checking if it is not new. The create of the node will handle it.

Specified by:
onCreateChildAssociation in interface NodeServicePolicies.OnCreateChildAssociationPolicy
Parameters:
childAssocRef - the child association that has been created
isNew - true if the node is new or false if the node is being linked in

onDeleteChildAssociation

public void onDeleteChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
Called after a node child association has been deleted.

Specified by:
onDeleteChildAssociation in interface NodeServicePolicies.OnDeleteChildAssociationPolicy
Parameters:
childAssocRef - the child association that has been deleted

onCreateAssociation

public void onCreateAssociation(org.alfresco.service.cmr.repository.AssociationRef nodeAssocRef)
Called after a regular node association is created.

Specified by:
onCreateAssociation in interface NodeServicePolicies.OnCreateAssociationPolicy
Parameters:
nodeAssocRef - the regular node association that was created

onDeleteAssociation

public void onDeleteAssociation(org.alfresco.service.cmr.repository.AssociationRef nodeAssocRef)
Called after a regular node association is deleted.

Specified by:
onDeleteAssociation in interface NodeServicePolicies.OnDeleteAssociationPolicy
Parameters:
nodeAssocRef - the regular node association that was removed

beforeCommit

public void beforeCommit(boolean readOnly)
Process all the nodes that require checking within the transaction.

Specified by:
beforeCommit in interface TransactionListener
Overrides:
beforeCommit in class TransactionListenerAdapter
Parameters:
readOnly - true if the transaction is read-only


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