Access Keys:
Skip to content (Access Key - 0)
My Area (Access Key - 2)


Toggle Sidebar
Your Rating: Results: PatheticBadOKGoodOutstanding! 4 rates
Labels:
basic basic Delete
webvoyage webvoyage Delete
tomcat tomcat Delete
xsl xsl Delete
opac opac Delete
voyager voyager Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Explicitly state number of available items in a holding record

Tags: , , , , ,
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

University of Waikato

University of the Arts London

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!


Comments

Page Attachments

No files have been attached to this page.

Added by David Friggens on Sep 09, 2010 06:08, last edited by David Friggens on Sep 21, 2010 00:05

  1. Sep 15, 2010

    Sweet! Works swell!! Five stars!

  2. Sep 17, 2010

    This is what we have been waiting for. Before Tomcat we used to have this (javascript in footer).  

  3. Sep 20, 2010

    Pleased it's of use to others.

Adaptavist Theme Builder Powered by Atlassian Confluence