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 |
|---|---|
| title | Singular title of the entity, e.g. Person |
| titlePlural | 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… |
| 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… |
| comment | Property to store a developer comment in form of |
| icon | Image. |
| iconProcess | Specifies the icon dynamically. If the icon has no effect, neither will the result of the process. |
| metadata | Metadata field. |
| siblings | A sibling describes other entities that represent the same data as the current entity where this property can be set. |
| useFavorites | Determines if the views using this entity can show private tags (favorites). |
| entityFields | List of fields, providers, consumers, etc. for this entity |
| recordContainers | The record containers in this entity |
| usePermissions | — |
| recordsRecipeSupported | — |
| color | 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… |
| 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… |
| grantCreate | Specifies whether the creation of a new record is allowed in principle. |
| grantCreateProcess | Process for the permission to create a new record. |
| grantUpdate | Specifies whether changing a new record is allowed in principle. |
| grantUpdateProcess | Process for the permission to update a record. |
| grantDelete | Specifies whether the deletion of a record is allowed in principle. |
| grantDeleteProcess | Process for the permission to delete a record. |
| 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 image… |
| 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… |
| 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… |
| onInit | Process that is executed during initialization. |
| 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. |
| afterOperatingState | Process that runs after the operatingstate is changed. |
| 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… |
| afterSave | Process that is executed after the record has been successfully saved |
| initFilterProcess | Process that can return an initial filter (json) for the entity. |
| contentTitleProcess | Process to determine the title based on content of a record within an entity. |
| contentDescriptionProcess | Process to determine a longer description based on content of a record within an entity. |
| recordContainer | 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… |
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
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 he designed.
You may want to add the plugin "AsciidoctorJ" to your ADITO Designer in order
to modify AsciiDoc files.
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.
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 iconId property\
- 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.
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 the icon-avatar.text with result.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_BINARIES via result.string().
Error messages from this process do not arrive at the client, they are only visible in the server log.
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.
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_entity is a sibling of EventparticipantAdd_entity
and
EventparticipantAdd_entity is a sibling of Eventparticipant_entity
useFavorites
Type: Boolean
Default: false
Determines if the views using this entity can show private tags (favorites).
entityFields
Type: EntityFields
List of fields, providers, consumers, etc. for this entity
recordContainers
Type: RecordContainers
The record containers in this entity
usePermissions
Type: Boolean
Default: false
recordsRecipeSupported
Type: Boolean
Default: false
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.
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.
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.
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.
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.
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.
onInit
Type: String
Process that is executed during initialization.
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.
afterOperatingState
Type: String
Process that runs after the operatingstate is changed.
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!
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".
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 inentities.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);
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.
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.
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).