|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.bridge.util.AbstractNode
org.mmbase.bridge.util.MapNode
A bridge Node based on a Map. It can come in handy sometimes to be able to present any Map as an MMBase Node. E.g. because then it can be accessed in MMBase taglib using mm:field tags.
| Field Summary | |
protected NodeManager |
nodeManager
This is normally, but not always, a VirtualBuilder. |
protected Map |
originalValues
|
protected Map |
sizes
|
protected Map |
values
|
| Fields inherited from class org.mmbase.bridge.util.AbstractNode |
ACTION_COMMIT, ACTION_CREATE, ACTION_DELETE, ACTION_EDIT |
| Constructor Summary | |
MapNode(Map v)
This allows you to create a Node object even without having a Cloud object. |
|
MapNode(Map v,
Cloud cloud)
A node with a 'virtual' nodemanager will be constructed. |
|
MapNode(Map v,
NodeManager nm)
This constructor explicitely specifies the node manager of the Node. |
|
| Method Summary | |
void |
cancel()
Cancel changes to a node This fails if the current node is not in edit mode. |
void |
commit()
Commit the node to the database. |
int |
countRelatedNodes(NodeManager otherNodeManager,
String role,
String direction)
|
int |
countRelatedNodes(String type)
Returns the number of related nodes that have a specific node manager. |
void |
createAlias(String aliasName)
Create an alias for this node. |
Relation |
createRelation(Node destinationNode,
RelationManager relationManager)
Adds a relation between this node and a specified node to the cloud. |
protected static NodeManager |
createVirtualNodeManager(Cloud cloud,
Map map)
|
void |
delete(boolean deleteRelations)
Removes the Node. |
void |
deleteAlias(String aliasName)
Delete an alias for this node. |
void |
deleteRelations(String type)
Removes all relation nodes with a certain relation manager that are attached to this node. |
protected void |
edit(int i)
|
StringList |
getAliases()
Returns all aliases for this node. |
Cloud |
getCloud()
Returns the cloud this node belongs to. |
String |
getContext()
Get the security context of the current Node |
Collection |
getFunctions()
Returns all the Function objects of this Node |
protected Function |
getNodeFunction(String functionName)
|
NodeManager |
getNodeManager()
Returns the node manager for this node. |
int |
getNumber()
Returns the unique number for this node. |
StringList |
getPossibleContexts()
Contacts the security implementation to find out to which other possible contexts the context of this node may be set. |
NodeList |
getRelatedNodes(NodeManager nodeManager,
String role,
String searchDir)
Returns all related nodes that have a specific node manager and role. |
RelationList |
getRelations(String role,
NodeManager nodeManager,
String searchDir)
|
RelationList |
getRelations(String role,
String nodeManager)
Returns all relation nodes attached to this node that have a specific role, or refer a node from a specific nodemanager |
long |
getSize(String fieldName)
Returns the 'size' (e.g. |
Object |
getValueWithoutProcess(String fieldName)
Like getObjectValue, but skips any processing that MMBase would normally perform on a field. |
boolean |
hasRelations()
Checks whether this node has any relations. |
boolean |
isChanged()
Whether field values were changed since the last commit. |
boolean |
isChanged(String fieldName)
Whether a certain field's value was changed since the last commit. |
boolean |
isNew()
Whether this Node is new (not yet commited). |
boolean |
isNull(String fieldName)
Whether the value for the speficied field is null. |
boolean |
mayChangeContext()
Check context-change rights on this node. |
boolean |
mayDelete()
Check delete rights on this node. |
boolean |
mayWrite()
Check write rights on this node. |
void |
setContext(String context)
Sets the security context of this Node (AKA the 'owner' field) |
protected void |
setSize(String fieldName,
long size)
|
void |
setValueWithoutChecks(String fieldName,
Object value)
|
void |
setValueWithoutProcess(String fieldName,
Object value)
Like setValue, but skips any processing that MMBase would normally perform on a field. |
String |
toString()
Converts the node to a string |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.lang.Comparable |
compareTo |
| Field Detail |
protected final NodeManager nodeManager
protected final Map values
protected final Map sizes
protected final Map originalValues
| Constructor Detail |
public MapNode(Map v,
NodeManager nm)
public MapNode(Map v,
Cloud cloud)
public MapNode(Map v)
| Method Detail |
protected static NodeManager createVirtualNodeManager(Cloud cloud,
Map map)
public Cloud getCloud()
Node
getCloud in interface Nodepublic NodeManager getNodeManager()
Node
getNodeManager in interface Nodepublic int getNumber()
Node
getNumber in interface NodegetNumber in class AbstractNodepublic boolean isNew()
Node
isNew in interface NodeisNew in class AbstractNodepublic boolean isChanged(String fieldName)
Node
isChanged in interface NodeisChanged in class AbstractNodepublic boolean isChanged()
Node
isChanged in interface NodeisChanged in class AbstractNodeprotected void edit(int i)
edit in class AbstractNodepublic Object getValueWithoutProcess(String fieldName)
Node
getValueWithoutProcess in interface NodefieldName - name of field
public void setValueWithoutProcess(String fieldName,
Object value)
Node
setValueWithoutProcess in interface NodesetValueWithoutProcess in class AbstractNodefieldName - name of fieldvalue - new value of the field
public void setValueWithoutChecks(String fieldName,
Object value)
setValueWithoutChecks in class AbstractNodepublic boolean isNull(String fieldName)
Nodenull. This avoids acquiring the
complete value if you only want to check if for emptyness.
isNull in interface NodeisNull in class AbstractNode
protected void setSize(String fieldName,
long size)
setSize in class AbstractNodepublic long getSize(String fieldName)
Node
getSize in interface Nodepublic void commit()
Node
commit in interface Nodecommit in class AbstractNodepublic void cancel()
Node
cancel in interface Nodecancel in class AbstractNodepublic void delete(boolean deleteRelations)
Node
delete in interface Nodedelete in class AbstractNodepublic String toString()
Node
toString in interface Node
public void deleteRelations(String type)
throws NotFoundException
Node
deleteRelations in interface NodedeleteRelations in class AbstractNodeNotFoundException
public RelationList getRelations(String role,
NodeManager nodeManager,
String searchDir)
throws NotFoundException
getRelations in interface NodegetRelations in class AbstractNodeNotFoundException
public RelationList getRelations(String role,
String nodeManager)
throws NotFoundException
Node
getRelations in interface NodegetRelations in class AbstractNodeNotFoundExceptionpublic boolean hasRelations()
Node
hasRelations in interface NodehasRelations in class AbstractNode
public int countRelatedNodes(NodeManager otherNodeManager,
String role,
String direction)
countRelatedNodes in interface NodecountRelatedNodes in class AbstractNode
public NodeList getRelatedNodes(NodeManager nodeManager,
String role,
String searchDir)
Node
getRelatedNodes in interface NodegetRelatedNodes in class AbstractNodepublic int countRelatedNodes(String type)
Node
countRelatedNodes in interface NodecountRelatedNodes in class AbstractNodepublic StringList getAliases()
Node
getAliases in interface NodegetAliases in class AbstractNodepublic void createAlias(String aliasName)
Node
createAlias in interface NodecreateAlias in class AbstractNodepublic void deleteAlias(String aliasName)
Node
deleteAlias in interface NodedeleteAlias in class AbstractNode
public Relation createRelation(Node destinationNode,
RelationManager relationManager)
Node
createRelation in interface NodecreateRelation in class AbstractNodepublic void setContext(String context)
Node
setContext in interface NodesetContext in class AbstractNodepublic String getContext()
Node
getContext in interface NodegetContext in class AbstractNodepublic StringList getPossibleContexts()
Node
getPossibleContexts in interface NodegetPossibleContexts in class AbstractNodepublic boolean mayWrite()
Node
mayWrite in interface NodemayWrite in class AbstractNodepublic boolean mayDelete()
Node
mayDelete in interface NodemayDelete in class AbstractNodepublic boolean mayChangeContext()
Node
mayChangeContext in interface NodemayChangeContext in class AbstractNodepublic Collection getFunctions()
Node
getFunctions in interface NodeFunction objects.protected Function getNodeFunction(String functionName)
getNodeFunction in class AbstractNode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||