Dictionaries

Extend the configuration via dictionaries

Sometimes you need to choose from a predefined list of values already existing in the system.

In the configuration, it's not always easy as the values may be related to the configuration itself. The values may be available only after configuring the API Key in step one etc, therefore, cannot be part of the regular schema.

That's where the dictionaries come in handy. There are two sources of the configuration. The data either come from Ergonode or App.

The source of the dictionary is recognized via prefixes ergonode: and app:

Ergonode

List of available dictionaries

  • ergonode:attributes

    • it is possible to limit types of attributes thanks to query parameters - egonode:attributes?type=TEXT,TEXT_AREA

  • ergonode:categories

  • ergonode:languages

App

In App, you can define as many custom dictionaries as you require.

In Manifest configuration_schema you reference the dictionary by the conjunction of app: prefix and dictionary ID suffix i.e app:attributes.

App provides custom dictionaries by implementing /dictionary/{dictionary} endpoint.

For the above example, the endpoint would be /dictionary/attributes.

The endpoint response for the valid dictionary should return

{
  "dictionary": [
    {
      "id": "value",
      "label": "Presentation label"
    }
  ]
}

The endpoint will be called only on generating the step of the configuration schema it is defined in - so you have all the earlier steps of configuration at your disposal during dictionary retrieval.

Last updated