Skip to content

Module fields ​

Fields are created in the modules folder fields. The result is the automatic creation of the corresponding field in the module table.

The file is structured as follows:

xml
<field>
   <name></name> <!-- required -->
   <type></type> <!-- required -->
   <length></length> <!-- Angabe der Feldlänge -->
   <default></default> <!-- Value der bei Create Record eingetragen wird -->
   <not_null></not_null> <!-- Darf das Feld NULL sein? Default: 'yes' -->
   <pk></pk> <!-- Primary key in der Tabelle? Default: 'no' -->
   <unique></unique> <!-- Der Value im Feld muss eindeutigsein -->
   <precision></precision>
   <scale></scale>
   <is_native></is_native>
   <value_option_key></value_option_key>
   <modules> <!-- nur für  CEExternalObjectLink und CEObjectLink -->
      <module></module>
   </modules> 
   <audit></audit> <!-- true | false um das Audit zu aktivieren | deaktivieren -->
   <dimensions>
     <dimension>channel</dimension>
     <dimension>locale</dimension>
   </dimensions>
</field>

Naming Rules ​

The following characters are allowed for field names:

  • lowercase letters
  • numbers (not as first character)
  • special character _ (underscore)

Not allowed are:

  • uppercase letters
  • special characters
  • spaces
  • reserved word "module"

The total length must not exceed 28 characters.

Available Values ​

The following values are available for the <type> depending on the context:

Tables with available field types
TypeDescriptionMSSQLMySQL
CEAddressList
CEBooleanBITBOOL
CEDateIs used for a date field.DATEDATE
CEEmailIs used for an e-mail.NVARCHAR(128)VARCHAR(128)
CEEmailListIs used if several e-mail addresses are to be maintained.
CEEnum
CEIdConfiguration see ceid-ceexternalidCHAR(36)CHAR(36)
CEIdList
CEIntegerINTINT
CELongBIGINTBIGINT
CEPhone
CETextNVARCHAR(MAX)TEXT
CETextList
CETimestampDATETIME2(4)DATETIME(4)
CEVarcharMaximum length is limited to 450NVARCHARVARCHAR
CEVarcharList
CEObjectLinkConfiguration see ceid-ceobjectlink
CEObjectLinkListConfiguration see ceid-ceobjectlink
CEExternalObjectLinkConfiguration see ceid-ceobjectlink
CEExternalObjectLinkListConfiguration see ceid-ceobjectlink
CEDoubleFLOAT(53)DOUBLE
CEFloatFLOAT(24)FLOAT
CEExternalIdConfiguration see ceid-ceexternalidVARCHAR(63)VARCHAR(63)
CEExternalIdListListe von CEExternalIdVARCHAR(63)VARCHAR(63)
CEAdditionalPermission
CEAdditionalPermissionList

CEMetric

Data type for metric fields.

name: Metric that is stored in this field.

default_unit: The unit for the metric field. If not set like name.

FLOAT(53)

DOUBLE

CEMetricListCEMetric[]
  • Example
    For the task module, the XML (name.xml) for the name field looks like this
xml
<field>
   <is_native>true</is_native>
   <name>name</name>
   <type>CEVarchar</type>
   <length>120</length>
   <not_null>true</not_null>
</field>

Element <dimensions> ​

Globally defined dimensions can be activated here. See dimensions_config. If an undefined dimension is specified, an error is output in catalina.out and the dimension is ignored.

CEMetric- Fields ​

The data type CEMetric allows to store data with one unit. The value for the unit (generated by the frontend) and the value for the base unit (generated by the backend) are stored.

The values are stored in the database with the data type CEDouble.

  • Example
    Field configuration for field of type CEMetric:
xml
<field>
  <is_native>true</is_native>
  <type>CEMetric</type>
  <not_null>true</not_null>
  <metric>
    <name>length</name>
    <default_unit>kilometer</default_unit><!-- if not set the value from name -->
  </metric>
</field>

Special field configuration ​

CEId-/CEExternalId- Fields ​

At these fields the target module must be configured. This is done with the element related_module in the XML. The newer variant provides for configuration in XML modules/module with only one module. If variant 2 does not work, use the old variant, otherwise use variant 2 for new developments.

Old variant (if possible do not use it anymore)

xml
<field>
  <is_native>true</is_native>
  <type>CEExternalId</type>
  <not_null>true</not_null>
  <related_module>data</related_module>
 </field>

New variant

xml
<modules>
  <module></module>
</modules>

only one "related" module is allowed here. As soon as exactly one "related" module is specified, a "virtual" relation is created. The name of the relation is constructed as follows: <parent_module>_<field_name>, where <parent_module> is the module where the field was configured. The relation can be used for "get" requests as well as for searching in both modules.

The configuration is similar to ceid-ceexternalid. The difference is that several related modules can be specified. For each specified module a "virtual" relation will be created. The name of the relation is constructed as follows: <parent_module>_<field_name>_<child_module>, where <parent_module> is the module in which the field was configured. The relation can be used for "get" requests as well as for searching in both modules.

Request missing documentation