This software is OSI Certified Open Source Software. OSI Certified is a certification mark of the Open Source Initiative.
The license (Mozilla version 1.0) can be read at the MMBase site. See http://www.mmbase.org/license
Table of Contents
By installing applications or adding your own builder files you can expand the object types that can be used in MMBase.
Active builders are stored in the builders
directory of the MMbase configuration directory. New MMBase installations only contain the core builders. In order to add an object type, you need to add a builder xml, with the name objecttype.xml
somewhere in the builders directory.
You can make use of subdirectories to divide your builders in groups for easier maintenance. Note that the MMBase core builders are located under core
, and that the applications by default install new builders under applications
.
A builder file uses the following general format:
<?xml version="1.0" encoding="UTF-8"?> <builder xmlns="http://www.mmbase.org/xmlns/builder" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mmbase.org/xmlns/builder http://www.mmbase.org/xmlns/builder.xsd" name="..." maintainer="..." version="..." extends="..."> <status>...</status> <class>...</class> <searchage>...</searchage> <names> <singular xml:lang="...">...</singular> ... <plural xml:lang="...">...</plural> ... </names> <descriptions> <description xml:lang="...">...</description> ... </descriptions> <properties> <property name="...">...</property> ... </properties> <fieldlist> <field> <descriptions> <description xml:lang="...">...</description> ... </descriptions> <gui> <guiname xml:lang="...">...</guiname> ... </gui> <editor> <positions> <input>...</input> <list>...</list> <search>...</search> </positions> </editor> <datatype base="..." xmlns="http://www.mmbase.org/xmlns/datatypes"> ... (like in datatypes.xml)... </datatype> <db> <name>...</name> <type state="..." notnull="..." key="...">...</type> </db> </field> ... </fieldlist> </builder>
Most builders include less information than given here - since they can extend from each other, you only need to supply information that overrides the default, or when you add information such as fields.
The following sections explains the use and intention of each tag in detail.
The builder tag is the main tag. It's attributes define the builder's identity and place in the builder hierarchy. It is the parent of all other tags.
The maintainer of the builder. This attribute is mandatory, and should contain the name of the organization maintaining the builder. This is generally a domain name. For the core builders this value is mmbase.org
Example 1. Example Builder Tag
<builder name="people" maintainer="mycompany.com" version="1" extends="object"> ... </builder>
The status tag determines whether a builder is active or not. Valid values are active
and inactive
.
You generally do not specify this tag unless you want to turn a builder off
The java class used by this builder to administrate nodes of that builder type.
Specify this tag if you have custom behavior defined for an object type.
The default value for a builder that extends the core builder object is org.mmbase.module.builders.Dummy
.
The default value for a builder that extends the core relation builder insrel is org.mmbase.module.corebuilders.InsRel
.
The value given here is used in a number of generic editors, as a default value for the maximum age in days when searching for objects in MMBase.
Since this value is not available through the MMBase Bridge interface, this value is mostly used in older editors, that directly access the core system (such as SCAN).
The default value for a builder that extends the core builder object is 1000
.
This section is used to supply gui (graphical user interface) names for the builder. The information is generally used in generic editors, as well as the default value for use in the editwizards.
You can include gui names for different languages. the system picks the correct name depending on its currently specified locale.
A singular presentation of the builder object type, such as 'Person' or 'Company'.
en
.A plural presentation of the builder object type, such as 'People' or 'Companies'.
en
.This section is used to supply a description or help text for the builder. It may include information on the type of objects, specific behavior,and how it should be used.
You can include descriptions for different languages. the system picks the correct description depending on its currently specified locale.
A description of the builder object type.
en
.A list of name-value pairs, used by the java class specified in class as configuration parameters. You normally only specify properties for objects with specific behavior (such as Images).
This tag is used to supply a description or help text for the field. It may include information on the type of objects, specific behavior,and how it should be used. This description is used (among other places) in the editwizards.
You can include descriptions for different languages. The system picks the correct description depending on its currently specified locale.
A description of the field.
en
.This section contains gui (graphical user interface) information for the field. The information is generally used in generic editors, as well as the default value for use in the editwizards.
This tag includes gui names for different languages to represent a label for the field. The system picks the correct name depending on its currently specified locale.
It can also contain one guitype, which explains how the field should be rendered or edited.
A text to use as label for the field, such as 'First Name'.
en
.The data type used to determine how a field should be rendered or edited. There are a number of predefined values for the base attribute (defined in config/datatypes.xml).
Example 9. Example DataType Tag
<datatype base="date" xmlns="http://www.mmbase.org/xmlns/datatypes"> <default value="today + 100 year" /> <minInclusive enforce="never" value="yesterday" /> <maxInclusive enforce="always" value="today + 100 year" /> </datatype> <db> <name>end</name> <type key="false" notnull="false" state="persistent">DATETIME</type> </db>
Determines settings for this field when used in a generic editor.
The symbolic name of this field. The symbolic name is used to refer to the field in programming code or in a taglib or SCAN template. It is also used to map the field to a field in a database table.
the MMBASE type of the field. This determines, among other things, validation rules and the type of the field in the database.
Possible attributes are:
Either persistent
, system
or virtual
.
A persistent
or system
field is stored in the database, a virtual
field is generated live and not stored.
A system
field cannot be altered except by the MMBase system.
true
or false
. If true
, this field cannot be empty. This is not currently enforced except by the editwizards.true
or false
. If true
, this field must be unique.Possible values are:
Example 13. Example Builder Config
<fieldlist> <field> <descriptions> <description xml:lang="en">First name or initials of our contact.</description> <description xml:lang="nl">Voornaam of initialen van de contactpersoonen.</description> </descriptions> <gui> <guiname xml:lang="en">First name</guiname> <guiname xml:lang="nl">Voornaam</guiname> </gui> <editor> <positions> <input>4</input> <list>-1</list> <search>4</search> </positions> </editor> <datatype base="line" xmlns="http://www.mmbase.org/xmlns/datatypes" /><!-- no newlines in names --> <db> <name>firstname</name> <type state="persistent" size="255" key="false" notnull="false">STRING</type> </db> </field> </fieldlist>
This is part of the MMBase documentation.
For questions and remarks about this documentation mail to: [email protected]