Last updated August 23, 2001
Required
Optional
Control results information
Hide/show interface elements
Change the colors
Change the text
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.
Examples of the usage for nearly every parameter SearchToHTML understands can be found in ../examples/paramex.html.
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.
|
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 | _top | The name of the frame the search results will be opened in. |
startwords | Words displayed in the search box when the applet is first shown. | |
searchbox_size | 20 | The width of the search box in number of characters. This is equivalent to "size" attribute of an HTML input element. |
max_num_matches | [The number of documents to searched] | 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 | searchresults.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. |
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. |
start_pattern | Only text after a match for this pattern will searched. | |
stop_pattern | Only text up to and including a match for this pattern will be searched. |
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.
All of the information displayed in the search results is transmitted from the applet through a URL. If the URL grows too long, some of the search results may get chopped off or the search results might not be transmitted at all.
It's not likely that you will encounter this problem if you are running the applet from a server. If you are running the applet locally under Windows, however, and have set up the applet to search a fairly large number of files, more than 80 or so, then it is likely that you'll have to fiddle with these parameters to ensure that all of the search results are displayed consistently. (Under Windows, it appears that all URLs over 4096 characters are truncated.)
It is usually the context information that takes up the most space.
(To change the appearance of the search results, modify searchresults.html.)
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. |
It is possible to hide every element of the applet's interface but the search box. If an element is hidden, the remaining elements will be slid around to take its place. For example, if all of the checkboxes are hidden, the progress bar slides up and the top row down to take their place.
The "Require all terms" checkbox will only be drawn if the show_match_all_terms_checkbox
parameter is set to "true".
If you choose to display all of the checkboxes, you may need to increase the width of the applet to make room for them all.
Name | Default value | Description |
---|---|---|
hide_xhtml_chkbx | false | Set this parameter to "true" to hide the "Exclude HTML" checkbox; you can still have the applet ignore tags by setting the ignore_tags parameter to "true".
|
hide_exact_chkbx | false | Set this parameter to "true" to hide the "Exact matches only" checkbox -- you can still have the applet accept only exact matches by setting the exact_matches_only parameter to "true".
|
hide_button | false | Set this parameter to "true" to hide the search/stop button. |
hide_searchbox_label | false | Set this parameter to "true" to hide the label accompanying the search text box ("Search for: "). |
hide_progress_bar_message | false | Set this parameter to "true" to hide the progress bar's text message. |
hide_progress_bar | false | Set this parameter to "true" to hide the progress bar. |
show_match_all_terms_checkbox | false | Set this parameter to "true" to show the "Require all terms" checkbox. |
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 search/stop button. | |
buttonfgcolor | The foreground color of the buttons. | |
checkboxbgcolor | The background color of the checkboxes. | |
checkboxfgcolor | The foreground color of the checkboxes. | |
searchboxbgcolor | white | The background color of the search box. |
searchboxfgcolor | black | The foreground color of the search box. |
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. |
(To change the text of the search results, modify searchresults.html.)
Name | Default value | Description |
---|---|---|
searchbox_label_txt | Search for: | The text next to the search box. |
search_btn_txt | Search | The text of the button when a click will start a search. |
stop_btn_txt | Stop | The text of the button when a click will stop a search. |
exact_chkbx_txt | Exact matches only | The text of the check box used to specify exact matches only. |
xhtml_chkbx_txt | Exclude HTML | The text of the check box used to specify whether the contents of HTML tags should be ignored. |
progress_bar_message | Searching... | The message displayed (along with the percent done) in the progress bar. |
match_all_terms_checkbox_txt | Require all terms | The message displayed in checkbox that the user may check to require that a document contain a match for every term the user is searching for, to do AND searches. |