Place your JSON widget definition file and any dependent data files into the appropriate directory to deploy your widget. DTP checks two locations for custom widgets:
| JavaScript and JSP-based custom widgets | Place your widget definition file into the [DTP_HOME]/grs/widget directory. |
|---|---|
| Reused Base widgets (requires DTP 5.2.x or later) | You can also point to existing widget data in your widget definition JSON file and deploy the JSON into the [DTP_HOME]/grs/plugins/widgets directory. DTP ships with several widgets in the [DTP_HOME]/grs/plugins/widgets/builtin directory, but Parasoft strongly advises against modifying built-in widgets. You can copy an existing widget and use it as a guide or use one of the following examples to help you get started. |
Example
The following widget definition file is for the Violations - Summary Trend widget.
{
"category": "staticAnalysis10",
"baseWidget": "dtpSummaryTrendWidgetV2",
"processor": {
"type": "internal",
"name": "violationsSummaryTrendProcessor"
},
"widgets": [{
"uuid": "62cb0f66-bbb5-4de3-910c-b70b2e6528a1",
"name": "violations",
"description": "static_analysis.violations.summary_trend"
}],
"parameters": [
{
"type": "filterDropdown",
"title": "filter",
"required": true,
"inheritable": true
}, {
"type": "periodDropdown",
"title": "period",
"required": true,
"inheritable": true
}, {
"type": "dropdown",
"title": "severity",
"name": "severity",
"required": false,
"options": [{
"label": "1",
"value": "1"
}, {
"label": "2",
"value": "2"
}, {
"label": "3",
"value": "3"
}, {
"label": "4",
"value": "4"
}, {
"label": "5",
"value": "5"
}]
}, {
"type": "dropdown",
"title": "Type",
"name": "status",
"required": true,
"options": [{
"label": "violations_res",
"value": "failed"
}, {
"label": "Suppressions",
"value": "suppressed"
}],
"defaultOption": "failed"
}
],
"labels": [
{
"name": "filter",
"value": "filter"
}, {
"name": "period",
"value": "period"
}, {
"name": "severity",
"value": "severity"
}, {
"name": "Type",
"value": "status"
}
],
"unrestricted": true
}