Creating a view definition

Defining views

A dynamic view consist of a number of properties that should be rendered on a specific view. A dynamic view is registered for a specific dynamic document through a parent-child relationship, where the document definition is the parent of the view definition. Depending on the view type, additional configuration options may be available, for example on a list view, filter controls may be defined.

A single definition requires at least

a name

The name defines on which view the definition will be applied. E.g. a definition with name my-custom-view would be applied on a view with name my-custom-view.

a type

The type defines on views of which type the definition will be applied. E.g. a definition with type list would be applied only on list view configurations.

a list of properties

The list of properties is a listing of the properties of the parent document that should be rendered on the view.

a parent document definition

A view definition always configures views for a specific document.

The combination of name and type must be unique in the scope of its parent, as only one view configuration can be applied to a specific view.

Defining list views

To configure a list view for a document, a view definition will be created with the type list. Specifically on a list view, filter controls can be configured.

Example list view definition
view-definition: (1)
  name: listView (2)
  type: list (3)
  properties: (4)
    - "versionLabel"
    - "field:name"
  filter: (5)
    mode: (6)
      advanced: true
    fields: (7)
      - id: field:name
1 View definitions always start with the root path view-definition.
2 The default list view that is rendered has the name listView.
3 To configure list views, the type must be list.
4 The properties that should be rendered are listed. DynamicDocument properties can be listed as well as document definition properties. Document definition properties must be prefixed with field:.
5 A filter configuration is defined.
6 The filter control modes are defined.
7 A field is specified for which a filter control should be rendered.
Table 1. Listing of available properties on a filter configuration
property required description

mode

optional

Allows for the definition of which filter control modes should be available. By default the basic mode will be shown if at least one field is configured. advanced mode will by default not be available.

A specific mode can be set by setting the mode to true, e.g. advanced: true

defaultSelector

optional

Sets the default selector that should be used for all specified fields, if no selector is provided for the field itself. Defauls to SINGLE.

defaultQuery

optional

Sets the query that should be executed on every request. The provided query is an EQL statement.

basePredicate

optional

Sets the query that provides the initial filtering when navigating to the view. The provided query is an EQL statement.

fields

optional

Defines for which fields an EQL filter control should be rendered. Listed fields must always specify an id and can override the selector and operand that should be used.

Defining form views