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
- Enumeration labels
- Mandatory error message (osd:mandatoryErrorMessage)
- Conversion error message
- Error message associated to a facet
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:
-
full notation: label and description are defined respectively by the elements
<osd:label>and<osd:description>. -
simple notation: the label is extracted from the text content up to the first dot ('
.') and/or this extraction is not longer than 60 characters; the description is the rest of the text.
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.
-
hrefnotation, and more generally any html notation must be escaped. -
EBX.Manager link notation is not escaped and it must specify the path of the target, for example:
<osd:link path="../misc1">link to another node in the adaptation</osd:link>
Example:
<xs:annotation>
<xs:documentation>
Miscellaneous 1. This is the description of miscellaneous element #1.
Click <a href="http://www.orchestranetworks.com" target="_blank">here</a>
to learn more about EBX.Platform.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="misc2" type="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:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="1" osd:label="Blue"/>
<xs:enumeration value="2" osd:label="Red"/>
<xs:enumeration value="3" osd: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: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: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:
<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: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: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: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="0" osd:label="male"/>
<xs:enumeration value="1" osd: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: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