RadixWare Programmer Guide/Definition Types/Application Definition Segment/MSDL Schema Editor

From RadixWiki
Jump to: navigation, search

MSDL Schema Editor

The editor looks as:

Msdl-editor.jpg

MSDL Schema editor is the editor of the root node of the schema. It consists of three panes:

  • Msdl Schema <Name of Definition>
  • Structure Settings
  • Message Format
"Msdl Schema" Pane

The pane is used to set up the common parameters of the definition:

  • The access mode to the definition. Refer to Select Access Mode.
  • Definition Name. The name of the definition.
  • Namespace. The name space used for the names of fields in the schema (the analog of the targetNamespace attribute in an XML Schema).
  • Preprocessor class. The dynamic class that must be used for parsing the message.

The View XSD Schema... button opens the editor used to view XML schema generated by MSDL schema.

The Test button opens the dialog box for testing MSDL schema.

"Structure Settings" Pane

The pane is used to define the way the child fields of the schema are stored (they are arranged as the Structure). For the description of pane, refer to Editor of "Structure" Type Field.

"Message Format" Pane

The pane is used to define the formatting parameters for storing the whole message. The pane elements are similar to those of the Field Format pane (refer to Common Field Parameters) in the editors of the schema fields.

Common Field Parameters

The field editor of MSDL schema contains three panes: Header, Field Format and Settings. The Header and Field Format panes are common for all field types. The contents of the Settings pane depend on the field type.

"Header" Pane

The pane contains the following parameters:

  • Name. The field name.
  • Type. The field type.
  • Comment. The field comment.
  • Tag. This parameter is used to identify the schema fields. For example, it is used as a field name when the Named Fields storing variant is selected.
  • Nullable. If the flag is set, the field can be set to NULL. This parameter is available for not all field types display .
  • Required. If the flag is set, the field is mandatory.
  • Array. If the flag is set and the message contains the repeating fields with the same tag, their values will be written to array. The parameter is available for the fields with the Named Fields or BerTLV formatting method.

Note.jpgIf the Array flag is not set, each field in the message will be written to the previous one. As a result, only the value of the last field will be saved.

  • Union. If the flag is set, all values of sub-fields of the current field will be joined in the same element. If the flag is not set, the each value of the child field will be written to an independent element. The parameter is available for the Structure fields with the Named Fields formatting method.

Example.jpgLet’s consider how the message is parsed by the MSDL schema if the settings are defined as follows:

  • On the Child Fields Format page (the Structure Settings schema editor pane):
  • Named Fields value is specified in the Type parameter
  • "~" value is specified in the Field Separator parameter
  • Used encoding - ASCII.
  • The scheme contains the following fields:
  • the a field of the Str type (for which the "a" value is specified in the Tag parameter)
  • the at field of the Structure type for which:
  • the "@" value is specified in the Tag parameter
  • the Named Fields value is specified in the Type parameter (the Child Fields Format page)
  • the child fields b and с of Str type are created (the "b" and "c" values are defined in the Tag parameter for these fields)

Depending on the settings of the at field, the result of parsing the message a10~@b20~@c30 by the scheme described above can differ. Possible variants:

Variant 1: The Array and Union flags are not set. The XML code generated by the MSDL schema will be as follows:

<?xml version="1.0" encoding="UTF-8"?>
<MessageInstance xmlns="http://schemas.radixware.org/MessageMsdl.xsd">
<a>10</a>
<at>
  <с>30</с>
</at>
</MessageInstance>

Variant 2: The Array flag is set, the Union flag is not set. The XML code generated by the MSDL schema will be as follows:

<?xml version="1.0" encoding="UTF-8"?>
<MessageInstance xmlns="http://schemas.radixware.org/MessageMsdl.xsd">
<a>10</a>
<at>
  20
</at>
<at>
  <c>30</c>
</at>
</MessageInstance>

Variant 3: The Union flag is set (in this case, the parsing result does not depend on the Array flag). The XML code generated by the MSDL schema will be as follows:

<?xml version="1.0" encoding="UTF-8"?>
<MessageInstance xmlns="http://schemas.radixware.org/MessageMsdl.xsd">
<a>10</a>
<at>
  20
  <c>30</c>
</at>
</MessageInstance>

The Test this field… button opens the dialog box for testing the field.

"Field Format" Pane

The pane is used to define the formatting parameters of the current schema field: Note.jpgThe values of parameters marked with the symbol "*" can be inherited from the parent field (or from the whole schema). For this purpose, set the flag to the right of parameter.

  • Type. The formatting type. Available values:
    • None. Uses the formatting parameters specified for the parent field (or for the whole schema).
    • Fixed Length. The field length has a fixed number of bytes. If this value is selected, the following parameters become available:
      • Length. The number of units for storing this field.
      • Unit*. The units of measuring the Length field. Available values: Byte, Char, Element.
      • Align*. The field alignment if the value takes less space than the field length. Available values: None, Left, Right.
      • Pad. The character used to pad a field to the required length.
    • Separated. The field value is separated by the special characters. If these characters are present in the field value, they are escaped. If selected, the following parameters are available:
      • Start Separator*. The character placed before the field value.
      • End Separator*. The character placed after the field value.
      • Escape Char Format*. The way the special escape characters are represented. Available values: As Is, Hex.
      • Escape Char*. The characters for escaping.
      • Escaped Bytes. The additional bytes that also must be escaped.
    • Embedded Length. The length of the field value is located before the value. If selected, the following parameters are available:
      • Self Inclusive*. Available values:
        • Inclusive. When calculating the field length, the bytes for storing the field length will be considered.
        • Not inclusive. The bytes for storing the field length will not be considered when calculating the field length.
      • Unit*. The units of measuring the length of the field value.
      • 'Encoding'*. The encoding used to store the field length.
      • Piece. The parameters of the field length formatting. The parameters are similar to those of the Field Format pane.
      • Bounded. If the flag is set, the following settings of field length are available:
        • Low / High bound. The minimum / maximum length.
        • Alignment*. The field alignment if the value takes less space than the field length. Available values: None, Left, Right.
        • Padding*. The character used to pad a field to the required length.

Character Encoding

MSDL schemas support the following character encodings:

  • Hex. The hexadecimal character record.
  • ASCII. The character itself.
  • EBCDIC. The character number in EBCDIC encoding. Note.jpg When re-encoding the character that is not included in the EBCDIC table, the code 6F (corresponding to symbol ’?’) is written to result.

Example.jpgThe byte 0b01010010 can be represented as follows:

  • Two characters "52" in ASCII encoding (the bytes 0x35, 0x32) if the Hex variant is selected.
  • One byte 0b01010010 (the "R" character in ASCII encoding) if the ASCII variant is selected.
  • Two characters "52" in EBCDIC encoding (the bytes 0xF5, 0xF2) if the EBCDIC variant is selected.

Editor of "Structure" Type Field

The properties of the child schema fields are defined on the Structure Settings pane of the Structure type field editor. The pane contains the following pages: Child Fields Format, Field Defaults, Formatting Defaults.

"Child Fields Format" Page

The page is used to define the parameters of storing the schema fields:

  • Type. The type of the field structure. Available values:
    • Fields Sequence. The structure represents a list of fields. If selected, the following parameter is available:
      • Field Separator. The character used to separate the fields.
    • Bitmap. The string starts with the binary data of 64 bits (bitmap) in length, the value of each bit indicates the presence / absence of the respective field. If selected, the following parameters are available:
      • Bitmap encoding. The encoding used to store the bitmap.
      • First Bit Behaviour. The value of the first bit in the bitmap. Available values:
        • Continue. The first bit means that the following block contains the bitmap too.
        • Field. The first bit does not have a special value.
      • Block Length. The block length used to store the bitmap (by default - 8 bytes).
    • Named Fields. The structure represents a list of the named fields. Each field starts with the field name in the defined format. If selected, the following parameters are available:
      • Field Separator. The character used to separate the fields.
      • Field Name Format. The parameters define the format in which the field names must be stored. The parameters are similar to those of the Field Format pane.
      • Default Length Format. If the flag is set, the fields (that do not have the explicit definition) will be excluded when parsing the message depending on the following settings of length format:
        • Encoding. The encoding used to store the field length.
        • Default Length Format. The parameters defining the format of length of undefined fields. The parameters are similar to those of the Field Format pane.
    • BerTLV. The data is stored in BerTLV format. If selected, the following parameter is available:
      • Encoding. The encoding used for data in the BerTLV format.
    • DBF. The data is stored in DBF format. If selected, the following parameter is available:
      • Encoding. The encoding used for data in DBF format.

Note.jpgSelecting DBF format uniquely defines how the data is stored. Therefore, the Field Defaults and Formatting Defaults pages are not available when selecting this option.

"Field Defaults" Page

The page contains several pages used to define the default parameters for the child fields of various types. The parameters on the pages correspond to those of the field editors of the respective type.

The Common page is used to define the default parameters for all field types:

  • Encoding. The encoding used for the string values.
  • Null indicator. The character considered to be the indicator of the NULL value. If the field value starts with the specified character, it will be considered that the field value is NULL.
  • Item Separator. The default separator.
"Formatting Defaults" Page

The page is used to define the default formatting parameters. The Fixed Length, Separated and Embedded Length pages contain the parameters corresponding to the formatting parameters of the fields (see the description of the Child Fields Format page above).

Editor of "Choice" Type Field

The left pane of the field editor of the Choice type contains the Selector (Str Field) and Selector Format pages.

"Selector (Str Field)" Page

The parameters on the page define the way the selector field is stored. This field value defines the child field to follow it. The parameters are similar to those of Editor of "Str" Type Field.

"Selector Format" Page

The parameters on the page define the parameters of the selector field formatting. The parameters are similar to those of the Field Format pane.

Editor of "Sequence" Type Field

The left pane of the field editor of the Sequence type contains the following parameter:

  • Item Separator. The character used to separate the child fields.

Editor of "Str" Type Field

The left pane of the field editor of the Str type contains the following parameters:

  • Encoding. The encoding used to store the value of the selector field.
  • Null Indicator. The character indicating the NULL value.
  • Default Value. The default value of the selector field (it will be used if the selector field is not present in the message).
  • Enum. The enumeration containing the values that the selector can take on. If the parameter is not set, the selector can take on any value.

Editor of "Num" Type Field

The left pane of the field editor of the Num type contains the following parameters:

  • Encoding. The encoding used to store the value.
  • Null Indicator. The character indicating the NULL value.
  • Plus Sign, Minus Sign. The characters with which the positive and negative numbers respectively start from.
  • Fractional Point. The decimal separator (usually a dot or a comma).
  • Default Value. The default value of the selector field (it will be used if the selector field is not present in the message).

Editor of "DateTime" Type Field

The left pane of the field editor of the DateTime type contains the following parameters:

  • Encoding. The encoding used to store the value.
  • Null Indicator. The character indicating the NULL value.
  • Format. The format used to store the date and time. Available values:
    • Flora. Uses the format of date and time applied in FloraWare.
    • Java. Uses the format of date and time applied in Java by default.
    • Str. Defines the arbitrary format of date and time. In the Pattern parameter, it is possible to define the format template. To parse and format the date, the java.text.SimpleDateFormat class is used.

Editor of "BCH" Type Field

The left pane of the field editor of the BCH type contains the following parameters:

  • Align. The field alignment if the value takes less space than the field length. Available values: None, Left, Right.
  • BCH Pad. The character used to pad a field to the required length.
  • Default Value. The default value of the selector field (it will be used if the selector field is not present in the message).

Editor of "Bin" Type Field Editor

The left pane of the field editor of the Bin type contains the following parameters:

  • Encoding. The encoding used to store the value of the selector field.
  • Null Indicator. The character indicating the NULL value.
  • Default Value. The default value of the selector field (it will be used if the selector field is not present in the message).

Editor of "Int" Type Field Editor

The left pane of the field editor of the Int type contains the following parameters:

  • Plus Sign, Minus Sign. The characters with which the positive and negative numbers respectively start from.
  • Encoding. The encoding used to store the value.
  • Null Indicator. The character indicating the NULL value.
  • Default Value. The default value of the selector field (it will be used if the selector field is not present in the message).
  • Enum. The enumeration the values of which can be taken by the selector. If the parameter is not set, the selector can take on any value.