The code table file format

The code table file is an XML document that consists of a number of distinct elements and attributes. For a sample code table, see Rules of code table merges.

As a standard XML document, the encoding attribute indicates that the file is encoded in UTF-8. While this encoding is respected and maintained by an XML aware editor, some other editors do not maintain this encoding by default. You might have to specifically save a file that contains UTF-8 characters as UTF-8 with these editors.

The <codetables> element

The <codetables> element is the root element of a code table file and it groups all other elements together. The codetables element has the following attributes:

Table 1. Attributes of the codetables element

Attribute Name

Required

Default

Description

package

Yes

None

Specifies the package the generated symbol definition Java file is part of.

hierarchy_name

No

None

Identifies the code table file as containing a hierarchy of code tables.

The <description> element for the <codetables> element

The <description> element is an optional subelement in the <codetables> root element. It is used to define a description for the code tables. It must be listed first, before the other subelement, <codetable> and must be listed only once. The <description> element has no attributes.

The <codetable> element for the <codetables> element

The <codetable> element is a subelement in the <codetables> root element. The <codetable> element must follow the <description> element where specified. For an ordinary code table file definition, only a single <codetable> element can be defined. If a hierarchy_name attribute is specified in the <codetables> element, multiple <codetable> elements are allowed when they are linked correctly in a hierarchy.

The codetable element groups a number of <code> elements together and an optional <codetabledata> element.

The <codetable> element has the following attributes:

Table 2. Attributes of the codetable element

Attribute Name

Required

Default

Description

name

Yes

None

A unique identifier for the code table. The name attribute is trimmed of leading and trailing spaces on code table generation. Some restrictions apply to the name attribute when the <displaynames> element is specified. For more information, see Artifacts produced by the ctgen build target.

java_identifier

Yes

None

The name of the generated symbol definition Java file. This identifier cannot be duplicated for code tables with different names.

parent_codetable

No

None

Used to define the name of the parent code table in the hierarchy, where the code table file was defined as a hierarchy of code tables.

The <codetabledata> element

The <codetabledata> element is an optional subelement of <codetable> that groups the locale-specific comments for a code table. Each <codetable> element can have one optional <codetabledata> element. The <codetabledata> element can contain multiple optional <locale> elements.

Note: The <codetabledata> element and its child elements are optional elements.

The <codetabledata> element has the following attributes:

Table 3. Attributes of the codetabledata element

Attribute Name

Required

Default

Description

language

Yes

None

Specifies the language portion of the locale for the codetabledata element.

country

No

None

Specifies the country portion of the locale for the codetabledata element.

The <locale> element for the <codetabledata> element

The optional <locale> element can occur multiple times for the <codetabledata> element. Each <locale> element can contain one optional <comments> element.

The locale element has the following attributes:

Table 4. Attributes of the locale element

Attribute Name

Required

Default

Description

language

Yes

None

Specify a language that corresponds to a supported locale.

country

No

None

Specify a country that corresponds to a supported locale and language.

The <comments> element for the <codetabledata> element

The optional <comments> element is used to store the locale-specific comments for a code table.

The comments element has no attributes.

The <displaynames> element

The <displaynames> element groups a number of code table hierarchy <name> elements together, and it also groups a number of code table name <locale> elements together. It is an optional element. However, if present it can contain any one <name> element or <locale>, having a <locale> element helps the client to display the code table name in the locale set for the current user. The displaynames element has no attributes.

The <name> element

The <name> element is optional when the <displaynames> element is present. The name that contains the locale for the current user is displayed when displaying the <name> values on the client. However, if the current user's locale does not match any of the locales that are specified within the <name> element, then the <codetable> name attribute is displayed.

The name element has the following attributes:

Table 5. Attributes of the name element

Attribute Name

Required

Default

Description

language

Yes

None

Specifies the language portion of the locale for the name element.

country

No

None

Specifies the country portion of the local for the name element.

The <locale> element

The <locale> element is optional and is used to add localizable display names to represent the code table name when the <displaynames> element is present. The name that contains the locale for the current user is displayed when displaying the <codetable> name attribute on the client. However, if the current user's locale does not match any of the locales that are specified within the <locale> element, then the <codetable> name attribute is displayed.

The locale element has the following attributes:

Table 6. Attributes of the locale element

Attribute Name

Required

Default

Description

language

Yes

None

Specifies the language portion of the locale for the name element.

country

No

None

Specifies the country portion of the local for the name element.

The <code> element

The <code> element is a subelement of <codetable> and groups a number of <locale> elements together. The code element has the following attributes:

Table 7. Attributes of the code element

Attribute Name

Required

Default

Description

value

Yes

None

A unique identifier for the code in the code table.

status

Yes

None

Indicates whether the code table is enabled and selectable in the list of codes as displayed on the client. It can be set to either ENABLED or DISABLED and if set to anything else it is considered to be DISABLED.

default

No

None

Indicates whether this code is the default code for the code table. You must specify only one default code. The default code is used to define the initially selected value in an editable code table list in the client. For more information, see Cúram web client reference.

java_identifier

No

None

Used as part of the generated symbol definition Java file

removed

No

false

Set to true to indicate whether the code is to be removed and hence not included in the generated artifacts.

parent_code

No

None

Used to define the name of the code in the specified parent code table in the hierarchy that this code is linked to. For more information about defining a code table hierarchy, see Code table hierarchy.

The <locale> element for the <code> element

The <locale> element contains two mandatory subelements (<description> and <annotation>) and one optional subelement <comments>, which are used to describe the code.

To be included during generation of the code table artifacts, each <locale> element must specify a language (and optional country) attribute that corresponds to a supported locale. The SERVER_LOCALE_LIST environment variable is a comma-separated list of locales that are supported, where the locale is either of the form language or language_country as shown in this example:

SERVER_LOCALE_LIST=en, en_US, en_GB

The locale element has the following attributes:

Table 8. Attributes of the locale element

Attribute Name

Required

Default

Description

language

Yes

None

Specifies a language that corresponds to a supported locale.

country

No

None

Specifies a country that corresponds to a supported locale and language.

sort_order

No

None

Specifies the order in which the codes in a code table are displayed in the drop-down list on an edit page in the client.

The <description> element for the <locale> element

The <description> element is used to provide a description for the <code> element. The description element has no attributes.

The <annotation> element for the <locale> element

The <annotation> element is used to provide an annotation to the <code> element. The annotation element has no attributes.

The <comments> element for the <locale> element

The optional <comments> element is used to store the locale-specific comments for a code table item. This element can be used to provide localized information to aid in understanding the usage for a code table item, and any implication of change to it.

The comments element has no attributes.

The <views> element

The <views> element is an optional subelement of the <codetable> element that groups one or more views of the code table. Each child view corresponds to a specific application context. For more information, see Application definition.

The <views> element has no attributes.

The <view> element

The <view> element is a subelement of the <views> element. Each view corresponds to a specific application context. The <view> element groups a number of view <code> elements together. The <code> elements in the <view> element are structurally different from the elements that are defined in the <code table> element. The view <code> element contains the code of a code table item that is displayed when the application is running in a context that is defined by the parent <view> element.

The <view> element has the following attributes.

Table 9. Attributes of the views element

Attribute Name

Required

Default

Description

context

Yes

None

The application context code table code value that is taken from the ApplicationContext code table. For more information, see Application definition.

default_code

No

None

A code table code value that is defined in the <code table> element and must be one of the codes that are defined by the child code elements of the current view element. This code table item of this code is displayed as the default code table in the user interface when this code table view is accessed.

overwrite No False Boolean value that indicates whether this view overwrites a view that is located in another code table in a different component when the code tables are merged. When two code tables are merged, the views that have the same application context are merged. For more information about merging code table views, see Rules of code table merges.

The <code> element for the <view> element

The <code> element is a subelement of <view> element. The <view> element groups one or more <code> elements together. Each <code> element holds the code of a code table item that is displayed when the application is running in a context that is defined by the parent <view> element. This <code> element in the <view> element is structurally different from the one that is defined for the <codetable> element.

The <code> element has the following attributes:

Table 10. Attributes of the <code> element

Attribute Name

Required

Default

Description

value

Yes

None

A code table code value that is defined in the <codetable> element.