org.mmbase.bridge
Interface RelationManager

All Superinterfaces:
Node, 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.

Version:
$Id: RelationManager.java,v 1.7 2002/12/05 09:50:32 kees Exp $
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
GUI_PLURAL, GUI_SINGULAR, ORDER_CREATE, ORDER_EDIT, ORDER_LIST, ORDER_NONE, ORDER_SEARCH
 
Method Summary
 Relation createRelation(Node sourceNode, Node destinationNode)
          Adds a relation from this type.
 Relation createRelation(Node sourceNode, RelationManager relationManager)
          This method from Node is redeclared here to prevent an ambiguous invocation of method.
 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 getForwardGUIName()
          Retrieves the gui name (prompt) of the role from source to destination
 java.lang.String getForwardRole()
          Retrieves the role of the source to the destination
 java.lang.String getReciprocalGUIName()
          Retrieves the gui name (prompt) of the role from destination to source
 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.
 boolean mayCreateRelation(Node sourceNode, Node destinationNode)
          Check if the current user may create a new relation of this type between the specified nodes.
 
Methods inherited from interface org.mmbase.bridge.NodeManager
createNode, createQuery, getAllowedRelations, getAllowedRelations, getAllowedRelations, getCloud, getDescendants, getDescription, getDescription, getField, getFields, getFields, getGUIName, getGUIName, getGUIName, getInfo, getInfo, getList, getList, getList, getList, getName, getParent, getProperties, getProperty, hasField, mayCreateNode
 
Methods inherited from interface org.mmbase.bridge.Node
cancel, commit, countRelatedNodes, countRelatedNodes, countRelations, countRelations, createAlias, delete, delete, deleteAlias, deleteRelations, deleteRelations, getAliases, getBooleanValue, getByteValue, getContext, getDoubleValue, getFieldValue, getFieldValue, getFloatValue, getFunctionValue, getIntValue, getLongValue, getNodeManager, getNodeValue, getNumber, getObjectValue, getPossibleContexts, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelations, getRelations, getRelations, getRelations, getRelations, getStringValue, getValue, getXMLValue, getXMLValue, hasRelations, isNodeManager, isRelation, isRelationManager, mayChangeContext, mayDelete, mayWrite, setBooleanValue, setByteValue, setContext, setDoubleValue, setFloatValue, setIntValue, setLongValue, setNodeValue, setObjectValue, setStringValue, setValue, setXMLValue, toNodeManager, toRelation, toRelationManager, toString
 

Field Detail

UNIDIRECTIONAL

public static final int UNIDIRECTIONAL
Directionality constant : uni-directional

See Also:
Constant Field Values

BIDIRECTIONAL

public static final int BIDIRECTIONAL
Directionality constant : bi-directional

See Also:
Constant Field Values
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

getForwardGUIName

public java.lang.String getForwardGUIName()
Retrieves the gui name (prompt) of the role from source to destination

Returns:
the name as a String

getReciprocalGUIName

public java.lang.String getReciprocalGUIName()
Retrieves the gui name (prompt) of the role from destination to source

Returns:
the name 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

createRelation

public Relation createRelation(Node sourceNode,
                               RelationManager relationManager)
This method from Node is redeclared here to prevent an ambiguous invocation of method. reson: the the method in the base class (Node) is more specific than the one in the RelationManager (RelationManager extends Node).

Specified by:
createRelation in interface Node
Parameters:
sourceNode - the node to which you want to relate this node
relationManager - the relation manager you want to use
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

mayCreateRelation

public boolean mayCreateRelation(Node sourceNode,
                                 Node destinationNode)
Check if the current user may create a new relation of this type between the specified nodes.

Returns:
Check if the current user may create a new relation of this type between the specified nodes.


MMBase build 1.7.1.20041002