The following JSON code shows the widget structure and supported attributes. See Understanding JSON Metadata File Attributes for additional information about the attributes:
{ "name": "customWidgetName", "attributes": { "title": "A title is required", "description": "A description of your widget; optional.", "widgetCategory": "widgetCategory", "reportLocation": "widget/myWidgetData/myReport.jsp", "size_x": 2, "size_y": 1, "parameters": [ { "type": "dropdown", "name": "parameterName", "required": true, "dropdownOptions": [{ "key": "any", "value": " " }, { "key": "open", "value": "open" }] }, { "type": "text", "name": "textParameterName", "title": "textParameterTitle", }, { "type": "dropdown", "name": "filter", "title": "dropdownParameterTitle", "inheritable": true, } ], "widgetLabels": [ { "title": "Label that will show in the UI", "name": "filterName" } ], } }
Understanding JSON Metadata File Attributes
The following table describes the file attributes within the structure of the schema.
Attribute | Description | Type | Required | ||||
---|---|---|---|---|---|---|---|
name | The name of the widget also serves as the ID for adding widgets to custom dashboard templates. Only text (a-z) is allowed. Spaces are not allowed. See Custom Dashboard Templates. | string | Required | ||||
attributes | An object that contains the following attributes: | array | Required | ||||
title | Title of the widget that appears in the widget UI | string | Required | ||||
description | Description of the widget that appears in the widget UI | string | Optional | ||||
widgetCategory | Specifies a category that the widget should belong to. If the attribute is not specified, the default custom category is used. | string | Optional | ||||
widgetCategoryLabel | Specifies the name of the category that appears in the Add Widget dialog when adding a new category as defined in the | string | Optional | ||||
reportLocation | Specifies the relative path from <DTP_INSTALL>/tomcat/webapps/grs/custom directory to the report data used to populate the widget. Report files (HTML, JSP, etc.) should be placed in the custom folder to ensure that the files are backed up and restored when those processes occur. Do not include the beginning slash (/) when specifying the path. | string | Required | ||||
size_x | Specifies the width o the widget (see About the Dashboard Grid) | integer | Required | ||||
size_y | Specifies the height of the widget (see About the Dashboard Grid) | integer | Required | ||||
parameters | Contains an array of objects that represent the widgets parameters. Each object contains the following attributes: | Required | |||||
type | Specifies the input type of the parameter. The following values are valid:
When the value is set to | string | Required | ||||
dropdownOptions | Contains an array of objects that represent the drop-down menu UI | array | Optional | ||||
key | Parameter for the drop-down item. | string | Required | ||||
value | Parameter for the drop-down item. | string | Required | ||||
name | Specifies the label for the parameter input. Text-only strings are allowed. Spaces are not allowed. When type is set to
| string | Required | ||||
required | Specifies if the parameter is required to configure the widget. Default is false . | Boolean | Optional | ||||
title | Specifies the label for the parameter in the UI. The value of the name attribute will be used if not specified. | string | Optional | ||||
inheritable | Specifies if the filter, project, and period settings from the dashboard can be inherited. | Boolean | Optional | ||||
widgetLabels | Contains an array of objects that represent the widget labels that will appear in the UI | array | Required | ||||
title | Label that displays when the widget is added to the dashboard | string | Required | ||||
name | Name of the selected parameter when the widget is added to the dashboard. The name should match the name of the parameter unless | string | Required |