EP Metadata
Overview
EP Metadata widget allows a user to view, add, edit and delete metadata fields for individual endpoints.
config:
type: metadata
Widget configuration
EP Metadata widget has the following configuration:
config:
header:
title: # Widget title text.
displayTitle: true # Indicates whether to display widget title text.
iconPath: # Path to icon.
type: metadata # Widget type. Must always equal "metadata" for this widget type. REQUIRED.
serviceIntegration:
service: epr # Name of EPR service instance. REQUIRED.
fields: # List of the fields. REQUIRED.
- path: endpointId # Key of the value in endpoint description. REQUIRED.
displayName: EndpointId # Displays field name.
isEditable: true # Boolean that allows/disallows to edit field. By default, false, if allEditable was not setted.
dataType: number # Data type for the value if the value is editable. Supported values are "string", "number", "boolean".
allFields: true # Is false by default. Specifies whether to show fields other than specified. REQUIRED.
allEditable: true # Is false by default. Specifies whether to allow editing of the fields other than specified.
For endpointId
and createdDate
properties, the section
should not be specified.
If the field with the corresponding name is not found in endpoint description, No data available
message will be shown for the value.
Metadata fields example
For example, your widget has the following configuration:
fields:
- name: a21
displayName: My value
Then your endpoint will have the following metadata:
"metadata": {
"a11": 11,
"a12": 12,
"a21": 21,
"a22": 22
}
The widget will show the fields in the following order:
"a11": 11
"a21": 21
As field “a21” matches “a.*1” expression, it is ignored for “a21”.
Display name
By default, each field in the metadata widget is shown with its original field name.
Property displayName
in the field definition overrides this.
fields:
- path: metadata.value-1 # This will be shown as "Value-1"
displayName: Value-1
- path: metadata.value-2 # This will be shown as "value-2"
Edit field
Metadata widget allows editing metadata fields.
To make metadata field editable, set isEditable
property in the field definition to true
.
By default, all fields are non-editable.
This does not apply to endpointID
and createdDate
because they are immutable.
For the other fields, isEditable
indicates if their values can be edited from the widget UI.
fields:
- path: createdDate
isEditable: true # Will be ignored
- path: metadata.some_key
isEditable: true # Will show metadata.some_key
Data type
For editable fields you can specify a data type for new and edited values. Supported data types are:
- string
- number
By default, all values are strings.
Delete field
If allEditable
property is set to true
, then the displayed fields can be deleted.
The fields are removed from the endpoint metadata on EPR.
Example configurations
Minimal valid configuration for EP Metadata widget:
- config:
header:
title: Metadata
displayTitle: true
type: metadata
service: epr
allFields: true
allEditable: true
fields:
- path: endpointId
displayName: EndpointId
dataType: string
isEditable: false
- path: createdDate
displayName: Registered
isEditable: false
dataType: string
- path: metadata.areaID
displayName: Area ID
dataType: string
isEditable: true
- path: metadata.vendor
displayName: Vendor
dataType: string
isEditable: true
Interfaces
EP Metadata supports a number of service interfaces to perform its functional role. The key supported interfaces are summarized in the following diagram.
For service communication, WD widgets mainly use REST APIs.