Basic Presentation Customizations for Entities
Earlier, a model was loaded into the Xpress Insight application with the minimal required changes. Once deployed, the named entities in the model are presented to the user unchanged, and anonymous entities in the model are not visible.
The following options are customizable via Mosel annotations to modify the way in which the model entities are presented. Each entity in the model can have the following options set using the annotations:
- insight.alias: Sets an alias name that will be used in place of the entity name throughout the user interface.
- insight.hidden true: Marks the entity as hidden, and by default it will not be listed anywhere in the user interface. Some views allow this state to be unset manually to make hidden entities locally visible.
- insight.format $#,###.00: The format attribute controls how numeric values are displayed. If not present, numbers will be rendered in the manner of the current locale (e.g. the number 1234 would be rendered as 1,234 if your system uses US number formatting, or 1.234 if it uses French). The value of this attribute expresses, in a standard syntax, how the number is to be represented. This attribute can be used to control aspects such the currency symbol, the number of decimal places, and the presence and spacing of grouping separators.
- The syntax of the format attribute value adopts the number formatting conventions from Java (java.text.DecimalFormat).
- When editing or inserting a formatted value, the default formatting is used rather than the default formatting. The reason for this is so that numbers can be entered directly without having to conform to specific constraints (such as including a currency symbol or a set number of decimal places).
- insight.transform.labels.entity: Identifies an entity (B) to use for labels. Rather than display a data value from the original entity (A), the data value is used as the index for a lookup into the entity B. If the index exists in B, then the corresponding value from B is displayed rather than the original data value from A. The labels array B acts as a map from data values to labels for those data values and is commonly used to map integer data values to strings.
The labels entity B is required to be an array with an index set that is the same type as the data type for A. The data type of entity B can be any primitive type.