Novell exteNd
Director 5.2 API

com.sssw.cm.api
Interface EbiRelatedElements


public interface EbiRelatedElements

Describes a set of elements that are related to a specific element in some fashion. The relationship is defined by the "relationship type", i.e. one of the REL_TYPE_XXXX constants.

Since:
v.4.0

Field Summary
static int REL_TYPE_DEPENDENT
          The relationship type of "dependent elements".
static int REL_TYPE_SUPPORTING
          The relationship type of "supporting elements".
static int REL_TYPE_UNKNOWN
          The 'unknown' relationship type.
 
Method Summary
 void addRelatedElement(EbiFrameworkElement element, int level)
          Adds a single related element on the specified level.
 void addRelatedElements(Collection elements, int level)
          Adds related elements to a specific level.
 void clear()
          Clears the internal state of the object to enable it to be reused.
 Collection getAllElements(boolean includeElement)
          Returns all the related elements.
 EbiFrameworkElement getElement()
          Gets the element for which this object defines a set of related elements
 Collection getElements(int level)
          Returns related elements at a specific level of the relationship tree.
 Collection getElements(String elementType)
          Gets all the elements of a specific type that this Related Elements object knows about.
 String[] getElementTypes()
          Returns the list of element types to which the related elements belong.
 int getNumLevels()
          Returns the number of levels in the relationship tree.
 int getRelationshipType()
          Returns the relationship type.
 void setElement(EbiFrameworkElement element)
          Sets the element for which this object holds the list of related elements.
 void setRelationshipType(int relType)
          Sets the relationship type.
 

Field Detail

REL_TYPE_UNKNOWN

public static final int REL_TYPE_UNKNOWN
The 'unknown' relationship type.

REL_TYPE_DEPENDENT

public static final int REL_TYPE_DEPENDENT
The relationship type of "dependent elements". Used when the Related Elements object holds information on elements that depend on the specified element structurally (e.g. a child document depends on its parent, therefore the parent is the element in question and the child document is its dependency).

REL_TYPE_SUPPORTING

public static final int REL_TYPE_SUPPORTING
The relationship type of "supporting elements". Used when the Related Elements object holds information on elements that the element in question depends on. E.g. a document depends on the folder it belongs to, so the folder is a supporting structure.
Method Detail

getElements

public Collection getElements(String elementType)
Gets all the elements of a specific type that this Related Elements object knows about.
Parameters:
elementType - the element type of the related elements to return
Returns:
a Collection of the elements of a specific type that this Related Elements object knows about

getElements

public Collection getElements(int level)
Returns related elements at a specific level of the relationship tree. Note that the level is 0-based and the closer the related elements are to the one in question, the lower the level value is (i.e. the 0-th level contains that most immediate "relatives").
Parameters:
level - the level within the relationship tree
Returns:
a Collection of related elements from the specific level within the relationship tree

getElementTypes

public String[] getElementTypes()
Returns the list of element types to which the related elements belong.
Returns:
an array of element types such as EbiDocFolder.EL_DOC_FOLDER etc.

getAllElements

public Collection getAllElements(boolean includeElement)
Returns all the related elements.
Parameters:
includeElement - if true, the element in question is included into the returned collection of related elements
Returns:
a Collection of all related elements

getElement

public EbiFrameworkElement getElement()
Gets the element for which this object defines a set of related elements
Returns:
the element

getRelationshipType

public int getRelationshipType()
Returns the relationship type.
Returns:
the relationship type

addRelatedElements

public void addRelatedElements(Collection elements,
                               int level)
Adds related elements to a specific level.
Parameters:
elements - a Collection of related elements to be added
level - the level to add the related elements to

addRelatedElement

public void addRelatedElement(EbiFrameworkElement element,
                              int level)
Adds a single related element on the specified level.
Parameters:
element - the element to add
level - the level to add the element to

setElement

public void setElement(EbiFrameworkElement element)
Sets the element for which this object holds the list of related elements.
Parameters:
element - the element

setRelationshipType

public void setRelationshipType(int relType)
Sets the relationship type.
Parameters:
relType - the relationship type

getNumLevels

public int getNumLevels()
Returns the number of levels in the relationship tree.
Returns:
the number of levels in the relationship tree

clear

public void clear()
Clears the internal state of the object to enable it to be reused.

Novell exteNd
Director 5.2 API