Java Doc for MMObjectNode.java in  » Database-ORM » MMBase » org » mmbase » module » core » 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.module.core 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.mmbase.module.core.MMObjectNode

All known Subclasses:   org.mmbase.module.core.VirtualNode,
MMObjectNode
public class MMObjectNode implements org.mmbase.util.SizeMeasurable,java.io.Serializable(Code)
MMObjectNode is the core of the MMBase system. This class is what its all about, because the instances of this class hold the content we are using. All active Nodes with data and relations are MMObjectNodes and make up the object world that is MMBase (Creating, searching, removing is done by the node's parent, which is a class extended from MMObjectBuilder)
author:
   Daniel Ockeloen
author:
   Pierre van Rooden
author:
   Eduard Witteveen
author:
   Michiel Meeuwissen
author:
   Ernst Bunders
version:
   $Id: MMObjectNode.java,v 1.213 2008/02/03 17:33:57 nklasens Exp $


Field Summary
final public static  StringVALUE_SHORTED
     Large fields (blobs) are loaded 'lazily', so only on explicit request.
protected  booleaninitializing
     Determines whether the node is being initialized (typically when it is loaded from the database).
protected  booleanisNew
     If true, the node is a new node, which is not (yet) stored in storage.
protected  MMObjectBuilderparent
     Pointer to the parent builder that is responsible for this node.
public  Hashtable<String, MMObjectNode>properties
     Holds the 'extra' name-value pairs (the node's properties) which are retrieved from the 'properties' table.
protected  Map<String, Object>values
     Holds the name - value pairs of this node (the node's fields).

Constructor Summary
public  MMObjectNode(MMObjectBuilder parent)
     Default Main constructor, creates a node that is new and not (yet) in storage.
public  MMObjectNode(MMObjectBuilder parent, boolean isNew)
     Main constructor.
public  MMObjectNode(MMObjectNode node)
    
public  MMObjectNode(MMObjectBuilder parent, Map<String, Object> map)
     Creates an MMObject based on a given Map.

Method Summary
public  voidcancel()
     Undo changes made to the node.
protected  booleancheckFieldExistance(String fieldName)
    
public  booleanclearChanged()
     Clear the 'signal' Vector with the changed keys since last commit/insert.
public  booleancommit()
     Commit the node to the database or other storage system. This can only be done on a existing (inserted) node.
public  booleancommit(UserContext user)
    
public  ParameterscreateParameters(String functionName)
    
public  booleandefaultEquals(MMObjectNode n)
    
 StringdefaultToString()
    
public  voiddelPropertiesCache()
     Deletes the propertie cache for this node.
public  voiddelRelationsCache()
     Delete the relation cache for this node.
public static  voiddelRelationsCache(Integer number)
     Delete the relation cache for this node.
public  booleanequals(Object o)
    
public  voidfinish()
    
public  intgetAge()
     Return the age of the node, determined using the daymarks builder.
public  Enumeration<MMObjectNode>getAllRelations()
     Return all the relations of this node.
public  booleangetBooleanValue(String fieldName)
     Get a value of a certain field. The value is returned as an boolean value. If the actual value is numeric, this call returns true if the value is a positive, non-zero, value.
public  MMObjectBuildergetBuilder()
     Returns the actual builder of the node. Note that it is possible that, due to optimization, a node is currently associated with another (parent) builder, i.e.
public  intgetByteSize()
    
public  intgetByteSize(SizeOf sizeof)
    
public  byte[]getByteValue(String fieldName)
     Get a binary value of a certain field.
public  Set<String>getChanged()
     Return the names of all persistent fields that were changed. Note that this is a direct reference.
public  StringgetContext(UserContext user)
    
public  intgetDBState(String fieldName)
     Returns the DBState of a field.
public  intgetDBType(String fieldName)
     Returns the DBType of a field.
public  DategetDateValue(String fieldName)
     Get a value of a certain field. The value is returned as a Date value.
public  doublegetDoubleValue(String fieldName)
     Get a value of a certain field. The value is returned as a double value.
public  floatgetFloatValue(String fieldName)
     Get a value of a certain field. The value is returned as a float value.
public  FunctiongetFunction(String functionName)
    
public  ObjectgetFunctionValue(String functionName, List parameters)
    
public  Collection<Function<?>>getFunctions()
    
public  StringgetGUIIndicator()
     Return the GUI indicator for this node.
public  InputStreamgetInputStreamValue(String fieldName)
    
public  intgetIntValue(String fieldName)
     Get a value of a certain field. The value is returned as an int value.
public  IntegergetIntegerValue(String fieldName)
     Get a value of a certain field. The value is returned as an Integer value.
public  ListgetListValue(String fieldName)
     Get a value of a certain field.
public  longgetLongValue(String fieldName)
     Get a value of a certain field.
public  StringgetName()
    
public  MMObjectNodegetNodeValue(String fieldName)
     Get a value of a certain field. The value is returned as an MMObjectNode. If the field contains an Numeric value, the method tries to obtrain the object with that number. If it is a String, the method tries to obtain the object with that alias.
public  intgetNumber()
     Retrieve an object's number.
public  intgetOType()
     Retrieve an object's object type.
public  Map<String, Object>getOldValues()
    
public  Set<String>getPossibleContexts(UserContext user)
    
public  Hashtable<String, MMObjectNode>getProperties()
     Return a the properties for this node.
public  MMObjectNodegetProperty(String key)
     Returns a specified property of this node.
public  Vector<MMObjectNode>getRelatedNodes()
     Get all related nodes.
public  Vector<MMObjectNode>getRelatedNodes(String type)
     Get the related nodes of a certain type.
public  Vector<MMObjectNode>getRelatedNodes(String type, int search_type)
     If you query from this_node_type(type) (typex, insrel, typey where typex == typey) { if the insrel table is directional, use the multirelations.SEARCH_BOTH if the insrel table is not directional, use the multirelations.SEARCH_SOURCE + multirelations.SEARCH_DESTINATION } Otherwise the SEARCH_BOTH will result in an OR on insrel which will never return in (huge) databases.
public  Vector<MMObjectNode>getRelatedNodes(String type, String role, int search_type)
     If you query from this_node_type(type) (typex, insrel, typey where typex == typey) { if the insrel table is directional, use the multirelations.SEARCH_BOTH if the insrel table is not directional, use the multirelations.SEARCH_SOURCE + multirelations.SEARCH_DESTINATION } Otherwise the SEARCH_BOTH will result in an OR on insrel which will never return in (huge) databases.
public  intgetRelationCount()
     Returns the number of relations of this node.
public  intgetRelationCount(String wt)
     Return the number of relations of this node, filtered on a specified type.
Parameters:
  wt - the 'type' of related nodes (NOT the relations!).
protected  List<MMObjectNode>getRelationNodes()
    
public  Enumeration<MMObjectNode>getRelations()
     Return the relations of this node.
public  Enumeration<MMObjectNode>getRelations(int otype)
     Return the relations of this node, filtered on a specified type. Note that this returns the nodes describing the relation - not the nodes 'related to'.
Parameters:
  otype - the 'type' of relations to return.
public  Enumeration<MMObjectNode>getRelations(String wantedtype)
     Return the relations of this node, filtered on a specified type. Note that this returns the nodes describing the relation - not the nodes 'related to'.
Parameters:
  wantedtype - the 'type' of relations to return.
public  longgetSize(String fieldName)
     Returns the size (in byte) of the given field.
public  StringgetStringValue(String fieldName)
     Get a value of a certain field.
public  ObjectgetValue(String fieldName)
     Get a value of a certain field.
public  Map<String, Object>getValues()
    
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  booleanhasRelations()
     Returns whether this node has relations.
public  inthashCode()
    
public  intinsert(String userName)
     Insert this node into the storage
Parameters:
  userName - the name of the user who inserts the node.
public  intinsert(UserContext user)
     Insert this node into the database or other storage system.
public  booleanisChanged()
     Tests whether one of the values of this node was changed since the last commit/insert.
public  booleanisNew()
     If a node is still 'new' you must persistify it with MMObjectNode.insert , and otherwise with MMObjectNode.commit .
public  booleanisNull(String fieldName)
    
public  booleanisVirtual()
     Determines whether the node is virtual.
public  voidputProperty(MMObjectNode node)
     Sets a specified property for this node.
public  voidremove(UserContext user)
    
public  voidremoveRelations()
     Remove the relations of the node.
public  ObjectretrieveValue(String fieldName)
     Retrieves a value from the values hashtable.
public  booleansendFieldChangeSignal(String fieldName)
     Sends a field-changed signal.
Parameters:
  fieldName - the name of the changed field.
public  voidsetAlias(String alias)
     Sets the node's alias. The code only sets a (memory) property, it does not actually add the alias to the database. Only works for uninserted Nodes.
public  voidsetContext(UserContext user, String context, boolean now)
    
public  voidsetSize(String fieldName, long size)
     Sets the size (in byte) of the given field.
public  booleansetValue(String fieldName, Object fieldValue)
     Sets a key/value pair in the main values of this node.
public  voidstart()
    
public  voidstoreValue(String fieldName, Object fieldValue)
     Stores a value in the values hashtable.
public  voidtestValidData()
     Tests whether the data in a node is valid (throws an exception if this is not the case).
public  StringtoString()
     Returns the core of this node in a string.
protected  DocumenttoXML(Object value, String fieldName)
    
 voiduseAliases()
     Returns the node's alias.

Field Detail
VALUE_SHORTED
final public static String VALUE_SHORTED(Code)
Large fields (blobs) are loaded 'lazily', so only on explicit request. Until the first exlicit request this value is stored in such fields. It can be set back into the field with MMObjectNode.storeValue , to unload the field again.
since:
   MMBase-1.7.4



initializing
protected boolean initializing(Code)
Determines whether the node is being initialized (typically when it is loaded from the database). Use MMObjectNode.start to start initializing, use MMObjectNode.finish to end.
since:
   MMBase-1.7



isNew
protected boolean isNew(Code)
If true, the node is a new node, which is not (yet) stored in storage.



parent
protected MMObjectBuilder parent(Code)
Pointer to the parent builder that is responsible for this node. Note: this may on occasion (due to optimization) duffer for the node's original builder. Use MMObjectNode.getBuilder instead.



properties
public Hashtable<String, MMObjectNode> properties(Code)
Holds the 'extra' name-value pairs (the node's properties) which are retrieved from the 'properties' table.



values
protected Map<String, Object> values(Code)
Holds the name - value pairs of this node (the node's fields). Most nodes will have a 'number' and an 'otype' field, and fields which will differ by builder. This collection should not be directly queried or changed - use the SetValue and getXXXValue methods instead. It should then be made private, and methods that change the map (storeValue) be made synchronized. Note: To avoid synchronisation conflicts, we can't really change the type until the property is made private.




Constructor Detail
MMObjectNode
public MMObjectNode(MMObjectBuilder parent)(Code)
Default Main constructor, creates a node that is new and not (yet) in storage.
Parameters:
  parent - the node's parent, an instance of the node's builder.
throws:
  IllegalArgumentException - If parent is null



MMObjectNode
public MMObjectNode(MMObjectBuilder parent, boolean isNew)(Code)
Main constructor.
Parameters:
  parent - the node's parent, an instance of the node's builder.
Parameters:
  isNew - if the node is a newly created node
throws:
  IllegalArgumentException - If parent is null



MMObjectNode
public MMObjectNode(MMObjectNode node)(Code)

since:
   MMBase-1.8



MMObjectNode
public MMObjectNode(MMObjectBuilder parent, Map<String, Object> map)(Code)
Creates an MMObject based on a given Map. This can e.g. be used to make an MMObjectNode of a bridge node (use org.mmbase.bridge.util.NodeMap ).
since:
   MMBase-1.8




Method Detail
cancel
public void cancel()(Code)
Undo changes made to the node.
since:
   MMBase-1.8



checkFieldExistance
protected boolean checkFieldExistance(String fieldName)(Code)
true if field exists and may be used.
since:
   MMBase-1.8



clearChanged
public boolean clearChanged()(Code)
Clear the 'signal' Vector with the changed keys since last commit/insert. Marks the node as 'unchanged'. Does not affect the values of the fields, nor does it commit the node. always true



commit
public boolean commit()(Code)
Commit the node to the database or other storage system. This can only be done on a existing (inserted) node. It will use the changed Vector as its base of what to commit/change. true if the commit was succesfull, false is it failed



commit
public boolean commit(UserContext user)(Code)
Commit this node to the storage
Parameters:
  user - the user who commits the node.Used to set security-related information true if succesful
since:
   MMBase-1.7



createParameters
public Parameters createParameters(String functionName)(Code)

since:
   MMBase-1.8



defaultEquals
public boolean defaultEquals(MMObjectNode n)(Code)

since:
   MMBase-1.6.2



defaultToString
String defaultToString()(Code)

since:
   MMBase-1.6.2



delPropertiesCache
public void delPropertiesCache()(Code)
Deletes the propertie cache for this node. Forces a reload of the properties on next use.



delRelationsCache
public void delRelationsCache()(Code)
Delete the relation cache for this node. This means it will be reloaded from the database/storage on next use.



delRelationsCache
public static void delRelationsCache(Integer number)(Code)
Delete the relation cache for this node. This means it will be reloaded from the database/storage on next use.
Parameters:
  number - nodenumber



equals
public boolean equals(Object o)(Code)

since:
   MMBase-1.6.2



finish
public void finish()(Code)
Finish the loading of a node
since:
   MMBase-1.7



getAge
public int getAge()(Code)
Return the age of the node, determined using the daymarks builder. the age in days, or 0 if unknown (daymarks builder not present)



getAllRelations
public Enumeration<MMObjectNode> getAllRelations()(Code)
Return all the relations of this node. Use only to delete the relations of a node. Note that this returns the nodes describing the relation - not the nodes 'related to'. An Enumeration containing the nodes



getBooleanValue
public boolean getBooleanValue(String fieldName)(Code)
Get a value of a certain field. The value is returned as an boolean value. 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 concidered 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. Note that there is currently no basic MMBase boolean type, but some excecuteFunction calls may return a Boolean result.
Parameters:
  fieldName - the name of the field who's data to return the field's value as an int



getBuilder
public MMObjectBuilder getBuilder()(Code)
Returns the actual builder of the node. Note that it is possible that, due to optimization, a node is currently associated with another (parent) builder, i.e. a posrel node may be associated with a insrel builder. This method returns the actual builder. The node may miss vital information (not retrieved from the database) to act as a node of such a builder - if you need actual status you need to reload it.
since:
   MMBase-1.6 the builder of this node



getByteSize
public int getByteSize()(Code)



getByteSize
public int getByteSize(SizeOf sizeof)(Code)



getByteValue
public byte[] getByteValue(String fieldName)(Code)
Get a binary value of a certain field.
Parameters:
  fieldName - the name of the field who's data to return the field's value as an byte [] (binary/blob field)



getChanged
public Set<String> getChanged()(Code)
Return the names of all persistent fields that were changed. Note that this is a direct reference. Changes (i.e. clearing the vector) will affect the node's status. A Set containing Strings. The set is modifiable, and synchronized. Don't modify it though.



getContext
public String getContext(UserContext user)(Code)
Returns the security context for this node
Parameters:
  user - the user who requests the context of the node.
since:
   MMBase-1.7.1



getDBState
public int getDBState(String fieldName)(Code)
Returns the DBState of a field.
Parameters:
  fieldName - the name of the field who's state to return the field's DBState



getDBType
public int getDBType(String fieldName)(Code)
Returns the DBType of a field.
Parameters:
  fieldName - the name of the field which' type to return the field's DBType



getDateValue
public Date getDateValue(String fieldName)(Code)
Get a value of a certain field. The value is returned as a Date value. Values of numeric fields are converted as if they were time in seconds since 1/1/1970. String fields are parsed to a date, if possible. All remaining field values return -1.
since:
   MMBase-1.8
Parameters:
  fieldName - the name of the field who's data to return the field's value as a Date



getDoubleValue
public double getDoubleValue(String fieldName)(Code)
Get a value of a certain field. The value is returned as a double value. Values of non-double, numeric fields are converted if possible. Boolean fields return 0 for false, 1 for true. String fields are parsed to a number, if possible. All remaining field values return -1.
Parameters:
  fieldName - the name of the field who's data to return the field's value as a double



getFloatValue
public float getFloatValue(String fieldName)(Code)
Get a value of a certain field. The value is returned as a float value. Values of non-float, numeric fields are converted if possible. Boolean fields return 0 for false, 1 for true. String fields are parsed to a number, if possible. All remaining field values return -1.
Parameters:
  fieldName - the name of the field who's data to return the field's value as a float



getFunction
public Function getFunction(String functionName)(Code)

since:
   MMBase-1.8



getFunctionValue
public Object getFunctionValue(String functionName, List parameters)(Code)
XXX: return type of this method make it impossible to make MMObjectNode implements Node, perhaps it needs change
since:
   MMBase-1.6



getFunctions
public Collection<Function<?>> getFunctions()(Code)

since:
   MMBase-1.8



getGUIIndicator
public String getGUIIndicator()(Code)
Return the GUI indicator for this node. The GUI indicator is a string that represents the contents of this node. By default it is the string-representation of the first non-system field of the node. Individual builders can alter this behavior. the GUI iddicator as a String



getInputStreamValue
public InputStream getInputStreamValue(String fieldName)(Code)



getIntValue
public int getIntValue(String fieldName)(Code)
Get a value of a certain field. The value is returned as an int value. Values of non-int, numeric fields are converted if possible. Booelan fields return 0 for false, 1 for true. String fields are parsed to a number, if possible. If a value is an MMObjectNode, its numberfield is returned. All remaining field values return -1.
Parameters:
  fieldName - the name of the field who's data to return the field's value as an int



getIntegerValue
public Integer getIntegerValue(String fieldName)(Code)
Get a value of a certain field. The value is returned as an Integer value. Values of non-Integer, numeric fields are converted if possible. Boolean fields return 0 for false, 1 for true. String fields are parsed to a number, if possible. All remaining field values return -1.
Parameters:
  fieldName - the name of the field who's data to return the field's value as an Integer



getListValue
public List getListValue(String fieldName)(Code)
Get a value of a certain field. The value is returned as a List value. Strings are treated as comma-seperated value lists, and split into their component parts. Values of other fields are returned as Lists of one object.
since:
   MMBase-1.8
Parameters:
  fieldName - the name of the field who's data to return the field's value as a List



getLongValue
public long getLongValue(String fieldName)(Code)
Get a value of a certain field.
See Also:   MMObjectNode.getValue
See Also:   Casting.toLong
Parameters:
  fieldName - the name of the field who's data to return the field's value as a long



getName
public String getName()(Code)
Return the buildername of this node the builder table name



getNodeValue
public MMObjectNode getNodeValue(String fieldName)(Code)
Get a value of a certain field. The value is returned as an MMObjectNode. If the field contains an Numeric value, the method tries to obtrain the object with that number. If it is a String, the method tries to obtain the object with that alias. The only other possible values are those created by certain virtual fields. All remaining situations return null.
Parameters:
  fieldName - the name of the field who's data to return the field's value as an int



getNumber
public int getNumber()(Code)
Retrieve an object's number. In case of a new node that is not committed, this will return -1. the number of the node



getOType
public int getOType()(Code)
Retrieve an object's object type. This is a number (an index in the typedef builer), rather than a name. the object type number of the node



getOldValues
public Map<String, Object> getOldValues()(Code)

since:
   MMBase-1.8



getPossibleContexts
public Set<String> getPossibleContexts(UserContext user)(Code)
Returns the possible new security contexts for this node
Parameters:
  user - the user who requests the context of the node.
since:
   MMBase-1.7.1



getProperties
public Hashtable<String, MMObjectNode> getProperties()(Code)
Return a the properties for this node. the properties as a Hashtable



getProperty
public MMObjectNode getProperty(String key)(Code)
Returns a specified property of this node.
Parameters:
  key - the name of the property to retrieve the property object as a MMObjectNode



getRelatedNodes
public Vector<MMObjectNode> getRelatedNodes()(Code)
Get 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. XXX: return type of this method make it impossible to make MMObjectNode implements Node, perhaps it needs change a Vector containing MMObjectNodes



getRelatedNodes
public Vector<MMObjectNode> getRelatedNodes(String type)(Code)
Get the related nodes of a certain type. 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 XXX: return type of this method make it impossible to make MMObjectNode implements Node, perhaps it needs change
Parameters:
  type - the type of objects to be returned a Vector containing MMObjectNodes



getRelatedNodes
public Vector<MMObjectNode> getRelatedNodes(String type, int search_type)(Code)
If you query from this_node_type(type) (typex, insrel, typey where typex == typey) { if the insrel table is directional, use the multirelations.SEARCH_BOTH if the insrel table is not directional, use the multirelations.SEARCH_SOURCE + multirelations.SEARCH_DESTINATION } Otherwise the SEARCH_BOTH will result in an OR on insrel which will never return in (huge) databases.
Parameters:
  type - the type of teh realted node to return
Parameters:
  search_type - the type of directionality to use
since:
   MMBase-1.6.3



getRelatedNodes
public Vector<MMObjectNode> getRelatedNodes(String type, String role, int search_type)(Code)
If you query from this_node_type(type) (typex, insrel, typey where typex == typey) { if the insrel table is directional, use the multirelations.SEARCH_BOTH if the insrel table is not directional, use the multirelations.SEARCH_SOURCE + multirelations.SEARCH_DESTINATION } Otherwise the SEARCH_BOTH will result in an OR on insrel which will never return in (huge) databases.
Parameters:
  type - the type of teh realted node to return
Parameters:
  role - the role of the relation (null if no role specified)
Parameters:
  search_type - the type of directionality to use
since:
   MMBase-1.6.3



getRelationCount
public int getRelationCount()(Code)
Returns the number of relations of this node. An int indicating the number of nodes found



getRelationCount
public int getRelationCount(String wt)(Code)
Return the number of relations of this node, filtered on a specified type.
Parameters:
  wt - the 'type' of related nodes (NOT the relations!). An int indicating the number of nodes found



getRelationNodes
protected List<MMObjectNode> getRelationNodes()(Code)

since:
   MMBase-1.7



getRelations
public Enumeration<MMObjectNode> getRelations()(Code)
Return the relations of this node. Note that this returns the nodes describing the relation - not the nodes 'related to'. XXX: return type of this method makes it impossible to make MMObjectNode implements Node, perhaps it needs change An Enumeration containing the nodes



getRelations
public Enumeration<MMObjectNode> getRelations(int otype)(Code)
Return the relations of this node, filtered on a specified type. Note that this returns the nodes describing the relation - not the nodes 'related to'.
Parameters:
  otype - the 'type' of relations to return. The type identifies a relation (InsRel-derived) builder, not a reldef object. An Enumeration containing the nodes



getRelations
public Enumeration<MMObjectNode> getRelations(String wantedtype)(Code)
Return the relations of this node, filtered on a specified type. Note that this returns the nodes describing the relation - not the nodes 'related to'.
Parameters:
  wantedtype - the 'type' of relations to return. The type identifies a relation (InsRel-derived) builder, not a reldef object. An Enumeration containing the nodes



getSize
public long getSize(String fieldName)(Code)
Returns the size (in byte) of the given field. This is mainly targeted at fields of the type byte array. For other fields this method will return something reasonable, but it is as yet not well defined what...
since:
   MMBase-1.8



getStringValue
public String getStringValue(String fieldName)(Code)
Get a value of a certain field. The value is returned as a String. Non-string values are automatically converted to String. 'null' is converted to an empty string.
Parameters:
  fieldName - the name of the field who's data to return the field's value as a String



getValue
public Object getValue(String fieldName)(Code)
Get a value of a certain field.
Parameters:
  fieldName - the name of the field who's data to return the field's value as an Object



getValues
public Map<String, Object> getValues()(Code)



getXMLValue
public Document getXMLValue(String fieldName)(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. If the value cannot be converted, 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.
since:
   MMBase-1.6



hasRelations
public boolean hasRelations()(Code)
Returns whether this node has relations. This includes unidirection relations which would otherwise not be counted. true if any relations exist, false otherwise.



hashCode
public int hashCode()(Code)

since:
   MMBase-1.6.2



insert
public int insert(String userName)(Code)
Insert this node into the storage
Parameters:
  userName - the name of the user who inserts the node. This value is ignored the new node key (number field), or -1 if the insert failed



insert
public int insert(UserContext user)(Code)
Insert this node into the database or other storage system.
Parameters:
  user - the user who inserts the node.Used to set security-related information the new node key (number field), or -1 if the insert failed
since:
   MMBase-1.7



isChanged
public boolean isChanged()(Code)
Tests whether one of the values of this node was changed since the last commit/insert. true if changes have been made, false otherwise



isNew
public boolean isNew()(Code)
If a node is still 'new' you must persistify it with MMObjectNode.insert , and otherwise with MMObjectNode.commit .
since:
   MMBase-1.8



isNull
public boolean isNull(String fieldName)(Code)

since:
   MMBase-1.8



isVirtual
public boolean isVirtual()(Code)
Determines whether the node is virtual. A virtual node is not persistent (that is, stored in a database table).



putProperty
public void putProperty(MMObjectNode node)(Code)
Sets a specified property for this node. This method does not commit anything - it merely updates the node's propertylist.
Parameters:
  node - the property object as a MMObjectNode



remove
public void remove(UserContext user)(Code)
Remove this node from the storage
Parameters:
  user - the user who removes the node.Used to set security-related information
since:
   MMBase-1.7



removeRelations
public void removeRelations()(Code)
Remove the relations of the node.



retrieveValue
public Object retrieveValue(String fieldName)(Code)
Retrieves a value from the values hashtable. This is a low-level method that circumvents typechecking and the triggers of extended classes. You should normally call MMObjectNode.getValue to load fields.
Parameters:
  fieldName - the name of the field to change the value of the field



sendFieldChangeSignal
public boolean sendFieldChangeSignal(String fieldName)(Code)
Sends a field-changed signal.
Parameters:
  fieldName - the name of the changed field. always true



setAlias
public void setAlias(String alias)(Code)
Sets the node's alias. The code only sets a (memory) property, it does not actually add the alias to the database. Only works for uninserted Nodes. So this is actually only used for application import. No need to use this. Use MMObjectBuilder.createAlias .



setContext
public void setContext(UserContext user, String context, boolean now)(Code)
Sets the security context for this node
Parameters:
  user - the user who changes the context of the node.
Parameters:
  context - the new context
Parameters:
  now - if true, the context is changed instantly, otherwise it is changedafter the node is send to storage.
since:
   MMBase-1.7



setSize
public void setSize(String fieldName, long size)(Code)
Sets the size (in byte) of the given field. This is meant for byte-array fields, which you fill using an InputStream.
See Also:   MMObjectNode.getSize(String)
since:
   MMBase-1.8



setValue
public boolean setValue(String fieldName, Object fieldValue)(Code)
Sets a key/value pair in the main values of this node. Note that if this node is a node in cache, the changes are immediately visible to everyone, even if the changes are not committed. The fieldName is added to the (public) 'changed' vector to track changes.
Parameters:
  fieldName - the name of the field to change
Parameters:
  fieldValue - the value to assign true When the field was changed, false otherwise.



start
public void start()(Code)
Start the loading of a node
since:
   MMBase-1.7



storeValue
public void storeValue(String fieldName, Object fieldValue)(Code)
Stores a value in the values hashtable. This is a low-level method that circumvents typechecking and the triggers of extended classes. You should normally call MMObjectNode.setValue to change fields.
Parameters:
  fieldName - the name of the field to change
Parameters:
  fieldValue - the value to assign



testValidData
public void testValidData() throws InvalidDataException(Code)
Tests whether the data in a node is valid (throws an exception if this is not the case).
throws:
  org.mmbase.module.core.InvalidDataException - If the data was unrecoverably invalid (the references did not point to existing objects)



toString
public String toString()(Code)
Returns the core of this node in a string. Used for debugging. For data exchange use toXML() and getDTD(). the contents of the node as a string.



toXML
protected Document toXML(Object value, String fieldName)(Code)



useAliases
void useAliases()(Code)
Returns the node's alias. Does not support multiple aliases.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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