# 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:

<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
Type Description MSSQL MySQL
CEAddressList
CEBoolean BIT BOOL
CEDate Is used for a date field. DATE DATE
CEEmail Is used for an e-mail. NVARCHAR(128) VARCHAR(128)
CEEmailList Is used if several e-mail addresses are to be maintained.
CEEnum
CEId Configuration see ceid-ceexternalid CHAR(36) CHAR(36)
CEIdList
CEInteger INT INT
CELong BIGINT BIGINT
CEPhone
CEText NVARCHAR(MAX) TEXT
CETextList
CETimestamp DATETIME2(4) DATETIME(4)
CEVarchar Maximum length is limited to 450 NVARCHAR VARCHAR
CEVarcharList
CEObjectLink Configuration see ceid-ceobjectlink
CEObjectLinkList Configuration see ceid-ceobjectlink
CEExternalObjectLink Configuration see ceid-ceobjectlink
CEExternalObjectLinkList Configuration see ceid-ceobjectlink
CEDouble FLOAT(53) DOUBLE
CEFloat FLOAT(24) FLOAT
CEExternalId Configuration see ceid-ceexternalid VARCHAR(63) VARCHAR(63)
CEExternalIdList Liste von CEExternalId VARCHAR(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

CEMetricList CEMetric[]
  • Example
    For the task module, the XML (name.xml) for the name field looks like this
<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:
<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)

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

New variant

<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