org.alfresco.repo.policy
Class PolicyScope

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

public class PolicyScope
extends java.lang.Object

Policy scope.

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


Field Summary
protected  java.util.Map alwaysTraverseMap
          Map of assocs that will always be traversed
protected  java.util.Map aspectCopyDetails
          The aspects
protected  java.util.List childAssocs
          The child associations
protected  org.alfresco.service.namespace.QName classRef
          The class ref of the aspect
protected  java.util.Map properties
          The properties
protected  java.util.List targetAssocs
          The target associations
 
Constructor Summary
PolicyScope(org.alfresco.service.namespace.QName classRef)
          Constructor
 
Method Summary
 org.alfresco.repo.policy.AspectDetails addAspect(org.alfresco.service.namespace.QName aspect)
          Add an aspect
protected  void addAssociation(org.alfresco.service.cmr.repository.AssociationRef nodeAssocRef)
          Adds an association to be copied
 void addAssociation(org.alfresco.service.namespace.QName classRef, org.alfresco.service.cmr.repository.AssociationRef nodeAssocRef)
          Add an association
protected  void addChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
          Add a child association
protected  void addChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef, boolean alwaysTraverseAssociation)
          Add a child association
 void addChildAssociation(org.alfresco.service.namespace.QName classRef, org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
          Adds a child association
 void addChildAssociation(org.alfresco.service.namespace.QName classRef, org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef, boolean alwaysTraverseAssociation)
           
 void addProperty(org.alfresco.service.namespace.QName classRef, org.alfresco.service.namespace.QName qName, java.io.Serializable value)
          Add a property
 void addProperty(org.alfresco.service.namespace.QName qName, java.io.Serializable value)
          Add a property to the list
 java.util.Set getAspects()
          Gets a list of the aspects
 java.util.List getAssociations()
          Gets the map of associations to be copied
 java.util.List getAssociations(org.alfresco.service.namespace.QName classRef)
          Get associations
 java.util.List getChildAssociations()
          Gets the child associations to be copied
 java.util.List getChildAssociations(org.alfresco.service.namespace.QName classRef)
          Get a child association
 java.util.Map getProperties()
          Gets the map of properties
 java.util.Map getProperties(org.alfresco.service.namespace.QName classRef)
          Get the properties
protected  boolean isChildAssociationRefAlwaysTraversed(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
          Indicates whether a child association ref is always traversed or not
 boolean isChildAssociationRefAlwaysTraversed(org.alfresco.service.namespace.QName classRef, org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
           
 void removeAspect(org.alfresco.service.namespace.QName aspect)
          Removes an aspect from the list
 void removeProperty(org.alfresco.service.namespace.QName qName)
          Remove a property from the list
 void removeProperty(org.alfresco.service.namespace.QName classRef, org.alfresco.service.namespace.QName qName)
          Removes a property from the list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

aspectCopyDetails

protected java.util.Map aspectCopyDetails
The aspects


properties

protected java.util.Map properties
The properties


childAssocs

protected java.util.List childAssocs
The child associations


targetAssocs

protected java.util.List targetAssocs
The target associations


classRef

protected org.alfresco.service.namespace.QName classRef
The class ref of the aspect


alwaysTraverseMap

protected java.util.Map alwaysTraverseMap
Map of assocs that will always be traversed

Constructor Detail

PolicyScope

public PolicyScope(org.alfresco.service.namespace.QName classRef)
Constructor

Parameters:
classRef - the class reference
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 reference
qName - the qualified name of the property
value - 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 reference
qName - the qualified name

getProperties

public java.util.Map 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 -
qname -
childAssocRef -

addChildAssociation

public void addChildAssociation(org.alfresco.service.namespace.QName classRef,
                                org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef,
                                boolean alwaysTraverseAssociation)
Parameters:
classRef -
childAssocRef -
alwaysTraverseAssociation -

getChildAssociations

public java.util.List getChildAssociations(org.alfresco.service.namespace.QName classRef)
Get a child association

Parameters:
classRef -
Returns:

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 -
qname -
nodeAssocRef -

getAssociations

public java.util.List getAssociations(org.alfresco.service.namespace.QName classRef)
Get associations

Parameters:
classRef -
Returns:

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 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 property
value - 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 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 reference
alwaysDeepCopy - 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 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:
qname - the qualified name of the association
nodeAssocRef - the association reference

getAssociations

public java.util.List getAssociations()
Gets the map of associations to be copied

Returns:
a map conatining the associations to be copied


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