Switch metadata format

Starting from Switch 10 new metadata feature was implemented: dependent metadata fields. Due to this the metadata format had been changed.

In order to keep compatibility with previous versions it was decided to extend existing SOAP calls with additional field containing metadata in new format.

The metadata is stored in the following format:

<ValueDescription Type="metadatafields">
<<Fields list>>
</ValueDescription>

Where <<Fields list>> is a list of xml tags in format:

<FieldID @Format @LocalizedTagName @Subtype @Tooltip @Type @ReadOnly @ValueIsRequired @Editor @FormatEditor @DisplayField @RememberLastValue @Dependency @Dependencyvalue>Default value</spMF_1>

When metadata came from Switch to Client tag contains default field value.

Attribute Description
FieldID Identification of the field, generated automatically by Switch
LocalizedTagName Name of field displayed on UI
Tooltip Tooltip of the field
Type Type of field. Possible values are: -          bool (Yes/No value) -          enum (drop down list) -          string (text edit) -          date (datetime) -          number (number edit) -          password (password edit) -          time (hours and minutes)
Subtype Always “inline”
Editor Always “inline”
Format Indicates format of the field input. Actual only for “string” and “number” Types. It should be regular expression
FormatEditor Specifies format of editor. Possible values are “inline” if format set as string and “regexp” if format is regular expression. Used only when modifying metadata fotmat
ReadOnly Indicates if field is readonly. Possible values are “Yes”/”No”
ValueIsRequired Indicates if field is mandatory or not. Possible values are “Yes”/”No”
DisplayField Indicates if field should be shown on UI. Possible values are “Yes”/”No”
RememberLastValue Indicates that Metadata editor should remember value entered last time, and provide it as default value. Possible values are “Yes”/”No”
Dependency If field has this attribute it means that current field is a child of field specified in Dependency attribute
Dependencyvalue This attribute specifies that current field will be displayed only when parent field has given value

Sample metadata:

<ValueDescription Type="metadatafields">
<spMF_1 Format="[0-9]{5}" LocalizedTagName="Customer Code" Subtype="inline" Tooltip="Please enter the customer code.&#xa;&#xa;e.g. 00234&#xa;&#xa;" Type="string" ReadOnly="No" ValueIsRequired="Yes" Editor="inline" FormatEditor="regexp" DisplayField="Yes" RememberLastValue="No"></spMF_1>
<spMF_2 Format="" Dependencyvalue="00123" LocalizedTagName="Publication" Subtype="inline" Tooltip="" Type="enum:TravelMagazine;NewsToday;" Dependency="spMF_1" ReadOnly="No" ValueIsRequired="No" Editor="inline" FormatEditor="inline" DisplayField="Yes" RememberLastValue="No"></spMF_2>
<spMF_3 Format="" Dependencyvalue="00123" LocalizedTagName="Color" Subtype="inline" Tooltip="Output color" Type="enum:B&amp;W;CMYK only;CMYK + Spot" Dependency="spMF_1" ReadOnly="No" ValueIsRequired="No" Editor="inline" FormatEditor="inline" DisplayField="Yes" RememberLastValue="No">CMYK only</spMF_3>
<spMF_4 LocalizedTagName="Express Print" Subtype="inline" Tooltip="" Type="bool" ReadOnly="No" ValueIsRequired="No" Editor="inline" DisplayField="Yes" RememberLastValue="No"></spMF_4>
<spMF_5 Format="" Dependencyvalue="Yes" LocalizedTagName="Timing" Subtype="inline" Tooltip="" Type="enum:Same day;Next day;3 day;" Dependency="spMF_4" ReadOnly="No" ValueIsRequired="No" Editor="inline" FormatEditor="inline" DisplayField="Yes" RememberLastValue="No"></spMF_5>
<spMF_10 Format="" Dependencyvalue="No" LocalizedTagName="Process date" Subtype="calendardate" Tooltip="" Type="date" Dependency="spMF_4" ReadOnly="No" ValueIsRequired="No" Editor="calendardate" FormatEditor="inline" DisplayField="Yes" RememberLastValue="No"></spMF_10>
<spMF_9 LocalizedTagName="Hard copy request" Subtype="inline" Tooltip="" Type="bool" ReadOnly="No" ValueIsRequired="No" Editor="inline" DisplayField="Yes" RememberLastValue="No"></spMF_9>
</ValueDescription>