Advanced Configuration

Configuring the Velocity Engine

The config.xml file can be used to pass configuration parameters to the Velocity templating engine. The velocity element in the configuration file allows any number of property elements to appear as children, each one specifying the name and value of a Velocity configuration property. For details of the properties that are recognised by Velocity, please refer to the Velocity Developer's Guide.

Customising Page Appearance

There are two principle ways of modifying the appearance of the pages presented by TMBrowse.

Simple style changes can be applied by modifying the CSS file used by TMBrowse. The best way to do this we find is to experiment with the default css file, changing properties until you have the layout that you want. Making use of CSS positioning attributes and the background-image property can quickly change the look of TMBrowse pages to match your own site style.

More complex page layout changes can be achieved by modifying the page templates themselves. The templates that are used by TMBrowse are all located in the TMBrowse web application directory and have the file extension .vm. The following table shows what the purpose of each of the template files are.

Table 3. Default TMBrowse Velocity Template Files

File Name Description
associations.vm This is one of the more complex template files that performs the layout of the lists of associations that a topic participates in. Modifying this file is not recommended for the novice template writer! However, it is worth studying as an example of the kind of flexibility you can get from a combination of Velocity scripting and Java coded "helpers".
class-tree-entry.vm This template is called recursively to build the class hierarchy view that is displayed by default on the topic map page.
error.vm The template used to render error messages generated by the TMBrowse application.
footer.vm The standard page footer for all pages.
header.vm The top navigation bar for pages displaying topics.
listmaps.vm The template used to render the list of all topic maps that TMBrowse can display.
query.vm The query page. This page displays the results of the submitted query as well as edit boxes for submitting new queries.
setup.vm Sets up all of the utility objects used for rendering other pages. This file is worth studying as an example of how to use the object factory to create objects and how to use Extractors, Testers and other functional objects in composition to make reusable filters and tests.
topic.vm The default template for rendering a topic page.
topicdetail.vm Called from topic.vm, this template lists the occurrences of the topic, presenting occurrences typed as an abstract or a description in a special manner. This template makes use of helper objects initialised by the setup.vm template.
topicmap.vm The default template for rendering the overview page for the topic map.
utils.vm Defines a colleciton of macros used by the other template files.

For the details on variables available to you in these templates and in other templates you may create, and on how to add make new helpers and variables available to templates, please refer to the TMBrowse Developer's Guide.

Customising the template for a topic or class of topics

To Be Completed