The previous page: Meta security¶
Meta report - is used to build a data minethat contains analytical information on data from the meta. The information is organized in the form of tables. In the meta of report module, the data sources are indicated, on the basis of which the information is generated to build a report. Further the report table columns are formed, indicating the resource for the data from the meta classes of the system.
Meta report is located in the
bi folder of the project in the YML format.
NB: Definition of “Data mine”
Test report contains data from the “sourceClass” class. The data source “dataSource” retrieves data from the corresponding meta class specified in the
results: property. Then the “test” subsection forms and transforms data (based on the data obtained from the source specified in the
source: property) for correct display in the report tables. The
joins: property sets the attribute, which is the identifier for building the report (in this case, object id).
Next, the system generates a report table, based on the converted data from the source, in the
reports: section. The``rangeFilters:`` property contains information on filters that are configured for the report (in this case, you must specify a date range according to the data from the class). In the module, set the range filter by using the query parameters:
?rangeFld=0&rangeFld=5, where rangeFld is the field we use for searching. If you are searching by date - the date is sent in the locale format, which is transmitted in the http-header
'accept-language', or in the format
columns: property allows to form table columns (numbers are actual).
The result: a two-column table (Date and Name) in which class objects from the _”dataSource”_ source are displayed, according to the date filter configured in rangeFilters:. The number of objects in the table will be equal to the number of identifier values configured in the joins: property.
You can see the example of a simple report here.
Configuration of comparison¶
The configuration of strict comparison within the boundaries of a
rangeFilters in the report:
both - both bounds can be equal to the sought values
```left`- left border (smaller one) can be equal to the sought values
right - right border (bigger one) can be equal to the sought values
inclusive is nor specified - the comparison is strict at both boundaries.
The configuration of the hierarchical build is necessary to process the initial data when building the mine:
- To make in one data source data extraction across the entire hierarchy in the DB
- To display data of the first column with indents depending on the nesting depth
Configuration of the hierarchical build in the data mine:¶
"hierarchyBy" config is the objects with the following set of properties:
id - is the attribute in data, identifying element of the hierarchy
parent - is the attribute in data containing parent id
level - is the attribute in the resulting source where the nesting level of the element will be written
order - is the attribute in the resulting source where the value will be written to organize the hierarchy when displayed on the form.
objLevel and``objOrder`` field - are the fields to write values (no need to calculate, aggregate etc.).
NB: Hierarchical build is possible only on the basis of the source and impossible on the basis of the class.
- Create a result source.
- Make a sample of root elements that have an empty
- We sort and write elements in the result source (in the special attribute
element_id- the object identifier (id), in
level- the value 0, in
order- the sequence number of the element in the sample, reduced to a string, supplemented up to 6 characters with leading zeros).
- Iteratively, we make samples of the levels of nesting (starting from 0), until 0 objects are extracted at the final iteration. Samples are made by combining the initial source with the resulting one by the
parent = element_idconnection and the constraint
level = current levelof nesting.
- At each iteration, we sort and write elements in the result source, and at the same time:
- write the id of the object in the special attribute
- write the current level of nesting in
order, write an order concatenation of the parent element and the sequence number of the element in the sample, reduced to a string, supplemented up to 6 characters with leading zeros.
- write the id of the object in the special attribute
Configuration to hide objects¶
Configuration to hide all objects if tabular filters are not specified. Apply the
"needFilterSet: true" setting to hide all objects when opening a report, until a value is selected from the list in the filter.
How to display sample parameters in the report header by using patterns¶
The year value in the
$yearStart attribute is equal to the year value from the date in the
NB: It is used in the reports of the
type: list type.
We recommend using the “pageSize”, when the report contains many objects and you need to output the lines page-by-page, not to load the browser with heavy data processing.
Output line by line¶
Setting up the line by line output of nested data in the report is configured as follows:
Incremental load configuration¶
Specify the ``append: true``property to set the incremental load of data into the source when building the data mine.
It is used to upload the statistics for a day to the mine, so as not to recalculate the entire volume of source data and have a history by periods.
Specificity of object sorting¶
Taking into account the MongoDB aggregation functional — the sorting is possible only by the resulting fields. This means that for backward compatibility, you should name the result fields that are used for sorting the same way as the fields in the data source.