Home > Models

Labels and Messages

EBX.Platform allows you to enrich your Master Data models with labels and error messages displayed in EBX.Manager tool .


Label and description

A label and a description can be added to each node in an adaptation model.

In EBX.Manager, each adaptation node is displayed with its label. If no label is defined, the name of the element is used instead.

Two notations are available:

The description may also have an hyperlink, either a standard html href to an external document, or an EBX.Manager link to another node in the adaptation.

Example:

<xs:element name="misc1type="xs:string>
        <xs:annotation>
          <xs:documentation>
            Miscellaneous 1. This is the description of miscellaneous element #1.
            Click &lt;a href="http://www.orchestranetworks.com" target="_blank"&gt;here&lt;/a&gt;
            to learn more about EBX.Platform.
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="misc2type="xs:string>
        <xs:annotation>
          <xs:documentation>
            <osd:label>
            Miscellaneous 2
            </osd:label>
            <osd:description>
              This is the miscellaneous element #2 and here is a 
              <
osd:link path="../misc1"> link to another node in the 
              adaptation</osd:link>.
            </osd:description>
          </xs:documentation>
        </xs:annotation>
</xs:element>

If a node points to a named type, then the label of the node replaces the label of the named type. The same mechanism applies for the description of the node (osd:description).

Enumeration labels

A simple and not localized label can be added to each enumeration element, by means of the attribute osd:label .

Example:

<xs:element name="ServicemaxOccurs="unbounded">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="1osd:label="Blue"/>
            <xs:enumeration value="2osd:label="Red"/>
            <xs:enumeration value="3osd:label="White"/>
          </xs:restriction>
        </xs:simpleType>
</xs:element>

It is also possible to fully localize the labels by means of the standard xs:documentation element.

Example:

<xs:element name="accessminOccurs="0">
    <xs:simpleType>
        <xs:restriction base="xs:string">
            <xs:enumeration
                value="readOnly">
                <xs:annotation>
                    <xs:documentation xml:lang="en-US">
                        read only
                    </xs:documentation>
                    <xs:documentation xml:lang="fr-FR">
                        lecture seule
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration
                value="readWrite">
                <xs:annotation>
                    <xs:documentation xml:lang="en-US">
                        read/write
                    </xs:documentation>
                    <xs:documentation xml:lang="fr-FR">
                        lecture écriture
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration
                value="hidden">
                <xs:annotation>
                    <xs:documentation xml:lang="en-US">
                        hidden
                    </xs:documentation>
                    <xs:documentation xml:lang="fr-FR">
                        masqué
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>
</xs:element>

Mandatory error message (osd:mandatoryErrorMessage)

If the node specifies the attribute minOccurs="1" (default behavior), then a required error message is displayed if the user does not fill the field. This error message can be specific to each node by using the element osd:mandatoryErrorMessage

Example:

<xs:element name="birthDatetype="xs:date">
        <xs:annotation>
          <xs:documentation>
            <osd:mandatoryErrorMessage>
            Please give your birth date.
            </osd:mandatoryErrorMessage>
          </xs:documentation>
        </xs:annotation>
</xs:element>

The mandatory error message can be localized:

<xs:documentation>
    <osd:mandatoryErrorMessage xml:lang="en-US">
        Name is mandatory
    </osd:mandatoryErrorMessage>
    <osd:mandatoryErrorMessage xml:lang="fr-FR">
        Nom est obligatoire
    </osd:mandatoryErrorMessage>
</xs:documentation>

Conversion error message

For each predefined XML Schema element, it is possible to define a specific error message if the user entry has an incorrect format.

Example:

<xs:element name="emailtype="xs:string">
        <xs:annotation>
          <xs:appinfo>
            <fmt:string>
              <fmt:ConversionErrorMessage xml:lang="en-US">
                Please enter a valid e-mail address.
              </fmt:ConversionErrorMessage>
              <fmt:ConversionErrorMessage xml:lang="fr-FR">
                Saisissez un e-mail valide.
              </fmt:ConversionErrorMessage>
            </fmt:string>
          </xs:appinfo>
        </xs:annotation>
</xs:element>

Error message associated to a facet

XML Schema facet (osd:defaultErrorMessage)

The error message is described by the element osd:defaultErrorMessage in annotation/documentation under the definition of the facet.

Example:

<xs:element name="zipCode">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <!--facet is not localized, but error message is localized-->
            <xs:minInclusive value="01000">
              <xs:annotation>
                <xs:documentation>
                  <osd:defaultErrorMessage xml:lang="en-US">
                    Postal code not valid.
                  </osd:defaultErrorMessage>
                  <osd:defaultErrorMessage xml:lang="fr-FR">
                    Le code postal n'est pas valide.
                  </osd:defaultErrorMessage>
                </xs:documentation>
              </xs:annotation>
            </xs:minInclusive>
          </xs:restriction>
        </xs:simpleType>
</xs:element>

XML Schema enumeration facet (osd:enumerationErrorMessage)

The error message is described by the element osd:enumerationErrorMessage in annotation/documentation under the definition of the facet.

Example:

<xs:element name="Gender">
        <xs:annotation>
          <xs:documentation>
            <osd:enumerationErrorMessage>
            Please indicate a valid gender.
            </osd:enumerationErrorMessage>
          </xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="0osd:label="male"/>
            <xs:enumeration value="1osd:label="female"/>
          </xs:restriction>
        </xs:simpleType>
</xs:element>

EBX.Platform Facet (osd:defaultErrorMessage)

The error message is described by the element osd:defaultErrorMessage under the definition of the facet (which is defined in annotation/appInfo/otherFacets).

Example:

<xs:element name="pricetype="xs:decimal">
        <xs:annotation>
          <xs:appinfo>
            <osd:otherFacets>
              <osd:minInclusive path="../priceMin">
              <osd:defaultErrorMessage xml:lang="en-US">
                The amount
                '{1}' is too low.
              </osd:defaultErrorMessage>
              <osd:defaultErrorMessage xml:lang="fr-FR">
                Le montant
                '{1}' est trop bas.
              </osd:defaultErrorMessage>
              </osd:minInclusive>
            </osd:otherFacets>
          </xs:appinfo>
        </xs:annotation>
</xs:element>

Home > Models