Compass Server 3.0 Developer's Guide

[Contents] [Previous] [Next] [Last]

Chapter 3
Configuration Files for UI Templates

Each UI template has one configuration file. A configuration file must have a .conf extension. The main purpose of a configuration file is to specify which pattern files are used to create the End User page. However, configuration files also do several other things, such as determining whether categories or documents are displayed first.

This chapter has the following sections:

Variables in Configuration Files

A configuration file contains variables that assign pattern files to components, as well as variables used for several other tasks. The names of all variables in a configuration file always start with RDM-. RDM standards for resource description messages. The RDM protocol is the protocol that the Compass Server uses for discovering and retrieving data about resources on a network.

The first thing a configuration file does is define the RDM-description variable, which indicates the name of the template. This name appears in the menu of templates in the End User screen of the Compass Server Administration environment. For example:

RDM-description="Corporate Search and Browse"

Assigning Pattern Files to Components

A configuration file uses special variables to indicate which pattern file to use for each component in a Compass Server End User page.

Each variable corresponds to a component of the page. The components are discussed in Composition of the End User Page.

The variable names are not case-sensitive.

The variables are:

Variables for components for browse-mode pages
Variable name Description of value for this variable
RDM-browse-top
A pattern file that provides the content for the top of a browse-mode page.

RDM-browse-bottom
A pattern file that provides the content for the bottom of a browse-mode page.

RDM-category-browse-top
A pattern file that provides the content immediately preceding the list of subcategories in a browsed category.

RDM-category-browse-hit
A pattern file that provides the content for each subcategory of a browsed category.

RDM-category-browse-bottom
A pattern file that provides the content immediately following the list of subcategories.

RDM-document-browse-top
A pattern file that provides the content immediately preceding the list of documents in a browsed category.

RDM-document-browse-hit
A pattern file that provides the content for each document in a browsed category.

RDM-document-browse-bottom
A pattern file that provides the content following the list of documents in a browsed category.

Variables for components for search-results pages
Variable name Description of value for this variable
RDM-search-results-top
A pattern file that provides the content for the top of a search-results page.

RDM-search-results-bottom
A pattern file that provides the content for the bottom of a search-results page.

RDM-category-match-top
A pattern file that provides the content immediately preceding the list of categories that matched the search criteria.

RDM-category-match-hit
A pattern file that provides the content for each matching category.

RDM-category-match-bottom
A pattern file that provides the content immediately following the list of matching categories.

RDM-document-match-top
A pattern file that provides the content immediately preceding the list of documents that matched the search criteria.

RDM-document-match-hit
A pattern file that provides the content for each matching document.

RDM-document-match-bottom
A pattern file that provides the content immediately following the list of matching documents.

The value of each of these variables must be an existing pattern file in the same templates directory as the configuration file. For example:

RDM-document-match-top=normal-dm-top.pat
RDM-category-browse-top=custom1-bw-top.pat
RDM-category-browse-hit=custom1-bw-hit.pat
RDM-category-browse-bottom=custom1-bw-bot.pat
If you want to omit a component, you can just omit the appropriate RDM-variable. Alternatively, you can set its value to nothing.pat, which is a file in the templates directory that has no content. For example, the following code causes the Compass Server End User page to omit the components that display subcategories in a category:

RDM-category-browse-top=nothing.pat
RDM-category-browse-hit=nothing.pat
RDM-category-browse-bottom=nothing.pat
For more information on pattern files, see Pattern Files for UI Templates.

Determining the Order of Search Results

The variable RDM-search-results-order determines whether matching categories or matching documents are listed first when the Compass Server End User page displays the results of a search. The value is either cm,dm (meaning categories are listed first) or dm,cm (meaning documents are listed first).

RDM-search-results-order=cm,dm
OR

RDM-search-results-order=dm,cm

Determining What the Compass End User Page Lets the User Do

You can determine what a Compass End User page allows the user to do by specifying values for the RDM-perform-task variables. These are:

The value of each of these variables is true or false. The following example enables searching for categories and documents, enables category browsing, and disables browsing for documents.

RDM-perform-document-match=true
RDM-perform-category-match=true
RDM-perform-document-browse=false
RDM-perform-category-browse=true
If a task is enabled, the three components for that task are included in the page. If the task is disabled, the three components are not included. For example, if document browsing is disabled, then the document-browse-top, document-browse-hit, and document-browse-bottom components will not be included in the Compass Server End User page when it uses browse mode.

Note however that the browse-top and browse-bottom components are always included in browse-mode pages, regardless of what tasks are disabled. Similarly, search-top and search-bottom components are always included in search-results mode pages. Both the search-top and browse-top components often include a search query entry field. In the unlikely event that you want to disable searching for both categories and documents, you should make sure that the pattern files used for the browse-top and search-top components do not display a search query entry field. If the user sees a search query entry field, they will expect to be able to perform searches, and will be surprised if their search requests are ignored.

Specifying Which Attributes Can Be Viewed in Hit Components

You can use RDM-view variables to determine which SOIF attributes can be included in the description of categories and documents. A SOIF attribute is derived from a database field of the resource description for the category or document. For more about SOIF attributes, see SOIF Attributes.

The RDM-view variables are:

RDM-category-browse-view-attributes

Specifies which $$SOIF-attribute variables can be used in the category-browse- hit components in browse-mode pages. A $$SOIF-attribute is an attribute that is derived from a database field for a resource description. For more about SOIF attributes, see SOIF Attributes.

For example, the following statement allows the $$id, $$parent-id, and $$description variables to be used in the RDM-category-browse-hit pattern file. (This basically means that the end user page can display the id, parent-id, and description for browsed categories.)

RDM-category-browse-view-attributes=id,parent-id,description

RDM-category-browse-view-hits

Specifies the first and last subcategory to be displayed in the list of subcategories in browse-mode pages.

For example, the following statement invokes the RDM-category-browse-hit pattern file to display the first subcategory, and continues invoking it until the 100th subcategory has been displayed.

RDM-category-browse-view-hits=1..100

RDM-category-browse-view-order

Specifies which attributes are used to order the subcategories. For example, the following statement specifies that the subcategories are ordered by increasing value of their id. Since a category id is basically the category name, the subcategories are listed in increasing alphabetical order.

RDM-category-browse-view-order=+id

RDM-document-browse-view-attributes

Specifies which $$SOIF-attribute variables can be used in the document- browse-hit components in browse-mode pages. A $$SOIF-attribute is an attribute that is derived from a database field for a resource description. For more about SOIF attributes, see SOIF Attributes.

For example, the following statement allows the $$url, $$title, $$description, and $$author variables to be used in the RDM-document- browse-hit pattern file. (This basically means that the End User page can display the URL, title, description, and author of documents.)

RDM-document-browse-view-attributes=url,title,description,author

RDM-document-browse-view-hits

Specifies the first and last documents in a category to be displayed in browse-mode pages.

For example, the following statement invokes the RDM-document-browse-hit pattern file to display the first document in the current category, and continues invoking it until the 20th document has been displayed. That is, for each subcategory, up to 20 documents in the category will be shown.

RDM-document-browse-view-hits=1..20

RDM-document-browse-view-order

Specifies which attributes are used to order the documents in a category in browse- mode pages. For example, the following statement specifies that documents are listed in increasing alphabetical order of their titles.

RDM-document-browse-view-order=+title

RDM-category-match-view-attributes

Specifies which $$SOIF-attribute variables can be used in the category-match- hit components in search-results mode pages. A $$SOIF-attribute is an attribute that is derived from a database field for a resource description. For more about SOIF attributes, see SOIF Attributes.

For example, the following statement allows the $$id variable to be used in the $$RDM-category-match-hit pattern file. (This basically means that the End User page can display a category's id.)

RDM-category-match-view-attributes=id

RDM-category-match-view-order

Specifies which attributes are used to order the matching categories in a search- results page. For example, the following statement specifies that matching categories are ordered by decreasing value of their match score. Categories that have the same score are ordered by increasing alphabetical order of their id.

RDM-category-match-view-order=-score,+id

RDM-document-match-view-attributes

Specifies which $$SOIF-attribute variables can be used in the document-match- hit components in search-results pages. A $$SOIF-attribute is an attribute that is derived from a database field for a resource description. For more about SOIF attributes, see SOIF Attributes.

For example, the following statement allows the $$url, $$title, $$description, and $$last-modified variables to be used in the RDM- document-match-hit pattern file. (This basically means that the End User page can display the URL, title, description, and last modified date of each document.)

RDM-document-match-view-attributes= url,title,description,last-modified

RDM-document-match-view-order

Specifies which attributes are used to order the matching documents in a search- results page. For example, the following statement specifies that the matching documents are ordered by decreasing value of their match score.

RDM-document-match-view-order=-score

Specifying Defaults for Basic Parameters

You can specify default values for some basic parameters by assigning values to the following variables:

For example:

RDM-default-browse-category=ROOT
RDM-default-chunk-size=10
RDM-default-page=1
RDM-default-scope=NULL
RDM-default-search-category=NULL

Determining Which Images to Use to Indicate Rankings

When a user submits a search, the page that shows the results can display "ranking" icons that indicate how well each document matches the query. (Usually the document-match-hit component displays these icons.)

You can specify whatever images you want to use as the ranking icons, by specifying values for the following variables:

The value of each of these variables must be a GIF or JPEG file. For example:

RDM-score-icon1=images/goldstar1.gif
RDM-score-icon2=images/goldstar2.gif
RDM-score-icon3=images/goldstar3.gif
RDM-score-icon4=images/goldstar4.gif
RDM-score-icon5=images/goldstar5.gif

Determining What Colors to Use for Documents and Categories

When the user browses a category, the documents in the category can be shown in a table, where each document appears in a separate row that has a different background color from its adjacent rows. Similarly, when the end user searches for documents, the matching documents can be displayed in table rows with different colored backgrounds. It is also possible to display categories in tables, where each row has a different colored background.

You can specify the list of colors to use as the backgrounds of the table rows by providing a value for the RDM-rotated-colors variable. The value must be a comma-separated list of colors, with no spaces surrounding the commas. For example:

RDM-rotated-colors="red,white,blue,green"
RDM-rotated-colors="#445566,#67FF22,cyan,#FFAABC,#708090"
The table rows are defined by the pattern files assigned to the RDM-document-browse-hit, RDM-document-match-hit, RDM-category-browse-hit, and RDM-category-match-hit variables. The rotated colors will be used if these files make use of the RDM-rotated-colors variable.

Whenever the $$RDM-rotated-colors variable is used in the pattern files for the category-match-hit, category-browse-hit, document-match-hit, or document-browse hit components, the color will be advanced to the next color in the list. (The list is cyclic.)


[Contents] [Previous] [Next] [Last]

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