JournalTOCs is the largest free collection of scholarly journals Table of Contents (TOCs) for more than 15,000 journals from nearly 700 publishers.
At Aalborg University Library we've created a mash-up using JournalTOCs, a home grown web service, and some Primo UI modifications which provide the user with a new tab (using EXL Tab API) presenting the latest articles for a given journal with the opportunity to share TOCs and articles and subscribe to the TOCs via RSS (using e.g.: Google Reader, MS Outlook, smart phone etc.). To be able to provide the "appropriate copy" to the end user the feeds from JournalTOCs are parsed and rewritten to include OpenURL, links to remote access proxies as well as DOI links.
- Author: Kasper Løvschall and Karsten Kryger Hansen
- Additional author(s):
- Institution: Aalborg Universitetsbibliotek
- Year: 2010
- License: BSD style
- Short description: Use, modification and distribution of the code are permitted provided the copyright notice, list of conditions and disclaimer appear in all related material.
- Link to terms: [Detailed license terms]
- Skill required for using this code:
advanced to expert (depending on requirements)
'In Development' but running in production at our library. So you can call it: beta!
The web service is written in Perl (running mod_perl specifically for performance reasons). UI implementation is done using jQuery and EXL Tab API.
Tested using Perl 5.8.x but can probably run in lower versions. mod_perl 2.0 and Apache 2.x web server is a requirement unless the code is rewritten to support common CGI. This can be done (originally this was the case) but to provide reasonable performance to the end user this is not recommended.
Only Perl modules from the standard distribution are required for version 1.0.
From version 1.1 and onwards the Perl module CHI (http://search.cpan.org/~jswartz/CHI/) is required for caching of RSS feeds from JournalTOCs.
The above image show a journal in Primo with an available table of contents. You can share, print, email, subscribe to the entire TOC as well as individual article entries. Full text can be accessed via direct link from the original feed or via OpenURL. If the article had a DOI it would be available as link also.
The above image show a feed subscribed through Google Reader. Additional links are provided at the bottom of each article entry.
JournalTOCs web service for mod_perl version 1.0
JournalTOCs web service for mod_perl version 1.1
JournalTOCs web service "heater" version 1.0
JournalTOCs example CSS file for the rendered view
Try a search for e.g. "library hi tech". The tab "Seneste artikler" (Danish page) or "Recent articles" (English page) contain the output of this service.
The above example outside Primo:
And it's multilingual capabilities:
RSS feed for feed readers:
JSONP request for UI implementation:
First release to the public.
- Added support for the CHI unified cache handling interface for effective caching of already downloaded RSS feeds. The cache is shared between mod_perl threads
- Fixed some double encoding and xml validation problems in RSS feeds
- Fixed some embedded HTML in feeds so it will display correctly in render view
Notice: This CodeShare page is a work in progress. Help us to improve the code and documentation by giving us feedback. Thanks!
If no other mod_perl code is running on the Apache web server you'll need to make some basic configuration. If it's already running some other code you'll need to merge the existing configuration with this one.
First make a directory for the setup file and web service code (the path is really up to your preferences):
Create a "startup.pl" file for mod_perl with the following contents:
If using version 1.1 please also add the following line to "startup.pl" (after the last "use" line):
Edit your httpd.conf or virtual host and add the following:
Download the file "JournalTOCs.pm" to the directory /usr/local/apache/mod_perl/Primo (the one created in the above process).
This should be it. Restart apache to reload the configuration. Remember to check the error_log!
Edit JournalTOCs.pm and locate the following section:
Change the following to point to your (in this case) EZproxy remote access server prefix:
Change the following to your base url for your OpenURL resolver:
Change the following to identify this service to the resolver (for statistical purposes I guess):
Change the following to identify yourself (linktext is the verbal name of your OpenURL service):
If the Apache server is running https change http to https below:
Link to CSS for the rendered feed:
If you have an account for AddThis.com please insert it here:
Edit the translations to suit your needs. You can add a language by creating hash entries for it's two letter language code: en = English and da = Danish etc. Someone with excellent English language skills are very welcome to supply proper English text labels for all to use!
This should be the user configuration needed to run the web service unmodified.
If using version 1.1 you might need to edit the section:
"root_dir" must point to a directory with write access for the Apache (httpd) process. "expires_in" is set to one day and can be raised or lowered to your liking.
JournalTOCs is not yet providing it's own JSONP service so we'll provide this one ourself.
So for the web service to be able to provide fast response to requests from the Primo UI using JSONP you'll need to preload all ISSN numbers with available Table of Contents to a database. For ease of use and speed tied access to a gdbm file is used - depending on Perl distribution several file database modules could be used: NDBM_File, GDBM_File, SDBM_File (not recommended for speed), and DB_File should be possible. Originally I used ndbm but on CentOS Linux this is not available due to licence issues. Gdbm is an excellent choice anyway!
To populate this gdbm file download the program "build_issn_hash-file.pl" to your installation directory /usr/local/apache/mod_perl/Primo and execute it (remember to have write access to the installation directory):
If the programs output is like above you should have one (or two depending on database module) new file(s) in the directory :
This is the newly created gdbm database with entries for every single ISSN number available through JournalTOCs. The web service is now "heated up" and ready for requests!
|Try to fire some requests at your web service to check if it is working. You can take a look at the working examples and change the base url to your own. Monitor the Apache error_log! ISSN numbers are valid with or without a dash. Also ISSN numbers are case insensitive when it comes to "x" or "X".|
|The gdbm file is static at the moment. If new feeds are added to JournalTOCs this database need to be updated by running the script again. This can be done once a month or so. If feeds were to be deleted from JournalTOCs you would need to delete the to issn_gdbm files first.|
The UI implementation is based on the EXL Tab API created by Hanan Jacob. We use a version with minor changes, similar to EXLTabAPI.03b.js found in EXL Tab Api.
We have included all functions in our footer file. Remember to include jQuery and the correct version of the EXL Tab API.
There are a few text labels used by the code to identify e.g. content type. Remember to change these to match yours.
The gdbm file is static. In a future release ISSN numbers not found here will be consulted with JournalTOCs directly. This will be done so the JSONP service reports the ISSN number unavailable first (speed is an issue here). Then in the background JournalTOCs will be consulted and if a feed is available the gdbm file would get updated. The next time the ISSN number is checked the JSONP service will respond positive.
The RSS feeds from JournalTOCs are often double encoded which renders HTML markup tags within the XML difficult to identify. Some fixing is done by the web service to support proper formatting in the rendered view (&render=true). This is not yet done for RSS readers so this is up to the reader to clean this up. I will consider to enable this for RSS feeds as well in the future.
The configuration of the web service is tied to the Perl code. I'm considering a configuration file and the possibility to support multiple configurations within one installation (hosted services will then be possible).