Semantics

Semantics - is used to output a class object as one string of the class title.

The "semantic" field is used twice in the meta class:

  1. in the general part of the meta class, where it forms a string view for this class;
  2. in the class attribute meta, where it forms a string representation of the objects of the class referenced by the attribute, i.e. used for reference attributes.

Purpose of use

“Semantics” is used to adjust the display of attributes and attribute properties in the list. In attributes that display tabular data, semantics are used to limit the output of columns.

Examples of use in reference attributes

For example, there is a class, which has attributes: id, name, link, date. There is a second class - classTable, which has a reference attribute table on the class class. Without using the semantics in objects of the classTable class, in the table attribute only the values of identifiers of objects of the class will be displayed. Attributes used as identifiers are listed in the class meta class.

To display the values of the name and link attributes in the tableattribute, and not the values of identifiers, you need to write "semantic": "name|link". Depending on the type of attribute, the result will be different:

  • if the table attribute is a reference, then the values of the name and link attributes separated by spaces will be filled in. Here you can use additional words and expressions using the || sign, for example " semantic ":" name|, |link" or "semantic":"The object has 2 attributes:|name|, |link";
  • If the table attribute is a collection of objects of the classclass, then it will display the name and link columns.

Display format in semantics

  • You can trim the output with:[].

      "name[0,50]|..."
    Указываем позицию и количество выводимых букв из семантики атрибута. Из атрибута name выводим 50 символов семантики (значение атрибута), начиная с первого.
    
  • Dereferencing is available via ``. `` i.e. access to the nested object.

     "semantic": "digitalTV|kachestvoCTB|analogTV.name|kachestvoAnal|period"
    где ``analogTV`` - ссылочный атрибут класса, для которого задается семантика, а ``name`` - атрибут класса по ссылке.
    

Display semantics on form

  1. In the first-level lists (opened directly by the navigation node), only the value from the “caption” field of the navigation node is displayed as the title.
  2. In the selection lists we display only the value from the “caption” field of the class of the list objects as a title.
  3. In the edit form we display only the semantics of the object as a title.
  4. In the creation form we display only the value from the “caption” field of the class as a title.
  5. In the selection lists we display the following line in fine print “Selecting the value of the attribute <…> of the object <…>” above the title.
  6. In the creation form, if an object is created in a collection or a reference, we display the following line in fine print “Creating an object in the collection/by reference <…> object <…>” above the title.