New Books List for your OPAC: Shareware that’s worth every penny!

advertisement
New Books List
for your OPAC: Shareware
that’s worth every penny!
Debbie Morrow
Automation Librarian
Grand Valley State University
GLUGM 2002, Fri. October 4
ISU, Terre Haute IN
New Books List:
The Concept
Michael Doran’s
“New Books List”
is, in part, a bit of
clever window
dressing – what in
French is called
trompe l’oeil …
… or “fools the eye”!
New Books List:
The Concept
It looks like part of Voyager, but it really isn’t …
it’s just a little bit of extra programming that
you can drop in place to dress up your Voyager
catalog. And it doesn’t cost anything!
‘New Books List’:
A note about versions
GVSU has implemented the 4.0 version of the
New Books List on our SUN Unix server. Since
then, Michael Doran has released version 5.0,
which primarily introduces a multilingual
interface capability; and also a Windows server
version.
We’ll be looking at the Unix installation, and
focusing on those aspects which 5.0 has in
common with 4.0.
Adding ‘New Books List’
requires …
• Michael Doran’s website
• newbooks.pl
newbooks.ini
• newbooks.cgi + newbooks.[language]
• opac.ini
• webvoy.htm
a little ingenuity!
‘New Books List’:
Michael Doran’s website
The place to begin is:
rocky.uta.edu/doran/autolist/
Here you’ll find out about Michael Doran
(Systems Librarian, University of Texas
at Arlington), the current version of his
program, how to download
it to your server,
installation tips, etc.
‘New Books List’:
Getting the goods
Find the
rocky.uta.edu/doran/autolist/INSTALL.unix.txt
document on the website, and read it all the way
through. All the basic information you need is
included in
• Prerequisites
• Installation scenarios
• Installation steps
• Testing and configuration steps
• Free Advice
• Mailing list
• Bug reports
• Support
‘New Books List’:
Getting the goods
(cont.)
Using the ‘Download’ link,
get the file
newbooks-5.0.tar.gz
onto your PC, then FTP it
to your Voyager server – a
directory such as
/m1/incoming/newbooks/
is convenient.
Follow the directions to
unzip and distribute the
files on your server.
‘New Books List’:
Testing …
After you’ve followed the initial ‘Installation
steps,’ you’re ready to get down to business:
Follow the directions in
‘Testing and configuration steps’ to:
• 1) Do a pre-configuration test, and
• 2) Generate your own data
Once you have newbooks.pl working, make it a
Voyager cron job that runs once a day. –This was the
only step where I needed the assistance of our Unix
system administrator!
‘New Books List’:
… and configuration
Finally, the fun part!
Once you know that the “out of the box” version
of the cgi script works on your server, and that
the Perl script can successfully extract data from
your Voyager database, you can get down to the
real fun of doing your own customized Voyager
New Books List trompe l’oeil …
‘New Books List’:
newbooks.pl
One of the wonderful features of Michael Doran’s
add-on program is the care that he’s taken with
internal documentation. Even a novice or nonprogrammer can read through his code and make
some sense out of it. Let’s take a look at
‘newbooks.pl’ –
newbooks.pl (executable program)
• A Perl program that extracts "new books" data
from your Voyager database and outputs a
newbooks.txt file.
‘New Books List’:
newbooks.pl (cont.)
= gvsudb
The INSTALL doc
directs you to edit
the configurable
elements of
newbooks.pl,
selecting the desired
options for your site.
Comments in the
code, often quite
detailed, provide
hints and tips.
‘New Books List’:
newbooks.pl (cont.)
Following the section
with configuration
options, there’s
nothing else you
must do here – and
you may not want to
try!
However, for the
adventuresome …
‘New Books List’:
newbooks.pl (cont.)
127
134
GVSU wanted to
offer intervals of a
few weeks, up to 16
weeks or a full
semester – not just a
choice of some
weeks or months.
Changing the
number of days in
the calculated
interval for “weeks”
accomplished this.
‘New Books List’:
newbooks.pl (cont.)
###################################
# ConstructSQL
###################################
#
# This routine returns an SQL query according to which
# option was selected in the configuration section.
sub ConstructSQL {
my ($sql_pass) = @_;
# The SQL option "choice" is an artifact of previous
# versions. This SQL query's embedded logic as to
# "what constitutes a new item" should be adequate
# for all sites. If it isn't, you may create your
# own; however, it must output the same fields in
# order for the newbooks.cgi to utilize it. -mdd
# 2/27/02 Two lines modified in SQL pass 2 per MDD
# in order to find e-links in BIB, not MFHD -dmo
my $date_condition_one = &SetInterval("one");
my $date_condition_two = &SetInterval("two");
if ($sql_pass eq "1") {
return ("
select distinct
$db_name.bib_text.isbn,
$db_name.bib_text.author,
$db_name.bib_text.title, …
At GVSU, we store our 856
“Linked Resources” in our
Bib records, rather than in
our MFHDs as UTA has
done.
In 5.0 there’s a
configuration option to
handle this; in 4.0 Michael
Doran helped me with a
change to the SQL query
which selects new items
from the local database.
‘New Books List’:
newbooks.cgi, etc.
Once you have the newbooks.pl program working
and customized, the next step is setting up the
configuration files and customizing the
newbooks.cgi script that controls the interface
your users see on the screen …
‘New Books List’:
newbooks.cgi, etc.
(cont.)
newbooks.cgi (executable program)
• A CGI/Perl program that displays the initial New
Books search form, and then displays the results
pages from user searches.
+ newbooks.ini (configuration file)
• This file (new in 5.0) contains configuration variables
that are used to customize the newbooks.cgi
program.
+ newbooks.English/other lang. (language modules)
• These files (new in 5.0) provide the language of the
user interface. Only one language module is
required, but all modules can be utilized if desired.
‘New Books List’:
newbooks.cgi
.cgi
Version
4.0
#
* * * * * * * *
Edit below to customize
* * * * * *
#
* * * * * * * *
for your site.
* * * * * *
#
* * * * * * * *
* * * * * *
##############################################################
#
# Editorial: Version 4.0 offers many new options for customization.
# The original idea for the New Books List was that it be a rather
# minimalist solution. However, I've discovered that minimalism is
# * * * * *I *hope
* * that
No people
editing required!
* *this
******
# not a universal preference.
who install
# usability
* * * * * *for
* * library patrons when deciding
********
# program keep in mind
############################################
# how many of the extra
"bells and whistles" to use. Simplicity (and
# restraint) can often
# be a virtue. :-)
# The New Books List can be customized by editing newbooks.ini and
# the appropriate language module(s). There shouldn't be any need
.cgi
# to edit this program.
Version
#
5.0
# However, if you are a Perl programmer or just adventuresome, then
# by all means have a go. Commenting is minimal - if you don't
# understand what the code does, chances are you don't want to mess
# with it. :-)
In version 5.0 basic configuration is done
in the .ini file and the language file(s) …
‘New Books List’:
newbooks.ini
The .ini file includes
most of the
configuration choices
that you can make.
Again, the choices are
thoroughly
documented, including
interactions with the
.pl file.
‘New Books List’:
newbooks.ini (cont.)
$body_background
= "/images/ivory.jpg";
The ‘Colors’ stanza in
newbooks.ini is what
makes the “New
Books” search screen
look just like part of
your WebVoyáge –
spend some time
getting this right!
GVSU’s OPAC includes
a background JPEG,
ivory.jpg, which is
added in here.
‘New Books List’:
newbooks.[language]
The language configuration files, newbooks.English,
etc., allow you to customize all the values for any
textual labels, etc.
For example, the $short_blurb text value
is customized at GVSU to read as follows:
$short_blurb = "Books, Internet
resources,<br />etc. recently added
to<br />the GVSU Local Catalog.";
‘New Books List’:
newbooks.cgi (reprise)
For the adventuresome, more serious customizing
may involve studying and changing code in
newbooks.cgi – cautiously!
A big part of the .cgi program is HTML code defining
the appearance of the search and results screens.
We wanted to make some minor changes:
• At GVSU, we wanted to search by intervals of 2
weeks, 4 weeks, 2 months (8 weeks), or 4
months (16 weeks).
• And we wanted to add some elements to the
display of the “hit list” resulting from a search.
Changing the search
intervals menu
.english
# English interface
# Form labels
$select_location_label = "Select Location:";
$display_interval_label = “Display:";
$sort_by_label
= "Sort by:";
$search_for_label
= "Search for: (optional)";
#################
# NewSearchForm
#################
--code omitted-<td valign="top" width="30%">
<font color="$active_font_color"><b>  $display_interval_label</b></font><br />
  <select name="week" size="4">
<option selected="selected" value="1">$last_text $interval</option>
<option value="2">$last_text 2 $interval_plural</option>
<option value="3">$last_text 3 $interval_plural</option>
<option value="4">$last_text 4 $interval_plural</option>
</select> </td>
.cgi
.english
Values encoded in the .cgi
are defined in the .ini and
.[language] files, and
control the screen display.
# Intervals of weeks or months
#####################
# This value is set in newbooks.ini.
if ($interval eq "month") {
$interval = "month";
$interval_plural = "months";
} else {
$interval = "week";
$interval_plural = "weeks";
}
# This goes in the period box of the form
$last_text = "last";
Changing the search
intervals menu
#################
# NewSearchForm
Changed to “20%”, to size the
#################
menu properly after deciding text
--code omitted-<td valign="top" width="30%">
<font color="$active_font_color"><b>  $display_interval_label</b></font><br />
  <select name="week" size="4">
<option selected="selected" value=“2">2 weeks</option>
<option value=“4">4 weeks</option>
<option value=“8">2 months</option>
<option value=“16">4 months</option>
</select> </td>
For our purposes, the
variables didn’t work, so
we substituted fixed text.
# Intervals of weeks or months
######################
# This value is set in newbooks.ini.
if ($interval eq "month") {
$interval = "month";
$interval_plural = "months";
} else {
$interval = "week";
$interval_plural = "weeks";
}
# This goes in the period box of the form
$last_text = "last";
Changing the search
intervals menu (cont.)
# NewSearchForm
#################
--code omitted-<td valign="top" width=“20%">
<font color="$active_font_color"><b>  $display_interval_label</b></font><br />
  <select name="week" size="4">
<option selected="selected" value=“2">2 weeks</option>
<option value=“4">4 weeks</option>
<option value=“8">2 months</option>
<option value=“16">4 months</option>
</select> </td>
Earlier on in the script the variable $date_range is associated with
an HTML ‘form’ tag “name=” element:
my $date_range = $formdata{'week'};
A “value=” element combined with name=“week” in this HTML
‘select’ tag is submitted when the user searches. Later in the .cgi,
in the ReturnList section, records of the right age are selected:
if ( $week <= $date_range )
Changing the search
results list
Changing the search
results list (cont.)
While implementing the New Books List, I looked at
many of the other Voyager OPACs where it had
been added, and collected ideas here and there.
Adding the .gif with the key to the Amazon and
Barnes & Noble buttons was easy, after borrowing
newbna3.gif from University of Rochester’s New
Books screen.
But to add the buttons and links to each line
with an ISBN that could be searched on, I
contacted University of Rochester and asked
if they’d be willing to share their code.
Once I had a copy of Rochester’s .cgi, it
wasn’t too hard to figure out what section to
copy into our own – and learn a few more
HTML tricks!
The additional code looks at each entry retrieved
from newbooks.txt. If there’s an ISBN, it displays
a .gif (src=/images/newbna2.gif) in the box with
the line number. Clickable areas in newbna2.gif
are mapped to links which do ISBN searches in
the BNA and Amazon databases, so that users
can get to reviews and excerpts of the new titles.
http://search.barnesandnoble.com
‘New Books List’:
opac.ini (Voyager)
opac.ini (configuration file)
This Voyager file contains configuration
variables that are used to customize your
library’s WebVoyáge.
… In a nutshell, you just need to do the following edit
in opac.ini to tack the additional tab on after the
Course Reserve tab on your search screens, inserting
your OPAC’s colors:
[Course_Reserve_Search_Page]
–-lines omitted–Tab_Text=Course Reserve</a> </font> </th></tr></table></td>
<td>  </td><td><table border="0" cellspacing="0" cellpadding="0">
<tr><th nowrap bgcolor="#336699"> <font color="#ccffff"> <a
style="color:#ccffff" href="/cgi-bin/newbooks.cgi">New Items</a>
‘New Books List’ at GVSU –
Voyager … Before:
‘New Books List’ at GVSU –
Voyager … After! :
‘New Books List’:
webvoy.htm (Voyager)
webvoy.htm (HTML file)
This HTML file is the “front page” to your
library’s WebVoyáge, and can be entirely
customized.
Chances are, your Voyager site has in
some way customized or completely
recreated this page already. At GVSU, we
just added another section to our
webvoy.htm page, with a ‘New Items’ link
‘New Books List’:
Examples from other libraries
Looking for
ideas and code
to borrow is
easy – Michael
Doran asks
new sites to
send him links
to add to this
list of NBL
users.
‘New Books List’:
Examples from other libraries
• Put links to your New Books List (and
your OPAC) in other places, like on your
library’s main web page:
‘New Books List’:
Examples from other libraries
• Put links to your New Books List (and
your OPAC) in other places, like on your
library’s main web page:
‘New Books List’:
Examples from other libraries
• Put links to your New Books List (and
your OPAC) in other places, like on your
library’s main web page:
Download