Extending an existing dashboard by adding new dashlets in the web UI framework
You can customize/extend an existing dashboard by adding dashlets.
About this task
<Dashlets>
<Dashlet id="dashlet_one" title="Dashlet One" type="html" tag="tag_1">
<Url>/stk/dashboard/dashlet_one.jsp</Url>
<Imgurl>/stk/img/dashboard/dashlet_one_preview.png</Imgurl>
<Description>
Dashlet one description bundle key
</Description>
<Config numberOfColumns="3">
</Config>
</Dashlet>
<Dashlet id="dashlet_two" title="Dashlet Two" type="extscreen" tag="tag_2"
multiInstance="true" refreshable="Y">
<Url>/stk/dashboard/dashlet_two.jsp</Url>
<Imgurl>/stk/img/dashboard/dashlet_two_preview.png</Imgurl>
<Description>
Dashlet two description bundle key
</Description>
<Config numberOfColumns="2">
</Config>
<!-- Other metadata relevant to the dashlet can be added based on type
and url of the dashlet -->
</Dashlet>
<Dashlet id="dashlet_three" title="Dashlet Three" type="html" tag="tag_3">
<Url>/stk/dashboard/dashlet_three.jsp</Url>
<Imgurl>/stk/img/dashboard/dashlet_three_preview.png</Imgurl>
<Description>
Dashlet three description bundle key
</Description>
<Config>
</Config>
</Dashlet>
</Dashlets> Attribute
and element descriptions for the above sample are given below. - id
-
A unique identifier of the dashlet. This id is used to query a dashlet and its properties. It is used by a dashboard definition to add a dashlet to it.
- title
- The title of the dashlet. It can be a bundle key which can be localized.
- type
- The type of the dashlet is a metadata about the type of content returned by a dashlet URL. By default, the Web UI Framework supports following types of dashlet:
- HTML. Response of type HTML must be a valid HTML document fragment. Following examples illustrate various ways in which it can be used to render the dashlet UI: (1) A fully rendered HTML fragment that can be viewed in a browser without any further processing. (2) An iframe that can be used to safely embed widget from external websites. (3) A scriptlet that can dynamically render the content in the container.
- extscreen. An extscreen is an ExtJS-based JavaScript UI rendering script. It can be used to render dynamic and interactive UI components.
- tag
- A comma separated value of tag names of the dashlet.
- refreshable
-
Setting this value to Y makes the dashboard refreshable and a refresh icon is shown in the dashlet toolbox. When the refresh icon is clicked, the individual dashlet is refreshed.
- multiInstance
-
Setting this to true would allow the dashlet to be added to the dashboard multiple times. This is an optional parameter and defaults to false.
- URL
-
The URL used to get contents to render a dashlet. To render a dashlet into the dashboard, a request needs to be made to the server. The request is made to this URL and the response is rendered on the UI.
- Imgurl
-
The URL to the image to be displayed showing a preview of the content displayed by the dashlet.
- description
- The description of the dashlet. It can be a bundle key which can be localized.
- Config
- The Config element is used to define configuration options used to render the dashlet on the UI.
Some dashlets that do not require a configuration option may choose not to specify the Config
element. Note: In addition to the Config element, a dashlet can have other metadata elements. In general, the Config is used to define UI properties but it can be used to hold any kind of metadata.
To customize/extend an existing dashboard by adding dashlets, do the following: