Explicitly state number of available items in a holding record
Tags: basic
, webvoyage
, tomcat
, xsl
, opac
, voyager
Last Updated: Sep 21, 2010 00:05
- Description
Are your staff and patrons complaining about (Tomcat) WebVoyage being less than helpful in displaying availability? If there are 21 items for a holding and 12 are out it just displays 12 status lines, leaving you to count them up and subtract that from the total. Wouldn't it be much more helpful to state that there are still 9 items available? Fear not - this can be easily achieved within the Tomcat XSL!
- Author: David Friggens
- Additional author(s):
- Institution: University of Waikato
- Year: 2010
- License: public domain
- Short description: Use, modify and distribute as you like, with or without attribution.
- Skill required for using this code: basic
State
Stable
Programming language
XSLT
Software requirements
WebVoyage 7+ (implemented in 7.0.4, but relevant section is unchanged in 7.2.2)
Screen captures
The screenshot shows an record where it would not be immediately apparent that there are available items.

Download
No download - just follow the "installation instructions" below to modify the XSL files appropriately.
Working example
Satakunta University of Applied Sciences
If you're lucky, this record will be a handy specific example: http://waikato.lconz.ac.nz/vwebv/holdingsInfo?bibId=730418
Changes
Version 1.0
Initial release.
Release notes
The problem
Each holding in a bib record page had a section for "Number of Items" and a section for "Status". If all items are available / not charged there is a one line display to this effect. Otherwise there is one line for each item that is not available. The user must manually count the unavailable items and subtract from the total to see if there are still any items available. The subsequent step for many users is to complain to a librarian about how unhelpful the OPAC is.
The solution
The XSL code (below) should be fairly straightforward to follow. In the XML's (*) item:itemRecord there is either one item:itemData with statusCode 1 ("not charged") no matter how many total items; or there is a collection of item:itemData's - one for each item with statusCode != 1.
If we see statusCode 1 in the first item:itemData then we don't do anything, because the display is clear enough already.
Otherwise we count up all the item:itemData's - excluding those with statusCode 11 ("discharged" / "just returned"), which we deem to be available. This number is subtracted from the total number of items and we add "(N available)" after the displayed total.
(*) NB Turn on debugging in xsl/pageTools/frameWork.xsl (preferably on your test server) to enable the "Show XML" button that shows this data.
Installation instructions
Put the following new template in YOUR_SKIN/xsl/contentLayout/display/display.xsl in between the BMD1010 and BMD1012 templates:
Now modify the line
to call the new template:
Known issues
None so far, but it has not been exhaustively tested. Please let me know if you run into anything.
Warning
This code may be dangerous in over-inflating your ego.
Within minutes of announcing this improvement the author was inundated with superlative hyperbole and praise from fellow library staff. Implement at your own risk! ![]()


3 Comments
comments.show.hideSep 15, 2010
Laura Guy
Sweet! Works swell!! Five stars!
Sep 17, 2010
Harri Salminen
This is what we have been waiting for. Before Tomcat we used to have this (javascript in footer).
Sep 20, 2010
David Friggens
Pleased it's of use to others.