JSWISHI - Dec 10, 1999 AUTHORS ------- James Dean Palmer Steve Eckert INSTALLATION INSTRUCTIONS ------------------------- [1] Download, compile and install swish-e from http://sunsite.berkeley.edu/SWISH-E/ [2] Create an index or indices of files you would like to be searched on-line. Read the swish-e documentation to refine your index. Here is a quick and (very dirty) index of my web content: $ swish-e -f /data/www/index.swish -i /data/www/ [3] Edit the "search.cgi" file that came in this archive and make sure the perl path on the top line is correct, and change the $template_file variable to refer to the location of your template file. In my example, I use "/data/www/jswishi/example-1.html" [4] Copy the cgi script "search.cgi" into a web accessible directory where it can be executed. In my example, I use "/data/www/jswishi/" [5] Edit example-1.html and make the necessary changes, additions, subtractions based on the reference information below. Be sure to change the path to the cgi executable in both the configuration tags and in the FORM tag! You can do a search for ".cgi" to find both occurances. [6] With any luck (and or kludgeing), it should work. BUILDING A TEMPLATE FILE ------------------------ When I first wrote my swish interface, the interface was built into the cgi script. This was convenient in that you only had to bother with one file, and it was fairly simplistic. But I maintain a lot of systems, and each content maitainer I work with wanted the interface to look differently. Thus as they started changing my perl script (and usually messing them up) the different scripts started diverging from each other, and thus became impossible to maintain. So, one of the jswish design goals was to use "skins" so that any of my script users can modify their html skins without messing up/changing my code. It's probably easier to look at the examples than for me to explain the simple tag based grammar, but here it goes: REQUIRED TAGS ============= Each skin file *must* have the following tags. (And if you haven't noticed, all the tags are "html comments", so your skin file should be valid html, if not a bit odd looking.) * The "search-cgi" directive indicates the URL of the search.cgi script. * The "swish-command" directive indicates the location of swish-e. * The "page-size" directive indicates the number of hits to put on a single page. * The "maximum-matches" directive indicates the maximum number of matches to return. INDEX TAGS ========== Each skin file must have at least one index directive of the form: The first argument "swish-e" tells it the type of backend to use for searching. What other backends are supported? Well, none that you would find useable. The other backend type "calendar" is a calendar database that this script can search -- I have left the code that does this in the script to serve as an example of how you might search your own databases. The second index argument determines wether the index is SELECTED or UNSELECTED by default. You can declare a number of indexes with swish-e or database backends, and allow the user to toggle which ones they want. This sets the default. The third index directive is the full path to the index (or indices seperated by commas). The final index directive is the name of the index. REPLACEMENT RULES ================= Replacement rules allow you to change how file paths appear to the user. Naturally you would want to change "/home/www/" to "http://your.computer.com/". This would be accomplished with the following rule: DOCUMENT CONSTRUCTION TAGS ========================== The actual "skinning" of the document is done with construction tags that indicate what part of the document the html refers to. The following tags are supported: HTML between these tags make up the head of the document. HTML between these tags make up the summary box heading. HTML between these tags make up the summary box body. Words that get replaced with values: "Entry Title" "Entry Range" "Entry Total" HTML between these tags make up the summary tail. HTML between these tags make up the search results heading. Words that get replaced with values: Entry Title Next Page Previous Page HTML between these tags make up the search results body for html documents. Words that get replaced with values: "REPLACE NUMBER" "REPLACE PREVIEW" "REPLACE SCORE" "REPLACE SIZE" HTML between these tags make up the search results body for pdf documents. Words that get replaced with values: "REPLACE AUTHOR" "REPLACE SCORE" "REPLACE SIZE" "REPLACE PAGES" HTML between these tags make up the search results body for calendar documents. Words that get replaced with values: "REPLACE NUMBER" "REPLACE DESCRIPTION" "REPLACE DATE" "REPLACE LOCATION" HTML between these tags make up the search results tail. Words that get replaced with values: Entry Title Next Page Previous Page HTML between these tags make up the search box head. HTML between these tags is used for the *first* entry in the search box. Words that get replaced with values: "Entry Title" HTML between these tags is used for the subsequent entries in the search box. Words that get replaced with values: "Entry Title" HTML between these tags is used for the tail of the search box. HTML between these tags is used for the tail of the page. Confused? I highly reccomend starting with one of the included examples! OTHER INFORMATION ================= Thanks to Steve Eckert for all of his wonderful additions. JSWISHI has been much improved because of his efforts. If you have any questions feel free to contact me at: james@tiger-marmalade.com http://www.tiger-marmalade.com/~james/ James Dean Palmer December 10, 1999