| org.mmbase.bridge.NodeManager
All known Subclasses: org.mmbase.bridge.util.AbstractNodeManager, org.mmbase.bridge.implementation.BasicNodeManager, org.mmbase.bridge.implementation.VirtualNodeManager,
NodeManager | public interface NodeManager extends Node(Code) | | This interface 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).
author: Rob Vermeulen author: Pierre van Rooden version: $Id: NodeManager.java,v 1.43 2007/12/18 12:44:57 michiel Exp $ |
Method Summary | |
public FieldList | createFieldList() | public Node | createNode() Creates a new node. | public NodeList | createNodeList() | public NodeQuery | createQuery() Creates a query for this NodeNanager. | public RelationList | createRelationList() | public RelationManagerList | getAllowedRelations() Retrieve all relation managers that can be used to create relations for objects of this nodemanager. | public RelationManagerList | getAllowedRelations(String nodeManager, String role, 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. | public RelationManagerList | getAllowedRelations(NodeManager nodeManager, String role, 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. | public Cloud | getCloud() Returns the cloud to which this manager belongs. | public NodeManagerList | getDescendants() | public String | getDescription() Returns the description of this node manager. | public String | getDescription(Locale locale) Returns the description of this node manager in a specified language. | public Field | getField(String name) Returns the field with the specified name. | public FieldList | getFields() Returns a list of all fields defined for this node manager. | public FieldList | getFields(int order) Retrieve a subset of field types of this NodeManager, depending on a given order. | public String | getGUIName() Returns the descriptive name of this node manager. | public String | getGUIName(int plurality) Returns the descriptive name of this node manager. | public String | getGUIName(int plurality, Locale locale) Returns the descriptive name of this node manager ina a specified language. | public String | getInfo(String command) Retrieve info from a node manager based on a command string.
Similar to the $MOD command in SCAN.
Parameters: command - the info to obtain, i.e. | public String | getInfo(String command, ServletRequest req, ServletResponse resp) Retrieve info from a node manager based on a command string
Similar to the $MOD command in SCAN.
Parameters: command - the info to obtain, i.e. | public NodeList | getList(String constraints, String orderby, String directions) Returns a list of nodes belonging to this node manager. | public NodeList | getList(NodeQuery query) | public NodeList | getList(String command, Map parameters) Retrieve info (as a list of virtual nodes) from a node manager based on a command string.
Similar to the LIST command in SCAN.
The values retrieved are represented as fields of a virtual node, named following the fieldnames listed in the fields paramaters..
Parameters: command - the info to obtain, i.e. | public NodeList | getList(String command, Map parameters, ServletRequest req, ServletResponse resp) Retrieve info from a node manager based on a command string
Similar to the LIST command in SCAN.
The values retrieved are represented as fields of a virtual node, named following the fieldnames listed in the fields paramaters..
Parameters: command - the info to obtain, i.e. | public String | getName() Returns the name of this node manager. | public NodeManager | getParent() Retrieve the parent of this NodeManager (the Nodemanager that this nodemanager extends from)
the NodeManager's parent throws: NotFoundException - if no parent exists (i.e. | public Map<String, String> | getProperties() | public String | getProperty(String name) Retrieve a property of the node manager. | public boolean | hasField(String fieldName) Tests whether the field with the specified name exists in this nodemanager. | public boolean | mayCreateNode() Check if the current user may create a new node of this type. |
GUI_PLURAL | final public static int GUI_PLURAL(Code) | | |
GUI_SINGULAR | final public static int GUI_SINGULAR(Code) | | |
ORDER_CREATE | final public static int ORDER_CREATE(Code) | | A constant for use with
NodeManager.getFields(int) , meaning `all fields, in storage order (so
which are in storage'.
|
ORDER_EDIT | final public static int ORDER_EDIT(Code) | | A constant for use with
NodeManager.getFields(int) , meaning all fields which a user may want to
fill when creating or editing this node. That are normally all nodes without the `automatic'
ones like `number' and `otype'.
|
ORDER_LIST | final public static int ORDER_LIST(Code) | | A constant for use with
NodeManager.getFields(int) . When presenting a Node in some list overview
then less essential fields can be left out, to get a more concise presentation of the node.
|
ORDER_SEARCH | final public static int ORDER_SEARCH(Code) | | A constant for use with
NodeManager.getFields(int) On some fields, like binary fields (e.g. images) it makes no sense searching. These are left
out among the `search' fields.
|
createFieldList | public FieldList createFieldList()(Code) | | Returns a new, empty field list for this nodemanager
The empty list since: MMBase-1.8 |
createNode | public Node createNode()(Code) | | 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.
the new Node |
createNodeList | public NodeList createNodeList()(Code) | | Returns a new, empty node list for this nodemanager
The empty list since: MMBase-1.8 |
createQuery | public NodeQuery createQuery()(Code) | | Creates a query for this NodeNanager. The nodemanager is added as a step, and also all (non
byte array) fields are added. The query can be used by getList of Cloud.
You can not add steps to this NodeQuery.
query for this NodeNanager since: MMBase-1.7 See Also: NodeManager.getList(NodeQuery) See Also: Cloud.createNodeQuery |
createRelationList | public RelationList createRelationList()(Code) | | Returns a new, empty relation list for this nodemanager
The empty list since: MMBase-1.8 |
getAllowedRelations | public RelationManagerList getAllowedRelations()(Code) | | Retrieve all relation managers that can be used to create relations for objects of this nodemanager.
the relation manager list since: MMBase-1.6 |
getAllowedRelations | public RelationManagerList getAllowedRelations(String nodeManager, String role, String direction)(Code) | | 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.
Parameters: nodeManager - the name of the nodemanger with which to make a relation, can be null Parameters: role - the role with which to make a relation, can be null Parameters: direction - the search direction ("source", "destination", "both"), can be null the relation manager list since: MMBase-1.6 |
getAllowedRelations | public RelationManagerList getAllowedRelations(NodeManager nodeManager, String role, String direction)(Code) | | 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.
Parameters: nodeManager - the nodemanger with which to make a relation, can be null Parameters: role - the role with which to make a relation, can be null Parameters: direction - the search direction ("source", "destination", "both"), can be null the relation manager list since: MMBase-1.6 |
getCloud | public Cloud getCloud()(Code) | | Returns the cloud to which this manager belongs.
the cloud to which this manager belongs |
getDescendants | public NodeManagerList getDescendants()(Code) | | Retrieve a list of descendant nodemanagers (the nodemanagers that - possibly indirectly - extend from this nodemanager)
a list of NodeManagers since: MMBase-1.7 |
getDescription | public String getDescription()(Code) | | Returns the description of this node manager.
the description of this node manager |
getDescription | public String getDescription(Locale locale)(Code) | | Returns the description of this node manager in a specified language.
Parameters: locale - the locale that determines the language for the description the description of this node manager since: MMBase-1.7 |
getField | public Field getField(String name) throws NotFoundException(Code) | | Returns the field with the specified name.
Parameters: name - the name of the field to be returned the field with the requested name throws: NotFoundException - is the field does not exist |
getFields | public FieldList getFields()(Code) | | Returns a list of all fields defined for this node manager.
a list of all fields defined for this node manager |
getFields | public FieldList getFields(int order)(Code) | | Retrieve a subset of field types of this NodeManager, depending on a given order. The order
is a integer constant which symbolizes `none', `create', `edit', `list' or `search'. These last three one may recognize
from builder XML's. `none' means `all fields'. The actual integer contants are present as the
ORDER contants in this interface.
Parameters: order - the order in which to list the fields a FieldList object, which is a specialized List of Field objects. See Also: NodeManager.ORDER_NONE See Also: NodeManager.ORDER_CREATE See Also: NodeManager.ORDER_EDIT See Also: NodeManager.ORDER_LIST See Also: NodeManager.ORDER_SEARCH |
getGUIName | public String getGUIName()(Code) | | Returns the descriptive name of this node manager. This name will be in
the language of the current cloud (defined in cloud.getLocale()).
the descriptive name of this node manager |
getGUIName | public String getGUIName(int plurality)(Code) | | Returns the descriptive name of this node manager. This name will be in
the language of the current cloud (defined in cloud.getLocale()).
since: MMBase-1.6 Parameters: plurality - the plurality (number of objects) for which to return a description(NodeManager.GUI_SINGULAR or NodeManager.GUI_PLURAL) the descriptive name of this node manager |
getGUIName | public String getGUIName(int plurality, Locale locale)(Code) | | Returns the descriptive name of this node manager ina a specified language.
since: MMBase-1.6 Parameters: plurality - the plurality (number of objects) for which to return a description(NodeManager.GUI_SINGULAR or NodeManager.GUI_PLURAL) Parameters: locale - the locale that determines the language for the GUI name the descriptive name of this node manager |
getInfo | public String getInfo(String command)(Code) | | Retrieve info from a node manager based on a command string.
Similar to the $MOD command in SCAN.
Parameters: command - the info to obtain, i.e. "USER-OS". info from a node manager |
getInfo | public String getInfo(String command, ServletRequest req, ServletResponse resp)(Code) | | Retrieve info from a node manager based on a command string
Similar to the $MOD command in SCAN.
Parameters: command - the info to obtain, i.e. "USER-OS". Parameters: req - the Request item to use for obtaining user information. For backward compatibility. Parameters: resp - the Response item to use for redirecting users. For backward compatibility. info from a node manager |
getList | public NodeList getList(String constraints, String orderby, String directions)(Code) | | Returns a list of nodes belonging to this node manager. Constraints can
be given to exclude nodes from the returned list. These constraints
follow the syntax of the SQL where clause. It's a good practice to use
uppercase letters for the operators and lowercase letters for the
fieldnames. Example constraints are:
"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
Jim Hoffman's introduction to Structured Query Language.
Parameters: constraints - Constraints to prevent nodes from beingincluded in the resulting list which would normallyby included or null if no constraintsshould be applied . Parameters: orderby - A comma separated list of field names on which thereturned list should be sorted or null if the order of the returned virtual nodes doesn'tmatter. Parameters: directions - A comma separated list of values indicating wetherto sort up (ascending) or down (descending) on thecorresponding field in the orderby parameter or null if sorting on allfields should be up.The value DOWN (case insensitive) indicatesthat sorting on the corresponding field should bedown, all other values (including theempty value) indicate that sorting on thecorresponding field should be up.If the number of values found in this parameter areless than the number of fields in theorderby parameter, all fields thatdon't have a corresponding direction value aresorted according to the last specified directionvalue. a list of nodes belonging to this node manager |
getList | public NodeList getList(NodeQuery query)(Code) | | Executes a query and returns the result as nodes of this NodeManager (or of extensions)
Parameters: query - query to execute list of nodes since: MMBase-1.7 |
getList | public NodeList getList(String command, Map parameters)(Code) | | Retrieve info (as a list of virtual nodes) from a node manager based on a command string.
Similar to the LIST command in SCAN.
The values retrieved are represented as fields of a virtual node, named following the fieldnames listed in the fields paramaters..
Parameters: command - the info to obtain, i.e. "USER-OS". Parameters: parameters - a hashtable containing the named parameters of the list. info from a node manager (as a list of virtual nodes) |
getList | public NodeList getList(String command, Map parameters, ServletRequest req, ServletResponse resp)(Code) | | Retrieve info from a node manager based on a command string
Similar to the LIST command in SCAN.
The values retrieved are represented as fields of a virtual node, named following the fieldnames listed in the fields paramaters..
Parameters: command - the info to obtain, i.e. "USER-OS". Parameters: parameters - a hashtable containing the named parameters of the list. Parameters: req - the Request item to use for obtaining user information. For backward compatibility. Parameters: resp - the Response item to use for redirecting users. For backward compatibility. info from a node manager (as a list of virtual nodes) |
getName | public String getName()(Code) | | Returns the name of this node manager. This name is a unique name.
the name of this node manager. |
getParent | public NodeManager getParent() throws NotFoundException(Code) | | Retrieve the parent of this NodeManager (the Nodemanager that this nodemanager extends from)
the NodeManager's parent throws: NotFoundException - if no parent exists (i.e. this nodeManager is "object") |
getProperties | public Map<String, String> getProperties()(Code) | | Retrieve a copy of the node manager's properties
a map of node manager properties since: MMBase-1.7 |
getProperty | public String getProperty(String name)(Code) | | Retrieve a property of the node manager.
Parameters: name - the name of the property the property value (null if not given) since: MMBase-1.7 |
hasField | public boolean hasField(String fieldName)(Code) | | Tests whether the field with the specified name exists in this nodemanager.
since: MMBase-1.6 Parameters: fieldName - the name of the field to be returned true if the field with the requested name exists |
mayCreateNode | public boolean mayCreateNode()(Code) | | Check if the current user may create a new node of this type.
Check if the current user may create a new node of this type. |
|
|