ReadMe

SearchToHTML parameters guide

Last updated September 3, 2004

Required
Optional
Control results information
Change the colors
Change the text
Change the fonts

Parameters allow you to pass information into the applet before it is shown. It is through parameters (files or files_file) that you must tell SearchToHTML which files to search. SearchToHTML's parameters also allow you to control nearly every aspect of the applet's appearance, to say what information will be displayed in the search results, and to change the default properties of searches.

The values of parameters are set in the HTML used to display the applet.

To set the value of a parameter, we add param tags between the opening and closing applet tags. A param tag has the following format:
<param name="[name]" value="[value]">
where [name] will be replaced with the name of the parameter and [value] will be replaced with the value of the parameter.


Required

Top

The required parameters let the applet know the names of the files to search. If you do not fill in at least one of the following parameters, files or files_file, the applet will not work. (It's all right to fill in both parameters too.)

Name Description
files List of files to search. The file names are expected to be relative to the path to the file displaying the applet. Each file name in the list should be separated from the others by a comma, space, tab, or a line ending.
files_file You may use this parameter to have the applet load a list of files to search from a separate file. The files_file value should be a file path relative to the location of the file displaying the applet. The list of files within the file should have the same format as that given to the files parameter. Using this parameter will force the user to wait for another file (the list of files to search) to be downloaded.

Optional

Top

The following optional parameters control a hodge-podge of features from the width of the progress bar to whether the applet will require every term to match.

Name Default value Description
target results The name of the frame the search results will be opened in.
max_num_matches The maximum number of documents that will be added to the results list.
leadingcontextlength 15 How many characters previous to and including the match should be displayed.
trailingcontextlength 0 How many characters following the match should be included in the context displayed in the search results.
resultspage displaymatches.html The name of the file containing the JavaScript to decode the search results.
ignore_tags false If this parameter is set to "true", by default, the applet will not search text lying in between lesser than and greater than signs. The user may have the applet stop ignoring tags by unchecking the "Exclude HTML" (or equivalent) checkbox.
exact_matches_only false If this parameter is set to "true", by default, the applet will only match whole words -- a match will be required to be surrounded by non-word characters. The user may have the applet stop requiring exact matches by unchecking the "Exact matches only" (or equivalent) checkbox.
match_all_terms false If this parameter is set to "true", by default, a document will not be considered to match unless every search term is found within the document -- an AND search. The user may switch the applet to do OR searches by unchecking the "Require all terms" (or equivalent) checkbox.
progress_bar_height 20 The height of the progress bar in pixels.
progress_bar_width [Width of the applet minus 20] The width of the progress bar in pixels.
hide_progress_bar_message false Set this parameter to "true" to hide the progress bar's text message.
phrase_searches_only false Setting this parameter to true will cause the applet to treat all of the text the user enters as one phrase -- as if the user had placed double quotes around all of the text. Double quotes within the text will not be interpreted. Please change the comment accompanying the applet if you use this parameter to let users know how their searches will be interpreted.
allow_multiple false If true, look for multiple matches on a page. By default, the applet stops searching a page once it has found a match.
sort_by_date false If true, sort the search results by modification date. Otherwise, sort by title and file name.
base_url Taken to be the URL of the document displaying the applet. Used as the base for interpreting relative URLs in other applet parameters. Normally this parameter is provided by the script that writes the applet tag.
query Taken to be the query portion of the URL of the document containing the applet. Parameters set in the query string generally have precedence over parameters set in the applet tag. Normally this parameter is provided by the script that writes the applet tag.
q The string to search for. If this parameter is not specified, the applet will die with an exception. Normally this parameter is provided by the search form.

Control results information

Top

The following parameters control what information the applet will send onto the search results page to be displayed. Setting one of these parameters to false will eliminate will cause some element to disappear from the search results page. More importantly, the space used to transmit that element will be freed up.

(To change the appearance of the search results, modify results.js.)

Name Default value Description
send_context true If this parameter is set to "false", context information will not be sent.
send_titles true If this parameter is set to "false", the titles of the documents will not be sent.
send_info true If this parameter is set to "false", document information (file size, modification date) will not be sent.
send_anchors true If this parameter is set to false, the anchor nearest a match will not be sent.
max_url_length 2040 The applet will attempt to keep the URLs used to display search results shorter than the value of this parameter. The applet will, however, always send out at least one match per URL irregardless of the size of that match.
matches_per_page 25 The maximum number of matches to display on a single page. max_url_length takes precedence over this parameter.

Change the colors

Top

The following colors are available by name: black, green, blue, darkblue, lightblue, cyan, darkgray, gray, lightgray, magenta, orange, pink, red, white, and yellow.

Colors may also be defined as hexadecimal strings (beginning with "#" as in HTML).

If the SecurityManager allows it, you may also try to get System (property) defined colors.

Under some Java implementations, such as Apple's MRJ, trying to change the colors of most interface elements (checkboxes and buttons) will have no effect.

Name Default value Description
bgcolor gray The background color of the applet.
fgcolor black The foreground (text of labels) color.
buttonbgcolor   The background color of the buttons.
buttonfgcolor   The foreground color of the buttons.
progress_bar_completed_color blue The color of the portion of the progress bar representing the percent of the search completed.
progress_bar_remaining_color cyan The color of the portion of the progress bar representing the percent of the remaining to be completed -- basically, the background color of the progress bar.
progress_bar_text_color black The color of the text of the progress bar.

Change the text

Top

(To change the text of the search results, modify displaymatches.html.)

Name Default value Description
stop_btn_txt Stop The text of the button when a click will stop a search.
progress_bar_message Searching... The message displayed (along with the percent done) in the progress bar.
label_txt Results Page: The text of the label next to the navigation buttons.
previous_btn_txt Previous The text of the navigation button to press to display the previous page of results.
next_btn_txt Next The text of the navigation button to press to display the next page of results.

Change the fonts

Top

The font parameters expect their values to have the following format: "font-family font-style size". All Java implementations are required to provide the following font families: Serif, SansSerif, Monospaced, Dialog, and DialogInput. The valid styles are "bold", "italic", and "bolditalic" (case insensitive). For example, if you wanted the applet's buttons to use a bold Arial font of size 14, you could add the following param tag to the applet tag of appletframe.html:

<param name="button_font" value="Arial bold 14">
Name Default value Description
button_font   The font of the applet's buttons.
label_font   The font of the label next to the navigation buttons.
progress_bar_font   The font of the progress bar.

ReadMe