close

Filter

loading table of contents...

Site Manager Developer Manual / Version 2304

Table Of Contents

5.1.6 Initializer Classes

<DocumentType name="article">
  <PropertyType name="Author">
    <Initializer class="myInitializer" myattribute="MyValue"/>
  </PropertyType>
</DocumentType>

Example 5.8. Example for the use of an initializer


Initializer fill the fields of a newly created document with default values. Thus, an initializer is defined in the element <PropertyType> of the XML file. A GenericInitializer is provided which fills String, Integer, Date and SGML text fields with a default value. In addition, an own initializer class can be used which must be declared via the element <Initializer>. Own initializers can be written, which must implement the interface hox.corem.editor.initialization.Initializer.

Initializer Description
GenericInitializer

This initializer fills String, Integer, Date and SGML text fields with a default value. The initializer is called implicitly, if the attribute initialValue of the element < PropertyType> is used. That is, the initializer is not explicitly specified via the attribute class. Thus, it is not allowed to use this initializer with the attribute class. If you want to initialize a Date field, you can use the following date formats:

  • yyyy-MM-dd

  • An ISO8601 format according to java.text.SimpleDateFormat.

  • yyyy-MM-ddTHH:mm:ss

  • An ISO8601 format according to java.text.SimpleDateFormat.

  • dd.MM.yyyy HH.mm

  • This format is locale dependent. It only works with a German locale.

Example:

A generic initializer that initializes the property "limit" with the value "20":

<DocumentType name="DynamicCollection">

<PropertyType name="limit" initialValue="20"/>

</DocumentType>

LinkListInitializer

This initializer fills a LinkList field with a document. Either the document defined via the path attribute is used or - if you omit the document and enter only the folder - the first document with the appropriate document type found in the folder given via the attribute path is used.

Example:

<Initializer class="LinkListInitializer" path="/default"/>

Table 5.25. Initializer classes


Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.