org.mmbase.bridge.implementation
Class BasicRelationManager

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

public class BasicRelationManager
extends BasicNodeManager
implements RelationManager

Version:
$Id: BasicRelationManager.java,v 1.34 2005/12/27 22:14:14 michiel Exp $
Author:
Rob Vermeulen, Pierre van Rooden
Warning: No Java Documentation Available.

Nested Class Summary
 
Nested classes inherited from class org.mmbase.bridge.implementation.BasicNodeManager
BasicNodeManager.NodeAndId
 
Field Summary
 MMObjectNode relDefNode
           
 
Fields inherited from class org.mmbase.bridge.implementation.BasicNodeManager
builder, fieldTypes
 
Fields inherited from class org.mmbase.bridge.implementation.BasicNode
cloud, nodeManager, noderef
 
Fields inherited from class org.mmbase.bridge.util.AbstractNode
ACTION_COMMIT, ACTION_CREATE, ACTION_DELETE, ACTION_EDIT
 
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
protected  BasicNode createBasicNode()
          BasicNodeManager is garantueed to return BasicNode's.
protected  BasicRelation createBasicRelation()
          BasicRelationManager is garantueed to create BasicRelations.
 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).
 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.
protected  void initManager()
          Initializes the NodeManager: determines the MMObjectBuilder from the passed node (reldef or typerel), and fills temporary variables to maintain status.
 boolean isRelationManager()
          Determine whether this Node is a RelationManager.
 boolean mayCreateRelation(Node sourceNode, Node destinationNode)
          Check if the current user may create a new relation of this type between the specified nodes.
protected  void setNodeManager(MMObjectNode node)
           
 RelationManager toRelationManager()
          Returns this as a RelationManager.
 
Methods inherited from class org.mmbase.bridge.implementation.BasicNodeManager
commit, createFieldList, createMMObjectNode, createNode, createNodeList, createQuery, createRelationList, delete, getAllowedRelations, getAllowedRelations, getAllowedRelations, getDescendants, getDescription, getDescription, getField, getFields, getFields, getFieldTypes, getFunctions, getGUIName, getGUIName, getGUIName, getInfo, getInfo, getList, getList, getList, getList, getName, getNodeFunction, getParent, getProperties, getProperty, hasField, isNodeManager, mayCreateNode, sync, toNodeManager
 
Methods inherited from class org.mmbase.bridge.implementation.BasicNode
cancel, countRelatedNodes, countRelatedNodes, createAlias, createFunctionValue, createParameters, deleteAlias, deleteRelations, edit, finalize, getAliases, getBooleanValue, getByteSize, getByteSize, getByteValue, getChanged, getCloud, getContext, getDateValue, getDoubleValue, getFloatValue, getInputStreamValue, getIntValue, getListValue, getLongValue, getNode, getNodeManager, getNodeValue, getNumber, getPossibleContexts, getRelatedNodes, getRelations, getRelations, getSize, getStringValue, getValueWithoutProcess, getXMLValue, hashCode, hasRelations, init, invalidateNode, isChanged, isChanged, isNew, isNull, mayChangeContext, mayDelete, mayWrite, setContext, setNode, setSize, setValueWithoutChecks, toNodeNumber, toString
 
Methods inherited from class org.mmbase.bridge.util.AbstractNode
compareTo, countRelations, countRelations, createRelation, delete, deleteRelations, equals, getFieldValue, getFieldValue, getFunction, getFunctionValue, getObjectValue, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelations, getRelations, getRelations, getValue, getXMLValue, isRelation, processCommit, setBooleanValue, setByteValue, setDateValue, setDoubleValue, setFloatValue, setInputStreamValue, setIntValue, setListValue, setLongValue, setNodeValue, setObjectValue, setStringValue, setValue, setValueWithoutProcess, setXMLValue, toRelation, validate
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mmbase.bridge.RelationManager
createRelation
 
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, 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, mayChangeContext, mayDelete, mayWrite, setBooleanValue, setByteValue, setContext, setDateValue, setDoubleValue, setFloatValue, setInputStreamValue, setIntValue, setListValue, setLongValue, setNodeValue, setObjectValue, setStringValue, setValue, setValueWithoutProcess, setXMLValue, toNodeManager, toRelation, toString, validate
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

relDefNode

public MMObjectNode relDefNode
Method Detail

isRelationManager

public final boolean isRelationManager()
Description copied from interface: Node
Determine whether this Node is a RelationManager.

Specified by:
isRelationManager in interface Node
Overrides:
isRelationManager in class AbstractNode

toRelationManager

public final RelationManager toRelationManager()
Description copied from interface: Node
Returns this as a RelationManager.

Specified by:
toRelationManager in interface Node
Overrides:
toRelationManager in class AbstractNode

initManager

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

Overrides:
initManager in class BasicNodeManager

setNodeManager

protected void setNodeManager(MMObjectNode node)
Overrides:
setNodeManager in class BasicNodeManager

getForwardRole

public 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 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 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 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

createBasicNode

protected final BasicNode createBasicNode()
Description copied from class: BasicNodeManager
BasicNodeManager is garantueed to return BasicNode's. So extendsion must override this, and not BasicNodeManager.createNode()

Overrides:
createBasicNode in class BasicNodeManager

createBasicRelation

protected BasicRelation createBasicRelation()
BasicRelationManager is garantueed to create BasicRelations. Extension therefore most override this and not createBasicNode().

Since:
MMBase-1.8

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
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 build 1.8.1.20060716