Display integer values as strings
For object class properties stored as integer values, you can assign an enumeration to the object class property to define an allowed value range and at the same time display the values as string on the Alfabet user interface. This is for example provided in the standard meta-model for the object class PERSON . Whether the user is a named user or an anonymous user is stored as an integer with 1 for named user, 2 for anonymous user, and 4 for users with no access. A private PersonType enumeration is assigned to the object class property. This enumeration restricts the integer values which can be set for the property to the valid values 1, 2, or 4 and provides a string for each integer value. When the user sets the value in the user interface, the drop-down list will display the string values only. The user can select between meaningful values.
You can define enumerations for custom object class propertyies and calculated object class properties only. Assignment of enumerations to private and protected object class properties is blocked.
Create an integer enumeration.
- In Alfabet Expand, go to the Meta-Model tab.
- Right-click the Enumerations node and select Add New Integer Enum.
- Set the attributes of the new enumeration:
- Name: Define a technical name for the enumeration.
- Comments: Optionally enter a comment about the meaning of the enumeration. This comment is only visible in Alfabet Expand
- Extract for Translation: Set to True to add the strings defined for enumeration items in the enumeration to the vocabulary. You can then provide translations for the strings for users rendering the Alfabet user interface in other than the primary language.
All attributes not listed here are currently not in use.
- For each integer users shall be able to set,right-click the enumeration node, select Add New Enumeration Items and specify the attributes of the enumeration item:
- Value: The integer value which will be stored when the user selects the enumeration item from the drop-down list.
- Caption: The string value the user will see in the drop-down list for setting the object class property.
- Comments: Optionally enter a comment about the meaning of the value. This comment is only visible in Alfabet Expand.
- You can define coloring and an icon for each enumeration item. It is recommended to use the coloring via style groups which adapts the colors to the color theme selected by the user.
- If you want to change the order of enumeration items, click the node of the enumeration, open the editor of the Sort Enumeration Items attribute, click an enumeration item in the list and use the arrow buttons on the upper right to change its position.
- In the toolbar, click the Save
button.
Assign the integer enumeration to the object class property.
In the Meta-Model under the Classes node, click the node of the custom object class property or calculated object class property to which you want to assign the enumeration. Select the enumeration in the Enumeration attribute.