Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DTPDEVEL and version 5.4.3

...

Code Block
languagexml
{
		"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 list table describes the file attributes within the structure of the schema.

AttributeDescription

...

TypeRequired
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

title

...

Title of the widget that appears in the widget UI

...

stringRequired

descriptionDescription of the widget that appears in the widget UIstringOptional

widgetCategory

Specifies a category that the widget should belong to. There are three options for specifying the widget category:

  • Existing category: You can view the JSON file of an existing widget in the DTP_HOME/grs/widget/builtin directory and copy its widgetCategory value (e.g.projectCenter).
  • Custom category: If the attribute is not specified, the default custom category is used. 
  • New category: The new category value can not match the value of an existing category. Spaces are not allowed. Set the widgetCategoryLabel attribute to specify a new category that appears in the Add Widget dialog.
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 widgetCategory attribute.

stringOptional

reportLocation

...

Specifies the relative path from DTP_HOME/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_x

...

Specifies the width

...

o the

...

...

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.
string

...

Required


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

...

  • key: Parameter for the drop-down item.
  • value: Parameter for the drop-down item.
BooleanOptional


titleSpecifies the label

...

for the parameter in the UI.

...

 The value of the name attribute will be used if not specified.string

...

Optional


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


title
Label that displays when the widget is added to the dashboard

...

stringRequired


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