Class/collection (class)
Description
User class metadata.
Allows you to define a structure for the data and the rules for maintaining it. For each class in the REST-API appears endpoint /rest/v1/model/CLASSPATH and possibility to perform operations via WebSocket-API with capability=rest.
Can place data in memory, in a distributed object database, in a postgres relational database (with and without partitions for historical data), in a Kafka broker, and store data in an analytic columnar database Clickhouse.
Each collection publishes changes delivered to subscribers (subscriptions via websocket-API, authorized based on roles).
Supports multiple modes of operation: speed read, speed notification, asynchronous mode, synchronous mode.
Each of them ensures internal integrity by preventing the original sequence of requests from being altered when they are processed and notifications are sent out. The exception is the processing of different entities in modes that utilize parallel processing. +
Supports property inheritance.
Supports restricting data access for different users to methods and collections by role (role.routes and iam_all.json), as well as based on complex filters to specific data on read, modify, field visibility and the ability to modify them (class.opts.security_filter_read, class.opts.security_filter_write, class.properties..security_filter_read, class.properties..security_filter_write).
Classes in a distributed object database can be auto-deleted by lifetime with automatic renewal when saving; at the same time, the maximum possible number of records in the collection is limited due to the fact that to apply a filter to a selection, the entire collection is searched element by element.
Fields
{
"id": uuid,
"classname": str,
"name": str,
"description": str,
"parent_id": uuid,
"properties": [
{
"name": str,
"data_type": str,
"multi": bool,
"required": bool,
"default": any,
"idclass": uuid,
"items": array<str>,
"security_filter_read": array,
"security_filter_write": array
}
]: array<obj>,
"storage_mode": str,
"integrity_mode": str,
"cache_mode": str,
"opts": {
"title": str,
"comment": str,
"dms_group": object,
"check_required_fill_defaults": bool,
"max_limit": int,
"max_mask": array<str>,
"max_size": int,
"store_changehistory_mode": str,
"caption_property": str,
"expires_mode": str,
"expires_ttl_property": str,
"expires_ts_property": str,
"storage_instance": str,
"filestorage_instance": str,
"lookup_properties": array<str>,
"partition_property": str,
"partition_interval": str,
"partition_count": int,
"replication_factor": str,
"notify_transactions": bool,
"cache_sec": int,
"cache_limit": int,
"security_filter_read": array,
"security_filter_write": array
},
"ext": {
"ct": date,
"lwt": date
}
}
Specification | Description |
---|---|
Field: |
Identifier. Can be specified at creation, otherwise generated by the system. |
Field: |
Class collection name. May contain a path through '/'. Typically in plural. |
Field: |
Displayed class name |
Field: |
Class Description |
Field: |
Ancestor class identifier. Inherits all its fields. |
Field: |
List of class instance properties.
|
Storage Mode:
|
|
Maintenance Mode: |
|
Memory cache mode. Makes sense only for types category, history, transactionlog.
In 'transactionlog' storage mode without using clickhouse storage, the mode is automatically applied 'none'. |
|
Field: |
|
Field: |
Arbitrary header |
Field: |
Arbitrary comment |
Field: |
Section name to select responsible dms group (by configuration option sections). |
Field: |
Site → role group index. Default - unique (less number) dms group for domain |
Field: |
if entities should be checked for required and filled by defaults by the server. Model can economy |
Field: |
How many items could be requested on read in max. |
Field: |
Max mask of properties, that could be returned on collection read. |
Field: |
Max size of storage (only for 'ram' and 'runtime'). |
Field: |
Transaction log saving mode for all changes to class entities.
The data model class is used as a log 'platform/log/HistoryChanges'. The default change history class is created from a fixture descriptor with type storage_mode='history' and placement in the storage_instance='auto'. If necessary, the class can be adjusted by placing it in a different storage or at a different address. The main thing is the values of 'ext.fixture_version', 'opts.store_changehistory_mode', field structure, as well as leaving the type 'history' or 'transactionlog'. |
Field: |
The name of the property with the name to display for the entity, particularly in the change history. |
Field: |
Mode of minute-by-minute logging of class statistics.
|
Number of parallel threads for processing read operations. |
|
Number of parallel threads processing write operations. |
|
Field: |
when to auto set (reset) timestamp in ts property
|
Field: |
Property of int to setup auto ttl (time-to-live) in seconds. |
Field: |
Property of long to setup ts in milliseconds from 1970 (unix time * 1000). |
Field: |
Time to store in the cache the results of aggregate read requests. Data aggregation queries in the listed repositories are performed by full scanning, so they consume resources in voluminous collections. |
InstanceKey or #{Site ⇒ InstanceKey}. If there is no configured storage with code 'auto', the class is automatically bound to the model base ('era_model_DOMAIN') created through the main connection to the Postgres domain database). |
|
InstanceKey or #{Site ⇒ InstanceKey} (for attachments), when InstanceKey defines storage of type s3, fs, nfs, fsync.
If there is no configured storage with code 'auto', the class is automatically bound to be hosted on system file servers. |
|
Field: |
List of property names for lookup operation (indexes, separate fields etc). |
Field: |
Property of type=datetime to make partitioned history storage. |
Field: |
Size of partition in partitioned history storage.
|
Field: |
How many partitions does topic have (1-10). |
Field: |
How many replicas does topic have (1-4). |
Field: |
If should forcely notify. Note, than storage_mode = |
Field: |
Cancels the read operation of the entity before replacement. This, in turn, is done to a) check the replacement rights, b) generate a notification with the update or create operation, depending on the presence of the entity before replacement. In 'transactionlog' storage mode without using clickhouse storage, it is not used because the replace operation is not available. |
Field: |
How long temporarily cache holds modified items. The more values in the cache, the more resource-intensive the operation of clearing obsolete entries. |
Field: |
How many modified items are holded in temporarily cache. The more values in the cache, the more resource-intensive the operation of clearing obsolete entries. |
Field: |
Filter for custom queries to select data from a collection, read a specific collection item, and search by key fields. The format of the value corresponds to the format of the 'filter' parameter when selecting from a collection (read more). Does not apply to requests from users who have the role 'admin'. Applies to HTTP REST API, Websocket REST API, change subscriptions and notifications. |
Field: |
Filter for custom requests to create, replace, modify, delete a collection item. The format of the value corresponds to the format of the 'filter' parameter when selecting from a collection (read more). Does not apply to read requests. Applied in HTTP REST API, Websocket REST API. |
Field: |
Allows you to extend the compound with arbitrary keys and values |
Field: |
Object creation time |
Field: |
Time of last modification of the object |
Field: |
Debug mode switch to speed up the class with the 'runtime' type without using transactions on write operations. |
Special filter functions
Function | Description and Examples |
---|---|
|
Provides access to the data of the authorized user on whose behalf the read request is made. Examples:
Allows you to access deep related user settings - a list of all user roles, including those built on the basis of joining groups, groups via groups, etc.
Allows you to refer to the full-depth group list of the user:
Allows you to access the list of subordinates. In the simplest case of full mutual access, all are subordinate to all. This is reflected by a single element "all" instead of several identifiers in the list.
Allows you to select an aggregate value from the set of all entities: the user, all his roles and groups. The second-order function is used "DEEP". Examples:
The field path can be of arbitrary depth - a comma-delimited list of nested keys. If the specified field or path is not found, the Depending on the type of the detected value, the transformation to the final result is performed: numbers remain numbers, strings remain strings, Boolean values remain Boolean values, arrays are replaced by A complex expression example: ["or", ["in", "master", ["$USER","ROLES"] ], ["and", ["in", ["property","status"], ["list","in_work","in_review"] ], ["==", ["property","responsibleUserId"], ["$USER", "id"] ] ] ] |