Simple Primo RSS
Tags: basic
, rss
, elympics
, primo
Last Updated: Mar 01, 2010 06:33
- Description
A JSP file that provides a simpler URL for returning query results in RSS (and MediaRSS) format.
- Author: Mike Kmiec
- Additional author(s):
- Institution: National Library of New Zealand
- Year: 2010
- License: Apache License, Version 2.0
- Short description: An overview of Apache 2.0 License
- Link to terms: Detailed license terms
- Skill required for using this code:
Basic - some editing of configuration variables in JSP required
State
Stable
Programming language
JavaServer Pages (JSP) using the JavaServer Pages Standard Tag Library (JSTL) version 1.1.
Software requirements
An application server capable of running JavaServer Pages. Using the file on your Primo installation satisfies this requirement.
Screen captures
Author(s) homepage
Download
Working example
Using the following Ex Libris open interfaces
- Brief Search X-Service
Release notes
Requires JavaServer Pages (JSP) using the JavaServer Pages Standard Tag Library (JSTL) version 1.1.
We received feedback from external users wanting to utilise RSS feeds as basic APIs. However, the URLs provided by Primo were especially long and contained cryptic characters.
This file accepts two parameters:
- query - The search query for which to return results.
- num_results - (Optional) The number of results to return, defaults to 10.
Writing this also provided the opportunity to add MediaRSS sections, for use by RSS readers providing support for this as well as other applications like CoolIris.
Installation instructions
1. Download the following files:
- simple_rss.jsp
- Remove-Namespaces.xsl
2. Open simple_rss.jsp in your favourite text editor, and change some of the configuration variables. Specifically, you'll need to change items under
- URL Configuration Variables - Essentially, where things link. If you are running this on the server running Primo, all you really need to change here is the view id parameter ('vid'). If you want to run this on a different server, these will need to change to point to the correct place.
- API Configuration Variables - For the API, currently only the institution id.
- Cosmetic Configuration Variables - Where the text of the RSS resides; also, the time zone setting, important for RSS feeds.
3. If you want to enable MediaRSS, you'll need to uncomment the associated section in simple_rss.jsp.
| Because Primo APIs return template codes for some URLs (like thumbnails) you may need to do some experimentation with URL Configuration Variables and the MediaRSS section to get this to work properly with your environment. |
4. Place both files into the same publicly-accessible directory on your JSP-capable application server. If they are going on the server you have running Primo, they will reside on the Front End server, in the static_htmls directory. (Really, you should put them in a subdirectory of static_htmls, and call it something like 'rss'. That way everything is organised.)
5. Congratulations! You're finished. Go do something nice for yourself. Maybe take a walk.
TO DO list
- Have an upper limit of num_results. Primo throttles this at 1000, but this code should probably enforce a much lower limit.
- Cacheing of results? Each time this is called, a new search will be run by Primo, so it could become a drain on server resources.
Known issues
- The Primo API returning template variables. This solution currently codes around the issue by hard-coding values for thumbnail and digital object URLs, which is inherently unstable - if the template value in Primo changes, this code will break. Dereferencing the template variables from within the API will solve this.

