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.

AttributeDescriptionTypeRequired
nameThe 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.stringRequired
attributesAn object that contains the following attributes:arrayRequired

titleTitle of the widget that appears in the widget UIstringRequired

descriptionDescription of the widget that appears in the widget UIstringOptional

widgetCategory

Specifies a category that the widget should belong to. If the attribute is not specified, the default custom category is used. 

stringOptional

widgetCategoryLabel

Specifies the name of the category that appears in the Add Widget dialog when adding a new category as defined in the widgetCategory attribute.

stringOptional

reportLocationSpecifies 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.stringRequired

size_xSpecifies the width o the widget (see About the Dashboard Grid)integerRequired

size_y

Specifies the height of the widget (see About the Dashboard Grid)

integerRequired

parametersContains 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:

  • text 
  • checkbox 
  • date 
  • dropdown

When the value is set to dropdown, the following attributes can be set:

stringRequired



dropdownOptionsContains an array of objects that represent the drop-down menu UIarrayOptional




keyParameter for the drop-down item.stringRequired




valueParameter for the drop-down item.stringRequired


name

Specifies the label for the parameter input. Text-only strings are allowed. Spaces are not allowed.

When type is set to dropdown, the following special values can also be used:

  • filter: Enables the user to select a DTP filter.
  • project: Enables the user to select a DTP project.
  • period: Enables the user to select a date range.
stringRequired


requiredSpecifies if the parameter is required to configure the widget. Default is false.BooleanOptional


titleSpecifies the label for the parameter in the UI.  The value of the name attribute will be used if not specified.stringOptional


inheritableSpecifies if the filter, project, and period settings from the dashboard can be inherited.BooleanOptional

widgetLabelsContains an array of objects that represent the widget labels that will appear in the UIarrayRequired


titleLabel that displays when the widget is added to the dashboardstringRequired


name

Name of the selected parameter when the widget is added to the dashboard. The name should match the name of the parameter unless filter is used. You can also use filterName to display the name of the filter or filterId to show the ID.

stringRequired
  • No labels