org.mmbase.bridge
Interface RelationManager

All Superinterfaces:
Comparable<Node>, Node, NodeManager
All Known Implementing Classes:
BasicRelationManager, MockRelationManager

public interface RelationManager
extends NodeManager

This interface represents a relation constraint. More specifically, it represents a relation manager (itself a node manager) as it applies between a node 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 therefore not a real mmbase 'object' in itself - it exists of two objects joined together.

Version:
$Id: RelationManager.java 40471 2010-01-11 16:58:52Z michiel $
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
 
Fields inherited from interface org.mmbase.bridge.Node
CLOUD_COMMITNODE_KEY
 
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).
 String getForwardGUIName()
          Retrieves the gui name (prompt) of the role from source to destination
 String getForwardRole()
          Retrieves the role of the source to the destination
 String getReciprocalGUIName()
          Retrieves the gui name (prompt) of the role from destination to source
 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
createFieldList, createNode, createNodeList, createQuery, createRelationList, 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, createParameters, delete, delete, deleteAlias, deleteRelations, deleteRelations, getAliases, getBooleanValue, getByteValue, getChanged, getContext, getDateValue, getDecimalValue, getDoubleValue, getFieldValue, getFieldValue, getFloatValue, getFunction, getFunctions, getFunctionValue, getInputStreamValue, getIntValue, getListValue, getLongValue, getNodeManager, getNodeValue, getNumber, getObjectValue, getPossibleContexts, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelations, getRelations, getRelations, getRelations, getRelations, getSize, getStringValue, getValue, getValueWithoutProcess, getXMLValue, getXMLValue, hasRelations, isChanged, isChanged, isNew, isNodeManager, isNull, isRelation, isRelationManager, mayChangeContext, mayDelete, mayWrite, setBooleanValue, setByteValue, setContext, setDateValue, setDecimalValue, setDoubleValue, setFloatValue, setInputStreamValue, setIntValue, setListValue, setLongValue, setNodeManager, setNodeValue, setObjectValue, setStringValue, setValue, setValueWithoutProcess, setXMLValue, toNodeManager, toRelation, toRelationManager, toString, validate
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

UNIDIRECTIONAL

static final int UNIDIRECTIONAL
Directionality constant : uni-directional

See Also:
Constant Field Values

BIDIRECTIONAL

static final int BIDIRECTIONAL
Directionality constant : bi-directional

See Also:
Constant Field Values
Method Detail

getForwardRole

String getForwardRole()
Retrieves the role of the source to the destination

Returns:
the role as a String

getReciprocalRole

String getReciprocalRole()
Retrieves the role of the destination to the source

Returns:
the role as a String

getForwardGUIName

String getForwardGUIName()
Retrieves the gui name (prompt) of the role from source to destination

Returns:
the name as a String

getReciprocalGUIName

String getReciprocalGUIName()
Retrieves the gui name (prompt) of the role from destination to source

Returns:
the name as a String

getDirectionality

int getDirectionality()
Retrieves the directionality for this type (the default assigned to a new relation).

Returns:
one of the directionality constants

getSourceManager

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

Returns:
the source NodeManager

getDestinationManager

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

Returns:
the destination NodeManager

createRelation

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

Relation createRelation(Node sourceNode,
                        RelationManager relationManager)
This method from Node is redeclared here to prevent an ambiguous invocation of method. reason: 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 - source node of the relation
relationManager - relation manager of the relation
Returns:
new Relation

getRelations

RelationList getRelations(Node node)
Retrieves all the relations of this type from a given node. This method returns all relations of a certain node not considering role, source manager and destination manager, but only the builder of relation (e.g. it queries either insrel, or an extension thereof). See Node.getRelations(String, NodeManager, String).

Parameters:
node - the node from which to give the relations
Returns:
a list of relations
To Do:
I think this is a silly method.

mayCreateRelation

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

Parameters:
sourceNode - source node of the relation
destinationNode - destination node of the relation
Returns:
Check if the current user may create a new relation of this type between the specified nodes.


MMBase 2.0-SNAPSHOT - null