org.mmbase.bridge
Interface RelationManager

All Superinterfaces:
NodeManager
All Known Implementing Classes:
BasicRelationManager

public interface RelationManager
extends NodeManager

This interface represents a relation constraint (or contex, if you like). More specifically, it represents a relation manager (itself a node manager) as it applies between bnode belonging to two other node managers. Some of the information here is retrieved from the NodeManager used to build the catual relation node (the data as described in the xml builder config file). This NodeManager is also referred to as the parent. Other data is retrieved from a special (hidden) object that decsribes what relations apply between two nodes. (formerly known as the TypeRel builder). This includes direction and cardinality, and the NodeManagers of nodes itself. These fields cannot be changed except through the use of an administration module. This interface is therefor not a real mmbase 'object' in itself - it exists of two objects joined together.

Author:
Rob Vermeulen, Pierre van Rooden

Field Summary
static int BIDIRECTIONAL
          Directionality constant : bi-directional
static int UNIDIRECTIONAL
          Directionality constant : uni-directional
 
Fields inherited from interface org.mmbase.bridge.NodeManager
ORDER_CREATE, ORDER_EDIT, ORDER_LIST, ORDER_SEARCH
 
Method Summary
 Relation createRelation(Node sourceNode, Node destinationNode)
          Adds a relation from this type.
 NodeManager getDestinationManager()
          Retrieves the type of node that can act as the destination of a relation of this type.
 int getDirectionality()
          Retrieves the directionality for this type (the default assigned to a new relation).
 java.lang.String getForwardRole()
          Retrieves the role of the source to the destination
 java.lang.String getReciprocalRole()
          Retrieves the role of the destination to the source
 RelationList getRelations(Node node)
          Retrieves all the relations of this type from a given node.
 NodeManager getSourceManager()
          Retrieves the NodeManager of node that can act as the source of a relation of this type.
 
Methods inherited from interface org.mmbase.bridge.NodeManager
createNode, getCloud, getDescription, getField, getFields, getFields, getGUIName, getInfo, getInfo, getList, getList, getList, getName, mayCreateNode
 

Field Detail

UNIDIRECTIONAL

public static final int UNIDIRECTIONAL
Directionality constant : uni-directional

BIDIRECTIONAL

public static final int BIDIRECTIONAL
Directionality constant : bi-directional
Method Detail

getForwardRole

public java.lang.String getForwardRole()
Retrieves the role of the source to the destination
Returns:
the role as a String

getReciprocalRole

public java.lang.String getReciprocalRole()
Retrieves the role of the destination to the source
Returns:
the role as a String

getDirectionality

public int getDirectionality()
Retrieves the directionality for this type (the default assigned to a new relation).
Returns:
one of the directionality constants

getSourceManager

public NodeManager getSourceManager()
Retrieves the NodeManager of node that can act as the source of a relation of this type.
Returns:
the source NodeManager

getDestinationManager

public NodeManager getDestinationManager()
Retrieves the type of node that can act as the destination of a relation of this type.
Returns:
the destination NodeManager

createRelation

public Relation createRelation(Node sourceNode,
                               Node destinationNode)
Adds a relation from this type.
Parameters:
sourceNode - the node from which you want to relate
destinationNode - the node to which you want to relate
Returns:
the added relation

getRelations

public RelationList getRelations(Node node)
Retrieves all the relations of this type from a given node.
Parameters:
node - the node from which to give the relations
Returns:
a list of relations


MMBase 2001