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


Toggle Sidebar
Your Rating: Results: PatheticBadOKGoodOutstanding! 0 rates

Labels

primo primo Delete
elympics elympics Delete
rss rss Delete
basic basic Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Simple Primo RSS

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

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

  • 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


Comments

Page Attachments

File NameCommentSizeNumber of Downloads
simple_rss.jspJSP for simple RSS feed6 kB35
Remove-Namespaces.xslXSL to remove namespaces (for ease of JSTL)1 kB20

Added by Mike Kmiec on Mar 01, 2010 06:19, last edited by Mike Kmiec on Mar 01, 2010 06:33

Adaptavist Theme Builder Powered by Atlassian Confluence