Java Doc for Node.java in  » Database-ORM » MMBase » org » mmbase » bridge » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » MMBase » org.mmbase.bridge 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.mmbase.bridge.Node

All known Subclasses:   org.mmbase.bridge.util.NodeWrapper,  org.mmbase.bridge.implementation.BasicNode,  org.mmbase.bridge.implementation.VirtualNode,  org.mmbase.bridge.util.MapNode,  org.mmbase.bridge.util.AbstractNode,
Node
public interface Node extends Comparable<Node>(Code)
Describes an object in the cloud.
author:
   Rob Vermeulen
author:
   Pierre van Rooden
version:
   $Id: Node.java,v 1.76 2008/02/16 22:13:53 nklasens Exp $




Method Summary
public  voidcancel()
     Cancel changes to a node This fails if the current node is not in edit mode.
public  voidcommit()
     Commit the node to the database.
public  intcountRelatedNodes(String nodeManager)
     Returns the number of related nodes that have a specific node manager.
public  intcountRelatedNodes(NodeManager otherNodeManager, String role, String searchDir)
    
public  intcountRelations()
     Returns the number of relations this node has with other nodes.
public  intcountRelations(String relationManager)
     Returns the number of relation nodes attached to this node that have a specific relation manager.
public  voidcreateAlias(String alias)
     Create an alias for this node.
public  ParameterscreateParameters(String functionName)
     Creates a parameter list for a function.
public  RelationcreateRelation(Node destinationNode, RelationManager relationManager)
     Adds a relation between this node and a specified node to the cloud.
public  voiddelete()
     Removes the Node.
public  voiddelete(boolean deleteRelations)
     Removes the Node.
Parameters:
  deleteRelations - a boolean.
public  voiddeleteAlias(String alias)
     Delete an alias for this node.
public  voiddeleteRelations()
     Removes all relation nodes attached to this node.
public  voiddeleteRelations(String relationManager)
     Removes all relation nodes with a certain relation manager that are attached to this node.
public  StringListgetAliases()
     Returns all aliases for this node.
public  booleangetBooleanValue(String fieldName)
     Returns the value of the specified field as a boolean. If the actual value is numeric, this call returns true if the value is a positive, non-zero, value.
public  byte[]getByteValue(String fieldName)
     Returns the value of the specified field as a byte array. This function returns either the value of a byte field, or the byte value of a string (converted using the default encoding, i.e.
public  Set<String>getChanged()
     A Set of Strings containing the names of all changed fields.
public  CloudgetCloud()
     Returns the cloud this node belongs to.
public  StringgetContext()
    
public  DategetDateValue(String fieldName)
    
public  doublegetDoubleValue(String fieldName)
     Returns the value of the specified field as a double. This function attempts to convert the value to a double. Numeric fields are simply converted.
public  FieldValuegetFieldValue(String fieldName)
     Returns the value of the specified field as a FieldValue object.
public  FieldValuegetFieldValue(Field field)
     Returns the value of the specified field as a FieldValue object.
public  floatgetFloatValue(String fieldName)
     Returns the value of the specified field as a float. This function attempts to convert the value to a float. Numeric fields are simply converted. Boolean fields return 0.0 if false, and 1.0 if true. String fields are parsed. If a parsed string contains an error, ot the field value is not of a type that can be converted (i.e.
public  FunctiongetFunction(String functionName)
     Returns a Fuction object. The object returned is a org.mmbase.util.functions.Function object. You need to explixitly cast the result to this object, since not all bridge implementations (i.e.
public  FieldValuegetFunctionValue(String functionName, List parameters)
     Returns the value of the specified function on the node.
public  Collection<Function<?>>getFunctions()
    
public  InputStreamgetInputStreamValue(String fieldName)
     Returns the value of the specified field as a java.io.InputStream This is especially useful for large byte-array fields.
public  intgetIntValue(String fieldName)
     Returns the value of the specified field as an int. Numeric fields are simply converted.
public  ListgetListValue(String fieldName)
    
public  longgetLongValue(String fieldName)
     Returns the value of the specified field as a long. This function attempts to convert the value to a long. Numeric fields are simply converted.
public  NodeManagergetNodeManager()
     Returns the node manager for this node.
public  NodegetNodeValue(String fieldName)
     Returns the value of the specified field as a Node. If the value is not itself a Node, this call attempts to convert the original field value to a Node, by trying to retrieve a Node using the field value as a Node number or alias.
For instance, getNodeValue("destination"), when run on a OAlias object, returns the referenced destination node (instead of the number, which is what it normally holds).
Mostly, this call is used in cluster nodes (nodes retrieved by using the Cloud.getList method.
public  intgetNumber()
     Returns the unique number for this node.
public  ObjectgetObjectValue(String fieldName)
     Returns the field's value as an object.
public  StringListgetPossibleContexts()
     Contacts the security implementation to find out to which other possible contexts the context of this node may be set.
public  NodeListgetRelatedNodes()
     Returns all related nodes.
public  NodeListgetRelatedNodes(String nodeManager)
     Returns all related nodes that have a specific node manager.
public  NodeListgetRelatedNodes(NodeManager nodeManager)
     Returns all related nodes that have a specific node manager.
public  NodeListgetRelatedNodes(String nodeManager, String role, String searchDir)
     Returns all related nodes that have a specific node manager and role.
public  NodeListgetRelatedNodes(NodeManager nodeManager, String role, String searchDir)
     Returns all related nodes that have a specific node manager and role.
public  RelationListgetRelations()
     Returns all relation nodes attached to this node.
public  RelationListgetRelations(String role)
    
public  RelationListgetRelations(String role, String nodeManager)
    
public  RelationListgetRelations(String role, NodeManager nodeManager)
    
public  RelationListgetRelations(String role, NodeManager nodeManager, String searchDir)
    
public  longgetSize(String fieldName)
     Returns the 'size' (e.g.
public  StringgetStringValue(String fieldName)
     Returns the value of the specified field as a String.
public  ObjectgetValue(String fieldName)
     Returns the value of the specified field as an object.
public  ObjectgetValueWithoutProcess(String fieldName)
     Like getObjectValue, but skips any processing that MMBase would normally perform on a field.
public  DocumentgetXMLValue(String fieldName)
     Returns the value of the specified field as a dom.Document If the node value is not itself a Document, the method attempts to attempts to convert the String value into an XML.
public  ElementgetXMLValue(String fieldName, Document tree)
     Returns the value of the specified field as a dom.Element If the node value is not itself a Document, the method attempts to attempts to convert the String value into an XML.
public  booleanhasRelations()
     Checks whether this node has any relations.
public  booleanisChanged(String fieldName)
     Whether a certain field's value was changed since the last commit.
public  booleanisChanged()
     Whether field values were changed since the last commit.
public  booleanisNew()
     Whether this Node is new (not yet committed).
public  booleanisNodeManager()
     Determine whether this Node is a NodeManager.
public  booleanisNull(String fieldName)
     Whether the value for the specified field is null.
public  booleanisRelation()
     Determine whether this Node is a Relation.
public  booleanisRelationManager()
     Determine whether this Node is a RelationManager.
public  booleanmayChangeContext()
     Check context-change rights on this node.
public  booleanmayDelete()
     Check delete rights on this node.
public  booleanmayWrite()
     Check write rights on this node.
public  voidsetBooleanValue(String fieldName, boolean value)
     Sets the value of the specified field using an boolean.
public  voidsetByteValue(String fieldName, byte[] value)
     Sets the value of the specified field using a byte array.
public  voidsetContext(String context)
    
public  voidsetDateValue(String fieldName, Date value)
     Sets the value of the specified field using a Date.
public  voidsetDoubleValue(String fieldName, double value)
     Sets the value of the specified field using a double.
public  voidsetFloatValue(String fieldName, float value)
     Sets the value of the specified field using a float.
public  voidsetInputStreamValue(String fieldName, InputStream value, long size)
     Sets the value of the specified field using a java.io.InputStream.
public  voidsetIntValue(String fieldName, int value)
     Sets the value of the specified field using an int.
public  voidsetListValue(String fieldName, List value)
     Sets the value of the specified field using a List.
public  voidsetLongValue(String fieldName, long value)
     Sets the value of the specified field using a long.
public  voidsetNodeValue(String fieldName, Node value)
     Sets the value of the specified field using an Node.
public  voidsetObjectValue(String fieldName, Object value)
     Sets the value of the specified field using an object, but without dispatching to the right type first.
public  voidsetStringValue(String fieldName, String value)
     Sets the value of the specified field using a String.
public  voidsetValue(String fieldName, Object value)
     Sets the value of the specified field using an object, but delegated to the right set--Value depending on the type of the field.
public  voidsetValueWithoutProcess(String fieldName, Object value)
     Like setValue, but skips any processing that MMBase would normally perform on a field. You can use this to set data on fields that are 'system' defined, to prevent (among other things) infinite recursion.
public  voidsetXMLValue(String fieldName, Document value)
    
public  NodeManagertoNodeManager()
     Returns this as a NodeManager.
public  RelationtoRelation()
     Returns this as a Relation.
public  RelationManagertoRelationManager()
     Returns this as a RelationManager.
public  StringtoString()
    
public  Collection<String>validate()
     Validates a node by checking the values from it's fields against the constraints of each field's datatype.



Method Detail
cancel
public void cancel()(Code)
Cancel changes to a node This fails if the current node is not in edit mode. If the node is in a transaction, nothing happens - actual committing occurs through the transaction.



commit
public void commit()(Code)
Commit the node to the database. Prior to committing, the values are processed by any commit-processors associated with the datatype of the node's fields), then validated. Makes this node and/or the changes made to this node visible to the cloud. If this method is called for the first time on this node it will make this node visible to the cloud, otherwise the modifications made to this node using the set methods will be made visible to the cloud. This action fails if the current node is not in edit mode. If the node is in a transaction, nothing happens - actual committing occurs through the transaction.
throws:
  BridgeException -
throws:
  IllegalArgumentException - If certain value of the node are invalid according to their data type.



countRelatedNodes
public int countRelatedNodes(String nodeManager)(Code)
Returns the number of related nodes that have a specific node manager. The counted nodes are not the nodes directly attached to this node (the relation nodes) but the nodes attached to the relation nodes of this node.
Parameters:
  nodeManager - the name of the node manager the counted nodesshould have the number of related nodes that have a specific nodemanager



countRelatedNodes
public int countRelatedNodes(NodeManager otherNodeManager, String role, String searchDir)(Code)

Parameters:
  otherNodeManager - the node manager the nodes should have
Parameters:
  role - the role of the relation
Parameters:
  searchDir - the direction of the relation number of related nodes
since:
   MMBase-1.7



countRelations
public int countRelations()(Code)
Returns the number of relations this node has with other nodes. the number of relations this node has with other nodes



countRelations
public int countRelations(String relationManager)(Code)
Returns the number of relation nodes attached to this node that have a specific relation manager.
Parameters:
  relationManager - relation manager the number of relation nodes attached to this node that have aspecific relation manager



createAlias
public void createAlias(String alias)(Code)
Create an alias for this node. An alias can be used to refer to a node in addition to his number.
Parameters:
  alias - the alias to be created for this node
throws:
  BridgeException - if the alias allready exists



createParameters
public Parameters createParameters(String functionName)(Code)
Creates a parameter list for a function. The list can be filled with parameter values by either using the List set(int, Object) method, to set values for parameters by psoition, or by using the set(String, Object) method to set parameters by name.
This object can then be passed to the getFunctionValue method. Note that adding extra parameters (with the add(Object) method) won't work and may cause exceptions.

since:
   MMBase-1.8
Parameters:
  functionName - name of the function a org.mmbase.util.functions.Parameters object.
throws:
  NotFoundException - if the function does not exist



createRelation
public Relation createRelation(Node destinationNode, RelationManager relationManager)(Code)
Adds a relation between this node and a specified node to the cloud.
Parameters:
  destinationNode - the node to which you want to relate this node
Parameters:
  relationManager - the relation manager you want to use the added relation
throws:
  BridgeException - if the relation manager is not the right onefor this type of relation



delete
public void delete()(Code)
Removes the Node. Throws an exception if still has relations. Like delete(false).



delete
public void delete(boolean deleteRelations)(Code)
Removes the Node.
Parameters:
  deleteRelations - a boolean. If true, then first allexisting relations with this node will be removed.



deleteAlias
public void deleteAlias(String alias)(Code)
Delete an alias for this node.
Parameters:
  alias - the alias to be removed for this node



deleteRelations
public void deleteRelations()(Code)
Removes all relation nodes attached to this node.



deleteRelations
public void deleteRelations(String relationManager)(Code)
Removes all relation nodes with a certain relation manager that are attached to this node.
Parameters:
  relationManager - the name of the relation manager the removedrelation nodes should have



getAliases
public StringList getAliases()(Code)
Returns all aliases for this node. a list of alias names for this node



getBooleanValue
public boolean getBooleanValue(String fieldName)(Code)
Returns the value of the specified field as a boolean. If the actual value is numeric, this call returns true if the value is a positive, non-zero, value. In other words, values '0' and '-1' are considered false. If the value is a string, this call returns true if the value is "true" or "yes" (case-insensitive). In all other cases (including calling byte fields), false is returned.
Parameters:
  fieldName - the name of the field to be returned the value of the specified field



getByteValue
public byte[] getByteValue(String fieldName)(Code)
Returns the value of the specified field as a byte array. This function returns either the value of a byte field, or the byte value of a string (converted using the default encoding, i.e. UTF8) Other types of values return an empty byte-array.
Parameters:
  fieldName - the name of the field to be returned the value of the specified field



getChanged
public Set<String> getChanged()(Code)
A Set of Strings containing the names of all changed fields. Set of changed fields
since:
   MMBase-1.8



getCloud
public Cloud getCloud()(Code)
Returns the cloud this node belongs to. the Cloud



getContext
public String getContext()(Code)
Get the security context of the current Node the current context of the node (as a String)
throws:
  SecurityException - When appropriate rights to perform this are lacking (read rights)



getDateValue
public Date getDateValue(String fieldName)(Code)

Parameters:
  fieldName - the name of the field to be returned the value of the specified field
since:
   MMBase-1.8



getDoubleValue
public double getDoubleValue(String fieldName)(Code)
Returns the value of the specified field as a double. This function attempts to convert the value to a double. Numeric fields are simply converted. Double may be truncated. Boolean fields return 0.0 if false, and 1.0 if true. String fields are parsed. If a parsed string contains an error, ot the field value is not of a type that can be converted (i.e. a byte array), this function returns -1.0.
Parameters:
  fieldName - the name of the field to be returned the value of the specified field



getFieldValue
public FieldValue getFieldValue(String fieldName) throws NotFoundException(Code)
Returns the value of the specified field as a FieldValue object.
since:
   MMBase-1.6
Parameters:
  fieldName - the name of the field whose value to return the value of the specified field
throws:
  NotFoundException - is the field does not exist



getFieldValue
public FieldValue getFieldValue(Field field)(Code)
Returns the value of the specified field as a FieldValue object.
since:
   MMBase-1.6
Parameters:
  field - the Field object whose value to return the value of the specified field



getFloatValue
public float getFloatValue(String fieldName)(Code)
Returns the value of the specified field as a float. This function attempts to convert the value to a float. Numeric fields are simply converted. Boolean fields return 0.0 if false, and 1.0 if true. String fields are parsed. If a parsed string contains an error, ot the field value is not of a type that can be converted (i.e. a byte array), this function returns -1.0.
Parameters:
  fieldName - the name of the field to be returned the value of the specified field



getFunction
public Function getFunction(String functionName)(Code)
Returns a Fuction object. The object returned is a org.mmbase.util.functions.Function object. You need to explixitly cast the result to this object, since not all bridge implementations (i.e. the RMMCI) support this class.
since:
   MMBase-1.8
Parameters:
  functionName - name of the function a org.mmbase.util.functions.Function object.
throws:
  NotFoundException - if the function does not exist



getFunctionValue
public FieldValue getFunctionValue(String functionName, List parameters)(Code)
Returns the value of the specified function on the node. A function normally has arguments, which can be supplied with a List.
since:
   MMBase-1.6
Parameters:
  functionName - name of the function
Parameters:
  parameters - list with parameters for the fucntion the result value of executing the function
throws:
  NotFoundException - if the function does not exist



getFunctions
public Collection<Function<?>> getFunctions()(Code)
Returns all the Function objects of this Node
since:
   MMBase-1.8 a Collection of org.mmbase.util.functions.Function objects.



getInputStreamValue
public InputStream getInputStreamValue(String fieldName)(Code)
Returns the value of the specified field as a java.io.InputStream This is especially useful for large byte-array fields. By this you can avoid them to be completely stored in memory.
Parameters:
  fieldName - the name of the field value of field as a input stream
since:
   MMBase-1.8



getIntValue
public int getIntValue(String fieldName)(Code)
Returns the value of the specified field as an int. Numeric fields are simply converted. Double and float values may be truncated. For Node values, the numeric key is returned. Long values return -1 of the value is too large. Boolean fields return 0 if false, and 1 if true. String fields are parsed. If a parsed string contains an error, ot the field value is not of a type that can be converted (i.e. a byte array), this function returns -1
Parameters:
  fieldName - the name of the field to be returned the value of the specified field



getListValue
public List getListValue(String fieldName)(Code)

Parameters:
  fieldName - the name of the field to be returned the value of the specified fieldnot yet working
since:
   MMBase-1.8



getLongValue
public long getLongValue(String fieldName)(Code)
Returns the value of the specified field as a long. This function attempts to convert the value to a long. Numeric fields are simply converted. Double and float values may be truncated. Boolean fields return 0 if false, and 1 if true. String fields are parsed. If a parsed string contains an error, ot the field value is not of a type that can be converted (i.e. a byte array), this function returns -1
Parameters:
  fieldName - the name of the field to be returned the value of the specified field



getNodeManager
public NodeManager getNodeManager()(Code)
Returns the node manager for this node. the node manager



getNodeValue
public Node getNodeValue(String fieldName)(Code)
Returns the value of the specified field as a Node. If the value is not itself a Node, this call attempts to convert the original field value to a Node, by trying to retrieve a Node using the field value as a Node number or alias.
For instance, getNodeValue("destination"), when run on a OAlias object, returns the referenced destination node (instead of the number, which is what it normally holds).
Mostly, this call is used in cluster nodes (nodes retrieved by using the Cloud.getList method. A cluster node returns one of its compound nodes when an appropriate nodemanager name (name from the nodepath) is specified. I.e. getNodeValue("people") will return the people-node in the cluster. If this fails, the method returns null.
Notes: the behavior of getNodeValue when called on a field that is not intended to be a node reference is currently undefined and is not encouraged.
Calling this method with field "number" or null lets the Node return a reference to itself, regardless of the actual value of the number field or status of the Node.
Parameters:
  fieldName - the name of the field to be returned the value of the specified field
See Also:   Cloud.getList(StringStringStringStringStringStringStringboolean)



getNumber
public int getNumber()(Code)
Returns the unique number for this node. Every node has a unique number which can be used to refer to it. In addition to this number a node can have one or more aliases. A value of -1 indicates an invalid number. Other negative values may be used for temporary ids (but not true node numbers). This may differ by implementation. the unique number for this node
See Also:   Node.createAlias(String alias)



getObjectValue
public Object getObjectValue(String fieldName)(Code)
Returns the field's value as an object. It is not delegated to the right get--Value.
Parameters:
  fieldName - name of the field object value
since:
   MMBase-1.7



getPossibleContexts
public StringList getPossibleContexts()(Code)
Contacts the security implementation to find out to which other possible contexts the context of this node may be set. A StringList containing the contexts which can be used in setContext on this node.
throws:
  SecurityException - When appropriate rights to perform this are lacking (read rights)



getRelatedNodes
public NodeList getRelatedNodes()(Code)
Returns all related nodes. The returned nodes are not the nodes directly attached to this node (the relation nodes) but the nodes attached to the relation nodes of this node. a list of all related nodes



getRelatedNodes
public NodeList getRelatedNodes(String nodeManager)(Code)
Returns all related nodes that have a specific node manager. The returned nodes are not the nodes directly attached to this node (the relation nodes) but the nodes attached to the relation nodes of this node.
Parameters:
  nodeManager - the name of the node manager the returned nodesshould have a list of related nodes



getRelatedNodes
public NodeList getRelatedNodes(NodeManager nodeManager)(Code)
Returns all related nodes that have a specific node manager. The returned nodes are not the nodes directly attached to this node (the relation nodes) but the nodes attached to the relation nodes of this node.
Parameters:
  nodeManager - the node manager the returned nodes should have, can be null a list of related nodes



getRelatedNodes
public NodeList getRelatedNodes(String nodeManager, String role, String searchDir)(Code)
Returns all related nodes that have a specific node manager and role. The returned nodes are not the nodes directly attached to this node (the relation nodes) but the nodes attached to the relation nodes of this node.
since:
   MMBase-1.6
Parameters:
  nodeManager - the name of the node manager the returned nodesshould have
Parameters:
  role - the role of the relation
Parameters:
  searchDir - the direction of the relation a list of related nodes



getRelatedNodes
public NodeList getRelatedNodes(NodeManager nodeManager, String role, String searchDir)(Code)
Returns all related nodes that have a specific node manager and role. The returned nodes are not the nodes directly attached to this node (the relation nodes) but the nodes attached to the relation nodes of this node.
since:
   MMBase-1.6
Parameters:
  nodeManager - the node manager the returned nodes should have
Parameters:
  role - the role of the relation
Parameters:
  searchDir - the direction of the relation a list of related nodes



getRelations
public RelationList getRelations()(Code)
Returns all relation nodes attached to this node. a list of relation nodes



getRelations
public RelationList getRelations(String role)(Code)
Returns all relation nodes attached to this node that have a specific role
Parameters:
  role - the name of the role the returnedrelation nodes should have a list of relation nodes



getRelations
public RelationList getRelations(String role, String nodeManager)(Code)
Returns all relation nodes attached to this node that have a specific role, or refer a node from a specific nodemanager
Parameters:
  role - the name of the role the returnedrelation nodes should have
Parameters:
  nodeManager - the name of the nodemanager for the nodes the returnedrelation nodes should have a relation to a list of relation nodes



getRelations
public RelationList getRelations(String role, NodeManager nodeManager)(Code)
Returns all relation nodes attached to this node that have a specific role, or refer a node from a specific nodemanager
Parameters:
  role - the name of the role the returnedrelation nodes should have
Parameters:
  nodeManager - the nodemanager for the nodes the returnedrelation nodes should have a relation to (can be null) a list of relation nodes



getRelations
public RelationList getRelations(String role, NodeManager nodeManager, String searchDir)(Code)

Parameters:
  role - forward role of a relation
Parameters:
  nodeManager - node manager on the other side of the relation
Parameters:
  searchDir - the direction of the relation List of relations
since:
   MMBase-1.7



getSize
public long getSize(String fieldName)(Code)
Returns the 'size' (e.g. the number of bytes of a byte array) for the specified field. This avoids acquiring the complete value if you only want to know how big the value of the field is.
Parameters:
  fieldName - the name of the field the 'size'
since:
   MMBase-1.8



getStringValue
public String getStringValue(String fieldName)(Code)
Returns the value of the specified field as a String. Byte arrays are converted to string using the default encoding (UTF8). Node values return a string representation of their numeric key. For other values the result is calling the toString() method on the actual object.
Parameters:
  fieldName - the name of the field to be returned the value of the specified field



getValue
public Object getValue(String fieldName)(Code)
Returns the value of the specified field as an object. For example a field of type int is returned as an Integer. The object type may vary and is dependent on how data was stored in a field. I.e. It may be possible for an Integer field to return it's value as a String if it was stored that way in the first place.
Parameters:
  fieldName - the name of the field to be returned the value of the specified field



getValueWithoutProcess
public Object getValueWithoutProcess(String fieldName)(Code)
Like getObjectValue, but skips any processing that MMBase would normally perform on a field. You can use this to get data from a field for validation purposes.
Parameters:
  fieldName - name of field value without processing
since:
   MMBase-1.8



getXMLValue
public Document getXMLValue(String fieldName) throws IllegalArgumentException(Code)
Returns the value of the specified field as a dom.Document If the node value is not itself a Document, the method attempts to attempts to convert the String value into an XML. This included the empty string, but not the 'null' value. If the value is null, this method returns null
Parameters:
  fieldName - the name of the field to be returned the value of the specified field as a DOM Element or null
throws:
  IllegalArgumentException - if the value cannot be converted to xml.
since:
   MMBase-1.6



getXMLValue
public Element getXMLValue(String fieldName, Document tree) throws IllegalArgumentException(Code)
Returns the value of the specified field as a dom.Element If the node value is not itself a Document, the method attempts to attempts to convert the String value into an XML. This method fails (throws a IllegalArgumentException) if the Field is not of type TYPE_XML. If the value cannot be converted, this method returns null
Parameters:
  fieldName - the name of the field to be returned
Parameters:
  tree - the DOM Document to which the Element is added(as the document root element) the value of the specified field as a DOM Element or null
throws:
  IllegalArgumentException - if the value cannot be converted to xml.
since:
   MMBase-1.6



hasRelations
public boolean hasRelations()(Code)
Checks whether this node has any relations. true if the node has relations



isChanged
public boolean isChanged(String fieldName)(Code)
Whether a certain field's value was changed since the last commit.
Parameters:
  fieldName - the name of the field true when field's value was changed
since:
   MMBase-1.8



isChanged
public boolean isChanged()(Code)
Whether field values were changed since the last commit. true when changed
since:
   MMBase-1.8



isNew
public boolean isNew()(Code)
Whether this Node is new (not yet committed). true when new
since:
   MMBase-1.8



isNodeManager
public boolean isNodeManager()(Code)
Determine whether this Node is a NodeManager.
since:
   MMBase-1.6 true if this Node is a NodeManager.



isNull
public boolean isNull(String fieldName)(Code)
Whether the value for the specified field is null. This avoids acquiring the complete value if you only want to check if for emptiness.
Parameters:
  fieldName - the name of the field true when value is null
since:
   MMBase-1.8



isRelation
public boolean isRelation()(Code)
Determine whether this Node is a Relation.
since:
   MMBase-1.6 true if this Node is a Relation.



isRelationManager
public boolean isRelationManager()(Code)
Determine whether this Node is a RelationManager.
since:
   MMBase-1.6 true if this Node is a RelationManager.



mayChangeContext
public boolean mayChangeContext()(Code)
Check context-change rights on this node. Whether the current user may change the context of this node



mayDelete
public boolean mayDelete()(Code)
Check delete rights on this node. Whether the node may be deleted by the current user



mayWrite
public boolean mayWrite()(Code)
Check write rights on this node. Whether the node may be changed by the current user



setBooleanValue
public void setBooleanValue(String fieldName, boolean value)(Code)
Sets the value of the specified field using an boolean. This change will not be visible to the cloud until the commit method is called.
since:
   MMBase-1.6
Parameters:
  fieldName - the name of the field to be updated
Parameters:
  value - the new value for the given field



setByteValue
public void setByteValue(String fieldName, byte[] value)(Code)
Sets the value of the specified field using a byte array. This change will not be visible to the cloud until the commit method is called.
Parameters:
  fieldName - the name of the field to be updated
Parameters:
  value - the new value for the given field



setContext
public void setContext(String context)(Code)
Sets the security context of this Node (AKA the 'owner' field)
Parameters:
  context - The security context to which this node should belong,
throws:
  SecurityException - When appropriate rights to perform this are lacking (write / change context rights)



setDateValue
public void setDateValue(String fieldName, Date value)(Code)
Sets the value of the specified field using a Date. This change will not be visible to the cloud until the commit method is called.
Parameters:
  fieldName - the name of the field to be updated
Parameters:
  value - the new value for the given field
since:
   MMBase-1.8



setDoubleValue
public void setDoubleValue(String fieldName, double value)(Code)
Sets the value of the specified field using a double. This change will not be visible to the cloud until the commit method is called.
Parameters:
  fieldName - the name of the field to be updated
Parameters:
  value - the new value for the given field



setFloatValue
public void setFloatValue(String fieldName, float value)(Code)
Sets the value of the specified field using a float. This change will not be visible to the cloud until the commit method is called.
Parameters:
  fieldName - the name of the field to be updated
Parameters:
  value - the new value for the given field



setInputStreamValue
public void setInputStreamValue(String fieldName, InputStream value, long size)(Code)
Sets the value of the specified field using a java.io.InputStream.
Parameters:
  fieldName - the name of the field to be updated
Parameters:
  value - the new value for the given field
Parameters:
  size - size of input stream
since:
   MMBase-1.8.



setIntValue
public void setIntValue(String fieldName, int value)(Code)
Sets the value of the specified field using an int. This change will not be visible to the cloud until the commit method is called.
Parameters:
  fieldName - the name of the field to be updated
Parameters:
  value - the new value for the given field



setListValue
public void setListValue(String fieldName, List value)(Code)
Sets the value of the specified field using a List. This change will not be visible to the cloud until the commit method is called.
Parameters:
  fieldName - the name of the field to be updated
Parameters:
  value - the new value for the given field// not yet working
since:
   MMBase-1.8



setLongValue
public void setLongValue(String fieldName, long value)(Code)
Sets the value of the specified field using a long. This change will not be visible to the cloud until the commit method is called.
Parameters:
  fieldName - the name of the field to be updated
Parameters:
  value - the new value for the given field



setNodeValue
public void setNodeValue(String fieldName, Node value)(Code)
Sets the value of the specified field using an Node. This change will not be visible to the cloud until the commit method is called.
since:
   MMBase-1.6
Parameters:
  fieldName - the name of the field to be updated
Parameters:
  value - the new value for the given field



setObjectValue
public void setObjectValue(String fieldName, Object value)(Code)
Sets the value of the specified field using an object, but without dispatching to the right type first.
Parameters:
  fieldName - the name of the field to be updated
Parameters:
  value - the new value for the given field
since:
   MMBase-1.7



setStringValue
public void setStringValue(String fieldName, String value)(Code)
Sets the value of the specified field using a String. This change will not be visible to the cloud until the commit method is called.
Parameters:
  fieldName - the name of the field to be updated
Parameters:
  value - the new value for the given field



setValue
public void setValue(String fieldName, Object value)(Code)
Sets the value of the specified field using an object, but delegated to the right set--Value depending on the type of the field. For example a field of type int can be set using an Integer. This change will not be visible to the cloud until the commit method is called.
Parameters:
  fieldName - the name of the field to be updated
Parameters:
  value - the new value for the given field



setValueWithoutProcess
public void setValueWithoutProcess(String fieldName, Object value)(Code)
Like setValue, but skips any processing that MMBase would normally perform on a field. You can use this to set data on fields that are 'system' defined, to prevent (among other things) infinite recursion. Use with care - in general processing of a field has a purpose!
Parameters:
  fieldName - name of field
Parameters:
  value - new value of the field
since:
   MMBase-1.8



setXMLValue
public void setXMLValue(String fieldName, Document value)(Code)
Set's the value of the specified field as a dom.Element
Parameters:
  fieldName - the name of the field to be returned
Parameters:
  value - the DOM Document to has to be set, if not correct doc-type,system will try to convert it to the wanted type.
since:
   MMBase-1.6



toNodeManager
public NodeManager toNodeManager()(Code)
Returns this as a NodeManager.
since:
   MMBase-1.6 a NodeManager object
throws:
  ClassCastException - if the Node is not a NodeManager



toRelation
public Relation toRelation()(Code)
Returns this as a Relation.
since:
   MMBase-1.6 a Relation object
throws:
  ClassCastException - if the Node is not a Relation



toRelationManager
public RelationManager toRelationManager()(Code)
Returns this as a RelationManager.
since:
   MMBase-1.6 a NodeManager object
throws:
  ClassCastException - if the Node is not a RelationManager



toString
public String toString()(Code)
Converts the node to a string string representation of a node



validate
public Collection<String> validate()(Code)
Validates a node by checking the values from it's fields against the constraints of each field's datatype. For performance reasons, it only validates fields that actually changed (as of MMBase 1.8.4), or when a new node is created. This method is called by the Node.commit method, after commit processors are run. Note that because commit processors may make necessary changes to field values, it is possible for validate() to fail when used outside the commit process if the constraints are set too strict. Collection of errors as String (in the current locale of the cloud) or an empty collection if everything ok.
since:
   MMBase-1.8



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.