Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 1 Introduction : Customizing the Content, Look and Feel of XML Data

Customizing the Content, Look and Feel of XML Data
When you invoke a relative URL, the resulting XML stream is saved in HAWK_HOME/webconsole/tomcat/AppData/HawkXml.xml. The raw data in this file is replaced every time you invoke a relative URL.
The data in HawkXml.xml is determined by schema definitions included with TIBCO Hawk HTTP Adapter. These definitions are predefined and cannot be modified, but you can view them to gain an understanding of the structure of HawkXml.xml and the data collected.
You can filter or massage the XML stream in HawkXml.xml to display all, some, or only a small amount of the data: information about only one domain, for example, or for particular agents, types of alerts, or methods in one or multiple domains.
The following types of files allow you to modify the amount and format of data displayed from HawkXml.xml:
Schema Definitions determine the data in the XML stream. These schema definitions cannot be modified.
XSLT/XPATH Stylesheets allow you to filter the content of the XML stream and transform it into other formats, such as HTML, PDF, WML, other forms of XML, and so on. These files can be modified and you can create new ones.
Cascading Stylesheets control the look and feel of the pages in an HTML interface. These can be modified.
JSP/JSTL Files are JAVA server pages that convert XML content into HTML pages for an HTML interface. These JSPs can be modified.
These files are described in the following sections.
Schema Definitions
The schema definitions determine the data in the XML stream. These schema definitions cannot be modified.
Agents, Alerts, and Microagents URLs
There are three schema definition files, one each for the Agents, Alerts, and MicroAgents URLs, respectively:
HAWK_HOME/webconsole/tomcat/webapps/http/xsd/MicroAgents.xsd
You can view these schema definitions as files or in Appendix B, Sample Files. You can also display them from the TIBCO Hawk HTTP Adapter Index Page.
Invoke URL
The Invoke URL displays the results of subscribed or invoked methods, so the content varies by method. To allow for this, Invoke uses a framework instead of a static schema definition like the other three relative URLs. The XML stream is generated dynamically by the servlet.
For composite returns (one row of data), all method parameters returned become child elements of <Row>. All data is returned in a root element called <Returns> and each row of data is delimited by <Row> </Row> tags. The format is:
<Returns xmlns="http:\\www.tibco.com\TIBCOHawk"
  <Row>
    <returned_data>
  </Row>
</Returns>
For tabular returns (multiple rows), all method parameters become child elements of the row. The format is:
<Returns xmlns="http:\\www.tibco.com\TIBCOHawk"
  <Rowset>
    <Row>
      <returned_data>
    </Row>
  </Rowset>
</Returns>
XSLT/XPATH Stylesheets
All four relative URLs retrieve Hawk data in XML. The presentation of the XML data is controlled by stylesheets that use XSLT (eXtensible Stylesheet Language Transformation) and XPath, a language that describes a way to locate and process items in XML. These stylesheets filter and format the XML output to determine the domains, agents, alerts and microagents shown. Each relative URL uses a default stylesheet that displays all elements in your configuration.
These files can be modified and are in the HAWK_HOME/webconsole/tomcat/webapps/http/xsl/http/xsl directory. You can also view the files using an XML-aware application.
All stylesheets must reside in the /xsl directory. If you reference a stylesheet that is not in this directory, a server error occurs.
Additional sample stylesheets are included with TIBCO Hawk HTTP Adapter. These provide examples of other kinds of formatting and filtering that you can do with the XML data. You can customize any of the existing stylesheets or create new ones to perform such actions as filter data, show only the alerts for particular agents in several domains, or show the status of a selected set of agents in all domains.
To use a customized stylesheet, include the Style parameter in the path when you invoke the relative URL, as described in Relative URL Overview. All four relative URLs can take the Style parameter.
Cascading Stylesheets
The sample HTML interface uses cascading stylesheets to control the look and feel of the Web pages. These are written using standard HTML and can be modified.
There are two cascading stylesheets used by the sample HTML application. The actual stylesheet used on a particular system depends on the Web server or Web application being used to view the data.
For more information, see Customizing the HTML Application.
JSP/JSTL Files
JSP/JSTL (Java Server Page/JSP Standard Tag Libraries) files retrieve XML content using the relative URLs, transform the content into HTML, and display the content in HTML. The sample HTML application uses JSP/JSTL. The JSPs can be modified.
All JSPs for the sample HTML application are in the HAWK_HOME/webconsole/tomcat/webapps/http/xsl/http/jsp directory and can be modified. You can also create new JSPs for a new HTML application.
For more information, see Customizing the HTML Application and Generating HTML Pages from the XML Stream Using JSTL in JSP.

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved