You could do all this with Javascript and not have to worry about mucking
around with wwwoptions or any of that messy stuff. Just create a static
JSON or XML file in the webpac directory containing a list of all the
classification names and their associated call number ranges (as detailed
or as general as you want it to be). Write some Javascript code that looks
at each call number on a page, matches it to a LC classification name
based on your definitions file, and then append that name next to the call
number (or wherever you might want it). If you have "impure" call numbers,
such as prepending REF to reference titles, you can use regular
expressions or just basic string matching to remove those from the
beginning of the call numbers.
But as Kyle mentioned, this data might not be especially helpful to users.
A more robust option would be to connect to WorldCat API or a similar
service to fetch LC Subject Headings for each title and display that
rather than the classification heading.
Maybe one day webpacs will have a nice templating system where you can
just use tags like {callnumber} or {marc650}.
Josh Welker
-----Original Message-----
From: Code for Libraries [mailto:[log in to unmask]] On Behalf Of
Kyle Banerjee
Sent: Wednesday, December 04, 2013 1:10 PM
To: [log in to unmask]
Subject: Re: [CODE4LIB] Interested in enhancing call-number browse in
Millennium catalog
This is going to be tricky. AFAIK, you can't modify the call number result
table on the fly without proxying since Mil doesn't let you get at the
routine that renders the call numbers.
If proxying is not what you had in mind and rendering the call number
meanings above the table is acceptable, I suppose you could load a
javascript routine in the footer that reads what's been loaded and then
puts a call number explanation somewhere near the top. One trick you could
use if you wanted it lower is to redefine an image in WWWOPTIONS that
contains embedded HTML that renders your value dynamically. As far as I
remember, you can break out of image definitions simply by adding a double
quote, closing the tag, and inserting whatever script you want, e.g.:
BUT_WHATEVER=/screens/image.gif" alt="whatever" border="0"
/></a><script.... [load or embed whatever you like]...</script><img
src="invisible_spacer.gif
(note lack of closing quote -- don't forget you broke out of an image tag)
As far as a method for getting the data goes, your best option would be to
download the linked data from id.loc.gov and extract the ranges which
could be processed as strings matched by regex rather than linked data.
All processing could be offloaded on the client.
But this is horribly hacky and a lot of work for relatively little gain.
When you get right down to it, the only purpose of a call number is to
physically collocate materials on the shelf and it's not really that
useful for search which is why practically no one aside from a few
cataloging nerds do call number searches. Plus, anyone geeky enough to do
a call number search actually must know what call number range is relevant
to their needs. Keep in mind that in many cases, no decent call number
exists for a concept and the best one available really is quite crummy so
prominently displaying that won't necessarily be a good thing.
kyle
On Tue, Dec 3, 2013 at 6:35 PM, Harper, Cynthia <[log in to unmask]> wrote:
> I'm thinking of trying to enhance the call-number browse pages on a
> Millennium catalog with meanings of the classification ranges taken
> from the LoC Classification database.
>
> http://id.loc.gov/authorities/classification.html
>
> a typical call-number browse page might look like this:
>
> http://librarycatalog.vts.edu/search~S1?/cBX100.7.B632+1999/cbx++100.7
> +b632+1999/-3,-1,,E/browse
> <
> http://librarycatalog.vts.edu/search%7ES1?/cBX100.7.B632+1999/cbx++100
> .7+b632+1999/-3,-1,,E/browse
> >
>
> I'd like to intersperse the call-number listing with call-number range
> meanings like
>
> BX100 - Christian denominations - Eastern churches
>
> Has anyone tried this? Can you point me to the API documentation for
> the LC Classification?
>
> Cindy Harper
>
|