HtmlSearch Usage

This document describes how to deploy and use the HtmlSearch local search.
HtmlSearch can be deployed as an applet or an application. A number of parameters apply in either case.

The CLASSPATH environment variable may need to be set for your search to work.

There are a number of examples that describe various combinations of options.

See also the user help for screen description and options, as well as support and contact info.


General Parameters

When invoking, HtmlSearch you can specify parameters, whether you use HtmlSearch as an applet or an application.
Refer to the appropriate section for how to specify the parameters.
The HtmlSearch parameters correspond to settings on the screen (most of them in the Advanced panel), so you may want to refer to the user help for more explanations.
The asterisk (*) indicates parameters that are ignored in the Lite version. For parameters that are available in both versions, they can be set in the Lite version but the user will not be able to change the settings from the screen.

Usage As An Applet

In this case, HtmlSearch is invoked from an HTML page. Browser security settings may restrict access to other hosts and/or your PC. You may also have to set the CLASSPATH environmnent variable

HtmlSearch can be used within a an HTML page with the following applet tag:

<APPLET codebase="../../../.." code="HtmlSearchApp.HtmlSearch.class" height=550 width=650 archive="HtmlSearchApp/htmlsearch.jar"> <PARAM name="startUrl" value="html/index.htm"> <EM> In order to use the search applet, please enable JAVA in your browser. Set the appropriate level of security, depending on whether you're using Netscape or Explorer and your paranoia... </EM> </APPLET> Here is a brief explanation of the various elements of the invocation (this is not a HTML tutorial !):
codebase = path to the directory containing the HtmlSearch directory 
	(where the search class files have been copied)
	e.g.: if the applet has been installed in the directory D:\h1\h2\HtmlSearchApp
	and this page is in D:\h1\p1\p2\search.html set codebase to: "../../h2".
	If you can, it is better to use relative paths than absolute paths.

code = "HtmlSearchApp.HtmlSearch.class". No choice here.

width and height = any size you want to display your applet. The height
	of 550 provides a nice balance between all the panels.
	The width can be anything you want (less than 500 would look really
	goofy though): 650 seems to provide enough room for most error
	error messages during the search; 550 is a nicer look. Try what fits
	for you. If you are using the standAloneFrame option
	you can set these to 5 (or some lower value: there is a lurking Netscape bug, so
	you'll have to try what works for the version you're using).

jar = the name of the JAR archive for loading a compressed image of the code.
	This speeds the loading of the applet for Netscape and MsIE 4 and above, or
	any other browser that supports loading JAR files (JDK 1.1 and above).

param: startUrl = optional if you want to specify where the search starts
	from; e.g. startUrl = the page that invoked this search page
	(default = from this page). 
	All the parameters follow the same syntax: 
	just replace "startUrl" by the name of the option, 
	and set the value to what you want for the option.
	See below for the list of options.

You can also use the applet attributes 'MAYSCRIPT' and 'NAME' if you
want to use javascript to refer to the applet (you'll quickly
run into Netscape vs Explorer discrepancies though, so beware...)

The following HtmlSearch parameters have a particular usage with applets:

String: URL to start the search. By default, the startUrl is "." (i.e. the directory from which the applet was launched)
boolean: show the dialog in a stand alone frame instead of in the applet. By default, the HtmlSearch dialog is displayed in the page where HtmlSearch is invoked. If you set standAloneFrame to 'true', nothing will be displayed until you invoke the initsearch() function. This can be used if you want a button to start the search (see example in top.htm). The advantage is that the dialog window can be resized, and also that it doesn't occupy real estate on your HTML page. There is however a Netscape bug so beware: if you leave the page from which the search was started in the HTML page (e.g. type another URL or follow a link), the 'display' button doesn't work anymore.
String: window or frame name where to display the page. By default, when you press the 'display' button, pages are shown in a new browser window. You can tell HtmlSearch to display the page in a specific window. This is useful if you want to display the results in a specific frame.


Usage As An Application

To use HtmlSearch as an application you need to start it with the Java Interpreter, which you can download from the Java site if you don't already have it on your machine. Java 1.1x will also work (it is also available at the Java site).
On Windows, if you download the Java Interpreter after you installed HtmlSearch, you may want to re-run the installation because that will automatically create a batch file that invokes HtmlSearch.
When you use HtmlSearch as a Java application, there are no browser access restrictions, so searches can take place anywhere your firewall lets you go. The display button will work only if you specify which application you want to use to display the pages.

To specify the arguments, use a syntax such as: argumentName="value".
To specify quoted arguments, escape them with a backslash, and if necessary, separate the escaped quotes from the other quotes with a space; this is somewhat platform dependant so you may have to try what works with your environment.

The following HtmlSearch parameters have a particular usage with applications:

String: URL to start the search. You should set this one to a specific absolute URL, because the application has no frame of reference.
String: application to use when displaying the pages. Typically this would be the path to your browser, e.g. on Windows
"C:\program files\netscape\navigator\program\netscape.exe"
Depending on your Operating System and settings, this may start a new browser every time you click the display button.
You can start an HtmlSearch application with a command such as (example given for Windows, with lines split for better readability):
	JAVA_BIN_DIR\java HtmlSearchApp.HtmlSearch startUrl="D:\dir\index.html"
		displayApp="C:\program files\netscape\navigator\program\netscape.exe"
		lookFor=" \"a complex sentence\" \"another sentence\" individual words "

with HTMLSEARCH_INSTALL_DIR = the directory where you installed HtmlSearch (i.e. the one containing the subdirectory HtmlSearchApp)
and JAVA_BIN_DIR the directory where the Java interpreter resides (e.g. on a Windows PC, look for java.exe).

The HtmlSearch java window can be closed with CTRL-F4, although that is somewhat platform dependant, so try it first.