Class PolicyScope

java.lang.Object
org.alfresco.repo.policy.PolicyScope

public class PolicyScope extends Object
Policy scope.

Helper often used by policies which require information about a node to be gathered, for example onCopy or onCreateVersion.

Author:
Roy Wetherall
  • Field Details

  • Constructor Details

    • PolicyScope

      public PolicyScope(QName classRef)
      Constructor
      Parameters:
      classRef - the class reference
  • Method Details

    • addProperty

      public void addProperty(QName classRef, QName qName, Serializable value)
      Add a property
      Parameters:
      classRef - the class reference
      qName - the qualified name of the property
      value - the value of the property
    • removeProperty

      public void removeProperty(QName classRef, QName qName)
      Removes a property from the list
      Parameters:
      classRef - the class reference
      qName - the qualified name
    • getProperties

      public Map<QName,Serializable> getProperties(QName classRef)
      Get the properties
      Parameters:
      classRef - the class ref
      Returns:
      the properties that should be copied
    • addChildAssociation

      public void addChildAssociation(QName classRef, ChildAssociationRef childAssocRef)
      Adds a child association
      Parameters:
      classRef - QName
      childAssocRef - ChildAssociationRef
    • addChildAssociation

      public void addChildAssociation(QName classRef, ChildAssociationRef childAssocRef, boolean alwaysTraverseAssociation)
      Parameters:
      classRef - QName
      childAssocRef - ChildAssociationRef
      alwaysTraverseAssociation - boolean
    • getChildAssociations

      public List<ChildAssociationRef> getChildAssociations(QName classRef)
      Get a child association
      Parameters:
      classRef - QName
    • isChildAssociationRefAlwaysTraversed

      public boolean isChildAssociationRefAlwaysTraversed(QName classRef, ChildAssociationRef childAssocRef)
    • addAssociation

      public void addAssociation(QName classRef, AssociationRef nodeAssocRef)
      Add an association
      Parameters:
      classRef - QName
      nodeAssocRef - AssociationRef
    • getAssociations

      public List<AssociationRef> getAssociations(QName classRef)
      Get associations
      Parameters:
      classRef - QName
    • addAspect

      public org.alfresco.repo.policy.AspectDetails addAspect(QName aspect)
      Add an aspect
      Parameters:
      aspect - the aspect class reference
      Returns:
      the apsect copy details (returned as a helper)
    • removeAspect

      public void removeAspect(QName aspect)
      Removes an aspect from the list
      Parameters:
      aspect - the aspect class reference
    • getAspects

      public Set<QName> getAspects()
      Gets a list of the aspects
      Returns:
      a list of aspect to copy
    • addProperty

      public void addProperty(QName qName, Serializable value)
      Add a property to the list
      Parameters:
      qName - the qualified name of the property
      value - the value of the property
    • removeProperty

      public void removeProperty(QName qName)
      Remove a property from the list
      Parameters:
      qName - the qualified name of the property
    • getProperties

      public Map<QName,Serializable> getProperties()
      Gets the map of properties
      Returns:
      map of property names and values
    • addChildAssociation

      protected void addChildAssociation(ChildAssociationRef childAssocRef)
      Add a child association
      Parameters:
      childAssocRef - the child association reference
    • addChildAssociation

      protected void addChildAssociation(ChildAssociationRef childAssocRef, boolean alwaysTraverseAssociation)
      Add a child association
      Parameters:
      childAssocRef - the child assoc reference
      alwaysTraverseAssociation - indicates whether the assoc should always be traversed
    • isChildAssociationRefAlwaysTraversed

      protected boolean isChildAssociationRefAlwaysTraversed(ChildAssociationRef childAssocRef)
      Indicates whether a child association ref is always traversed or not
      Parameters:
      childAssocRef - the child association reference
      Returns:
      true if the assoc is always traversed, false otherwise
    • getChildAssociations

      public List<ChildAssociationRef> getChildAssociations()
      Gets the child associations to be copied
      Returns:
      map containing the child associations to be copied
    • addAssociation

      protected void addAssociation(AssociationRef nodeAssocRef)
      Adds an association to be copied
      Parameters:
      nodeAssocRef - the association reference
    • getAssociations

      public List<AssociationRef> getAssociations()
      Gets the map of associations to be copied
      Returns:
      a map conatining the associations to be copied