advance notices / pre-overdues

Once again, apologies for the delay in getting the script available!

introduction

At Huddersfield, we’ve recently gone live with a bespoke Perl script for generating pre-overdue emails:

advanceNotices.pl
settings.ini

To run the script, use the following command:

perl advanceNotices.pl settings.ini

You can use multiple settings files and then just tell the script which settings to use, e.g.:

perl advanceNotices.pl settings1.ini
perl advanceNotices.pl settings2.ini

To run the script, you’ll need the following:

  1. an installation of Perl (e.g. ActivePerl for Windows)
  2. the following Perl modules:
  3. a working ODBC connection to your Horizon database – if you use ODBC for EasyAsk or ReportSmith, then that should do

The script also expects to be able to create log files and these are stored in a subdirectory called logs – create this subdirectory within the directory where you’ve got the script. So, if you run in the script in C:scripts, then create the subdirectory C:scriptslogs.
To use the script, you’ll need to edit the “settings.ini” file and also make a couple of small changes to the Perl script.

the “settings.ini” file

The “settings.ini” file contains the following settings that the script uses to generate the emails:

  • days_in_advance

    The number of days in advance to check for items due back – e.g. if you set it to 1 and run the script on a Monday, then it will generate emails for items that are due back on the Tuesday.

  • debug

    Set this to either yes or no – if set to yes then all emails will be sent to the address(es) specified in the debug_email setting rather than to the patron. You should leave this set to yes until you’ve finished your testing!

  • debug_email

    If debug is set to yes, then all email notices are sent to the address(es) listed in this setting. To send to multiple addresses, separate each address with a space.

  • summary

    Set this to either yes or no – if set to yes then the script will send a summary email to the email address(es) specified in summary_email

  • summary_email

    If summary is set to yes, then a summary email is sent to the address(es) listed in this setting. To send to multiple addresses, separate each address with a space.

  • smtp_server

    Set this to the IP address (or DNS name?) of your SMTP server.

  • email_replyto

    Set this to the email address that the notices should appear to have come from – this is also used as the “reply to” address.

The remaining settings are used to decide which types of borrowers and items are suitable for sending the notices. If you want to send notices to all patrons for all types of items, then simply leave each of the settings blank.
If you prefer to fine tune the borrowers / items, then you need to set up suitable inclusions or exclusions.
So, if you have a specific list of borrower types that you want to send the notices to, then list them in the inclusion settings.
Alternatively, if you have a specific list of borrower types that you don’t want to send the notices to, then list them as an exclusion.
However, don’t try setting both a borrower type inclusion and exclusion, as that doesn’t make sense!
For example, if you only want to send emails to borrower types STU, FTP and PRE, then you’d use:

btype_include         STU FTP PRE

As well as borrower types, you can also add inclusions or exclusions for collection codes, itype codes and location codes.
In the example “settings.ini” file that I’ve posted are the settings we use at Huddersfield. If you look at it, you’ll see that we don’t send emails to lef borrower types (which stands for “left”) and we don’t send notices for the SL location (which is Short Loan).
If you want to, you can create multiple settings files – for example, you might want to send 1 day in advance for everyone except part-time borrowers, and then have another file that’s set up to send 3 days in advance to only the part-time borrowers.

setting up the script

As well as setting up the “settings.ini” file, you need to make a small chance to the script to set up your ODBC connection information. These changes need to made near line 100:

my $dbh = DBI->connect('dbi:ODBC:REPORTSMITH',
      'report', 'abc123', { RaiseError => 1 });

You’ll need to change:

  1. REPORTSMITH – change this the name of your ODBC connection
  2. report – change this to your ODBC connection username
  3. abc123 – change this to your ODBC connection password

final notes

  • At Huddersfield, the script runs daily on the HIP server as a scheduled task.
  • There’s a few lines of code that are commented out relating to providing a direct secure link to the patron’s “items out” page in HIP. Let me know if providing this kind of functionality in your notices is of interest, and then I’ll send you further details of how to do this.
  • You can probably guess that the script isn’t for the faint hearted! If you’re looking for an easy method of implementing pre-overdues, then you might want wait until Dynix build the functionality into Horizon or maybe take a look Alpha-G Consulting solution.
  • I can only offer limited support for the script (d.c.pattern@hud.ac.uk), but I’ll try and make sure that any bugs get fixed.
  • If you spot any errors in these instructions, please let me know!

Finally – have fun and I hope the script comes in useful!

Horizon “reconst” in Perl

Apologies to everyone who was interested in this for the delay in getting it posted!
The Horizon database stores several fields (e.g. title, author, etc) in the format “processed” / “reconst”, where the “processed” column contains the text stripped of punctuation and the indefinite/definite article, and “reconst” contains the stripped characters.
For example, the title “The great Aussie fashion : Australian fashion designers 1984-1985 /” is stored in Horizon as:

processed:
    great Aussie fashion Australian fashion designers 1984 1985
reconst:
    <M /7R-M: MThe

The “processed” version of the title is much more suitable for sorting than the original title.
Browsing through the Horizon mailing list archive, I came across a set of instructions for interpreting the “reconst” value.   As we generate a lot of custom HTML reports at Huddersfield, I decided to have a stab at coding the instructions in Perl:

reconstructTitle.txt

To use it in your own Perl script, just paste the subroutine in and call it with the “processed” and “reconst” strings, e.g.:

reconstructTitle( $processed, $reconst );

I’ve only used the code for reconstructing titles so far, but it might also work with author names, call number, etc.
The code is definitely “beta” and I’m not sure if it handles every “reconst” command yet, but feel free to make use of it.  If you can improve it, please do!

creating a “3D” navigation bar

Due to some “Saturday morning boredom”, I’ve put together a tool for generating a set of replacement HIP navigation bar GIFs:

The idea is to replace the standard set of HIP graphics:

before

…with a set of more rounded ones:

after

I’ve also put together a “how to” guide for HIP 3.04 (which may work with other versions of HIP too):

Have fun and try not to break your HIP!
🙂

DUG/HUG – Friday

Friday started off with a session about the RFID implementation at Middlesex, with Alan Hopkinson, Tim Pond (D-Tech Direct), and Gregor Hotz (Bibliotheca). We’re planning to implement RFID at Huddersfield during 2006.
Next up, James Castle (Freshfields Bruckhaus Deringer) and myself did a 45 minute session entitled “HIP Ideas”. James talked about the issues involved with setting up multi-language subject indexes. You can find my presentation (“Break Your HIP!”) here. Once again, many thanks to eagle-eyed Polly who spotted what had caused the “wheels to fall off” my live floor plan demo!
Finishing off the morning, Jill Osborne (Dynix) gave a series of HIP 4 demonstrations – here are my brief notes:

  • the built in spellchecker is able to offer a range of possible correct spellings (similar to Google’s “did you mean xxx?”)
  • the optional “Thesaurus Expanded Search” includes synonyms for each search term
  • printer friendly versions of search results and full bib pages are available
  • the ADA and Kids HIP profiles won’t be available until HIP 4.1

Finally, Jill ran through some of the things that won’t be carried across from a HIP 3 to HIP 4 upgrade:

  • XSL stylesheet changes
  • some look and feel options
  • any tabs or subtabs that are links

…like many at the conference, I can’t wait to get my hands on HIP 4!
Sadly, we had to rush off after Jill’s session to get back to the airport on time.
Many thanks to everyone involved with organising the conference – especially the Dynix staff!

DUG/HUG – Thursday

Thursday started with a demo of Web Reporter from Phil Coles – here’s my notes from the session:

  • 140 reports supplied as standard
  • reports processed on the Web Reporter server, using live data from the Horizon database (i.e. no data mining)
  • reports can be scheduled to run overnight
  • reports can be exported as PDF, Excel, CSV, etc
  • new reports can be created from scratch, or you can use one of the existing templates
  • current version of Web Reporter is not Unicode compliant, however the Horizon 8 version will
  • no knowledge of SQL required
  • handles non-January financial years
  • SQL can be imported from ReportSmith

This was followed by a presentation from Eric Keith (VP Operations, SirsiDynix US) about the company’s current and future developments – my notes from the session are available here.
Finishing off the morning sessions, Polly Dawes (Bradford), and Ian Haydock & Jan Broad (Staffordshire) ran a session about Telecirc – including a live demo via mobile phone! We’re hoping to finally get Telecirc running live at Huddersfield by the start of the new term.
Starting off the afternoon, Phil Coles gave a short presentation about HIP 4 and Horizon 8 before attempting a live demo – unfortunately technical gremlins caused one or two problems with the demo. Here’s my notes about HIP 4:

  • works with Java v1.4.2, although Dynix are currently testing it with more recent releases of Java
  • allows pickup locations, search types, limits & sorts, and search location defaults to be set
  • built in spell checker and thesaurus
  • borrower history display
  • list of new and/or top circulating items
  • tighter integration for consolidated searching
  • Lucene indexing/search engine

…and about Horizon 8.0:

  • FRBR support
  • MFHD (MARC Format for Holdings Data) support
  • e-commerce integration
  • Electronic Resource Management (ERM) module
  • one-click sorting of colums
  • more integration between Horizon 8.0 and Web Reporter
  • new acquisitions workflows available
  • notes fields are all 1,500 characters (although Phil thought this can easily be increased if required)
  • EDI functionality built into Horizon (i.e. no need to use separate FTP software)
  • graphical serials prediction

This was followed by “Moving to MARC21”, with Ray Delahunty (Dynix UK), Polly Dawes (Bradford) and Ian Jennings (Huddersfield). It highlighted the two extremes of converting to MARC21 – Bradford had very few problems running the conversion under Dynix ILS, but the Huddersfield conversion (under Horizon) was a long and fairly painful process! Hopefully future conversions under Horizon will be much smoother.
The last session of the day was “My Favourite SQL” with Tim Fletcher (Birkbeck) and myself. I’ve uploaded my presentation (“Using SQL to Create Web Based Reports & Applications”) here. I’ll upload the advance notices Perl script as soon as I’ve finished debugging and documenting it.
Towards the end of the session, Anders F̴k (Link̦ping University) gave a quick demonstration of their web based reports (which uses Microsoft .Net and Crystal Reports) Рvery impressive stuff!

DUG/HUG – Wednesday

In the morning, Jill Osborne from Dynix gave a very impressive demonstration of the new HIP 4 administrator interface.
One of the biggest problems I found with HIP 3 (and below) was doing the admin configuration – the options were here, there and everywhere. HIP 4 brings everything together into a single (fairly) intuitive interface. If this is a taster of things to come with Horizon 8.0, then the wait will be well worth it.
There’s some more notes from Jill’s presentation here.
The afternoon saw a very honest keynote speech from Peter Gethin. Peter’s style might not be to everyone’s taste, but it marks the start of what should be an interesting few years for SirsiDynix.
If anyone is looking for the “Systems Managers Forum” presentations from Tim Fletcher and myself, then you can find them here.

An evening in Exeter

After a fairly uneventful cheap flight down from Leeds/Bradford, we’re here in breezy Exeter for the DUG/HUG 2005 Conference.
Sadly, the nearest bar (in Hope Hall) only seems to be open for an hour every day. So, a group of us headed down in to Exeter for some sight-seeing and pub grub at the Ship Inn – supposedly one of Sir Francis Drake’s favourite haunts.
Ship Inn, Exeter Ship Inn, Exeter

replacement inactive tab GIFs

The default GIF images used in HIP 3.04 for the inactive tabs only really work if you stick with the grey colour. Once you change that background colour, they no longer match:

Not only that, but the two corner GIFs are actually a different colour (more olive/brown than grey):

You can call me “sad”, but things like that niggle me! 😀
So, after a few minutes with Paint Shop Pro, I’ve come up with some replacement GIFs that use transparency to match whatever background colour you use for your inactive tabs:


If you too are niggled by your default GIFs, then you can download the replacement ones here: inactive_tab_GIFs.zip
You’ll need to overwrite the existing files, which are normally located in the “appserverjbossserverdefaultdeployhipres.warimages” directory:

…all of this assumes you’re on HIP 3.04 – so it might not work with other versions. Also, don’t forget to back up the original images (just in case!)
On a similar vein, I replaced the tab GIFs on our HIP a while ago with slightly more rounded 3D versions, although I’m not sure anyone actually noticed the change!

improving the “setfocus” JavaScript

HIP3 contains some JavaScript that sets the focus to the search box everytime a page is loaded – this means you can start typing text straight in to the box.
However, if you’ve already done a search, then it can be frustrating for the user to have the page suddenly jump to the top (especially if they are using the back button to return to a list of search results). In fact, it make more sense for the JavaScript to only set the focus on the initial search screens.
Here’s a quick hack that disables the JavaScript “setfocus” function for search result and full bib pages:
Open up searchresponse.xsl file and find the <body> tag (it’s around line 230)
A few lines down you’ll find the onload attribute code – this tells the web browser to execute the startTimer and setfocus JavaScript functions as soon as the page has loaded:

<xsl:attribute name="onload">startTimer();setfocus();</xsl:attribute>

Replace that entire line of code with the following:

<!-- disable the setfocus for search result pages -->
<xsl:if test="not(boolean(/searchresponse/yoursearch))">
<xsl:attribute name="onload">startTimer();setfocus();</xsl:attribute>
</xsl:if>
<xsl:if test="(boolean(/searchresponse/yoursearch))">
<xsl:attribute name="onload">startTimer();</xsl:attribute>
</xsl:if>
<!-- end of changes -->

Save the searchresponse.xsl file and check your HIP to see if the change works!
The usual notes apply:

  1. this worked fine for our UK HIP 3.04
  2. back up your original searchresponse.xsl file before you make any changes!
  3. if you’ve got one, try it on your test HIP server first