normal.conf
. This configuration file has code that specifies which pattern files define which components in pages that use this template. For example, the browse-top component of the End User page is defined by the normal-bw-top.pat
pattern file; the category-browse-top component is defined by the normal-cb-top.pat
pattern file; the category-browse-hit component is defined by the normal-cb-hit.pat
file; and so on.
To create a new template, you can copy and rename an existing configuration file. Edit the configuration file and specify which pattern files it uses. You can use existing pattern files, or you may want to create new ones, by copying and modifying existing ones. You can then modify the pattern files to suit your needs, using HTML or JavaScript.
The configuration file and all pattern files in a template must live in the templates
directory for the Compass Server. If you create additional configuration and pattern files, you can make them available to the Compass Server simply by putting them in the templates
directory.
.conf
. Open the file in your favorite text editor and change the value of the RDM-description
variable at the top of the file to a description of your new template. (This description will appear in the Template menu of the End User screen of the Compass Server Administration environment.)
Change the values of variables in the configuration file as appropriate. See the section "Configuration Files for UI Templates" for a discussion of these variables. Save the configuration file. Copy and modify any pattern files as needed. See the section "Pattern Files for UI Templates" for a discussion of pattern files. Save the changes.
Make sure that the configuration file and all pattern files that it uses are saved in the templates
directory of the server that will be using the template.
Selecting a New UI Template
In the Compass Server Administration environment, go to the End User screen, by selecting the End User button on the Administration page for the appropriate server.
In the "Search/Browse Preferences" section, select the desired template from the Template menu. Press the OK button. You will also need to press the Apply button at the top of the page, and press the "Apply Changes" button that subsequently appears.
If the new template uses files that were not previously loaded, or have been modified since they were last loaded, you will also need to load the configuration files.
Loading Updated Template Files
Before you create or modify configuration and pattern files, you need to change the value of the template-refresh-rate
variable in the csid.conf
file. This file lives in the config
directory of the directory containing the specific Compass Server. For example, suppose you have installed Compass Server 3.0 in compassdir
, and have created a server instance named topper
. In this case, the csid.conf
file will be in:
compassdir/compass-topper/config/csid.conf
The template-refresh-rate
variable tells the Compass Server how often (in seconds) to update the templates used by the End User page.
Set this to a low value such as 1:
template-refresh-rate=1
This tells the Compass Server to refresh the UI template once every second. This ensures that the Compass Server End User page uses the latest versions of the configuration and pattern files as you make changes to them.
Save the change. Open the Compass Server Administration environment (if it is not already open), and go to the Administration page for the appropriate server.
From any page in the Administration page of the appropriate server, you can press the Apply button at the top of the page. The main frame updates to show the "Apply Changes" frame, which includes a button labelled "Load Configuration Files." Press this button to load the changed csid.conf
file. The next time you use the Compass Server End User page, you should see that the changes have taken effect.
You only need to change and load the csid.conf
file once. From then on, any changes you make in the configuration or pattern files used by the currently selected template should automatically appear the first time you search or browse after making the changes.
Hint: If your changes do not appear automatically, make sure you set the template-refresh-rate
variable in the directory compassdir
/compass-
name
/config/
, not in the compassdir
/bin/compass/config/
directory.
When you have finished developing templates, you should set the template-refresh-rate
variable to a value such as 3600 so that the Compass Server does not waste time updating its UI template each time a user uses the End User page.
Last Updated: 02/07/98 20:49:01
Any sample code included above is provided for your use on an "AS IS" basis, under the Netscape License Agreement - Terms of Use