TACTWeb: Configuration

So far we have described how TACTweb should be set up, and we've tested it with the demonstration TDB we have provided. Now we will discuss how you can use TACTweb with your TDBs, and will also tell you how to modify the query form to suit your own purposes.

Setting up TACTweb to work with your texts

Creating a TACT database

TACTweb works with textual databases (TDBs) that are created by other parts of the TACT system (version 2.x). If you are already using TACT tools such as UseBase or Collgen from version 2.0 or 2.1 on your text, you already have the necessary TDB database. If you do not have a TDB database for your text, then you will need to create a TDB for it. This can be done using the standard TACT 2.x system tools MAKEBASE or MERGEBASE. The TACT software that contains these tools is available from ftp.epas.utoronto.ca. Alternatively, texts marked up with an SGML derived language can used as the basis for a TDB by processing them with sgml2tdb -- a part of the TACT system that was recently added.

Although TDBs can be put in any directory on your computer, there are some advantages to putting all the TDBs you want TACTweb to access in one subdirectory. We'll discuss this further when we talk about the steps involved in configuring TACTweb for your use. When TACTweb.ZIP is uncompressed, it will create a subdirectory within C:\WebSite\cgi-dos called tactweb. You will find the demonstration TDB midsumme.tdb there already, and you can also place your own TDBs there if you wish.

How TACTweb accesses your TDBs

There are two files which you must create to make TACTweb access your own TDB:

Pointing TACTweb to your own TACT TDB files

As was mentioned above, the first step is to create a new batch file in the directory C:\WebSite\cgi-dos. Suppose your database is called hamlet.tdb and is in the directory c:\tact\texts\hamlet.tdb. A batch file that will invoke TACTweb with your TDB could be called hamlet.bat, and must be stored with other batch files in c:\WebSite\cgi-dos if WebSite is to use it. Here is what it should look like:

c:
cd \website\cgi-dos
set tactpath=c:\website\cgi-dos
tactweb c:\tact\texts\hamlet.tdb >%output_file%
 

This batch file will be invoked automatically by the WebSite server when a user requests a query to be processed against the hamlet.tdb file.

Controlling the secondary displays

If you have used TACTweb you will already be aware that TACTweb output contains links in the KWIC and Variable Context displays to a secondary display (also generated by TACTweb) that contains a block of text from the TDB surrounding the selected position in the text. You can set the tactpage environment variable in your batch file to specify the amount of text you want TACTweb to generate for these secondary displays.

Suppose in your Hamlet text you have provided tags that mark the page boundaries from a standard edition. The name of this unit is "rivpage". If you wish to make TACTweb use this page boundary as the boundary between the chunks of text it displays in the secondary displays, you can set the tactpage environment variable in your batch file, as shown below:

c:
cd \website\cgi-dos
set tactpath=c:\website\cgi-dos
set tactpage=rivpage/Page
tactweb c:\tact\texts\hamlet.tdb >%output_file%
 

In this example, the value assigned to tactpage has two parts separated by a slash.

In other words, this setting specifies that the secondary textual displays are to contain text between "rivpage" tags, and that within the display itself this unit of text is called a "Page".

If no value for "tactpage" is given, TACTweb will generate a secondary display consisting of the line of text containing the selected position, plus 40 lines of text on each side.

Creating an HTML form for your own TACT TDB files

Having now created the batch file that will launch TACTweb and point it to your TDB, it is now necesary to create a form that can be filled in and will generate a request to your server to launch the batch file.

In order to understand how to modify the HTML query form, you will need to first understand how the HTML forms language works. There are many documents on the Web that describes the elements of the HTML form language. Here is a pointer to one set of them.

You have probably already seen how your browser displays the Query form we have provided as a sample.

To create a form that will cause TACTweb to access your own TDB, the easiest method is to copy the example form in c:\WebSite\htdocs\tactweb\tactweb.htm (calling the copy, say, c:\WebSite\htdocs\tactweb\hamlet.htm for the hamlet text), and edit the copy.

We will store the form on the same machine that provides access to TACTweb, and we will store it in the subdirectory under the "htdocs" directory (which contains documents that WebSite will serve), in a subdirectory called "tactweb". However, this is not necessary -- unlike the batch file which must reside in the directory "Website\cgi-dos", the form that invokes it may result in any directory that can contain documents on the WebSite machine, or, indeed even on a different Web Server altogether.

In any event, two changes from the sample form must be made:

Here is the HTML coding for the form in hamlet.htm that could be used to query the hamlet.tdb database::

<FORM METHOD="POST" ACTION="/cgi-bin/hamlet.bat">
<p><INPUT TYPE="submit" VALUE="Submit Query"> <INPUT TYPE="reset" VALUE="Reset Form">
<H2>Your Query:</H2>
 
<INPUT NAME="query" INPUT SIZE=70><P>
 
<b>Query Context:</b>
<SELECT NAME="qcontext_unit">
<OPTION> Lines
<OPTION VALUE=rivpage> Riverside Edition Page
<OPTION VALUE=ActScene> Scene
<OPTION> Speaker
<OPTION SELECTED>Words
</SELECT> 
 
Before: <INPUT NAME="qcontext_before" VALUE="5" INPUT SIZE=5 MAXLENGTH=5>
After: <INPUT NAME="qcontext_after" VALUE="5" INPUT SIZE=5 MAXLENGTH=5>
 
<h2>Display</h2>
<SELECT NAME="display_type">
<OPTION VALUE="KWIC" SELECTED>KWIC
<OPTION VALUE="VAR"> Variable Context Display
<OPTION VALUE="DIST"> Distribution
<OPTION VALUE="WORD"> Word List
</SELECT> 
 
<p><b>Variable Context Display Context:</b>
<SELECT NAME="dcontext_unit">
<OPTION SELECTED>Lines
<OPTION VALUE=rivpage>Riverside Edition Page
<OPTION VALUE=ActScene>Scene
<OPTION>Speaker
<OPTION>Words
</SELECT> 
 
Before: <INPUT NAME="dcontext_before" VALUE="3" INPUT SIZE=5 MAXLENGTH=5>
After: <INPUT NAME="dcontext_after" VALUE="3" INPUT SIZE=5 MAXLENGTH=5>
 
<p><b>Reference Template:</b>
<INPUT NAME="ref_template" INPUT SIZE=40>
</FORM>
 

If you have reviewed the format of HTML Forms, much of this will already be familiar to you. However, we'll give a brief overview here:

Having seen this introduction to the HTML form coding for TACTweb, you can probably read the rest of the form and understand it. The most important thing to understand here is that the NAME attribute is critical. It is the way by which specific values are identified to TACTweb for its use.

Using TACTweb to access more than one TDB

There are two ways to make TACTweb support access more than one TDB.

In the second method, since the same form is used to gain access to all TDBs, it will be necessary that all TDBs contain the same Reference information, since the names of the Reference Information are coded in the single form that is going to access all of them. Although some of your options are more restricted with this method, your users may find that the second procedure (which allows them to select among your TDBs) by choosing something on the form, is more flexible for them and easier to use.

The procedure to follow is:

If for example, the directory contained a set of 3 TDB's for three different Shakespeare plays, a SELECT element might be coded in a form to allow the user to select between them. The value assigned to "tdb_file" from this process would tell TACTweb which database to use. The suggested HTML for the SELECT element might be:

<p>Select play here: <SELECT NAME="tdb_file">
<OPTION SELECTED VALUE="midsumme.tdb">A Midsummer's Night's Dream
<OPTION VALUE="rjf.tdb">Romeo and Juliet
<OPTION VALUE="hamlet.tdb">Hamlet
</SELECT>
 

The TACTweb Result "Wrapper"

When TACTweb processes a query it generates a sequence of HTML containing the result. Surrounding this result is a small amount of HTML, that "wraps" the main result data. By generating a "wrapper file" for TACTweb, and specifying in the batch file that you want TACTweb to use your wrapper file you can control the HTML that will be wrapped around the results of a TACTweb display. In this way, you can, for example, wrap the results with some text that identifies your project, or your institution.

If you project was called the "Public Shakespeare Project", and you were mounting a set of plays as TACT databases, you might, for example, use something like the following as a "wrapper file" for, say the "midsumme.tdb":

<HTML>
<HEAD>
<TITLE>Public Shakespeare Project, Search Results</TITLE>
</HEAD>
<BODY>
<H1>Public Shakespeare Project</H1>
<H2>Search Results: A Midsummer Night's Dream</H2>
$$$$
<ADDRESS>
The Public Shakespeare Project<BR>
Copyright (c) 1997
</ADDRESS>
</BODY>
</HTML>
 

The line containing "$$$$" is the spot in the file TACTweb will look for to tell it where to insert its results.

Once you have created a wrapper file, you must tell TACTweb to use it. Suppose your wrapper file was called "midsumme.wap". Add the "-w" switch to the line in your CGI batch file that invokes TACTweb, and follow it with the wrapper file name, e.g.:

tactweb texts\midsumme.tdb -w midsumme.wap >%output_file%
 

What Else Is There?

We have now described the work involved in setting up TACTweb to provide access to your own TDBs. In the next page of the installation section we will describe how to create new forms, and use options on them to control the TACTweb search engine.


[Controlling TACTweb]

[TACTweb Installation and Configuration Home Page]

Web design Alex Stevens, content Geoffrey Rockwell or John Bradley. March 7, 1997