Re: [htdig] Record h for external parsers: Passing links to the excerpt


Subject: Re: [htdig] Record h for external parsers: Passing links to the excerpt
From: Gilles Detillieux (grdetil@scrc.umanitoba.ca)
Date: Fri Oct 06 2000 - 07:05:29 PDT


According to Rzepa, Henry:
> In htdig 3.1, we use external parsers, which return to htdig
> the value of so called record h. This is used to provide an excerpt
> to the contents of the file, to be displayed by the output template.
>
> Because the external file types we parse can also have an
> instantation in other databases (molecular ones) we have
> hitherto included in the h record stuff of the type
> <a href=...cgi request to external database>click here to go to molecule database</a>
>
> This field would appear as the excerpt for this hit.
>
> In htdig 3.2 (b2), the h record is now quoted as entity references,
> ie we find htdig is converting it to
> &lt;a href .... etc etc
>
> and hence the excerpt no longer has an active link.
>
> So can we stop the conversion of < and > to entities in htdig 3.2?

htsearch 3.1.5 also does this conversion of <, >, &, and ". You're using
excerpts in a pretty unconventional way, which is fine, but you'll need
to hack htsearch to support that. It would be a pretty straightforward
change to the 3.2 code: just change the SGMLencodedChars macro in
htsearch/Display.cc not to use the HtSGMLCodec decode method.
E.g., change:

#define SGMLencodedChars(p, l) (s = 0, s.append(p, l), HtSGMLCodec::instance()->decode(s))

 to

#define SGMLencodedChars(p, l) (s = 0, s.append(p, l), s)

Note that this change may pose problems for excerpts that contain special
characters that you don't want to go through, so the hacked version of
htsearch should be used only for this special purpose, or you should also
hack htdig's HTML.cc and Plaintext.cc parsers not to put unencoded special
characters in the DocHead field of the database.

> We would also like to go one stage further, and add multiple
> external links in the output template (via the h record, or other
> records). Thus if we are parsing an external molecule, we might
> wish to redirect the user to 3-4 other molecule databases which
> a cgi query containing a search string for that molecule. We
> would like these external redirections to appear in the htdig output
> template.
>
> Does anyone have any suggestions for the best way to achieve this?

Well, if you do it via the h record, it's just an extension of what you're
doing now, so it shouldn't require any further patching. If you want to
do it via another record, you may need to hack ExternalParser.cc to support
it, and perhaps even add a field to the database which would require lots
of other changes to the code. Which is easiest is pretty clear, but which
is best would depend a lot on your specific requirements.

-- 
Gilles R. Detillieux              E-mail: <grdetil@scrc.umanitoba.ca>
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 htdig mailing list, send a message to htdig-unsubscribe@htdig.org You will receive a message to confirm this. List archives: <http://www.htdig.org/mail/menu.html> FAQ: <http://www.htdig.org/FAQ.html>



This archive was generated by hypermail 2b28 : Fri Oct 06 2000 - 07:09:39 PDT