|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.mmbase.util.functions.FunctionProvider
org.mmbase.module.core.MMTable
org.mmbase.module.core.MMObjectBuilder
org.mmbase.module.corebuilders.TypeDef
public class TypeDef
TypeDef is used to define the* object types (builders). Nodes of this builder have a virtual 'config' field. This field contains the xml-Document of the builder represented by the node. The filename used to reference the xml document is derived by extending the field 'name'. Creating a new typedef node automatically creates a new xml file and loads a new builder. Removing a node drops and unloads a builder (including the xml). Changes to the config will also be active on commit of the node.
| Field Summary | |
|---|---|
(package private) String |
defaultDeploy
|
static String |
PROPERTY_DEPLOY_DIR
The property in the builder file ('deploy-dir') that sets the directory where new builder configuration files are to be deployed. |
| Fields inherited from class org.mmbase.module.core.MMObjectBuilder |
|---|
AGE_PARAMETERS, broadCastChanges, DEFAULT_ALINEA, DEFAULT_EOL, description, descriptions, EVENT_TYPE_LOCAL, EVENT_TYPE_REMOTE, FIELD_NUMBER, FIELD_OBJECT_TYPE, FIELD_OWNER, fields, genericBlobCache, getFunctionsFunction, GUI_INDICATOR, GUI_PARAMETERS, guiFunction, infoFunction, internalVersion, nodeCache, oType, pluralNames, searchAge, singularNames, SYSTEM_OWNER, TEMPNODE_DEFAULT_SIZE, TMP_FIELD_EXISTS, TMP_FIELD_NUMBER, virtual, WRAP_PARAMETERS, wrapFunction |
| Fields inherited from class org.mmbase.module.core.MMTable |
|---|
maxNodesFromQuery, mmb, storageConnector, tableName |
| Fields inherited from class org.mmbase.util.functions.FunctionProvider |
|---|
functions, getFunctions |
| Constructor Summary | |
|---|---|
TypeDef()
|
|
| Method Summary | |
|---|---|
boolean |
commit(MMObjectNode node)
Commit changes to this node to the database. |
protected boolean |
deleteBuilderConfiguration(MMObjectNode node)
|
protected Object |
executeFunction(MMObjectNode node,
String function,
List<?> args)
Executes a function on the field of a node, and returns the result. |
boolean |
fieldLocalChanged(String number,
String builder,
String field,
String value)
Called when a local field is changed. |
MMObjectBuilder |
getBuilder(MMObjectNode node)
Returns the MMObjectBuilder which is represented by the node. |
protected String |
getBuilderConfiguration(MMObjectNode node)
Returns the path, where the builderfile can be found, for not exising builders, a path will be generated. |
protected String |
getBuilderPath(MMObjectNode node)
Returns the path, where the builder configuration file can be found, for not exising builders, a path will be generated. |
String |
getGUIIndicator(MMObjectNode node)
What should a GUI display for this node. |
int |
getIntValue(String builderName)
Obtain the type value of the requested builder |
Vector<String> |
getList(PageInfo sp,
StringTagger tagger,
StringTokenizer tok)
Obtains a list of string values by performing the provided command and parameters. |
protected String |
getLocaleGUIIndicator(Locale locale,
MMObjectNode node)
The GUIIndicator can depend on the locale. |
protected String |
getLocaleGUIIndicator(Locale locale,
String field,
MMObjectNode node)
The GUIIndicator can depend on the locale. |
protected Map<String,Integer> |
getNameToNumberCache()
|
protected Map<Integer,String> |
getNumberToNameCache()
|
String |
getSingularName(String builderName,
String language)
|
String |
getValue(int type)
Obtain the buildername of the requested type |
Object |
getValue(MMObjectNode node,
String field)
Provides additional functionality when obtaining field values. |
String |
getValue(String type)
Deprecated. use getValue(int) |
boolean |
init()
Sets the default deploy directory for the builders. |
int |
insert(String owner,
MMObjectNode node)
Insert a new object (content provided) in the cloud, including an entry for the object alias (if provided). |
int |
insert(String owner,
MMObjectNode node,
boolean loadBuilder)
Insert a new object (content provided) in the cloud, including an entry for the object alias (if provided). |
boolean |
isRelationTable(String name)
|
protected MMObjectBuilder |
loadBuilder(MMObjectNode node)
|
void |
loadTypeDef(String name)
|
boolean |
reloadBuilder(String objectname)
|
void |
removeNode(MMObjectNode node)
Remove a node from the cloud, when the represented builder was active it will also be unloaded |
boolean |
setValue(MMObjectNode node,
String fieldName,
Object originalValue)
Sets a key/value pair in the main values of this node. |
protected void |
storeBuilderConfiguration(MMObjectNode node)
|
protected MMObjectBuilder |
unloadBuilder(MMObjectNode node)
|
void |
unloadTypeDef(String name)
|
| Methods inherited from class org.mmbase.module.core.MMTable |
|---|
count, count, created, getFullTableName, getMMBase, getNode, getNodes, getNodes, getNodes, getNodeType, getStorageConnector, getTableName, search, searchVector, setMMBase, setTableName, size |
| Methods inherited from class org.mmbase.util.functions.FunctionProvider |
|---|
addFunction, createParameters, getFunction, getFunctions, getFunctionValue |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String PROPERTY_DEPLOY_DIR
String defaultDeploy
| Constructor Detail |
|---|
public TypeDef()
| Method Detail |
|---|
public boolean init()
init in class MMObjectBuilderMMObjectBuilder.create()protected Map<Integer,String> getNumberToNameCache()
protected Map<String,Integer> getNameToNumberCache()
public int insert(String owner,
MMObjectNode node)
MMObjectBuilder.preCommit(org.mmbase.module.core.MMObjectNode).
Asside from that, this method loads the builder this node represents, and initalizes it. If you do
not wish to load the builder (i.e. because it is already loaded), use insert(String, MMObjectNode, boolean)
insert in class MMObjectBuilderowner - 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 insert(String owner,
MMObjectNode node,
boolean loadBuilder)
MMObjectBuilder.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.loadBuilder - if true, the builder should be loaded. This method is set to
false when it is called from the init() method of MMObjectBuilder to prevent
it from being loaded twice
int value which is the new object's unique number, -1 if the insert failed.public boolean commit(MMObjectNode node)
MMObjectBuilder.preCommit(org.mmbase.module.core.MMObjectNode).
Use only to commit changes - for adding node, use insert(java.lang.String, org.mmbase.module.core.MMObjectNode).
commit in class MMObjectBuildernode - The node to be committed
public void removeNode(MMObjectNode node)
removeNode in class MMObjectBuildernode - The node to remove.
RuntimeException - When the operation could not be performedpublic int getIntValue(String builderName)
builderName - name of the builder
public String getValue(int type)
type - the object type
public String getValue(String type)
type - the object type
public String getSingularName(String builderName,
String language)
public boolean isRelationTable(String name)
public Object getValue(MMObjectNode node,
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.
getValue in class MMObjectBuildernode - the node whos efields are queriesfield - the fieldname that is requested
public boolean setValue(MMObjectNode node,
String fieldName,
Object originalValue)
setValue in class MMObjectBuildernode - fieldName - the name of the field to changeoriginalValue - the value which was original in the field
true When an update is required(when changed),
false if original value was set back into the field.
public boolean fieldLocalChanged(String number,
String builder,
String field,
String value)
MMObjectBuilder
fieldLocalChanged in class MMObjectBuildernumber - Number of the changed node as a Stringbuilder - type of the changed nodefield - name of the changed fieldvalue - value it changed to
trueprotected String getBuilderConfiguration(MMObjectNode node)
node - The node, from which we want to know it;s MMObjectBuilder
null in case of strange failures
When the builder was not loaded.public MMObjectBuilder getBuilder(MMObjectNode node)
node - The node, from which we want to know its MMObjectBuilder
null
if the builder was not loaded.public boolean reloadBuilder(String objectname)
public String getGUIIndicator(MMObjectNode node)
getGUIIndicator in class MMObjectBuildernode - The node to display
String
protected String getLocaleGUIIndicator(Locale locale,
String field,
MMObjectNode node)
getLocaleGUIIndicator in class MMObjectBuilder
protected String getLocaleGUIIndicator(Locale locale,
MMObjectNode node)
MMObjectBuilderMMObjectBuilder.getNodeGUIIndicator(MMObjectNode, org.mmbase.util.functions.Parameters) for more flexibility.
getLocaleGUIIndicator in class MMObjectBuilderpublic void loadTypeDef(String name)
public void unloadTypeDef(String name)
public Vector<String> getList(PageInfo sp,
StringTagger tagger,
StringTokenizer tok)
MMObjectBuilder
getList in class MMObjectBuildersp - The PageInfo (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
Vector containing the result values as a String
protected Object executeFunction(MMObjectNode node,
String function,
List<?> args)
MMObjectBuilderMMObjectBuilder.getValue(MMObjectNode, String) method.
Derived builders should override this method to provide additional functions.
executeFunction in class MMObjectBuilderMMObjectBuilder.executeFunction(MMObjectNode, String, java.util.List)protected String getBuilderPath(MMObjectNode node)
node - The node, from which we want to know it;s MMObjectBuilder
null in case of strange failures
When the builder was not loaded.protected MMObjectBuilder loadBuilder(MMObjectNode node)
protected void storeBuilderConfiguration(MMObjectNode node)
throws IOException
IOExceptionprotected MMObjectBuilder unloadBuilder(MMObjectNode node)
protected boolean deleteBuilderConfiguration(MMObjectNode node)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||