According to Rick Richardson:
> Rick Richardson writes...
> > 
> > I worked out a shell script to do what I wanted to do.  I have
> > attached said shell script "digdir".
> > 
> 
> After further testing, I find that there is a slight problem when the
> search results are longer than 1 page and you press "next" or page 2
> to get the next page of results.
> 
> In that case, "htsearch" generates a CGI "GET" request.
> 
> Unfortuantely, with a "GET" request I am unable to override the
> htsearch config file location like I can with a "POST" request, and so
> htsearch tries to use the "normal" config file under /var/lib/htdig,
> rather than the per-collection config file that I want it to use.
> 
> To fix this issue, I am going to have to make a shell script wrapper
> for "htsearch" that converts any "GET" requests into pseudo-POST
> requests.  That means that a "stock" htdig installation will not be
> sufficient to use my tool.  Sadly, I can find no alternative.  Well,
> another alternative is to hack the htsearch source code.
> 
> However, the shell script wrapper will be trivial to install, and it
> only needs to be installed once.

Your script probably would not need to convert GET to POST requests.
It's just a matter of overriding the command-line arguments which
don't contain the -c if the method is GET.

If you're going to be using a script anyway, I can propose a much more
elegant solution.  Use a script like this:

  #!/bin/sh
  CONFIG_DIR=/home/httpd/html
  export CONFIG_DIR
  /home/httpd/cgi-bin/htsearch

Call it something like "cdsearch".  Then in the search.html form, you'd
call cdsearch instead of htsearch, and you would define, e.g.:

  <input type=hidden name=config value="rfc/.htdig/htsearch">

to select /home/httpd/html/rfc/.htdig/htsearch.conf as the configuration
file.  This way, the "config" input parameter gets passed along in all
followup searches, without having to kludge things up with the -c option.
The environment variable CONFIG_DIR overrides the compiled-in default, so
you are now free from that restriction.  The only snag is the user would
need to install the "cdsearch" script into cgi-bin, and possibly customize
it, before being able to search the CD.  It's not entirely automatic.

-- 
Gilles R. Detillieux              E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930

------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
[EMAIL PROTECTED] containing the single word "unsubscribe" in
the SUBJECT of the message.

Reply via email to