Entity
This page provides generated reference documentation for the Entity data model.
A business object to model the structure and type of the data
Overview
| Property | Summary |
|---|---|
| afterOperatingState | Process that runs after the operatingstate is changed. |
| afterSave | Process that is executed after the record has been successfully saved |
| afterUiInit | Process that is executed after the initialization of the UI (= after loading all displayed elements). |
| beforeOperatingState | Process that runs before the operatingstate is changed. |
| color | Defines a color for an element. |
| colorProcess | Defines a color for an element dynamically by executing the process. Where (or if) the color is used depends on different actors in the system and is defined… |
| comment | Property to store a developer comment in form of |
| contentDescriptionProcess | Process to determine a longer description based on content of a record within an entity. |
| contentTitleProcess | Process to determine the title based on content of a record within an entity. |
| description | Description |
| documentation | Contains the documentation of the data model in the popular AsciiDoc format (.adoc). The documentation should be set by the developer to explain different… |
| entityFields | List of fields, providers, consumers, etc. for this entity |
| grantCreate | Specifies whether the creation of a new record is allowed in principle. |
| grantCreateProcess | Process for the permission to create a new record. |
| grantDelete | Specifies whether the deletion of a record is allowed in principle. |
| grantDeleteProcess | Process for the permission to delete a record. |
| grantUpdate | Specifies whether changing a new record is allowed in principle. |
| grantUpdateProcess | Process for the permission to update a record. |
| icon | Image. |
| iconId | The icon is displayed in various situations in the client as symbol for an entity. |
| iconIdProcess | Basically the same as the iconId property, but this time it's dynamically calculated per record. This will overwrite the value that is set in the iconId… |
| iconProcess | Specifies the icon dynamically. If the icon has no effect, neither will the result of the process. |
| image | Image of a record in an entity (since the image property is static, this will affect every record). This could be for example a logo. You can access the… |
| imageProcess | Image of a record in an entity. Since the process can return an image dynamically this could be used for example to provide a portraits for persons within an… |
| initFilterProcess | Process that can return an initial filter (json) for the entity. |
| metadata | Metadata field. |
| onInit | Process that is executed during initialization. |
| onValidation | The onValidation is executed during loss of focus to check the input for validity. Validations fails, if a message other than true is returned by… |
| recordContainer | Configuration of the main record container of an entity. |
| recordContainers | The record containers in this entity |
| recordsRecipeSupported | Determines if the entity supports RecordsRecipe for selections. |
| siblings | A sibling describes other entities that represent the same data as the current entity where this property can be set. |
| title | Singular title of the entity, e.g. Person |
| titlePlural | entities title in plural; e.g. Persons |
| useFavorites | Determines if the views using this entity can show private tags (favorites). |
| usePermissions | Determines if the element is relevant for the authorisation concept. For example: If this value is true the element can be selected for the grant… |
afterOperatingState
Type: String
Process that runs after the operatingstate is changed.
afterSave
Type: String
Process that is executed after the record has been successfully saved
The variable $local.entitydata can be used to access the data of the entity that has been saved. The recordstate (NEW or EDIT) can be retrieved via "$local.recordstate.
By finishing the process with result.string(true), the default behavior after saving is ignored. In this case, the process must first execute commands regarding the further navigation, e.g., openContext(...). In any other case (= no result or result.string(false)), the default behavior is executed unchanged.
Example: If you use the process code
[...]
neon.openContext("Organisation", [...])
result.string(true);
then, the context "Organisation" is opened after saving, ignoring the user's selection, e.g., "Save and open" or "Save and close".
afterUiInit
Type: String
Process that is executed after the initialization of the UI (= after loading all displayed elements).
This is useful if you want to preset a consumer with records in the NEW-mode for example.
beforeOperatingState
Type: String
Process that runs before the operatingstate is changed.
color
Type: String
Defines a color for an element.
Where (or if) the color is used depends on different actors in the system and is defined internally.
Note that the color can not be chosen freely, but you can select from different presets (e.g.: priority-high-color).
This will ensure that the color will fit on different themes and for example a warning-color will always stand out.
colorProcess
Type: String
Defines a color for an element dynamically by executing the process.
Where (or if) the color is used depends on different actors in the system and is defined internally.
Note that the color can not be chosen freely, but you can select from different presets.
Within the system.neon module there exist constants for the different colors, e.g. neon.PRIORITY_HIGH_COLOR or neon.BRAND_COLOR.
This will ensure that the color will fit on different themes and for example a warning-color will always stand out.
comment
Type: String
Property to store a developer comment in form of
/**
*
*/
In the past this was used in customizing for frame controls additional settings, such as the activation of rights, histories, or attributes.
This should not be done anymore in the comment property, because therefor a metadata property exists.
contentDescriptionProcess
Type: String
Process to determine a longer description based on content of a record within an entity.
For example: If you've got a Person_entity, the contentTitle could be the full name of a person and the persons address.
contentTitleProcess
Type: String
Process to determine the title based on content of a record within an entity.
For example: If you've got a Person_entity, the contentTitle could be the first- and lastname of a person separated by a space character.
The result is used for example in a list of Persons.
description
Type: String
Default: ``
Description
documentation
Type: String
Contains the documentation of the data model in the popular AsciiDoc format (.adoc).
The documentation should be set by the developer to explain different aspects (like purpose, concept, etc.) of the data model that they designed.
You may want to add the extension "AsciiDoc" to your ADITO Designer in order to modify AsciiDoc files.
<!--VSCODE_ONLY-->
entityFields
Type: EntityFields
List of fields, providers, consumers, etc. for this entity
grantCreate
Type: Boolean
Default: true
Specifies whether the creation of a new record is allowed in principle.
grantCreateProcess
Type: String
Process for the permission to create a new record.
Returns result.string(true) for "allowed", result.string(false) for "not allowed".
The return of this process overrides the grantCreate setting.
Error messages in this process occur at the client.
grantDelete
Type: Boolean
Default: true
Specifies whether the deletion of a record is allowed in principle.
grantDeleteProcess
Type: String
Process for the permission to delete a record.
Returns result.string(true) for "allowed", result.string(false) for "not allowed".
The return of this process overrides the grantDelete setting.
Error messages in this process occur at the client.
grantUpdate
Type: Boolean
Default: true
Specifies whether changing a new record is allowed in principle.
grantUpdateProcess
Type: String
Process for the permission to update a record.
Returns result.string(true) for "allowed", result.string(false) for "not allowed".
Error messages from this process do not arrive at the client, they are only visible in the server log. If an error occurs in this process, the power is not granted.
icon
Type: String
Image.
Depending on the datamodel, this has different effects:
- Entity: used as symbol in the designer. Do not confuse this property with the
iconIdproperty - Context: used as symbol in the designer. If the contexts entity has an icon set, the entities icon is used
- System, Language, Role, Application: icon that appears only in the designer.
- Template: Same effect as on the respective component
- Alias, User: no effect
- Frame, Process, Report, NeonFrame: icon that appears in the designer and in the client for the frame.
<!--EOF-->
You can add a custom icon by placing an icon.png file in the folder of your data model.
iconId
Type: String
The icon is displayed in various situations in the client as symbol for an entity.
For example the sidebar with the list of contexts: Since every context has an entity associated, the icon of the entity is displayed.
You can access the icon via the virtual field #ICON if you need to.
iconIdProcess
Type: String
Basically the same as the iconId property, but this time it's dynamically calculated per record. This will overwrite the value that is set in the iconId property. This could be for example different icons for active tasks and already done tasks.
iconProcess
Type: String
Specifies the icon dynamically. If the icon has no effect, neither will the result of the process.
Depending on the datamodel, the result of the process has to be different:
-
When you can specify an icon-avatar-text (e.g.
VAADIN:USERS): You've to return theicon-avatar.textwithresult.string(...) -
When you can specify an image in the icon: This is returned as a string with the ID of the image in the
ASYS_BINARIESviaresult.string().
Error messages from this process do not arrive at the client, they are only visible in the server log.
image
Type: String
Image of a record in an entity (since the image property is static, this will affect every record).
This could be for example a logo. You can access the image via the virtual field #IMAGE (for example in a view).
Note that the image is not the icon that is displayed in the client, but it is a representation of the record in an image-format.
imageProcess
Type: String
Image of a record in an entity. Since the process can return an image dynamically this could be used for example to provide a portraits for
persons within an Person_entity (=> Every person has a different portrait)
You can return any valid avatarish-value (TEXT:MY NAME, base64 encoded string etc.) with result.string(...) and the result will overwrite
the value that is set in the image property.
You can access the image via the virtual field #IMAGE (for example in a view).
Note that the image is not the icon that is displayed in the client, but it is a representation of the record in an image-format.
initFilterProcess
Type: String
Process that can return an initial filter (json) for the entity.
This filter is applied when the entity is loaded, afterwards the data is requested from the associated recordcontainer.
Note that the result given in this process is only a preset filter that may be changed by the user either
- explicit by changing it for example via the filter-menu
- implicit for example via a search term in a lookup component
This process has to return a stringified filter-object to set (like in entities.createRowConfig().filter(...)) or nothing if no filter shall be set.
The filter string has to be a valid user-filter, additional filters like permissions are set automatically by the entity and are not required as result here.
Filtergroups and -rows can be combined to build up complex filters as long as the filter is valid.
Note that often more complex filters are performing slower when loading data instead of simple filters.
To learn more about how the base object for the result string (so the filter object) needs to be defined take a look in the general technical description of filters in the Customizing Manual.
Code Example:
var res;
// _hasPresetFilter is in this example a private function that determines
// if a user needs a filter preset or not
// only add preset in the filter presentationmode
// because we do not want to preset the filter in the lookup presentation mode
// since the filter is discarded
// when the user enters a search term into the lookup component
if (vars.get("$sys.presentationmode") === neon.CONTEXT_PRESENTATIONMODE_FILTER
&& _hasPresetFilter())
{
var filter = {
type: "group",
operator: "AND",
childs: [{
type: "row",
name: "CURRENT_SITUATION_LOG",
operator: "EQUAL",
contenttype: "TEXT",
key: "$R1258_DISABLED",
value: translate.text("Disabled")
}]
};
res = JSON.stringify(res);
}
if (res)
result.string(res);
metadata
Type: String
Metadata field.
This corresponds to the comment property on the swing frame. Settings can be made here, whether rights, histories, attributes,... are activated or not.
onInit
Type: String
Process that is executed during initialization.
onValidation
Type: String
The onValidation is executed during loss of focus to check the input for validity.
Validations fails, if a message other than true is returned by result.string().
result.string("Any Message") or result.string(false) results in failing the validation check, thus displaying the message to the user, not accepting the input data and disabling the save button.
If result.string() is not called or result.string(true) is used, the system assumes a positive validation and accepts the input data.
This process has to be fast, due to being called multiple times by the system. Do not use it to change the state of components!
recordContainer
Type: String
Configuration of the main record container of an entity.
For example, this recordContanier will be used for editing (new, update, delete), for default way of loading data or for providing data via a provider (if not specified otherwise).
recordContainers
Type: RecordContainers
The record containers in this entity
recordsRecipeSupported
Type: Boolean
Default: false
Determines if the entity supports RecordsRecipe for selections.
An entity supports the RecordsRecipe if the place of use of selections (like customized selection-actions) are processing the selection via the variable $sys.selectionRecordsRecipe.
When this property is disabled it tells the entity that only the legacy way for providing selections (e.g. $sys.selections providing UIDs of the selected items) is supported. A "select all"-checkbox will appear for all supported viewtemplates only if the recordContainer is not pageable.
When this property is enabled a "select all"-checkbox will appear for all supported viewtemplates (like tables, cards, treetables and more) even if the used recordContainer is pageable.
Note that the $sys.selectionRecordsRecipe exists and is filled no matter of what value of this property. This property only indicates if the entity and its elements (for example customized selection-actions) are ready to handle the $sys.selectionRecordsRecipe variable and a "select all" checkbox in viewtemplates can be displayed or not.
Therefore, it is possible to migrate all usage locations of the selection step by step and if everything is migrated this property can be set to true.
siblings
Type: String[]
A sibling describes other entities that represent the same data as the current entity where this property can be set.
For example: You've got a Eventparticipant_entity that represents participants of an event and a EventparticipantAdd_entity that is used for adding participants of an event in a special way.
If you stored information within the EventparticipantAdd_entity this would not trigger any auto refreshes in a Eventparticipant_entity that is also displayed in the current client view. To resolve this problem (and to provide the information that these two entities belong together by representing the same data in different ways) you can set the siblings as follows:
Eventparticipant_entityis a sibling ofEventparticipantAdd_entity
and
EventparticipantAdd_entityis a sibling ofEventparticipant_entity
title
Type: String
Constraints: Verification: TITLE_LENGTH
Singular title of the entity, e.g. Person
titlePlural
Type: String
entities title in plural; e.g. Persons
This is used within the client in views where multiple records are displayed - for example as detail-headline in a master-detail layout
useFavorites
Type: Boolean
Default: false
Determines if the views using this entity can show private tags (favorites).
usePermissions
Type: Boolean
Default: false
Determines if the element is relevant for the authorisation concept. For example: If this value is true the element can be selected for the grant configuration within the client