HIP Floor Maps JavaScript

I’ve put together a much simpler version of the floor plan code that we use on our HIP. This version uses JavaScript and only requires a single HIP XSL file (items.xsl) to be edited.

The full changes are shown in this copy of the file taken from a fresh installation of HIP 3.04 (UK releases):

The added sections of JavaScript are shown in red (and green for the two commented-out debug lines that might be useful for testing).

The JavaScript “checkMaps” function has 3 examples – here they are along with an example of what they would match:

  1. showMap( ‘plan1.gif’, ‘Loan Collection Floor 3’ );

  2. showMap( ‘plan2.gif’, ‘Music Library’, ‘Score and Parts’ );

  3. showMap( ‘plan3.gif’, ‘Audiovisual Collection Floor 5[^|]+Available’ );

You’ll need to copy and paste the red JavaScript sections into your existing items.xsl file – don’t replace your entire file with mine because I’ve edited out large sections of the Dynix code to make it easier to read!!!

Don’t forget to:

  1. back up your existing “items.xsl” file first in case it all goes wrong
  2. try the script on a test HIP server first

As shown, the code will be expecting to display floor plan images stored in a sub-directory called “maps” in your “hipres.war” folder:

…however, you can easily tweak the code to get the images from another server.

The JavaScript uses regular expressions (regexs) to do the matching – if you are familiar with these then you can easily do matches that take into account call/class numbers, availability, etc to display even more specific floor plans.

If you need help building a certain regex, then I’ll try and help out. Otherwise, most Perl and Unix people are familiar with building regexs.

If you have any suggestions, comments, questions, corrections, improvements, etc then please feel free to contact me (email@daveyp.com).

  1. Steve Toub said:

    I noticed this is no longer in production and am curious why. Too much effort to maintain changing locations?

  2. Hi Steve

    We’re in the midst of a major refurb and stock is being moved around every day, so the maps for each floor are fast becoming out-of-date.

    As soon as floors 5 & 6 are open for business again, we’ll be putting together a new set of floor plans.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: