[htdig] Re: New feature template_patterns (PR#733)

Subject: [htdig] Re: New feature template_patterns (PR#733)
From: Gilles Detillieux (grdetil@scrc.umanitoba.ca)
Date: Thu Jan 06 2000 - 14:16:39 PST

I'm cross-posting to htdig@htdig.org, because I thought this fix would
be of general interest...

According to terrier@univ-tlse1.fr:
> I've tried the new feature template_patterns of V3.1.4, but there is a
> problem in my opinion :
> - when you specifie different format (long, short, ...), it's not used
> if template_patterns is specified.
> I think it should be possible to merge the ability of template_patterns
> and template_map, to allow different style of output (long, short) but
> with differences function of server.

The user who requested the template_patterns feature wanted the selection
of templates to be controlled exclusively by the URL patterns, and not
by the user. In testing my implementation of this, I realised this
new feature doesn't fit well with the existing template_map feature,
as the URL-selected template always overrides the user-selected one.
In most cases, I'd expect you'd configure in one or the other, but not
a combination of the two.

However, something like the following would allow user-selected templates
to work even with template_patterns:

template_map: Long long ${common_dir}/long.html \
                   Short short ${common_dir}/short.html
template_name: long
template_patterns: .pdf ${common_dir}/${template_name}-pdffile.html \
                   .ps ${common_dir}/${template_name}-psfile.html \
                   .doc ${common_dir}/${template_name}-docfile.html

This works because the template_name attribute gets set internally in
htsearch, to the user-selected value of the "format" input parameter,
before the variable expansion in template_patterns takes place. As long
as you stick to a template file naming convention that uses the internal
name field of template_map as part of the file name, this should
work like a charm. Your common directory would have to contain the
template files long-pdffile.html, long-psfile.html, long-docfile.html,
short-pdffile.html, short-psfile.html, and short-docfile.html, for the
example above to work. Be sure to also change the values for "format"
in your search.html, to use your chosen internal names.

> Another thing : I think it would be good to be able to search for files
> modified at a
> date (or from a date, or a range of dates), even with no keywords, to
> have all last modified files, or day specifics changes.

I believe date range selection is slated for 3.2, and it's been
proposed that a "match all" feature be added too. Once both of these
are implemented, htsearch should do what you're requesting here.

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.

This archive was generated by hypermail 2b28 : Thu Jan 06 2000 - 14:32:24 PST