Configuring additional links
Naming your XML files
Naming the files is important as it specified the order in which the files are processed. This order is important as later definitions for a named additional links override those loaded earlier.
The directories are parsed in alphabetical order, with numbers before letters. The standard additional links are contained in a file called 00additional_links.xml.
Writing the additional links files
The additional links are defined in simple XML files, the elements of which are described in this topic.
Links configured in the installed subdirectory are displayed beneath the default links, those from the custom subdirectory follow them. However, if a custom link overrides an installed link it will appear in place of the installed link.
Notes
- The link must be specified in valid XML. The XML equivalents of certain characters must be used (for example, & instead of &, > instead of >, and < instead of <).
- Parse errors in the XML do not prevent the Application server from starting but might cause one or all external link definitions to be ignored.
- Failure to return a value for a requested attribute is caught, resulting in the link being discarded for this particular node, on this request. For future requests, an attempt to build the link will be made again.
- You can substitute any attribute in a tag. Use %(attribute_name)s to do this. If the attribute contains a list value there will also be a string representation containing a comma-separated list of values in %(comma_separated_attribute_name)s.
- The following keys are provided:
- id: the node ID as set in the URL, for example nodeID=%(id)s
- kind: the node kind.
- uiModule: the UI module that normally handles the display of the node kind.
- urlPrefix: the URL prefix of the appserver. This is usually ui.
- In addition <link> with <attribute> entries contain:
- translated: the locale translated attribute name.
- otherNodeID: if the attribute represents a link then the node ID of the related node.
Link tags
The link tag specifies the type of link that is being created. These can be one of the following:
- Normal Link — specified with a <link> tag.
- Report Link — specified with a <node-report> tag.
A report that is run against a single node and the link should be visible when viewing a node of the correct node kind. - Chart Link — specified with a <node-chart> tag.
A chart that is run against a single node. The link should be visible when viewing a node of the correct node kind. - Set Report Link — specified with a <refine-report> tag.
A report that is run against a nodeset and the link should be visible when viewing a set of nodes of the correct node kind. - Set Chart Link — specified with a <refine-chart> tag.
A chart that is run against a nodeset and the link should be visible when viewing a set of nodes of the correct node kind.
Each tag must specify a name using the name attribute. Each link tag is in a distinct namespace.
Tags available
The following XML tags are available in all forms of links:
Tag | Details |
---|---|
Title | Provides the main page title for the link. This tag is mandatory. |
Description | Populates the title attribute of the HTML link. Presented as a tool tip. Also shown as a subtitle in the following section is the main page title. This tag is mandatory. |
Kind | Link will be shown against this node kind. This tag is mandatory. |
Image | Specifies an image to display. The image should already exist on the appliance as the specification is from the appliance image root ({{ http://appliance/styles/default/images/image_name}}). This tag is mandatory. |
Permissions | Specifies a list of permissions that the user must possess in order to display the link. <permissions> contains a list of <permission> entries, one per required permission. |
The following XML tags are available in <link>:
Tag | Details |
---|---|
URL | The URL that the link points to. This tag is mandatory. <url>http://tickets.tideway.com</url> |
Attribute | Displays a link in the UI next to the attribute if the attribute is not displayed, or not present on the node, then the link is not displayed. |
Target | Populates the HTML anchor for the link. Points to the named window or frame that the results of this query will be displayed in. Frequently this will be _new so that the link will open in a new window. |
The following XML tags are available in the remaining link types:
Tag | Details |
---|---|
Lookup | Supported in <node-chart> and <node-report>. Indicates if the query is relative to the node. Defaults to true which will generate a search of the form LOOKUP '%(id)s'. If you need a general search then use this tag to override the behavior. |
Flags | Any flags to include in the search query. |
With | Any with functions to evaluate in the search query. |
Where | Any conditions in the search query. This tag takes an optional keyword attribute that, when given value False, prevents the addition of the WHERE keyword when constructing the query. For example, TRAVERSE :::Host must not be prefixed by WHERE. |
Order-by | Sort results of a query by specified order. |
Show | List of attributes to display. For <node-chart> and <refine-chart> this represents the list of attributes shown when clicking through the chart. |
Split | Supported in <node-chart> and <refine-chart>. Indicates the column to chart. This tag takes an optional columns attribute that specifies the number of columns generated by the split. For example |
Y-axis-title | Supported in <node-chart> and <refine-chart>. Indicates the title of the y axis column. This will default to 'Count' unless the <split> provides a second column. |
The default type of chart can be specified by adding the default attribute to <node-chart> or <refine-chart>. Supported charts depend upon the number of columns specified by <split>. For single columns the supported charts are:
- pie (default)
- bar
- column
For two columns the supported charts are:
- line (default)
- column
Example 00additional_links.xml file
An example XML file is broken down and its constituent parts are described in the following section:
All files start with an XML declaration and an <reports> tag.
<reports version="2.0">
The reports version must be 2.0.
External links
Each external link is defined under a <link> tag.
The following example shows a label populated with the text View trouble ticket for hostname, Where hostname is the name of the current host.
The URL in the example is to a trouble-ticketing system with a web interface. This assumes that there is a host attribute called ticketNum which contains the trouble ticket number.
<title>View trouble ticket for %(hostname)s</title>
<description>Browse trouble ticket system for this host.</description>
<kind>Host</kind>
<image>kind/gif/Location_16.gif</image>
<url>http://tickets.tideway.com/tickets/%(ticketNum)s.cgi</url>
</link>
Report links
Each report link is defined under a <node-report> tag.
The following examples retrieve a list of hosts with the same OS type as the currently viewed host.
<title>Hosts with the same OS type</title>
<description>List of hosts with the same OS type</description>
<kind>Host</kind>
<image>system/gif/report_16.gif</image>
<lookup>False</lookup>
<where>os_type = %(os_type)r</where>
</node-report>
Chart links
Each chart link is defined under a <node-chart> tag.
A chart showing access methods for this host node.
<title>Host Login Summary Chart</title>
<description>Host Login Methods on a column chart</description>
<kind>Host</kind>
<image>system/gif/column_chart_16.gif</image>
<where keyword="False">TRAVERSE :::DeviceInfo</where>
<split>last_access_method as '_|Method|_' </split>
<show>SUMMARY</show>
</node-chart>
SetReport links
Each set report link is defined under a <refine-report> tag.
Show the number of hosts per software package on which the currently viewed set of packages are installed.
<title>Package Host Density</title>
<description>How many Hosts are these Packages installed on</description>
<kind>Host</kind>
<image>system/gif/report_16.gif</image>
<show>
name,
version,
NODECOUNT(TRAVERSE InstalledSoftware:HostedSoftware:Host:Host)
AS '_|Number of Hosts|_'
</show>
</refine-report>
SetChart links
Each set chart link is defined under a <refine-chart> tag.
Summarise the currently viewed set of Software Instance nodes in a pie chart segmented by type.
<title>Software Instance Type Summary</title>
<description>Show a Summary of the Software Instance Types</description>
<kind>Host</kind>
<image>system/gif/pie_chart_16.gif</image>
<order-by>type</order-by>
<split>type</split>
<show>SUMMARY</show>
</refine-chart>
Completion
Finally, the XML file is completed with the closing tag.