org.mmbase.bridge.implementation
Class BasicRelationManager

Package class diagram package BasicRelationManager
java.lang.Object
  extended by org.mmbase.bridge.util.AbstractNode
      extended by org.mmbase.bridge.implementation.BasicNode
          extended by org.mmbase.bridge.implementation.BasicNodeManager
              extended by org.mmbase.bridge.implementation.BasicRelationManager
All Implemented Interfaces:
Comparable<Node>, Node, NodeManager, RelationManager, SizeMeasurable

public class BasicRelationManager
extends BasicNodeManager
implements RelationManager

Version:
$Id: BasicRelationManager.java 40572 2010-01-14 15:27:41Z michiel $
Author:
Rob Vermeulen, Pierre van Rooden
Javadoc:

Nested Class Summary
 
Nested classes/interfaces inherited from class org.mmbase.bridge.implementation.BasicNodeManager
BasicNodeManager.NodeAndId
 
Field Summary
(package private)  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, originalNoderef, 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
 
Fields inherited from interface org.mmbase.bridge.Node
CLOUD_COMMITNODE_KEY
 
Constructor Summary
BasicRelationManager(MMObjectNode node, BasicCloud cloud)
          Creates a new instance of Relation manager.
BasicRelationManager(MMObjectNode node, BasicCloud cloud, int nodeId)
          Creates a new Relation manager (for insert).
 
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)
           
(package private)  int getBuilder()
           
 NodeManager getDestinationManager()
           
 int getDirectionality()
           
 String getForwardGUIName()
           
 String getForwardRole()
           
 String getReciprocalGUIName()
           
 String getReciprocalRole()
           
 RelationList getRelations(Node node)
           
 NodeManager getSourceManager()
           
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()
           
 boolean mayCreateRelation(Node sourceNode, Node destinationNode)
           
protected  void setNodeManager(MMObjectNode node)
          Set nodemanager for node
 RelationManager toRelationManager()
           
 String toString()
           
 
Methods inherited from class org.mmbase.bridge.implementation.BasicNodeManager
commit, createFieldList, createMMObjectNode, createNode, createNodeList, createQuery, createRelationList, delete, finalize, getAllowedRelations, getAllowedRelations, getAllowedRelations, getDescendants, getDescription, getDescription, getField, getFields, getFields, getFieldTypes, getFunctions, getGUIName, getGUIName, getGUIName, getInfo, getInfo, getList, getList, getList, getList, getMMObjectBuilder, getName, getNodeFunction, getParent, getProperties, getProperty, hasField, isNodeManager, mayCreateNode, setDefaultsWithCloud, sync, toNodeManager
 
Methods inherited from class org.mmbase.bridge.implementation.BasicNode
cancel, checkAccount, checkCommit, checkCreate, checkDelete, checkWrite, countRelatedNodes, countRelatedNodes, createAlias, createFunctionValue, createParameters, deleteAlias, deleteRelations, getAliases, getBooleanValue, getByteSize, getByteSize, getByteValue, getChanged, getCloud, getContext, getDateValue, getDoubleValue, getFloatValue, getInputStreamValue, getIntValue, getListValue, getLongValue, getNode, getNodeManager, getNodeValue, getNumber, getPossibleContexts, getRelatedNodes, getRelatedNodes, getRelations, getRelations, getSize, getStringValue, getValueWithoutProcess, getXMLValue, hasRelations, init, invalidateNode, isChanged, isChanged, isNew, isNull, mayChangeContext, mayDelete, mayWrite, setContext, setNode, setNodeManager, setSize, setValueWithoutChecks, toNodeNumber
 
Methods inherited from class org.mmbase.bridge.util.AbstractNode
compareTo, countRelations, countRelations, createRelation, delete, deleteRelations, equals, getDecimalValue, getFieldValue, getFieldValue, getFunction, getFunctionMap, getFunctionValue, getObjectValue, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelations, getRelations, getRelations, getValue, getXMLValue, hashCode, isRelation, processNull, setBooleanValue, setByteValue, setDateValue, setDecimalValue, 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, 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, mayChangeContext, mayDelete, mayWrite, setBooleanValue, setByteValue, setContext, setDateValue, setDecimalValue, setDoubleValue, setFloatValue, setInputStreamValue, setIntValue, setListValue, setLongValue, setNodeManager, setNodeValue, setObjectValue, setStringValue, setValue, setValueWithoutProcess, setXMLValue, toNodeManager, toRelation, validate
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

relDefNode

MMObjectNode relDefNode
Constructor Detail

BasicRelationManager

BasicRelationManager(MMObjectNode node,
                     BasicCloud cloud,
                     int nodeId)
Creates a new Relation manager (for insert). The type of manager (a strictly constrained manager or a role manager) is dependend on the type of the passed node (from either the reldef of typerel builder).

Parameters:
node - the node on which to base the relation manager
cloud - the cloud for which to create the manager
id - the id of the node in the temporary cloud

BasicRelationManager

BasicRelationManager(MMObjectNode node,
                     BasicCloud cloud)
Creates a new instance of Relation manager. The type of manager (a strictly constrained manager or a role manager) is dependend on the type of the passed node (from either the reldef of typerel builder).

Parameters:
node - the node on which to base the relation manager
cloud - the cloud for which to create the manager
Method Detail

isRelationManager

public final boolean isRelationManager()
Specified by:
isRelationManager in interface Node
Overrides:
isRelationManager in class AbstractNode

toRelationManager

public final RelationManager toRelationManager()
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)
Description copied from class: BasicNode
Set nodemanager for node

Overrides:
setNodeManager in class BasicNodeManager
Parameters:
node - node to derive nodemanager from.

getForwardRole

public String getForwardRole()
Specified by:
getForwardRole in interface RelationManager

getReciprocalRole

public String getReciprocalRole()
Specified by:
getReciprocalRole in interface RelationManager

getForwardGUIName

public String getForwardGUIName()
Specified by:
getForwardGUIName in interface RelationManager

getReciprocalGUIName

public String getReciprocalGUIName()
Specified by:
getReciprocalGUIName in interface RelationManager

getDirectionality

public int getDirectionality()
Specified by:
getDirectionality in interface RelationManager

getBuilder

int getBuilder()

getSourceManager

public NodeManager getSourceManager()
Specified by:
getSourceManager in interface RelationManager

getDestinationManager

public NodeManager getDestinationManager()
Specified by:
getDestinationManager in interface RelationManager

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)
Specified by:
createRelation in interface RelationManager

getRelations

public RelationList getRelations(Node node)
Specified by:
getRelations in interface RelationManager

mayCreateRelation

public boolean mayCreateRelation(Node sourceNode,
                                 Node destinationNode)
Specified by:
mayCreateRelation in interface RelationManager

toString

public String toString()
Specified by:
toString in interface Node
Overrides:
toString in class BasicNode


MMBase2 Core 2.0-SNAPSHOT - 2013-03-30T06:36