org.mmbase.module.corebuilders
Class TypeDef
java.lang.Object
|
+--org.mmbase.module.core.MMTable
|
+--org.mmbase.module.core.MMObjectBuilder
|
+--org.mmbase.module.corebuilders.TypeDef
- public class TypeDef
- extends MMObjectBuilder
TypeDef, one of the meta stucture nodes it is used to define the
object types (builders)
- Version:
- 12 Mar 1997
- Author:
- Daniel Ockeloen
| Fields inherited from class org.mmbase.module.core.MMObjectBuilder |
className, database, debug, description, descriptions, fields, NODE_MAX_SIZE, nodeCache, obj2type, OBJ2TYPE_MAX_SIZE, oType, replaceCache, searchAge, sortedDBLayout, TEMPNODE_DEFAULT_SIZE, TemporaryNodes, virtual |
|
Method Summary |
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 |
getDBType(java.lang.String fieldName)
return the database type of the objecttype |
java.lang.String |
getDutchSName(java.lang.String name)
|
java.lang.String |
getEnglishName(java.lang.String dutchname)
|
java.lang.String |
getGUIIndicator(MMObjectNode node)
What should a GUI display for this node. |
int |
getIntValue(java.lang.String value)
obtain the type value of the requested type, returns -1 if not defined. |
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. |
java.lang.String |
getValue(int type)
obtain the type value of the requested type, returns -1 if not defined. |
java.lang.Object |
getValue(MMObjectNode node,
java.lang.String field)
Provides additional functionality when obtaining field values. |
java.lang.String |
getValue(java.lang.String type)
obtain the type value of the requested type, returns -1 if not defined. |
boolean |
init()
Initializes this builder
The property 'mmb' needs to be set for the builder before this method can be called. |
boolean |
isRelationTable(java.lang.String name)
|
void |
loadTypeDef(java.lang.String name)
|
boolean |
readCache()
|
boolean |
reloadBuilder(java.lang.String objectname)
|
java.lang.String |
replace(scanpage sp,
java.util.StringTokenizer tok)
Handle a $MOD command |
void |
unloadTypeDef(java.lang.String name)
|
| Methods inherited from class org.mmbase.module.core.MMObjectBuilder |
addField, addLocalObserver, addRemoteObserver, buildSet, checkAddTmpField, commit, convertMMNode2SQL, count, create, createAlias, created, debug, deleteNodeCache, executeFunction, getAge, getAliasedNode, getCacheNumbers, getCacheSize, getCacheSize, getClassName, getDBByte, getDBKey, getDBState, getDBText, getDefaultTeaser, getDefaultUrl, getDescription, getDescriptions, getDutchSName, getEditFields, getField, getFieldNames, getFields, getFullTableName, getFunctionParameters, getGUIIndicator, getHardNode, getHTML, getInitParameter, getInitParameters, getMachineName, getMaintainer, getNewNode, getNewTmpNode, getNextField, getNode, getNode, getNodeType, getNumberFromName, getPluralName, getPluralName, getPluralNames, getRelations_main, getSearchAge, getShort, getShortedByte, getShortedText, getSingularName, getSingularName, getSingularNames, getSmartPath, getSortedFields, getSortedListFields, getTableName, getTmpNode, getURLEncode, getVersion, getWAP, getXMLPath, getXMLSetup, hostname_function, init_obj2type, insert, insert, insertDone, isNodeCached, isVirtual, isXMLConfig, nodeLocalChanged, nodeRemoteChanged, preCommit, preEdit, process, putTmpNode, readSearchResults, removeField, removeNode, removeRelations, removeTmpNode, search, search, search, searchIn, searchIn, searchIn, searchNumbers, searchVector, searchVector, searchVector, searchVector, searchVectorIn, searchVectorIn, searchVectorIn, searchVectorIn, searchWithWhere, sendFieldChangeSignal, setClassName, setDBLayout_xml, setDBLayout, setDebug, setDefaults, setDescription, setDescriptions, setDutchSName, setInitParameter, setMaintainer, setMMBase, setPluralNames, setSearchAge, setSingularNames, setTableName, setValue, setVersion, setXmlConfig, setXMLPath, setXMLValues, signalNewObject, testValidData, toXML, waitUntilNodeChanged, wrap |
| Methods inherited from class org.mmbase.module.core.MMTable |
size |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
broadcastChanges
public boolean broadcastChanges
typedefsLoaded
public java.util.Vector typedefsLoaded
TypeDef
public TypeDef()
init
public boolean init()
- Description copied from class:
MMObjectBuilder
- Initializes this builder
The property 'mmb' needs to be set for the builder before this method can be called.
The method retrieves data from the TypeDef builder, or adds data to thet builder if the
current builder si not yet registrered.
- Overrides:
init in class MMObjectBuilder
- Following copied from class:
org.mmbase.module.core.MMObjectBuilder
- Returns:
- Always true.
- See Also:
MMObjectBuilder.create()
readCache
public boolean readCache()
getIntValue
public int getIntValue(java.lang.String value)
- obtain the type value of the requested type, returns -1 if not defined.
getValue
public java.lang.String getValue(int type)
- obtain the type value of the requested type, returns -1 if not defined.
getValue
public java.lang.String getValue(java.lang.String type)
- obtain the type value of the requested type, returns -1 if not defined.
getDutchSName
public java.lang.String getDutchSName(java.lang.String name)
getEnglishName
public java.lang.String getEnglishName(java.lang.String dutchname)
isRelationTable
public boolean isRelationTable(java.lang.String name)
getValue
public java.lang.Object getValue(MMObjectNode node,
java.lang.String field)
- Description copied from class:
MMObjectBuilder
- Provides additional functionality when obtaining field values.
This method is called whenever a Node of the builder's type fails at evaluating a getValue() request
(generally when a fieldname is supplied that doesn't exist).
It allows the system to add 'functions' to be included with a field name, such as 'html(body)' or 'time(lastmodified)'.
This method will parse the fieldname, determining functions and calling the
MMObjectBuilder.executeFunction(org.mmbase.module.core.MMObjectNode, java.lang.String, java.lang.String) 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 MMObjectBuilder.executeFunction(org.mmbase.module.core.MMObjectNode, java.lang.String, java.lang.String) instead.
- Overrides:
getValue in class MMObjectBuilder
- Following copied from class:
org.mmbase.module.core.MMObjectBuilder
- Parameters:
node - the node whos efields are queriesfield - the fieldname that is requested- Returns:
- the result of the 'function', or null if no valid functions could be determined.
fieldLocalChanged
public boolean fieldLocalChanged(java.lang.String number,
java.lang.String builder,
java.lang.String field,
java.lang.String value)
- Description copied from class:
MMObjectBuilder
- Called when a local field is changed.
- Overrides:
fieldLocalChanged in class MMObjectBuilder
- Following copied from class:
org.mmbase.module.core.MMObjectBuilder
- Parameters:
number - Number of the changed node as a Stringbuilder - type of the changed nodefield - name of the changed fieldvalue - value it changed to- Returns:
- always
true
reloadBuilder
public boolean reloadBuilder(java.lang.String objectname)
getGUIIndicator
public java.lang.String getGUIIndicator(MMObjectNode node)
- Description copied from class:
MMObjectBuilder
- What should a GUI display for this node.
Default is the first non system field (first field after owner).
Override this to display your own choice (see Images.java).
- Overrides:
getGUIIndicator in class MMObjectBuilder
- Following copied from class:
org.mmbase.module.core.MMObjectBuilder
- Parameters:
node - The node to display- Returns:
- the display of the node as a
String
replace
public java.lang.String replace(scanpage sp,
java.util.StringTokenizer tok)
- Handle a $MOD command
- Overrides:
replace in class MMObjectBuilder
- Following copied from class:
org.mmbase.module.core.MMObjectBuilder
- Parameters:
sp - The scanpage (containing http and user info) that calls the functiontok - a list of strings that describe the (sub)command to execute- Returns:
- the result value as a
String
getDBType
public int getDBType(java.lang.String fieldName)
- return the database type of the objecttype
- Overrides:
getDBType in class MMObjectBuilder
- Following copied from class:
org.mmbase.module.core.MMObjectBuilder
- Parameters:
the - requested field's name- Returns:
- the field's type.
loadTypeDef
public void loadTypeDef(java.lang.String name)
unloadTypeDef
public void unloadTypeDef(java.lang.String name)
getList
public java.util.Vector getList(scanpage sp,
StringTagger tagger,
java.util.StringTokenizer tok)
throws ParseException
- Description copied from class:
MMObjectBuilder
- Obtains a list of string values by performing the provided command and parameters.
This method is SCAN related and may fail if called outside the context of the SCAN servlet.
- Overrides:
getList in class MMObjectBuilder
- Following copied from class:
org.mmbase.module.core.MMObjectBuilder
- Parameters:
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 execute- Returns:
- a
Vector containing the result values as a String
MMBase 2001