Creating and registering dashboard metadata

You can create and register dashboard metadata by defining it's XML definition, and calling the registerDashboard.

The dashboard metadata definition is XML-based.
  • To create dashboard metadata, you need to define the dashboard metadata definition XML.
  • To register dashboard metadata, call the registerDashboard( ) method of the SCUIDashboardManager class (which is described in the Javadoc resource).

Sample XML: dashboard metadata definition


<Dashboards>
			<Dashboard id="myhomepage" title="My Homepage" tag="tag_1,tag_n"
														version="0.0.1">
						<Config>
									<Layouts  currentLayoutId="twoEqualColumn">
												<Layout id="twoEqualColumn" type="column"
																				previewIconUrl="/stk/img/dashboard/2col_preview.png">
															<Column id="d_one" width=".49"/>
															<Column id="d_two" width=".49"/>
												</Layout>
									</Layouts>
						</Config>
						<Dashlets>    
									<Dashlet id="dashlet_one" parent="d_one" >
									</Dashlet>
									<Dashlet id="dashlet_two" parent="d_two">
												<Config numberOfColumns="1" >
												</Config>
									</Dashlet>
						</Dashlets>
			</Dashboard>
</Dashboards>
Attribute and element descriptions for the above sample are given below.
id
A unique identifier of the dashboard. This id used for checking resource permissions and authorization. If a dashboard contains a dashlet for which the user does not have the permission, that dashlet will not be shown to the user.
title
The title of the dashboard. It can be a bundle key which can be localized.
tag
A comma separated value of tag names of the dashboard. These tags are used to find dashlets having matching tags. These related dashlets are available when you customize the dashboard.
Note: You will be able to see other tags also, but by default, only dashlets with matching tags will be displayed.
version
The dashboard metadata version. It can be used in case of multi-tenancy to support different versions of dashboard metadata.
Config
The Config element is used to define configuration options used to render the dashboard. One such configuration option is the layout of dashlets in a dashboard.
Layouts are used to define layout strategies supported by a dashboard. It contains child elements defining individual layout strategies. Currently, only a column layout is supported as a standard layout of dashboard.
Dashlets
A list of all the dashlets to be displayed in the dashboard. Each dashlet can have following set of attribute and elements:
  • id. Reference id of the dashlet to be added to the dashboard.
  • Parent. The layout container id in which the dashlet will be added.