org.mmbase.bridge.implementation
Class BasicRelationManager

java.lang.Object
  extended byorg.mmbase.bridge.implementation.BasicNode
      extended byorg.mmbase.bridge.implementation.BasicNodeManager
          extended byorg.mmbase.bridge.implementation.BasicRelationManager
All Implemented Interfaces:
java.lang.Comparable, Node, NodeManager, RelationManager, SizeMeasurable

public class BasicRelationManager
extends BasicNodeManager
implements RelationManager

Version:
$Id: BasicRelationManager.java,v 1.25 2003/12/21 17:42:04 michiel Exp $
Author:
Rob Vermeulen, Pierre van Rooden
Warning: No Java Documentation Available.

Field Summary
 MMObjectNode relDefNode
           
 
Fields inherited from class org.mmbase.bridge.implementation.BasicNodeManager
builder, fieldTypes, queryFields
 
Fields inherited from class org.mmbase.bridge.implementation.BasicNode
account, ACTION_COMMIT, ACTION_CREATE, ACTION_DELETE, ACTION_EDIT, cloud, isnew, mmb, nodeManager, noderef, temporaryNodeId
 
Fields inherited from interface org.mmbase.bridge.RelationManager
BIDIRECTIONAL, UNIDIRECTIONAL
 
Fields inherited from interface org.mmbase.bridge.NodeManager
GUI_PLURAL, GUI_SINGULAR, ORDER_CREATE, ORDER_EDIT, ORDER_LIST, ORDER_NONE, ORDER_SEARCH
 
Method Summary
 Node createNode()
          Creates a new node.
 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.
protected  void initManager()
          Initializes the NodeManager: determines the MMObjectBuilder from the passed node (reldef or typerel), and fillls temporary variables to maintain status.
 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 class org.mmbase.bridge.implementation.BasicNodeManager
commit, createQuery, delete, getAllowedRelations, getAllowedRelations, getAllowedRelations, getDescendants, getDescription, getDescription, getField, getFields, getFields, getGUIName, getGUIName, getGUIName, getInfo, getInfo, getList, getList, getList, getList, getName, getParent, getProperties, getProperty, getQueryFields, hasField, mayCreateNode
 
Methods inherited from class org.mmbase.bridge.implementation.BasicNode
cancel, compareTo, countRelatedNodes, countRelatedNodes, countRelations, countRelations, createAlias, delete, deleteAlias, deleteRelations, deleteRelations, edit, equals, finalize, getAliases, getBooleanValue, getByteSize, getByteSize, getByteValue, getCloud, getContext, getDoubleValue, getFieldValue, getFieldValue, getFloatValue, getFunctionValue, getIntValue, getLongValue, getNode, getNodeManager, getNodeValue, getNumber, getObjectValue, getPossibleContexts, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelations, getRelations, getRelations, getRelations, getRelations, getStringValue, getValue, getXMLValue, getXMLValue, hashCode, hasRelations, init, invalidateNode, isNodeManager, isRelation, isRelationManager, mayChangeContext, mayDelete, mayWrite, setBooleanValue, setByteValue, setContext, setDoubleValue, setFloatValue, setIntValue, setLongValue, setNode, setNodeValue, setObjectValue, setStringValue, setValue, setValueWithoutChecks, setValueWithoutProcess, setXMLValue, toNodeManager, toRelation, toRelationManager, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mmbase.bridge.NodeManager
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
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

relDefNode

public MMObjectNode relDefNode
Method Detail

initManager

protected void initManager()
Initializes the NodeManager: determines the MMObjectBuilder from the passed node (reldef or typerel), and fillls temporary variables to maintain status.

Overrides:
initManager in class BasicNodeManager

createNode

public Node createNode()
Description copied from interface: NodeManager
Creates a new node. The returned node will not be visible in the cloud until the commit() method is called on this node. Until then it will have a temporary node number.

Specified by:
createNode in interface NodeManager
Overrides:
createNode in class BasicNodeManager

getForwardRole

public java.lang.String getForwardRole()
Description copied from interface: RelationManager
Retrieves the role of the source to the destination

Specified by:
getForwardRole in interface RelationManager
Returns:
the role as a String

getReciprocalRole

public java.lang.String getReciprocalRole()
Description copied from interface: RelationManager
Retrieves the role of the destination to the source

Specified by:
getReciprocalRole in interface RelationManager
Returns:
the role as a String

getForwardGUIName

public java.lang.String getForwardGUIName()
Description copied from interface: RelationManager
Retrieves the gui name (prompt) of the role from source to destination

Specified by:
getForwardGUIName in interface RelationManager
Returns:
the name as a String

getReciprocalGUIName

public java.lang.String getReciprocalGUIName()
Description copied from interface: RelationManager
Retrieves the gui name (prompt) of the role from destination to source

Specified by:
getReciprocalGUIName in interface RelationManager
Returns:
the name as a String

getDirectionality

public int getDirectionality()
Description copied from interface: RelationManager
Retrieves the directionality for this type (the default assigned to a new relation).

Specified by:
getDirectionality in interface RelationManager
Returns:
one of the directionality constants

getSourceManager

public NodeManager getSourceManager()
Description copied from interface: RelationManager
Retrieves the NodeManager of node that can act as the source of a relation of this type.

Specified by:
getSourceManager in interface RelationManager
Returns:
the source NodeManager

getDestinationManager

public NodeManager getDestinationManager()
Description copied from interface: RelationManager
Retrieves the type of node that can act as the destination of a relation of this type.

Specified by:
getDestinationManager in interface RelationManager
Returns:
the destination NodeManager

createRelation

public Relation createRelation(Node sourceNode,
                               RelationManager relationManager)
Description copied from interface: 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 RelationManager
Overrides:
createRelation in class BasicNode

createRelation

public Relation createRelation(Node sourceNode,
                               Node destinationNode)
Description copied from interface: RelationManager
Adds a relation from this type.

Specified by:
createRelation in interface RelationManager
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)
Description copied from interface: RelationManager
Retrieves all the relations of this type from a given node.

Specified by:
getRelations in interface RelationManager
Parameters:
node - the node from which to give the relations
Returns:
a list of relations

mayCreateRelation

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

Specified by:
mayCreateRelation in interface RelationManager
Returns:
Check if the current user may create a new relation of this type between the specified nodes.


MMBase build 1.7.1.20041002