|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.mmbase.module.core.MMTable
|
+--org.mmbase.module.core.MMObjectBuilder
This class is the base class for all builders.
It offers a list of routines which are useful in maintaining the nodes in the MMBase
object cloud.
Builders are the core of the MMBase system. They create, delete and search the MMObjectNodes.
Most manipulations concern nodes of that builders type. However, a number of retrieval routines extend
beyond a builders scope and work on the cloud in general, allowing some ease in retrieval of nodes.
The basic routines in this class can be extended to handle more specific demands for nodes.
Most of these 'extended builders' will be stored in mmbase.org.builders or mmbase.org.corebuilders.
Examples include relation builders or builders for handling binary data such as images.
The various builders are registered by the 'TypeDef' builder class (one of the core builders, itself
an extension of this class).
| Field Summary | |
boolean |
broadcastChanges
Determines whether changes to this builder need be broadcasted to other known mmbase servers. |
static MMJdbc2NodeInterface |
database
Deprecated. use MMBase.getMMBase().getDatabase() or mmb.getDatabase() instead |
static java.lang.String |
DEFAULT_ALINEA
Default replacements for method getHTML() |
static java.lang.String |
DEFAULT_EOL
|
java.lang.String |
description
Description of the builder in the currently selected language Not that the first time the builder is created, this value is what is stored in the TypeDef table. |
java.util.Hashtable |
descriptions
Descriptions of the builder per language Can be set with the <descriptions> tag in the xml builder file. |
protected java.util.Hashtable |
fields
|
static NodeCache |
nodeCache
The cache that contains the X last requested nodes |
static Cache |
obj2type
Deprecated. Will not be available anymore in 1.7 |
static int |
OBJ2TYPE_MAX_SIZE
Max size of the object type cache, config/caches.xml can override this |
int |
oType
The current builder's object type Retrieved from the TypeDef builder. |
boolean |
REPLACE_CACHE
Detemines whether the cache need be refreshed? Seems useless, as this value is never changed (always true) |
java.lang.String |
searchAge
The default search age for this builder. |
java.util.Vector |
sortedDBLayout
Deprecated. this vector should not be used - if the order of the fields is an issue, use getFields(sortorder). |
static int |
TEMPNODE_DEFAULT_SIZE
Default size of the temporary node cache |
static java.util.Hashtable |
TemporaryNodes
Collection for temporary nodes, Used by the Temporarynodemanager when working with transactions The default size is 1024. |
protected boolean |
virtual
Determines whether a builder is virtual (data is not stored in a database). |
| Fields inherited from class org.mmbase.module.core.MMTable |
mmb, tableName |
| Constructor Summary | |
MMObjectBuilder()
Constructor. |
|
| Method Summary | |
void |
addField(FieldDefs def)
Add a field to this builder. |
boolean |
addLocalObserver(MMBaseObserver obs)
Adds a local observer to this builder. |
boolean |
addRemoteObserver(MMBaseObserver obs)
Adds a remote observer to this builder. |
java.lang.String |
buildSet(java.util.Vector nodes,
java.lang.String fieldName)
Build a set command string from a set nodes ( should be moved ) |
boolean |
checkAddTmpField(java.lang.String field)
Defines a virtual field to use for temporary nodes |
boolean |
commit(MMObjectNode node)
Commit changes to this node to the database. |
java.lang.String |
convertMMNode2SQL(java.lang.String where)
Converts an MMNODE expression to SQL. |
int |
count(java.lang.String where)
Count all the objects that match the searchkeys |
boolean |
create()
Creates a new builder table in the current database. |
boolean |
createAlias(int number,
java.lang.String alias)
Creates an alias for a node, provided the OAlias builder is loaded. |
boolean |
created()
Tests whether a builder table is created. |
void |
deleteNodeCache()
Delete the nodes cache. |
boolean |
drop()
Drops the builder table from the current database |
boolean |
equals(MMObjectNode o1,
MMObjectNode o2)
Implements equals for nodes (this is in MMObjectBuilder because you cannot override MMObjectNode) |
boolean |
equals(java.lang.Object o)
Equals must be implemented because of the list of MMObjectBuilder which is used for ancestors |
protected java.lang.Object |
executeFunction(MMObjectNode node,
java.lang.String function,
java.util.List arguments)
|
protected java.lang.Object |
executeFunction(MMObjectNode node,
java.lang.String function,
java.lang.String field)
Deprecated. use executeFunction(MMObjectNode, String, List) |
boolean |
fieldLocalChanged(java.lang.String number,
java.lang.String builder,
java.lang.String field,
java.lang.String value)
Called when a local field is changed. |
int |
getAge(MMObjectNode node)
Return the age of the node, determined using the daymarks builder. |
MMObjectNode |
getAliasedNode(java.lang.String key)
Deprecated. Use getNode(java.lang.String) instead. |
protected java.util.List |
getAncestors()
Gives the list of parent-builders. |
java.lang.String |
getCacheNumbers()
Get the numbers of the nodes cached (will be removed). |
int |
getCacheSize()
Gets the number of nodes currently in the cache. |
int |
getCacheSize(java.lang.String type)
Return the number of nodes in the cache of one objecttype. |
java.lang.String |
getClassName()
Deprecated. don't use |
java.io.File |
getConfigFile()
Gets the file that contains the configuration of this builder |
byte[] |
getDBByte(java.sql.ResultSet rs,
int idx)
Get binary data of a database blob field. |
int |
getDBKey()
Get the next database key (unique index for an object). |
int |
getDBState(java.lang.String fieldName)
Return a field's database state. |
java.lang.String |
getDBText(java.sql.ResultSet rs,
int idx)
Get text from a blob field. |
int |
getDBType(java.lang.String fieldName)
Return a field's database type. |
MMObjectNode |
getDefaultTeaser(MMObjectNode node,
MMObjectNode tnode)
Deprecated. Will be removed? |
java.lang.String |
getDefaultUrl(int src)
Return the default url of this object. |
java.util.List |
getDescendants()
Creates list of descendant-builders. |
java.lang.String |
getDescription()
Get description of the builder |
java.lang.String |
getDescription(java.lang.String lang)
Gets description of the builder, using the specified language. |
java.util.Hashtable |
getDescriptions()
Get descriptions of the builder |
java.util.Vector |
getEditFields()
Deprecated. use getFields() with sortorder ORDER_SEARCH |
FieldDefs |
getField(java.lang.String fieldName)
Return a field's definition |
java.util.Vector |
getFieldNames()
Return a list of field names of this table. |
java.util.Vector |
getFields()
Return a list of field definitions of this table. |
java.util.List |
getFields(int sortorder)
Get the field definitions for the editor, sorted according to the specified order. |
java.lang.String |
getFullTableName()
Retrieve the full table name (including the clouds' base name) |
protected java.util.Vector |
getFunctionParameters(java.lang.String fields)
Deprecated. use executeFunction(node, function, list) |
java.lang.String |
getGUIIndicator(MMObjectNode node)
What should a GUI display for this node. |
java.lang.String |
getGUIIndicator(java.lang.String field,
MMObjectNode node)
What should a GUI display for this node/field combo. |
MMObjectNode |
getHardNode(int number)
Retrieves a node based on it's number (a unique key), directly from the database, not using the node cache. |
MMObjectNode |
getHardNode(java.lang.String key)
Retrieves a node based on a unique key. |
protected java.lang.String |
getHTML(java.lang.String body)
Returns a HTML-version of a string. |
java.lang.String |
getInitParameter(java.lang.String name)
Retrieve a specific property. |
java.util.Hashtable |
getInitParameters()
Get all builder properties |
java.util.Vector |
getList(scanpage sp,
StringTagger tagger,
java.util.StringTokenizer tok)
Obtains a list of string values by performing the provided command and parameters. |
protected java.lang.String |
getLocaleGUIIndicator(java.util.Locale locale,
MMObjectNode node)
The GUIIndicator can depend on the locale. |
protected java.lang.String |
getLocaleGUIIndicator(java.util.Locale locale,
java.lang.String field,
MMObjectNode node)
The GUIIndicator can depend on the locale. |
java.lang.String |
getMachineName()
Get the name of this mmserver from the MMBase Root |
java.lang.String |
getMaintainer()
Retrieves the maintainer of this builder |
MMObjectNode |
getNewNode(java.lang.String owner)
Get a new node, using this builder as its parent. |
MMObjectNode |
getNewTmpNode(java.lang.String owner,
java.lang.String key)
Create a new temporary node and put it in the temporary _exist node space |
FieldDefs |
getNextField(java.lang.String currentfield)
Deprecated. use getNextField() with sortorder ORDER_EDIT |
FieldDefs |
getNextField(java.lang.String currentfield,
int sortorder)
Returns the next field as defined by its sortorder, according to the specified order. |
MMObjectNode |
getNode(int number)
Retrieves a node based on it's number (a unique key), retrieving the node from the node cache if possible. |
MMObjectNode |
getNode(int number,
boolean usecache)
Retrieves a node based on it's number (a unique key). |
MMObjectNode |
getNode(java.lang.String key)
Retrieves a node based on a unique key. |
MMObjectNode |
getNode(java.lang.String key,
boolean usecache)
Retrieves a node based on a unique key. |
java.util.List |
getNodes(java.util.List virtuals)
Convert virtual nodes to real nodes based on their otype Normally a multirelations-search will return virtual nodes. |
int |
getNodeType(int number)
Retrieves an object's type. |
java.lang.String |
getNumberFromName(java.lang.String name)
Returns the number of the node with the specified name. |
int |
getObjectType()
Returns the objecttype (otype). |
protected java.lang.Object |
getObjectValue(MMObjectNode node,
java.lang.String field)
Like getValue, but without the 'old' code. |
MMObjectBuilder |
getParentBuilder()
Returns the builder that this builder extends. |
java.lang.String |
getPluralName()
Gets long name of the builder in the current default language. |
java.lang.String |
getPluralName(java.lang.String lang)
Gets long name of the builder, using the specified language. |
java.util.Hashtable |
getPluralNames()
Gets a list of plural names (language - value pairs) |
protected java.lang.String |
getQuery(java.lang.String where)
Parses arguments of searchVector and searchList |
protected java.lang.String |
getQuery(java.lang.String where,
java.lang.String sorted,
boolean direction)
Parses arguments of searchVector and searchList |
protected java.lang.String |
getQuery(java.lang.String where,
java.lang.String sorted,
java.lang.String directions)
Parses arguments of searchVector and searchList |
java.util.Vector |
getRelations_main(int src)
Returns all relations of a node. |
java.lang.String |
getSearchAge()
Gets search Age |
java.lang.String |
getShort(java.lang.String str,
int len)
Support routine to return shorter strings. |
byte[] |
getShortedByte(java.lang.String fieldname,
int number)
Get binary data of a database blob field. |
java.lang.String |
getShortedText(java.lang.String fieldname,
int number)
Get text from a blob field. |
java.lang.String |
getSingularName()
Gets short name of the builder in the current default language. |
java.lang.String |
getSingularName(java.lang.String lang)
Gets short name of the builder, using the specified language. |
java.util.Hashtable |
getSingularNames()
Gets a list of singular names (language - value pairs) |
java.lang.String |
getSmartPath(java.lang.String documentRoot,
java.lang.String path,
java.lang.String nodeNumber,
java.lang.String version)
Returns the path to use for TREEPART, TREEFILE, LEAFPART and LEAFFILE. |
java.util.Vector |
getSortedFields()
Deprecated. use getFields() with sortorder ORDER_EDIT |
java.util.Vector |
getSortedListFields()
Deprecated. use getFields() with sortorder ORDER_LIST |
java.lang.String |
getTableName()
Retrieve the table name (without the clouds' base name) |
MMObjectNode |
getTmpNode(java.lang.String key)
Get nodes from the temporary node space |
protected java.lang.String |
getURLEncode(java.lang.String body)
Returns a URLEncoded-version (MIME x-www-form-urlencoded) of a string. |
java.lang.Object |
getValue(MMObjectNode node,
java.lang.String field)
Provides additional functionality when obtaining field values. |
int |
getVersion()
Retrieves the version of this builder |
protected java.lang.String |
getWAP(java.lang.String body)
Returns a WAP-version of a string. |
java.lang.String |
getXMLPath()
Retrieves the subpath of the builder's xml configuration file. |
int |
hashCode(MMObjectNode o)
Implements for MMObjectNode |
java.lang.String |
hostname_function(java.lang.String url)
hostname, parses the hostname from a url, so http://www.somesite.com/index.html becomed www.somesite.com |
boolean |
init()
Initializes this builder The property 'mmb' needs to be set for the builder before this method can be called. |
int |
insert(int oType,
java.lang.String owner)
Insert a new, empty, object of a certain type. |
int |
insert(java.lang.String owner,
MMObjectNode node)
Insert a new object (content provided) in the cloud, including an entry for the object alias (if provided). |
int |
insertDone(EditState ed,
MMObjectNode node)
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 |
isExtensionOf(MMObjectBuilder o)
Checks wether this builder is an extension of the argument builder |
boolean |
isNodeCached(int number)
Is this node cached at this moment? |
boolean |
isVirtual()
Is this byuilder virtual? A virtual builder represents nodes that are not stored or retrieved directly from the database, but are created as needed. |
boolean |
nodeLocalChanged(java.lang.String machine,
java.lang.String number,
java.lang.String builder,
java.lang.String ctype)
Called when a local node is changed. |
boolean |
nodeRemoteChanged(java.lang.String machine,
java.lang.String number,
java.lang.String builder,
java.lang.String ctype)
Called when a remote node is changed. |
MMObjectNode |
preCommit(MMObjectNode node)
This method is called before an actual write to the database is performed. |
int |
preEdit(EditState ed,
MMObjectNode node)
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. |
boolean |
process(scanpage sp,
java.util.StringTokenizer command,
java.util.Hashtable cmds,
java.util.Hashtable vars)
The hook that passes all form related pages to the correct handler. |
void |
putTmpNode(java.lang.String key,
MMObjectNode node)
Put a Node in the temporary node list |
SortedVector |
readSearchResults(java.sql.ResultSet rs,
SortedVector sv)
Store the nodes in the resultset, obtained from a builder, in a sorted vector. |
void |
removeField(java.lang.String fieldname)
Remove a field from this builder. |
void |
removeNode(MMObjectNode node)
Remove a node from the cloud. |
void |
removeRelations(MMObjectNode node)
Remove the relations of a node. |
void |
removeTmpNode(java.lang.String key)
Remove a node from the temporary node space |
java.lang.String |
replace(scanpage sp,
java.util.StringTokenizer tok)
Obtains a string value by performing the provided command. |
void |
safeCache(java.lang.Integer n,
MMObjectNode node)
Stores a node in the cache provided the cache is not locked. |
boolean |
safeCommit(MMObjectNode node)
Locks the node cache during the commit of a node. |
int |
safeInsert(MMObjectNode node,
java.lang.String username)
Locks the node cache during the insert of a node. |
java.util.Enumeration |
search(java.lang.String where)
Enumerate all the objects that match the searchkeys |
java.util.Enumeration |
search(java.lang.String where,
java.lang.String sort)
Enumerate all the objects that match the searchkeys |
java.util.Enumeration |
search(java.lang.String where,
java.lang.String sort,
boolean direction)
Enumerate all the objects that match the searchkeys |
java.util.Enumeration |
searchIn(java.lang.String where,
java.lang.String in)
Enumerate all the objects that match the searchkeys |
java.util.Enumeration |
searchIn(java.lang.String where,
java.lang.String sort,
boolean direction,
java.lang.String in)
Enumerate all the objects that match the searchkeys |
java.util.Enumeration |
searchIn(java.lang.String where,
java.lang.String sort,
java.lang.String in)
Enumerate all the objects that match the searchkeys |
java.util.List |
searchList(java.lang.String where)
As searchVector. |
java.util.List |
searchList(java.lang.String where,
java.lang.String sorted,
java.lang.String directions)
As searchVector But - throws Exception on error - returns List |
java.util.Vector |
searchNumbers(java.lang.String where)
Returns a Vector containing all the objects that match the searchkeys. |
java.util.Vector |
searchVector(java.lang.String where)
Deprecated. Use search() instead |
java.util.Vector |
searchVector(java.lang.String where,
java.lang.String sorted)
Returns a vector containing all the objects that match the searchkeys |
java.util.Vector |
searchVector(java.lang.String where,
java.lang.String sorted,
boolean direction)
Returns a vector containing all the objects that match the searchkeys |
java.util.Vector |
searchVector(java.lang.String where,
java.lang.String sorted,
java.lang.String directions)
Returns a vector containing all the objects that match the searchkeys in a given order. |
java.util.Vector |
searchVectorIn(java.lang.String in)
Returns a vector containing all the objects that match the searchkeys |
java.util.Vector |
searchVectorIn(java.lang.String where,
java.lang.String in)
|
java.util.Vector |
searchVectorIn(java.lang.String where,
java.lang.String sorted,
boolean direction,
java.lang.String in)
Returns a vector containing all the objects that match the searchkeys |
java.util.Vector |
searchVectorIn(java.lang.String where,
java.lang.String sorted,
java.lang.String in)
Returns a vector containing all the objects that match the searchkeys |
java.util.Enumeration |
searchWithWhere(java.lang.String where)
Enumerate all the objects that match the where clause This method is slightly faster than search(), since it does not try to 'parse' the where clause. |
boolean |
sendFieldChangeSignal(MMObjectNode node,
java.lang.String fieldname)
Send a signal to other servers that a field was changed. |
void |
setDBLayout_xml(java.util.Hashtable fields)
Deprecated. sortedDBLayout should not be used any more. use the getFields(sortorder) method instead |
void |
setDefaults(MMObjectNode node)
Sets defaults for a node. |
void |
setDescription(java.lang.String e)
Set description of the builder |
void |
setDescriptions(java.util.Hashtable e)
Set descriptions of the builder |
void |
setInitParameter(java.lang.String name,
java.lang.String value)
Set a single builder property The propertie will not be saved. |
void |
setMaintainer(java.lang.String m)
Sets the maintainer of this builder |
void |
setMMBase(MMBase m)
Set the MMBase object, and retrieve the database lasyer. |
void |
setParentBuilder(MMObjectBuilder parent)
Sets the builder that this builder extends, and registers it in the database layer. |
void |
setPluralNames(java.util.Hashtable names)
Sets a list of plural names (language - value pairs) |
void |
setSearchAge(java.lang.String age)
Sets search Age. |
void |
setSingularNames(java.util.Hashtable names)
Sets a list of singular names (language - value pairs) |
void |
setTableName(java.lang.String tableName)
Set tablename of the builder. |
boolean |
setValue(MMObjectNode node,
java.lang.String fieldname)
Provides additional functionality when setting field values. |
boolean |
setValue(MMObjectNode node,
java.lang.String fieldName,
java.lang.Object originalValue)
Sets a key/value pair in the main values of this node. |
void |
setVersion(int i)
Sets the version of this builder |
void |
setXMLPath(java.lang.String m)
Sets the subpath of the builder's xml configuration file. |
void |
setXMLValues(java.util.Vector xmlfields)
Stores fields information of this table. |
boolean |
signalNewObject(java.lang.String tableName,
int number)
Send a signal to other servers that a new node was created. |
void |
testValidData(MMObjectNode node)
Tests whether the data in a node is valid (throws an exception if this is not the case). |
java.lang.String |
toString()
Implmenting a sensible toString is usefull for debugging. |
java.lang.String |
toString(MMObjectNode n)
Implements for MMObjectNode |
java.lang.String |
toXML(MMObjectNode node)
Converts a node to XML. |
protected void |
updateFields()
Clears all field list caches, and recalculates the database field list. |
boolean |
waitUntilNodeChanged(MMObjectNode node)
Waits until a node is changed (multicast). |
java.lang.String |
wrap(java.lang.String text,
int width)
Wraps a string. |
| Methods inherited from class org.mmbase.module.core.MMTable |
size |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int OBJ2TYPE_MAX_SIZE
public static final int TEMPNODE_DEFAULT_SIZE
public static final java.lang.String DEFAULT_ALINEA
public static final java.lang.String DEFAULT_EOL
public static Cache obj2type
public static NodeCache nodeCache
public static java.util.Hashtable TemporaryNodes
public static MMJdbc2NodeInterface database
public int oType
public java.lang.String description
public java.util.Hashtable descriptions
public java.util.Vector sortedDBLayout
public java.lang.String searchAge
public boolean REPLACE_CACHE
public boolean broadcastChanges
protected java.util.Hashtable fields
protected boolean virtual
| Constructor Detail |
public MMObjectBuilder()
| Method Detail |
public boolean init()
create()public boolean create()
public boolean drop()
public void testValidData(MMObjectNode node)
throws InvalidDataException
node - The node whose data to checkInvalidDataException - If the data was unrecoverably invalid (the references did not point to existing objects)
public int insert(int oType,
java.lang.String owner)
oType - The type of object to createowner - The administrator creating the nodeint value which is the new object's unique number, -1 if the insert failed.
The basic routine does not create any nodes this way and always fails.
public int insert(java.lang.String owner,
MMObjectNode node)
preCommit(org.mmbase.module.core.MMObjectNode).owner - The administrator creating the nodenode - The object to insert. The object need be of the same type as the current builder.int value which is the new object's unique number, -1 if the insert failed.
public int insertDone(EditState ed,
MMObjectNode node)
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 the during the edit process.node - The node thatw as insertedint value. It's meaning is undefined.
The basic routine returns -1.
public int preEdit(EditState ed,
MMObjectNode node)
EditState),
endangering the separation between content and layout. It also has an undefined return value.
commit(org.mmbase.module.core.MMObjectNode) or insert(int, java.lang.String).
This method is called by the editor. This differs from 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.node - The node that was insertedint value. It's meaning is undefined.
The basic routine returns -1.public MMObjectNode preCommit(MMObjectNode node)
preEdit(org.mmbase.module.gui.html.EditState, org.mmbase.module.core.MMObjectNode), which is called by the editor.
That is, preCommit is enforced, while preEdit is not (depending on the editor used).node - The node to be committed.public boolean commit(MMObjectNode node)
preCommit(org.mmbase.module.core.MMObjectNode).
Use only to commit changes - for adding node, use insert(int, java.lang.String).node - The node to be committed
public boolean createAlias(int number,
java.lang.String alias)
number - the to-be-aliased node's unique numberalias - the aliasname to associate with the objectpublic MMObjectBuilder getParentBuilder()
protected java.util.List getAncestors()
public java.util.List getDescendants()
public void setParentBuilder(MMObjectBuilder parent)
throws StorageException
parent - the extended (parent) builder, or null if not availablepublic boolean isExtensionOf(MMObjectBuilder o)
public MMObjectNode getNewNode(java.lang.String owner)
insert(int, java.lang.String) to add the node to the cloud).owner - The administrator creating the new node.MMObjectNode.public void setDefaults(MMObjectNode node)
node - The node to set the defaults of.public void removeNode(MMObjectNode node)
node - The node to remove.public void removeRelations(MMObjectNode node)
node - The node whose relations to remove.public boolean isNodeCached(int number)
number - The number of the node to check.true if the node is in the cache, false otherwise.public boolean isVirtual()
true if the builder is virtual.public int getObjectType()
public void safeCache(java.lang.Integer n,
MMObjectNode node)
public boolean safeCommit(MMObjectNode node)
public int safeInsert(MMObjectNode node,
java.lang.String username)
public int getNodeType(int number)
number - The number of the node to search forint value which is the object type (otype) of the node.public MMObjectNode getAliasedNode(java.lang.String key)
getNode(java.lang.String) instead.
key - The value to search fornull if the node does not exist or the key is invalid, or a
MMObjectNode containing the contents of the requested node.public java.util.List getNodes(java.util.List virtuals)
List - containing virtual nodes
public MMObjectNode getNode(java.lang.String key,
boolean usecache)
key - The value to search forusecache - If true, the node is retrieved from the node cache if possible.null if the node does not exist or the key is invalid, or a
MMObjectNode containing the contents of the requested node.public MMObjectNode getNode(java.lang.String key)
key - The value to search fornull if the node does not exist or the key is invalid, or a
MMObjectNode containing the contents of the requested node.public MMObjectNode getHardNode(java.lang.String key)
key - The value to search fornull if the node does not exist or the key is invalid, or a
MMObjectNode containing the contents of the requested node.
public MMObjectNode getNode(int number,
boolean usecache)
number - The number of the node to search forusecache - If true, the node is retrieved from the node cache if possible.null if the node does not exist or the key is invalid, or a
MMObjectNode containign the contents of the requested node.java.lang.RuntimeException - If the node does not existpublic MMObjectNode getNode(int number)
number - The number of the node to search fornull if the node does not exist or the key is invalid, or a
MMObjectNode containign the contents of the requested node.public MMObjectNode getHardNode(int number)
number - The number of the node to search fornull if the node does not exist or the key is invalid, or a
MMObjectNode containign the contents of the requested node.
public MMObjectNode getNewTmpNode(java.lang.String owner,
java.lang.String key)
public void putTmpNode(java.lang.String key,
MMObjectNode node)
key - The (temporary) key under which to store the nodenode - The node to storepublic boolean checkAddTmpField(java.lang.String field)
field - the name of the temporary fieldpublic MMObjectNode getTmpNode(java.lang.String key)
key - The (temporary) key to use under which the node is storedpublic void removeTmpNode(java.lang.String key)
key - The (temporary) key under which the node is storedpublic int count(java.lang.String where)
where - scan expression that the objects need to fulfillEnumeration containing all the objects that apply.public java.util.Enumeration search(java.lang.String where)
where - scan expression that the objects need to fulfillEnumeration containing all the objects that apply.protected java.lang.String getQuery(java.lang.String where)
public java.util.Vector searchVector(java.lang.String where)
where - scan expression that the objects need to fulfill
public java.util.List searchList(java.lang.String where)
throws java.sql.SQLException
public java.util.Vector searchVectorIn(java.lang.String in)
in - either a set of object numbers (in comma-separated string format), or a sub query
returning a set of object numbers.public java.util.Vector searchNumbers(java.lang.String where)
where - scan expression that the objects need to fulfillVector containing all the object numbers that apply, null if en error occurred.
public java.util.Enumeration search(java.lang.String where,
java.lang.String sort)
where - where clause that the objects need to fulfillsorted - order in which to return the objectsEnumeration containing all the objects that apply.
public java.util.Enumeration searchIn(java.lang.String where,
java.lang.String sort,
java.lang.String in)
where - where clause that the objects need to fulfillsorted - order in which to return the objectsin - lost of node numbers to filter onEnumeration containing all the objects that apply.
public java.util.Enumeration searchIn(java.lang.String where,
java.lang.String in)
where - where clause that the objects need to fulfillin - lost of node numbers to filter onEnumeration containing all the objects that apply.
public java.util.Enumeration search(java.lang.String where,
java.lang.String sort,
boolean direction)
where - where clause that the objects need to fulfillsorted - order in which to return the objectsdirection - sorts ascending if true, descending if false.
Only applies if a sorted order is given.Enumeration containing all the objects that apply.
public java.util.Enumeration searchIn(java.lang.String where,
java.lang.String sort,
boolean direction,
java.lang.String in)
where - where clause that the objects need to fulfillsorted - order in which to return the objectsin - lost of node numbers to filter ondirection - sorts ascending if true, descending if false.
Only applies if a sorted order is given.Enumeration containing all the objects that apply.
public java.util.Vector searchVector(java.lang.String where,
java.lang.String sorted)
where - where clause that the objects need to fulfillsorted - order in which to return the objects
public java.util.Vector searchVectorIn(java.lang.String where,
java.lang.String sorted,
java.lang.String in)
where - where clause that the objects need to fulfillsorted - order in which to return the objectsin - either a set of object numbers (in comma-separated string format), or a sub query
returning a set of object numbers.
public java.util.Vector searchVectorIn(java.lang.String where,
java.lang.String in)
protected java.lang.String getQuery(java.lang.String where,
java.lang.String sorted,
boolean direction)
public java.util.Vector searchVector(java.lang.String where,
java.lang.String sorted,
boolean direction)
where - where clause that the objects need to fulfillsorted - order in which to return the objectsdirection - sorts ascending if true, descending if false.
Only applies if a sorted order is given.
protected java.lang.String getQuery(java.lang.String where,
java.lang.String sorted,
java.lang.String directions)
public java.util.Vector searchVector(java.lang.String where,
java.lang.String sorted,
java.lang.String directions)
where - where clause that the objects need to fulfillsorted - a comma separated list of field names on wich the
returned list should be sorteddirections - A comma separated list of the values indicating wether
to sort up (ascending) or down (descending) on the
corresponding field in the sorted
parameter or null if sorting on all
fields should be up.
The value DOWN (case insensitive) indicates
that sorting on the corresponding field should be
down, all other values (including the
empty value) indicate that sorting on the
corresponding field should be up.
If the number of values found in this parameter are
less than the number of fields in the
sorted parameter, all fields that
don't have a corresponding direction value are
sorted according to the last specified direction
value.
public java.util.List searchList(java.lang.String where,
java.lang.String sorted,
java.lang.String directions)
throws java.sql.SQLException
public java.util.Vector searchVectorIn(java.lang.String where,
java.lang.String sorted,
boolean direction,
java.lang.String in)
where - where clause that the objects need to fulfillsorted - order in which to return the objectsin - either a set of object numbers (in comma-separated string format), or a sub query
returning a set of object numbers.direction - sorts ascending if true, descending if false.
Only applies if a sorted order is given.public java.util.Enumeration searchWithWhere(java.lang.String where)
where - where clause (SQL-syntax) that the objects need to fulfillEnumeration containing all the objects that apply.
public SortedVector readSearchResults(java.sql.ResultSet rs,
SortedVector sv)
rs - The resultset containing the nodes
public java.lang.String buildSet(java.util.Vector nodes,
java.lang.String fieldName)
fieldName - fieldname whsoe values should be put in the setStringpublic java.util.Vector getFields()
Vector with the tables fields (FieldDefs)public java.util.Vector getFieldNames()
Vector with the tables field anmes (String)public FieldDefs getField(java.lang.String fieldName)
the - requested field's nameFieldDefs belonging with the indicated fieldprotected void updateFields()
public void addField(FieldDefs def)
def - the field definiton to addpublic void removeField(java.lang.String fieldname)
fieldname - the name of the field to removepublic int getDBType(java.lang.String fieldName)
the - requested field's namepublic int getDBState(java.lang.String fieldName)
the - requested field's namepublic java.lang.String getGUIIndicator(MMObjectNode node)
node - The node to displayString
public java.lang.String getGUIIndicator(java.lang.String field,
MMObjectNode node)
node - The node to displayfield - the name field of the field to displayString, null if not specified
protected java.lang.String getLocaleGUIIndicator(java.util.Locale locale,
java.lang.String field,
MMObjectNode node)
protected java.lang.String getLocaleGUIIndicator(java.util.Locale locale,
MMObjectNode node)
public java.util.List getFields(int sortorder)
public java.util.Vector getEditFields()
public java.util.Vector getSortedListFields()
public java.util.Vector getSortedFields()
public FieldDefs getNextField(java.lang.String currentfield,
int sortorder)
public FieldDefs getNextField(java.lang.String currentfield)
public java.lang.String getTableName()
String containing the table namepublic java.lang.String getFullTableName()
String containing the full table name
public java.lang.Object getValue(MMObjectNode node,
java.lang.String field)
executeFunction(org.mmbase.module.core.MMObjectNode, java.lang.String, java.util.List) method to handle it.
Functions in fieldnames can be given in the format 'functionname(fieldname)'. An old format allows 'functionname_fieldname' instead,
though this only applies to the text functions 'short', 'html', and 'wap'.
Functions can be nested, i.e. 'html(shorted(body))'.
Derived builders should override this method only if they want to provide virtual fieldnames. To provide addiitonal functions,
override executeFunction(org.mmbase.module.core.MMObjectNode, java.lang.String, java.util.List) instead.node - the node whos efields are queriesfield - the fieldname that is requested
protected java.lang.Object getObjectValue(MMObjectNode node,
java.lang.String field)
protected java.util.Vector getFunctionParameters(java.lang.String fields)
protected java.lang.Object executeFunction(MMObjectNode node,
java.lang.String function,
java.util.List arguments)
protected java.lang.Object executeFunction(MMObjectNode node,
java.lang.String function,
java.lang.String field)
getValue(org.mmbase.module.core.MMObjectNode, java.lang.String) method.
Derived builders should override this method to provide additional functions.
current functions are:node - the node whose fields are queriesfield - the fieldname that is requestedpublic java.util.Vector getRelations_main(int src)
src - the number of the node to obtain the relations fromVector with InsRel nodespublic java.lang.String getDefaultUrl(int src)
null.src - the number of the node to obtain the url fromString, or null if unknown.
public java.lang.String getSmartPath(java.lang.String documentRoot,
java.lang.String path,
java.lang.String nodeNumber,
java.lang.String version)
documentRoot - the root of the path to searchpath - the subpath of the path to searchnodeNumber - the numbve ror alias of the node to filter onversion - the version number (or null if not applicable) to filter onString, or null if not found
This method should be added to the bridge so jsp can make use of it.
This method can be overriden to make an even smarter search possible.public int getCacheSize()
public int getCacheSize(java.lang.String type)
type - the object type to countpublic java.lang.String getCacheNumbers()
public void deleteNodeCache()
public int getDBKey()
int value that is the next available key for an object.public int getAge(MMObjectNode node)
node - The node whose age to determinepublic java.lang.String getMachineName()
String which is the server's name
public boolean nodeRemoteChanged(java.lang.String machine,
java.lang.String number,
java.lang.String builder,
java.lang.String ctype)
machine - Name of the machine that changed the node.number - Number of the changed node as a Stringbuilder - type of the changed nodectype - command type, 'c'=changed, 'd'=deleted', 'r'=relations changed, 'n'=newtrue
public boolean nodeLocalChanged(java.lang.String machine,
java.lang.String number,
java.lang.String builder,
java.lang.String ctype)
machine - Name of the machine that changed the node.number - Number of the changed node as a Stringbuilder - type of the changed nodectype - command type, 'c'=changed, 'd'=deleted', 'r'=relations changed, 'n'=newtrue
public boolean fieldLocalChanged(java.lang.String number,
java.lang.String builder,
java.lang.String field,
java.lang.String value)
number - Number of the changed node as a Stringbuilder - type of the changed nodefield - name of the changed fieldvalue - value it changed totruepublic boolean addRemoteObserver(MMBaseObserver obs)
truepublic boolean addLocalObserver(MMBaseObserver obs)
true
public MMObjectNode getDefaultTeaser(MMObjectNode node,
MMObjectNode tnode)
public boolean waitUntilNodeChanged(MMObjectNode node)
node - the node to wait for
public java.util.Vector getList(scanpage sp,
StringTagger tagger,
java.util.StringTokenizer tok)
throws ParseException
sp - The scanpage (containing http and user info) that calls the functiontagger - a Hashtable of parameters (name-value pairs) for the commandtok - a list of strings that describe the (sub)command to executeVector containing the result values as a String
public java.lang.String replace(scanpage sp,
java.util.StringTokenizer tok)
sp - The scanpage (containing http and user info) that calls the functiontok - a list of strings that describe the (sub)command to executeString
public boolean process(scanpage sp,
java.util.StringTokenizer command,
java.util.Hashtable cmds,
java.util.Hashtable vars)
sp - The scanpage (containing http and user info) that calls the functioncommand - a list of strings that describe the (sub)command to execute (the portion after ' PRC-CMD-BUILDER')cmds - the commands (PRC-CMD) that are iurrently being processed, including the current command.vars - variables (PRC-VAR) thatw ere set to be used during processing. the variable 'EDITSTATE' accesses the
EditState object (if applicable).Stringpublic java.lang.String convertMMNode2SQL(java.lang.String where)
where - the MMNODE expressionStringpublic void setMMBase(MMBase m)
m - the MMBase object to set as owner of this builderpublic void setDBLayout_xml(java.util.Hashtable fields)
fields - A list of the builder's FieldDefspublic void setTableName(java.lang.String tableName)
the - name of the tablepublic void setDescription(java.lang.String e)
the - description textpublic void setDescriptions(java.util.Hashtable e)
a - Hashtable containing the descriptionspublic java.lang.String getDescription()
public java.lang.String getDescription(java.lang.String lang)
lang - The language requestedpublic java.util.Hashtable getDescriptions()
Hashtable containing the descriptionspublic void setSearchAge(java.lang.String age)
age - the search age as a Stringpublic java.lang.String getSearchAge()
Stringpublic java.lang.String getSingularName(java.lang.String lang)
lang - The language requestednull if it is not availablepublic java.lang.String getSingularName()
public java.lang.String getPluralName(java.lang.String lang)
lang - The language requestednull if it is not availablepublic java.lang.String getPluralName()
public java.lang.String getClassName()
public boolean sendFieldChangeSignal(MMObjectNode node,
java.lang.String fieldname)
node - the node the field was changed infieldname - the name of the field that was changedtrue
public boolean signalNewObject(java.lang.String tableName,
int number)
tableName - the table in which a node was edited (?)number - the number of the new nodetruepublic java.lang.String toXML(MMObjectNode node)
node - the node to convertStringpublic void setSingularNames(java.util.Hashtable names)
public java.util.Hashtable getSingularNames()
public void setPluralNames(java.util.Hashtable names)
public java.util.Hashtable getPluralNames()
public java.lang.String getShortedText(java.lang.String fieldname,
int number)
fieldname - name of the fieldnumber - number of the object in the tableString containing the contents of a field as text
public byte[] getShortedByte(java.lang.String fieldname,
int number)
fieldname - name of the fieldnumber - number of the object in the tablebyte containing the contents of a field as text
public byte[] getDBByte(java.sql.ResultSet rs,
int idx)
fieldname - name of the fieldnumber - number of the object in the tablebyte containing the contents of a field as text
public java.lang.String getDBText(java.sql.ResultSet rs,
int idx)
fieldname - name of the fieldnumber - number of the object in the tableString containing the contents of a field as textpublic boolean created()
created in class MMTabletrue if the table exists, false otherwisepublic java.lang.String getNumberFromName(java.lang.String name)
true if the table exists, false otherwise
public boolean setValue(MMObjectNode node,
java.lang.String fieldName,
java.lang.Object originalValue)
fieldname - the name of the field to changefieldValue - the value to assignoriginalValue - the value which was original in the fieldtrue When an update is required(when changed),
false if original value was set back into the field.
public boolean setValue(MMObjectNode node,
java.lang.String fieldname)
node - the node whose fields are changedfield - the fieldname that is changedtrue if the call was handled.protected java.lang.String getHTML(java.lang.String body)
body - text to convertprotected java.lang.String getWAP(java.lang.String body)
body - text to convertprotected java.lang.String getURLEncode(java.lang.String body)
body - text to convert
public java.lang.String getShort(java.lang.String str,
int len)
str - the string to shortenlen - the maximum lengthpublic void setXMLValues(java.util.Vector xmlfields)
setDBLayout_xml(java.util.Hashtable) to create a fieldnames list.xmlfields - A Vector with fields as they appear in the current table.
This data is retrieved from an outside source (such as an xml file), and thus
may be incorrect.public void setXMLPath(java.lang.String m)
public java.lang.String getXMLPath()
public java.io.File getConfigFile()
public java.util.Hashtable getInitParameters()
Hashtable containing the current properties
public void setInitParameter(java.lang.String name,
java.lang.String value)
name - name of the propertyvalue - value of the propertypublic java.lang.String getInitParameter(java.lang.String name)
name - the name of the property to getStringpublic void setVersion(int i)
i - the version numberpublic int getVersion()
public java.lang.String getMaintainer()
public void setMaintainer(java.lang.String m)
m - the name of the maintainerpublic java.lang.String hostname_function(java.lang.String url)
public java.lang.String wrap(java.lang.String text,
int width)
text - the text to wrapwidth - the maximum width to wrap atpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(MMObjectNode n)
public boolean equals(java.lang.Object o)
equals in class java.lang.Object
public boolean equals(MMObjectNode o1,
MMObjectNode o2)
public int hashCode(MMObjectNode o)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||