Simple Primo RSS
Tags: primo, elympics, rss, basic
Last Updated: Mar 01, 2010 06:33
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
http://find.natlib.govt.nz/
Download
simple_rss.jsp
Remove-Namespaces.xsl
Working example
http://find.natlib.govt.nz/primo_library/libweb/static_htmls/rss/rss.jsp?query=Te+Whiti+o+Rongomai&num_results=4
Using the following Ex Libris open interfaces
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
Comments