Browsing - Overview and Contents
Through a combination of database tables
and collmgr field configuration,
dynamic browsing is available through the DLXS middleware. When the proper
CGI-based URL is received, the middleware checks for certain metadata in the
database tables, packages some of it in XML, uses some of it, as is in its
stored format of XML, and lets XSLT format the results. At run time, no XPAT queries are needed, only MySQL queries are run against the item browse tables
in the dlxs
database.
After the tables are prepared, that is, populated with item metadata through
the $DLXSROOT/bin/browse/updatebrowsedb.pl script (aka "database populator"),
configuration for the behavior of dynamic browsing is accomplished by modifying
certain collmgr fields.
Provisions will soon be made for creating static HTML browse pages with the
database populator script.
Contents:
Item browse database tables
There are three tables in the dlxs database that are specifically used for
dynamic browsing in the middleware:
- ItemColl
- ItemBrowse
- ItemBrowseCounts
The ItemColl table holds, for each item/document and collection combination,
one row containing the following columns:
- the idno
- the collection
id
- the modification date of the row's information
- XML metadata
about the item: in the case of TextClass, this is simply the DLXSTEXTCLASS/HEADER element that is retrieved from an XPAT query in the "database
populator" script. In the case of ImageClass, the Perl subclass used
by the database populator grabs information from the MySQL or XPAT data
and wraps it in specific XML before filling in this field.
The ItemBrowse table holds, for each item/document's browseable field (e.g.,
author, title, etc.):
- the idno
- the field name
- the value of the field
- rank (not currently used)
The ItemBrowseCounts table holds, for each collection, a list of rows containing:
- colleciton id
- the field name
- the first character or the first two characters of the sortable
field's value (sortable title, author's name)
- the count of items that begin with that first character or those first
two characters
Collmgr fields for configuration
The main fields in the collmgr that need to be set properly are:
- locale
- browsenav
- browsefields
See Configure the collmgr fields below for
more information.
Preparing collections for browsing
Configure
the collmgr fields
Start collmgr and change the following fields:
- devhost: if you are running the database populator in a development environment
(that is, where DLPS_DEV environment variable
is set), you can have the middleware use XPAT-indexed data that is
on a machine different from the usual host. This can be useful for testing
purposes.
- locale: (this should be changed to a UTF-8 type of encoding, e.g., en_US.UTF-8)
- browsenav: enter 0, 1, or 2. If you want no paging, that is, that all
items in the colleciton appear on one HTML page for the user to browse,
enter 0. Enter 1, if you want "one level of browsing", that is, that a
separate page be created for each first character of the value in question
(e.g., title or author) and that a navigation bar be built that allows
the user to navigate to each page, for example, jump to the page listing
items whose value begins with "M". Entering 2 in this field will create
a "two-level browse", where two navigation bars will be created. The first
bar will allow the user to jump to items whose values begin with a particular
first character (e.g., jump to the records that begin with "B"). The second
navigation bar will allow the user to jump to items whose values begin
with a particular two-character combination, (e.g., records that begin
with "Bu"). This decision is left to the collection coordinator. We have
found that the level is based on how many total items there are in
the collection and therefore what is a reasonable number of browseable
items for a single HTML page.
- browsefields: list the browseable fields for the collection. For example,
some collections may have only title browsing, others may need both title
and author, etc.
Populating the item browse
tables
To initially populate or to update the item browse tables, simply run the
database populator. To do so, enter:
$DLXSROOT/bin/browse/updatebrowsedb.pl class=AAA c=BBB host=CCC
where AAA is either "text" or "image" and
where BBB is the collection id of
the collection you want to create browsing for and CCC is
the name of the host on which resides the XPAT index for the collection. You
may want to point the script at new or test data on a machine that is different
from your production machine. If that is the case, you may also want to change
the devhost field for the collection in collmgr and test the collection in
development mode (with the DLPS_DEV environment variable set).
Running this program will populate or update the rows necessary in each of
the three ItemBrowse related tables. These tables will be queried when the
user requests browsing from the middleware.