Package org.alfresco.repo.policy
Class PolicyScope
- java.lang.Object
-
- org.alfresco.repo.policy.PolicyScope
-
public class PolicyScope extends java.lang.ObjectPolicy 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 java.util.Map<org.alfresco.service.cmr.repository.ChildAssociationRef,org.alfresco.service.cmr.repository.ChildAssociationRef>alwaysTraverseMapMap of assocs that will always be traversedprotected java.util.Map<org.alfresco.service.namespace.QName,org.alfresco.repo.policy.AspectDetails>aspectCopyDetailsThe aspectsprotected java.util.List<org.alfresco.service.cmr.repository.ChildAssociationRef>childAssocsThe child associationsprotected org.alfresco.service.namespace.QNameclassRefThe class ref of the aspectprotected java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable>propertiesThe propertiesprotected java.util.List<org.alfresco.service.cmr.repository.AssociationRef>targetAssocsThe target associations
-
Constructor Summary
Constructors Constructor Description PolicyScope(org.alfresco.service.namespace.QName classRef)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.alfresco.repo.policy.AspectDetailsaddAspect(org.alfresco.service.namespace.QName aspect)Add an aspectprotected voidaddAssociation(org.alfresco.service.cmr.repository.AssociationRef nodeAssocRef)Adds an association to be copiedvoidaddAssociation(org.alfresco.service.namespace.QName classRef, org.alfresco.service.cmr.repository.AssociationRef nodeAssocRef)Add an associationprotected voidaddChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)Add a child associationprotected voidaddChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef, boolean alwaysTraverseAssociation)Add a child associationvoidaddChildAssociation(org.alfresco.service.namespace.QName classRef, org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)Adds a child associationvoidaddChildAssociation(org.alfresco.service.namespace.QName classRef, org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef, boolean alwaysTraverseAssociation)voidaddProperty(org.alfresco.service.namespace.QName qName, java.io.Serializable value)Add a property to the listvoidaddProperty(org.alfresco.service.namespace.QName classRef, org.alfresco.service.namespace.QName qName, java.io.Serializable value)Add a propertyjava.util.Set<org.alfresco.service.namespace.QName>getAspects()Gets a list of the aspectsjava.util.List<org.alfresco.service.cmr.repository.AssociationRef>getAssociations()Gets the map of associations to be copiedjava.util.List<org.alfresco.service.cmr.repository.AssociationRef>getAssociations(org.alfresco.service.namespace.QName classRef)Get associationsjava.util.List<org.alfresco.service.cmr.repository.ChildAssociationRef>getChildAssociations()Gets the child associations to be copiedjava.util.List<org.alfresco.service.cmr.repository.ChildAssociationRef>getChildAssociations(org.alfresco.service.namespace.QName classRef)Get a child associationjava.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable>getProperties()Gets the map of propertiesjava.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable>getProperties(org.alfresco.service.namespace.QName classRef)Get the propertiesprotected booleanisChildAssociationRefAlwaysTraversed(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)Indicates whether a child association ref is always traversed or notbooleanisChildAssociationRefAlwaysTraversed(org.alfresco.service.namespace.QName classRef, org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)voidremoveAspect(org.alfresco.service.namespace.QName aspect)Removes an aspect from the listvoidremoveProperty(org.alfresco.service.namespace.QName qName)Remove a property from the listvoidremoveProperty(org.alfresco.service.namespace.QName classRef, org.alfresco.service.namespace.QName qName)Removes a property from the list
-
-
-
Field Detail
-
aspectCopyDetails
protected java.util.Map<org.alfresco.service.namespace.QName,org.alfresco.repo.policy.AspectDetails> aspectCopyDetails
The aspects
-
properties
protected java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> properties
The properties
-
childAssocs
protected java.util.List<org.alfresco.service.cmr.repository.ChildAssociationRef> childAssocs
The child associations
-
targetAssocs
protected java.util.List<org.alfresco.service.cmr.repository.AssociationRef> targetAssocs
The target associations
-
classRef
protected org.alfresco.service.namespace.QName classRef
The class ref of the aspect
-
alwaysTraverseMap
protected java.util.Map<org.alfresco.service.cmr.repository.ChildAssociationRef,org.alfresco.service.cmr.repository.ChildAssociationRef> alwaysTraverseMap
Map of assocs that will always be traversed
-
-
Method Detail
-
addProperty
public void addProperty(org.alfresco.service.namespace.QName classRef, org.alfresco.service.namespace.QName qName, java.io.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(org.alfresco.service.namespace.QName classRef, org.alfresco.service.namespace.QName qName)Removes a property from the list- Parameters:
classRef- the class referenceqName- the qualified name
-
getProperties
public java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> getProperties(org.alfresco.service.namespace.QName classRef)
Get the properties- Parameters:
classRef- the class ref- Returns:
- the properties that should be copied
-
addChildAssociation
public void addChildAssociation(org.alfresco.service.namespace.QName classRef, org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)Adds a child association- Parameters:
classRef- QNamechildAssocRef- ChildAssociationRef
-
addChildAssociation
public void addChildAssociation(org.alfresco.service.namespace.QName classRef, org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef, boolean alwaysTraverseAssociation)- Parameters:
classRef- QNamechildAssocRef- ChildAssociationRefalwaysTraverseAssociation- boolean
-
getChildAssociations
public java.util.List<org.alfresco.service.cmr.repository.ChildAssociationRef> getChildAssociations(org.alfresco.service.namespace.QName classRef)
Get a child association- Parameters:
classRef- QName
-
isChildAssociationRefAlwaysTraversed
public boolean isChildAssociationRefAlwaysTraversed(org.alfresco.service.namespace.QName classRef, org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
-
addAssociation
public void addAssociation(org.alfresco.service.namespace.QName classRef, org.alfresco.service.cmr.repository.AssociationRef nodeAssocRef)Add an association- Parameters:
classRef- QNamenodeAssocRef- AssociationRef
-
getAssociations
public java.util.List<org.alfresco.service.cmr.repository.AssociationRef> getAssociations(org.alfresco.service.namespace.QName classRef)
Get associations- Parameters:
classRef- QName
-
addAspect
public org.alfresco.repo.policy.AspectDetails addAspect(org.alfresco.service.namespace.QName aspect)
Add an aspect- Parameters:
aspect- the aspect class reference- Returns:
- the apsect copy details (returned as a helper)
-
removeAspect
public void removeAspect(org.alfresco.service.namespace.QName aspect)
Removes an aspect from the list- Parameters:
aspect- the aspect class reference
-
getAspects
public java.util.Set<org.alfresco.service.namespace.QName> getAspects()
Gets a list of the aspects- Returns:
- a list of aspect to copy
-
addProperty
public void addProperty(org.alfresco.service.namespace.QName qName, java.io.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(org.alfresco.service.namespace.QName qName)
Remove a property from the list- Parameters:
qName- the qualified name of the property
-
getProperties
public java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> getProperties()
Gets the map of properties- Returns:
- map of property names and values
-
addChildAssociation
protected void addChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
Add a child association- Parameters:
childAssocRef- the child association reference
-
addChildAssociation
protected void addChildAssociation(org.alfresco.service.cmr.repository.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(org.alfresco.service.cmr.repository.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 java.util.List<org.alfresco.service.cmr.repository.ChildAssociationRef> getChildAssociations()
Gets the child associations to be copied- Returns:
- map containing the child associations to be copied
-
addAssociation
protected void addAssociation(org.alfresco.service.cmr.repository.AssociationRef nodeAssocRef)
Adds an association to be copied- Parameters:
nodeAssocRef- the association reference
-
getAssociations
public java.util.List<org.alfresco.service.cmr.repository.AssociationRef> getAssociations()
Gets the map of associations to be copied- Returns:
- a map conatining the associations to be copied
-
-