Throughout these documentation I've referred to SimpleSearch. This is our first WidgetType, and it's designed to do simple lookup and display of information from backends implementing the same query style as ERM.
I'm now going to walk you through some of the setup we have for SimpleSearch, in order to help illustrate some of this.
WidgetType
This is going to dig a bit deeper into the type JSON for SimpleSearch. The WidgetType is quite large, so I'm going to break it into component sections and talk about what they do and how you can use them to define a WidgetDefinition which conforms to this Type.
Top level
At the top level, this schema looks like the following:
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "SimpleSearch widget", "type": "object", "description": "SimpleSearch widget type", "additionalProperties": false, "required": ["baseUrl", "results"], "properties": { ... } }
This specifies some simple information about the type, as well as any required information a WidgetDefinition must contain in order to be a valid Definition for this Type. This is where anything the frontend absolutely requires for basic functionality has to be contained.
Let's look at some of the properties:
"properties": { "baseUrl": { "type": "string", "description": "The base url queries built with this widget will go to" }, "results": { "$ref": "#/$defs/results" }, "filters": { "$ref": "#/$defs/filters" }, "sort": { "$ref": "#/$defs/sort" }, "configurableProperties": { "$ref": "#/$defs/configurableProperties" } }