Class IncompleteNodeTagger

java.lang.Object
org.alfresco.util.transaction.TransactionListenerAdapter
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, org.alfresco.util.transaction.TransactionListener

Component that tags incomplete nodes.
Author:
Derek Hulley
  • Constructor Details

    • IncompleteNodeTagger

      public IncompleteNodeTagger()
  • Method Details

    • setPolicyComponent

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

      public void setDictionaryService(DictionaryService dictionaryService)
      Parameters:
      dictionaryService - the dictionary against which to confirm model details
    • setNodeService

      public void setNodeService(NodeService nodeService)
      Parameters:
      nodeService - the node service to use for browsing node structures
    • setStoresToIgnore

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

      public void setPropertiesToIgnore(List<String> propertiesToIgnore)
      Parameters:
      propertiesToIgnore - a list of property fully-qualified names to ignore
    • setBehaviourFilter

      public void setBehaviourFilter(BehaviourFilter behaviourFilter)
    • init

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

      public void onCreateNode(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(NodeRef nodeRef, Map<QName,Serializable> before, Map<QName,Serializable> 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(NodeRef nodeRef, 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(NodeRef nodeRef, 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(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(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(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(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 org.alfresco.util.transaction.TransactionListener
      Overrides:
      beforeCommit in class org.alfresco.util.transaction.TransactionListenerAdapter