Package org.alfresco.repo.policy
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 Summary
Fields Modifier and Type Field Description protected Map<ChildAssociationRef,ChildAssociationRef>alwaysTraverseMapMap of assocs that will always be traversedprotected Map<QName,org.alfresco.repo.policy.AspectDetails>aspectCopyDetailsThe aspectsprotected List<ChildAssociationRef>childAssocsThe child associationsprotected QNameclassRefThe class ref of the aspectprotected Map<QName,Serializable>propertiesThe propertiesprotected List<AssociationRef>targetAssocsThe target associations
-
Constructor Summary
Constructors Constructor Description PolicyScope(QName classRef)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.alfresco.repo.policy.AspectDetailsaddAspect(QName aspect)Add an aspectprotected voidaddAssociation(AssociationRef nodeAssocRef)Adds an association to be copiedvoidaddAssociation(QName classRef, AssociationRef nodeAssocRef)Add an associationprotected voidaddChildAssociation(ChildAssociationRef childAssocRef)Add a child associationprotected voidaddChildAssociation(ChildAssociationRef childAssocRef, boolean alwaysTraverseAssociation)Add a child associationvoidaddChildAssociation(QName classRef, ChildAssociationRef childAssocRef)Adds a child associationvoidaddChildAssociation(QName classRef, ChildAssociationRef childAssocRef, boolean alwaysTraverseAssociation)voidaddProperty(QName qName, Serializable value)Add a property to the listvoidaddProperty(QName classRef, QName qName, Serializable value)Add a propertySet<QName>getAspects()Gets a list of the aspectsList<AssociationRef>getAssociations()Gets the map of associations to be copiedList<AssociationRef>getAssociations(QName classRef)Get associationsList<ChildAssociationRef>getChildAssociations()Gets the child associations to be copiedList<ChildAssociationRef>getChildAssociations(QName classRef)Get a child associationMap<QName,Serializable>getProperties()Gets the map of propertiesMap<QName,Serializable>getProperties(QName classRef)Get the propertiesprotected booleanisChildAssociationRefAlwaysTraversed(ChildAssociationRef childAssocRef)Indicates whether a child association ref is always traversed or notbooleanisChildAssociationRefAlwaysTraversed(QName classRef, ChildAssociationRef childAssocRef)voidremoveAspect(QName aspect)Removes an aspect from the listvoidremoveProperty(QName qName)Remove a property from the listvoidremoveProperty(QName classRef, QName qName)Removes a property from the list
-
-
-
Field Detail
-
aspectCopyDetails
protected Map<QName,org.alfresco.repo.policy.AspectDetails> aspectCopyDetails
The aspects
-
properties
protected Map<QName,Serializable> properties
The properties
-
childAssocs
protected List<ChildAssociationRef> childAssocs
The child associations
-
targetAssocs
protected List<AssociationRef> targetAssocs
The target associations
-
classRef
protected QName classRef
The class ref of the aspect
-
alwaysTraverseMap
protected Map<ChildAssociationRef,ChildAssociationRef> alwaysTraverseMap
Map of assocs that will always be traversed
-
-
Constructor Detail
-
PolicyScope
public PolicyScope(QName classRef)
Constructor- Parameters:
classRef- the class reference
-
-
Method Detail
-
addProperty
public void addProperty(QName classRef, QName qName, Serializable value)
Add a property- Parameters:
classRef- the class referenceqName- the qualified name of the propertyvalue- the value of the property
-
removeProperty
public void removeProperty(QName classRef, QName qName)
Removes a property from the list- Parameters:
classRef- the class referenceqName- 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- QNamechildAssocRef- ChildAssociationRef
-
addChildAssociation
public void addChildAssociation(QName classRef, ChildAssociationRef childAssocRef, boolean alwaysTraverseAssociation)
- Parameters:
classRef- QNamechildAssocRef- ChildAssociationRefalwaysTraverseAssociation- 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- QNamenodeAssocRef- 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 propertyvalue- 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 referencealwaysTraverseAssociation- 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
-
-