|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--org.mmbase.module.core.MMObjectNode
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)
| Field Summary | |
protected java.lang.String |
alias
Alias name of this node. |
java.util.Vector |
changed
Vector whcih stores the key's of the fields that were changed since the last commit. |
MMObjectBuilder |
parent
Pointer to the parent builder that is responsible for this node. |
java.lang.String |
prefix
Used to make fields from multiple nodes (for multilevel for example) possible. |
java.util.Hashtable |
properties
Holds the 'extra' name-value pairs (the node's properties) which are retrieved from the 'properties' table. |
java.util.Hashtable |
values
Holds the name - value pairs of this node (the node's fields). |
protected boolean |
virtual
Deternmines whether this node is virtual. |
| Constructor Summary | |
MMObjectNode()
Deprecated. Unused. Should be removed. |
|
MMObjectNode(MMObjectBuilder parent)
Main constructor. |
|
| Method Summary | |
boolean |
clearChanged()
Clear the 'signal' Vector with the changed keys since last commit/insert. |
boolean |
commit()
Commit the node to the database or other storage system. |
void |
delPropertiesCache()
Deletes the propertie cache for this node. |
void |
delRelationsCache()
Delete the relation cache for this node. |
int |
getAge()
Returns the node's age |
java.lang.String |
getAlias()
Returns the node's alias. |
java.util.Enumeration |
getAllRelations()
Return all the relations of this node. |
boolean |
getBooleanValue(java.lang.String fieldname)
Get a value of a certain field. |
byte[] |
getByteValue(java.lang.String fieldname)
Get a binary value of a certain field. |
java.util.Vector |
getChanged()
Return all the names of fields that were changed. |
int |
getDBState(java.lang.String fieldname)
Returns the DBState of a field. |
int |
getDBType(java.lang.String fieldname)
Returns the DBType of a field. |
double |
getDoubleValue(java.lang.String fieldname)
Get a value of a certain field. |
java.lang.String |
getDutchSName()
Return the Single name for this node in the currently selected language (accoridng to the configuration). |
float |
getFloatValue(java.lang.String fieldname)
Get a value of a certain field. |
java.lang.String |
getGUIIndicator()
Return the GUI indicator for this node. |
java.lang.Integer |
getIntegerValue(java.lang.String fieldname)
Get a value of a certain field. |
int |
getIntValue(java.lang.String fieldname)
Get a value of a certain field. |
long |
getLongValue(java.lang.String fieldname)
Get a value of a certain field. |
java.lang.String |
getName()
Return the buildername of this node |
MMObjectNode |
getNodeValue(java.lang.String fieldname)
Get a value of a certain field. |
int |
getNumber()
Retrieve an object's number. |
int |
getOType()
Retrieve an object's object type. |
java.util.Hashtable |
getProperties()
Return a the properties for this node. |
MMObjectNode |
getProperty(java.lang.String key)
Returns a specified property of this node. |
java.util.Vector |
getRelatedNodes()
Get all related nodes. |
java.util.Vector |
getRelatedNodes(java.lang.String type)
Get the related nodes of a certain type. |
static int |
getRelationCacheHits()
|
static int |
getRelationCacheMiss()
|
int |
getRelationCount()
Returns the number of relations of this node. |
int |
getRelationCount(java.lang.String wantedtype)
Return the number of relations of this node, filtered on a specified type. |
java.util.Enumeration |
getRelations()
Return the relations of this node. |
java.util.Enumeration |
getRelations(int otype)
Return the relations of this node, filtered on a specified type. |
java.util.Enumeration |
getRelations(java.lang.String wantedtype)
Return the relations of this node, filtered on a specified type. |
java.lang.String |
getStringValue(java.lang.String fieldname)
Get a value of a certain field. |
java.lang.String |
getTableName()
Deprecated. use getName instead |
java.lang.Object |
getValue(java.lang.String fieldname)
Get a value of a certain field. |
java.lang.String |
getValueAsString(java.lang.String fieldName)
Deprecated. use getStringValue(java.lang.String) instead. |
java.util.Hashtable |
getValues()
Return the values of this node as a hashtable (name-value pair). |
boolean |
hasRelations()
Returns whether this node has relations. |
int |
insert(java.lang.String userName)
Insert this node into the database or other storage system. |
int |
insertDone(EditState ed)
Deprecated. This method doesn't seem to fit here, as it references a gui/html object ( EditState),
endangering the separation between content and layout, and has an undefined return value. |
boolean |
isChanged()
Tests whether one of the values of this node was changed since the last commit/insert. |
boolean |
isVirtual()
Determines whether the node is virtual. |
int |
preEdit(EditState ed)
Deprecated. This method doesn't seem to fit here, as it references a gui/html object ( EditState),
endangering the separation between content and layout. It also has an undefined return value (as well as a confusing name). |
void |
putProperty(MMObjectNode node)
Sets a specified property for this node. |
void |
removeRelations()
Remove the relations of the node. |
protected java.lang.Object |
retrieveValue(java.lang.String fieldname)
Retrieves a value from the values hashtable. |
boolean |
sendFieldChangeSignal(java.lang.String fieldname)
Sends a field-changed signal. |
void |
setAlias(java.lang.String alias)
Sets the node's alias. |
void |
setParent(MMObjectBuilder bul)
Deprecated. Unused. Should be removed. |
boolean |
setValue(java.lang.String fieldname,
boolean fieldvalue)
Sets a key/value pair in the main values of this node. |
boolean |
setValue(java.lang.String fieldname,
double fieldvalue)
Sets a key/value pair in the main values of this node. |
boolean |
setValue(java.lang.String fieldname,
int fieldvalue)
Sets a key/value pair in the main values of this node. |
boolean |
setValue(java.lang.String fieldName,
int type,
java.lang.String value)
Sets a key/value pair in the main values of this node. |
boolean |
setValue(java.lang.String fieldname,
java.lang.Object fieldvalue)
Sets a key/value pair in the main values of this node. |
protected void |
storeValue(java.lang.String fieldname,
java.lang.Object fieldvalue)
Stores a value in the values hashtable. |
void |
testValidData()
Tests whether the data in a node is valid (throws an exception if this is not the case). |
java.lang.String |
toString()
Returns the core of this node in a string. |
java.lang.String |
toXML()
Return the node as a string in XML format. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public java.util.Hashtable values
public java.util.Hashtable properties
public java.util.Vector changed
public MMObjectBuilder parent
public java.lang.String prefix
protected boolean virtual
protected java.lang.String alias
| Constructor Detail |
public MMObjectNode()
public MMObjectNode(MMObjectBuilder parent)
parent - the node's parent, an instance of the node's builder.| Method Detail |
public void testValidData()
throws InvalidDataException
InvalidDataException - If the data was unrecoverably invalid (the references did not point to existing objects)public boolean commit()
true if the commit was succesfull, false is it failedpublic int insert(java.lang.String userName)
public int insertDone(EditState ed)
EditState),
endangering the separation between content and layout, and has an undefined return value.
ed - Contains the current edit state (editor info). The main function of this object is to pass
'settings' and 'parameters' - value pairs that have been set during the edit process.int value. It's meaning is undefined.
The basic routine returns -1.public int preEdit(EditState ed)
EditState),
endangering the separation between content and layout. It also has an undefined return value (as well as a confusing name).
commit() or insert(java.lang.String).
This method is called by the editor. This differs from MMObjectBuilder.preCommit(org.mmbase.module.core.MMObjectNode), which is called by the database system
during the call to commit or insert.ed - Contains the current edit state (editor info). The main function of this object is to pass
'settings' and 'parameters' - value pairs that have been the during the edit process.int value. It's meaning is undefined.
The basic routine returns -1.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toXML()
protected void storeValue(java.lang.String fieldname,
java.lang.Object fieldvalue)
fieldname - the name of the field to changefieldValue - the value to assignprotected java.lang.Object retrieveValue(java.lang.String fieldname)
fieldname - the name of the field to changepublic boolean isVirtual()
public boolean setValue(java.lang.String fieldname,
java.lang.Object fieldvalue)
fieldname - the name of the field to changefieldValue - the value to assigntrue
public boolean setValue(java.lang.String fieldname,
boolean fieldvalue)
boolean.
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.fieldname - the name of the field to changefieldValue - the value to assigntrue
public boolean setValue(java.lang.String fieldname,
int fieldvalue)
int.
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.fieldname - the name of the field to changefieldValue - the value to assigntrue
public boolean setValue(java.lang.String fieldname,
double fieldvalue)
double.
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.fieldname - the name of the field to changefieldValue - the value to assigntrue
public boolean setValue(java.lang.String fieldName,
int type,
java.lang.String value)
fieldname - the name of the field to changefieldValue - the value to assignfalse if the value is not of the indicated type, true otherwisepublic int getNumber()
public int getOType()
public java.lang.Object getValue(java.lang.String fieldname)
fieldname - the name of the field who's data to returnObjectpublic java.lang.String getStringValue(java.lang.String fieldname)
fieldname - the name of the field who's data to returnStringpublic byte[] getByteValue(java.lang.String fieldname)
fieldname - the name of the field who's data to returnbyte [] (binary/blob field)public MMObjectNode getNodeValue(java.lang.String fieldname)
null.fieldname - the name of the field who's data to returnintpublic int getIntValue(java.lang.String fieldname)
fieldname - the name of the field who's data to returnintpublic boolean getBooleanValue(java.lang.String fieldname)
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.fieldname - the name of the field who's data to returnintpublic java.lang.Integer getIntegerValue(java.lang.String fieldname)
fieldname - the name of the field who's data to returnIntegerpublic long getLongValue(java.lang.String fieldname)
fieldname - the name of the field who's data to returnlongpublic float getFloatValue(java.lang.String fieldname)
fieldname - the name of the field who's data to returnfloatpublic double getDoubleValue(java.lang.String fieldname)
fieldname - the name of the field who's data to returndoublepublic java.lang.String getValueAsString(java.lang.String fieldName)
getStringValue(java.lang.String) instead.
fieldname - the name of the field who's data to returnStringpublic int getDBType(java.lang.String fieldname)
fieldname - the name of the field who's type to returnpublic int getDBState(java.lang.String fieldname)
fieldname - the name of the field who's state to returnpublic java.util.Vector getChanged()
a - Vector containing all the fieldnamespublic boolean isChanged()
true if changes have been made, false otherwisepublic boolean clearChanged()
truepublic java.util.Hashtable getValues()
Hashtablepublic void delPropertiesCache()
public java.util.Hashtable getProperties()
Hashtablepublic MMObjectNode getProperty(java.lang.String key)
key - the name of the property to retrieveMMObjectNodepublic void putProperty(MMObjectNode node)
node - the property object as a MMObjectNodepublic java.lang.String getGUIIndicator()
Stringpublic java.lang.String getDutchSName()
String valuepublic java.lang.String getName()
public void setParent(MMObjectBuilder bul)
bul - the builderpublic void delRelationsCache()
public boolean hasRelations()
true if any relations exist, false otherwise.public java.util.Enumeration getAllRelations()
Enumeration containing the nodespublic java.util.Enumeration getRelations()
Enumeration containing the nodespublic void removeRelations()
public int getRelationCount()
int indicating the number of nodes foundpublic java.util.Enumeration getRelations(int otype)
otype - the 'type' of relations to return. The type identifies a relation (InsRel-derived) builder, not a reldef object.Enumeration containing the nodespublic java.util.Enumeration getRelations(java.lang.String wantedtype)
wantedtype - the 'type' of relations to return. The type identifies a relation (InsRel-derived) builder, not a reldef object.Enumeration containing the nodespublic int getRelationCount(java.lang.String wantedtype)
wantedtype - the 'type' of related nodes (NOT the relations!).int indicating the number of nodes foundpublic int getAge()
public java.lang.String getTableName()
Stringpublic boolean sendFieldChangeSignal(java.lang.String fieldname)
fieldname - the name of the changed field.truepublic void setAlias(java.lang.String alias)
public java.lang.String getAlias()
Stringpublic java.util.Vector getRelatedNodes()
Vector containing MMObjectNodespublic java.util.Vector getRelatedNodes(java.lang.String type)
type - the type of objects to be returnedVector containing MMObjectNodespublic static int getRelationCacheHits()
public static int getRelationCacheMiss()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||