IBM Business Monitor, V8.0.1 > Reference > Developing for Monitor dashboard spaces > Overview of widgets
Anatomy of a widget
A widget uses a number of different files.
iWidget XML
IBM Business Monitor defines its widgets using XML files that conform to the
The iWidget XML file describes the properties of the widget. The properties include the name and description of the widget, its attributes, and the events that it might produce or that it might accept.
Widget attributes control how a widget looks and what its data sources are. Attributes are often exposed as points of configuration for the widget.
For example, a widget that lists hotels might define an attribute for determining the number of hotels it lists.
Widgets use events as a transitory means of sharing information with other widgets. Widgets can both send and receive events. Each widget decides when to send events and which events to receive. This sending and receiving occurs through a publish/subscribe model in the definition of the widget. The definition specifies which events the widget can publish (send) and which events that the widget can handle (receive).
The iWidget XML file defines various resources used by the widgets such as scripts and CSS (Cascading Style Sheet) files using the <iw:resource> element.
The iWidget XML also defines the modes that the widget has. A mode specifies what type of markup to generate for the user.
For example, a mode might be a view mode, which would be the normal user markup, or an edit mode, which would be the markup for editing the attributes of the widget.
Catalog XML
The catalog file registers the widget and identifies the category to which the widget belongs. When users are looking at the widgets on the palette, they can choose to filter the widgets. Filtering makes the palette display only the widgets belonging to a particular category. The catalog file also defines the locations of the various resources that the widget uses such as the location of the iWidget definition, the location of its icon and preview images, and the location of its help documentation.
Endpoint registration XML
The endpoint registration XML file defines the context roots for the various endpoints. An endpoint is a service running on a server using REST APIs. The endpoint registration file registers this service to the system so that widgets can communicate with the service.
Documentation plugins
The widget help files are contained within documentation plugins that run in a help system. A documentation plugin is a folder that contains at least three files:
- The plugin.xml file that defines the plugin.
- The navigation file defines the contents of the navigation frame in the help system.
- The doc.zip file that contains the contents of the documentation plugin.
There might also be some supporting files such as CSS files.
A documentation plugin might also be in the form of a JAR file, but its internal contents will be the same.
Related tasks:
Create widgets
Create a documentation plug-in
Packaging and deploying custom widgets
Related reference:
Environment for developing a widget