Configuration changes to Primo

We thought it may be useful to detail all the changes that need to be made to Ex-Libris Primo in order that it may communicate with WebLearn (Sakai)

1. Addition of a URI to Primo OpenURL

Requested change

A new http URI to be added to the OpenURLs generated by Primo which would provide a persistent link back to the Primo record. This should be added as an rft_id

Reason

In the existing setup the only way of identifying the originating Primo record is by examining the rft_dat element of the OpenURL. As rft_dat is simply an arbitrary string, this is not a preferred mechanism for storing the id for the Primo record, and so rft_id is seen as more appropriate. The rft_id must be a URI according to the OpenURL v1.0 specification. Additionally when using DAIA to return availability information for a resource, a URI must be used to identify the resource, therefore it makes sense to assign a URI when creating the OpenURL in Primo.

Change made

For ‘local’ items (i.e. not those available via Primo Central) an encoded http URI providing a persistent link to the Primo record has been added to the OpenURL generated for the record as a rft_id.

E.g. rft_id=http%3A%2F%2Fsolo.bodleian.ox.ac.uk%2Fprimo_library%2Flibweb%2Faction%2Fdisplay.do%3Fdoc%3DUkOxUUkOxUb11462895%26vid%3DOXVU1%26fn%3Ddisplay%26displayMode%3Dfull

Detail of change

This was achieved by modifying the default URL templates that primo uses to establish OpenURL. These are changed in Back Office > Advanced Configuration > All Mapping Tables > Sub System “Delivery” >Templates. Changes are made for openurl, openurlfulltext, openurl_journal, openurlfull_journal, openurl_article and openurlfull_article keys.

2.   Addition of class to <li> element in Primo Central results page

Requested change

Addition of the class ‘EXLMoreTab’ to the <li> element wrapping the ‘Additional Services’ tab heading in the Primo Central resuls page.

Reason

The <li> element wrapping the ‘Additional Services’ tab heading in the Primo results list is usually given a css class of “EXLMoreTab”. This is used by some javascript to identify the correct location in the page carry out some operations to add the ‘Add to WebLearn’ functionality.

However, in the Primo Central results when the ‘Additional Services’ tab is the first tab (in order, left to right), this class was not allocated. This resulted in the javascript not working. The addition of the class to the relevant div was requested so the javascript would work for all records.

Change made

The class was added to the relevant <li> element

Detail of change

This was achieved by modifying the default results tile for Primo. By default, the results are built up dynamically from resultsTile.jsp. This file resides in: fe_web>tiles (full path: /exlibris/primo/p3_1/ng/primo/home/system/thirdparty/openserver/server/search/deploy/primo_library-app.ear/primo_library-libweb.war/tiles).

The following changes are made to the file. The following change is to generate the additional class only when the first tab is the “Additional Services” tab (internal name: getit_link2).

New lines of code are highlighted.

<%-- viewonline,getit_link1,locations,details,reviewsandtags,recommendations,getit_link2 --%>

<c:if test="${tab=='viewonline' && not empty tabState.viewOnlineTab}">
<c:choose>
   <c:when test="${not empty tabState.moreTab}">
      <li id="exlidResult${resultStatus.index}-ViewOnlineTab">
   </c:when>
   <c:otherwise>
      <li id="exlidResult${resultStatus.index}-ViewOnlineTab">
   </c:otherwise>
</c:choose>

However, we also want to add the class WLTab to the “Additional Services” tab when it is not the first tab. For this reason, we modify another part of the code.

<c:if test="${tab=='getit_link2' && not empty tabState.moreTab}">
 <li id="exlidResult${resultStatus.index}-MoreTab">

Changes were also made in fullRecord.jsp file to achieve consistency among brief results and full record display. The following lines were added:

<c:if test="${tab=='viewonline' && not empty tabState.viewOnlineTab}">

--------------
<c:choose>
<c:when test="${not empty tabState.moreTab}">

 <li id="exlidResult0-ViewOnlineTab">

</c:when>
<c:otherwise>

<li id="exlidResult0-ViewOnlineTab">

</c:otherwise>
</c:choose>
----------------
<c:choose>
<c:when test="${tabState.viewOnlineTab.popOut == 'on'}">

3. Addition of ‘Add to WebLearn’ functionality in Primo results list

Requested change

Addition of ‘Add to WebLearn’ icon, text and link to each Primo record in the case the user had triggered a search of Primo from a WebLearn Citation Helper to build a reading list. The link should be an OpenURL with the base URL being a WebLearn URL which could be defined when the Primo search was triggered from the WebLearn Citation Helper.

Reason

In order to allow the addition of resources to WebLearn Citation Helper lists from Primo, only when the context was appropriate, using a standardised metadata format.

Change made

Javascript and JQuery used to enable the creation of the ‘Add to WebLearn’ link and the display of the link only when relevant to the context (i.e. the Primo search has been triggered from a WebLearn Citation Helper too build a reading list).

Detail of change

New javascript function ‘addWebLearn()’ added to the following file:

$fe_web/javascript/v3.js

This function:

  1. Checks if the window.name starts with ‘Weblearn Solo’
  2. Extracts the WebLearn URL to use from window.name
  3. Loops through each .EXLSummaryContainer div to:
    1. Extract the URL to call SFX menu
    2. Modify the URL to get an XML response only
    3. Extract the OpenURL from the response (looks for the first href)
    4. Substitute the baseurl in the returned OpenURL with the WebLearn URL extracted above
    5. Appends the resulting link with icon/text to .EXLSummaryFields div

The function was based on the function EXLTA_getSfxLink() written by Hanan Jacob as part of the EXL Tab API (EXLTA) (see http://www.exlibrisgroup.org/download/attachments/29590016/EXLTabAPI.03a.js?version=1&modificationDate=1288719708000)

The function is currently as follows:

function addWebLearn() {
  var weblearn = new Array();
  weblearn = window.name.split(' - ');
  if (weblearn[0] == "WebLearn Solo"){
    $('.EXLSummaryContainer').each(function() {
      try {
        var WLhref = $(this).closest('.EXLSummary').find('.EXLMoreTab a').attr('href');
        var WLmodifiedHref = WLhref.replace(/display\.do/,"expand.do").replace(/renderMode=poppedOut/,'renderMode=prefetchXml');
        var WLxml = $.ajax({url: WLmodifiedHref ,global: false,async: false,error:function(){log('WebLearn sfx retrieval error')}}).responseXML;
        var WLhtmlText = $(WLxml).find('element').text();
        var WLurl = WLhtmlText.match(/href="([^"]*)"/)[1].replace("http://oxfordsfx-direct.hosted.exlibrisgroup.com/oxford",unescape(weblearn[1]));
        $(this).find('.EXLSummaryFields').append("Import into WebLearn");
      }
      catch(WLerr) {
        log('Could not insert WebLearn link: ' + WLerr);
      }
    });
  }
}

Addition July 2011

Note from Owen Stephens: Section 3 no longer applies as written here – instead of a function we now have a separate script so:

  1. Copy the weblearn.js script from primo-s-web-2 to the live server
  2. Ensure that the weblearn.js script is called from the home screen, brief results and full results – we made this change on primo-s-web-2 but I’m not sure if we just put the call into the pages directly, or from another script.
Posted in Uncategorized | Tagged | Comments Off on Configuration changes to Primo

Comments are closed.