# Interface between web search form and Swish search engine for Professor # Robert Allison's Watermark Archive. Provides context sensitive # searching, emulating a true database search. # # written by Jim Hart # Copyright (C) 1996 Bates College # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # or point your web browser to http://www.fsf.org/copyleft/gpl.html BEGIN { RS = "&" # load the field name translation table kw["placename"] = "identification" kw["otherplacename"] = "identification" kw["libraryname"] = "identification" kw["otherlibraryname"] = "identification" kw["collection"] = "identification" kw["shelfnumber"] = "identification" kw["papernumber"] = "identification" kw["msform"] = "manuscript" kw["othermsform"] = "manuscript" kw["papvertical"] = "measuring" kw["paphorizontal"] = "measuring" kw["paperuse"] = "utilized" kw["otherpaperuse"] = "utilized" kw["scribename1"] = "scribe" kw["scribename2"] = "scribe" kw["scribename3"] = "scribe" kw["wmdesign"] = "design" kw["otherwmdesign"] = "design" kw["othercountermark"] = "countermark" kw["wmvertical"] = "dimensions" kw["wmhorizontal"] = "dimensions" kw["wmposition"] = "disposition" kw["otherwmposition"] = "disposition" kw["chain"] = "interval" kw["wire"] = "density" kw["wirepattern"] = "style" kw["otherwirepattern"] = "style" kw["thicksuppl"] = "thickness" kw["othercolor"] = "color" kw["texture"] = "surface" kw["texturesuppl"] = "surface" kw["stiffsuppl"] = "stiffness" kw["paperdate"] = "estimate" kw["chron"] = "dating" kw["otherchron"] = "dating" kw["imagetype1"] = "print" kw["imagetype2"] = "available" kw["otherimagetype1"] = "print" kw["otherimagetype2"] = "available" kw["catalog1"] = "facsimiles" kw["othercatalog1"] = "facsimiles" kw["wmref1"] = "facsimiles" kw["catalog2"] = "facsimiles" kw["othercatalog2"] = "facsimiles" kw["wmref2"] = "facsimiles" kw["catalog3"] = "facsimiles" kw["othercatalog3"] = "facsimiles" kw["wmref3"] = "facsimiles" kw["biblio"] = "bibliog" kw["fullname"] = "submitted" keywords = "placeholder" } { split ( $0, flds, "=" ) if ( flds[2] != "" ) { kw1 = flds[1] if ( kw[flds[1]] != "") kw1 = kw[flds[1]] # any (or) search #if ( keywords == "placeholder" ) keywords = " \(" kw1 " " flds[2] "\)" #else keywords = keywords " or \(" kw1 " " flds[2] "\)" # # all (and) search if ( keywords == "placeholder" ) keywords = kw1 " " flds[2] else keywords = keywords " " kw1 " " flds[2] } } END { gsub(/[&+!|;,=`$]/," ",keywords) # clear out special chars. gsub(/%../," ",keywords) # clear out http specials print keywords >> "/tmp/wmsearch.log" printf "Content-type: text/html\n\n" printf "" print "
" printf "\"Watermark" print "
" print "

" print "ARCHIVE OF WATERMARKS AND PAPERS IN GREEK MANUSCRIPTS

" print "Produced by Robert W. Allison
" print "Assoc. Prof of Religion, Bates College, Lewiston, Maine" print "and
" print "Research Fellow Ektaktikos,
" print "Patriarchal Institute for Patristic Studies, Thessaloniki
" print "© 1996 Robert W. Allison. All rights reserved.

" print "

" print "

Results of Your Search

" print "Search parameters: " keywords "
" cmd = "/usr/faculty/jhart/bin/swish -f /usr/faculty/jhart/BatesOnline/wmarchive.swish -t HBthec -w " keywords RS = "\n" while( cmd | getline ) { # clear out some unnecessary Swish output if ( $2 == "Saved" ) continue if ( $2 == "Name:" ) continue if ( $2 == "Counts:" ) continue if ( $2 == "Pointer:" ) continue if ( $2 == "Indexed" ) { continue } # if ( $2 == "Indexed" ) { $2 = "The archive submissions were last indexed for searches"; print $0 "
"; continue } if ( $2 == "Description:" ) continue if ( $2 == "SWISH" ) continue if ( $1 == "Swish" ) continue if ( $1 == "." ) continue if ( $2 == "Maintained" ) continue # if ( $1 == "search" ) { $1 = "# Search"; print $0 "
"; continue } if ( $1 == "search" ) { continue } if( $2 ~ "^http:") { # make all the search hits clickable links $2 = " \"",$0) stat = sub(/\" /,"\" ",$0) # change ranking to stars starcnt = int($1/168) $1 = "" for(i=1;i<=starcnt;i++) { $1 = $1 "\"*\"" } for(i=starcnt;i<5;i++) { $1 = $1 "\"\"" } # remove the ranking and size fields $NF = "" } if ( $1 == "err:") { if ( $2 == "no" && $3 == "results" ) { $0 = "

We have no papers on file matching your criteria. " $0 = $0 "You may want to fill in different search fields and try again," $0 = $0 " or use a wildcard search.

" $0 = $0 "(Use the Back function of your browser to return to the search form.)" } } print $0, "
" } print "
" print "" print "
" print " " print " " print "" print "" print "" print "" print " " print " " print "
" print "\"[HOME]\"" print " " print "\"[OVERVIEW]\"" print " " print "\"[GUIDE" print "" print " " print "\"[SEARCH]\"" print "" print " " print "\"[BIBLIOGRAPHY" print "
" print "\"[RESPOND]\"

" print "" print "

" print "\"[THE" print "" print " " print "\"[SUBMIT" print "" print " " print "\"[SUBMIT" print "" print " " print "\"[NEWS" print "
" print "
" print "" printf "


" printf "Technical support and functionality by James Hart
" printf "Information Services, Bates College" printf "Lewiston, Maine, 04240

" printf "\n
" }