|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.mmbase.bridge.implementation.BasicNode
|
+--org.mmbase.bridge.implementation.BasicNodeManager
This class represents a node's type information object - what used to be the 'builder'. It contains all the field and attribuut information, as well as GUI data for editors and some information on deribed and deriving types. It also contains some maintenance code - code to create new nodes, en code to query objects belonging to the same manager. Since node types are normally maintained through use of config files (and not in the database), as wel as for security issues, the data of a nodetype cannot be changed except through the use of an administration module (which is why we do not include setXXX methods here).
| Field Summary | |
protected MMObjectBuilder |
builder
|
protected java.util.Map |
fieldTypes
|
| 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.NodeManager |
ORDER_CREATE, ORDER_EDIT, ORDER_LIST, ORDER_NONE, ORDER_SEARCH |
| Method Summary | |
void |
commit()
Commit the node to the database. |
Node |
createNode()
Creates a new node. |
void |
delete(boolean deleteRelations)
Removes the Node. |
RelationManagerList |
getAllowedRelations()
Retrieve all relation managers that can be used to create relations for objects of this nodemanager. |
RelationManagerList |
getAllowedRelations(NodeManager nodeManager,
java.lang.String role,
java.lang.String direction)
Retrieve all relation managers that can be used to create relations for objects from this nodemanager, to the specified manager, using the specified role and direction. |
RelationManagerList |
getAllowedRelations(java.lang.String nodeManager,
java.lang.String role,
java.lang.String direction)
Retrieve all relation managers that can be used to create relations for objects from this nodemanager, to the specified manager, using the specified role and direction. |
java.lang.String |
getDescription()
Returns the description of this node manager. |
Field |
getField(java.lang.String fieldName)
Returns the field with the specified name. |
FieldList |
getFields()
Returns a list of all fields defined for this node manager. |
FieldList |
getFields(int order)
Retrieve a subset of field types of this NodeManager, depending on a given order. |
java.lang.String |
getGUIName()
Returns the descriptive name of this node manager. |
java.lang.String |
getGUIName(int plurality)
Returns the descriptive name of this node manager. |
java.lang.String |
getInfo(java.lang.String command)
Retrieve info from a node manager based on a command string. |
java.lang.String |
getInfo(java.lang.String command,
javax.servlet.ServletRequest req,
javax.servlet.ServletResponse resp)
Retrieve info from a node manager based on a command string Similar to the $MOD command in SCAN. |
NodeList |
getList(java.lang.String command,
java.util.Map parameters)
Retrieve info (as a list of virtual nodes) from a node manager based on a command string. |
NodeList |
getList(java.lang.String command,
java.util.Map parameters,
javax.servlet.ServletRequest req,
javax.servlet.ServletResponse resp)
Retrieve info from a node manager based on a command string Similar to the LIST command in SCAN. |
NodeList |
getList(java.lang.String constraints,
java.lang.String orderby,
java.lang.String directions)
Returns a list of nodes belonging to this node manager. |
java.lang.String |
getName()
Returns the name of this node manager. |
NodeManager |
getParent()
Retrieve the parent of this NodeManager (the Nodemanager that this nodemanager extends from) |
boolean |
hasField(java.lang.String fieldName)
Tests whether the field with the specified name exists in this nodemanager. |
protected void |
initManager()
Initializes the NodeManager: determines the MMObjectBuilder if it was not already known, and fills the fields list. |
boolean |
mayCreateNode()
Check if the current user may create a new node of this type. |
| Methods inherited from class java.lang.Object |
clone, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.mmbase.bridge.NodeManager |
getCloud |
| Methods inherited from interface java.lang.Comparable |
compareTo |
| Field Detail |
protected MMObjectBuilder builder
protected java.util.Map fieldTypes
| Method Detail |
protected void initManager()
public Node createNode()
NodeManagercreateNode in interface NodeManagerorg.mmbase.bridge.NodeManagerNode
public NodeManager getParent()
throws NotFoundException
NodeManagergetParent in interface NodeManagerorg.mmbase.bridge.NodeManagerNotFoundException - if no parent exists (i.e. this nodeManager is "object")public java.lang.String getName()
NodeManagergetName in interface NodeManagerorg.mmbase.bridge.NodeManagerpublic java.lang.String getGUIName()
NodeManagergetGUIName in interface NodeManagerorg.mmbase.bridge.NodeManagerpublic java.lang.String getGUIName(int plurality)
NodeManagergetGUIName in interface NodeManagerorg.mmbase.bridge.NodeManagerplurality - the plurality (number of objects) for which to return a description
(1 = singular, 0,2 or greater = plural)public java.lang.String getDescription()
NodeManagergetDescription in interface NodeManagerorg.mmbase.bridge.NodeManagerpublic FieldList getFields()
NodeManagergetFields in interface NodeManagerorg.mmbase.bridge.NodeManagerpublic FieldList getFields(int order)
NodeManagergetFields in interface NodeManagerorg.mmbase.bridge.NodeManagerorder - the order in which to list the fieldsList of FieldType objects
public Field getField(java.lang.String fieldName)
throws NotFoundException
NodeManagergetField in interface NodeManagerorg.mmbase.bridge.NodeManagername - the name of the field to be returnedNotFoundException - is the field does not existpublic boolean hasField(java.lang.String fieldName)
NodeManagerhasField in interface NodeManagerorg.mmbase.bridge.NodeManagername - the name of the field to be returnedtrue if the field with the requested name exists
public NodeList getList(java.lang.String constraints,
java.lang.String orderby,
java.lang.String directions)
NodeManager
"number = 100" (!=, <, >, <= and >= can also be used)
"name = 'admin'",
"email IS NULL" (indicating the email field is empty)
"email LIKE '%.org'" (indication the email should end with .org)
"number BETWEEN 99 AND 101"
"name IN ('admin', 'anonymous')"
The NOT operator can be used to get the opposite result like:
"NOT (number = 100)"
"NOT (name = 'admin')",
"email IS NOT NULL"
"email NOT LIKE '%.org'" (indication the email should not end with .org)
"number NOT BETWEEN 99 AND 101"
"name NOT IN ('admin', 'anonymous')"
Some special functions (not part of standard SQL, but most databases
support them) can be used like:
"LOWER(name) = 'admin'" (to also allow 'Admin' to be selected) "LENGTH(name) > 5" (to only select names longer then 5 characters)Constraints can be linked together using AND and OR:
"((number=100) OR (name='admin') AND email LIKE '%.org')"The single quote can be escaped using it twice for every single occurence:
"name='aaa''bbb'" (if we want to find the string aaa'bbb)For more info consult a SQL tutorial like this one.
getList in interface NodeManagerorg.mmbase.bridge.NodeManagerconstraints - Contraints to prevent nodes from being
included in the resulting list which would normally
by included or null if no contraints
should be applied .orderby - A comma separated list of field names on which the
returned list should be sorted or null
if the order of the returned virtual nodes doesn't
matter.directions - A comma separated list of values indicating wether
to sort up (ascending) or down (descending) on the
corresponding field in the orderby
parameter or null if sorting on all
fields should be up.
The value DOWN (case insensitive) indicates
that sorting on the corresponding field should be
down, all other values (including the
empty value) indicate that sorting on the
corresponding field should be up.
If the number of values found in this parameter are
less than the number of fields in the
orderby parameter, all fields that
don't have a corresponding direction value are
sorted according to the last specified direction
value.public RelationManagerList getAllowedRelations()
NodeManagergetAllowedRelations in interface NodeManagerorg.mmbase.bridge.NodeManager
public RelationManagerList getAllowedRelations(java.lang.String nodeManager,
java.lang.String role,
java.lang.String direction)
NodeManagergetAllowedRelations in interface NodeManagerorg.mmbase.bridge.NodeManagernodeManager - the name of the nodemanger with which to make a relation, can be nullrole - the role with which to make a relation, can be nulldirection - the search direction ("source", "destination", "both"), can be null
public RelationManagerList getAllowedRelations(NodeManager nodeManager,
java.lang.String role,
java.lang.String direction)
NodeManagergetAllowedRelations in interface NodeManagerorg.mmbase.bridge.NodeManagernodeManager - the nodemanger with which to make a relation, can be nullrole - the role with which to make a relation, can be nulldirection - the search direction ("source", "destination", "both"), can be nullpublic java.lang.String getInfo(java.lang.String command)
NodeManagergetInfo in interface NodeManagerorg.mmbase.bridge.NodeManagercommand - the info to obtain, i.e. "USER-OS".
public java.lang.String getInfo(java.lang.String command,
javax.servlet.ServletRequest req,
javax.servlet.ServletResponse resp)
NodeManagergetInfo in interface NodeManagerorg.mmbase.bridge.NodeManagercommand - the info to obtain, i.e. "USER-OS".req - the Request item to use for obtaining user information. For backward compatibility.resp - the Response item to use for redirecting users. For backward compatibility.
public NodeList getList(java.lang.String command,
java.util.Map parameters)
NodeManagergetList in interface NodeManagerorg.mmbase.bridge.NodeManagercommand - the info to obtain, i.e. "USER-OS".parameters - a hashtable containing the named parameters of the list.
public NodeList getList(java.lang.String command,
java.util.Map parameters,
javax.servlet.ServletRequest req,
javax.servlet.ServletResponse resp)
NodeManagergetList in interface NodeManagerorg.mmbase.bridge.NodeManagercommand - the info to obtain, i.e. "USER-OS".parameters - a hashtable containing the named parameters of the list.req - the Request item to use for obtaining user information. For backward compatibility.resp - the Response item to use for redirecting users. For backward compatibility.public boolean mayCreateNode()
NodeManagermayCreateNode in interface NodeManagerorg.mmbase.bridge.NodeManagerpublic void commit()
Nodecommit in interface Nodecommit in class BasicNodepublic void delete(boolean deleteRelations)
Nodedelete in interface Nodedelete in class BasicNodeorg.mmbase.bridge.NodedeleteRelations - a boolean. If true, then first all
existing relations with this node will be removed.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||