Skip to content

wrlc-primo-dev/hide-unavailable-open-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

hide-unavailable-open-library

The included custom.js file includes code to check the Open Library API and find out whether the currently displayed ISBN in Primo is borrowable from Open Library.

If a General Electronic Service (GES) for displaying links to Open Library has been set up in Alma's Fulfillment configuration (as outlined below), the custom.js will hide the GES link if the item is not borrowable from Open Library.

Setting up the Open Library GES

  1. Log into Alma with an administrator account,

  2. Under Alma Configuration/Fulfillment/Discovery Interface Display Logic/General Electronic Services, click on “Add Service”,

  3. Fill in the popup window with the information below:

    1. Service Code: OpenLibrary
    2. Service Name: Open Library
    3. Service Description: give a short description about this service, for example: Search OpenLibrary.org for bib records and display a link to the open library catalog when available.
    4. Public Name: this is the language/label that will show to the public users. Please fill in what your institution would like your users to see, for example: “Check full text availability at OpenLibrary.”
    5. Public Note: leave it blank or fill in detailed information for the public.
    6. Is this a Document Delivery/ILL service?: Choose “Yes”
    7. URL template: https://openlibrary.org/search?isbn={rft.isbn}
  4. Click “Add and Close” to add this service,

  5. Now you should see this as a new service under General Electronic Services. Click on “Edit” of the service you just created, you should see something like this screenshot:GES Edit ScreenPlease adjust the configuration options according to the screenshot above or make adjustments to meet your institution's needs. We selected the “Getit, viewit & How to Getit” option to enable the Open Library links to display in those three different situations, but you might want to change that to fit your own needs.

  6. Click on “Service Availability Rules”, we added three rules to prevent the link to display whenever not needed. You might want to add more or revise those rules according to your own needs. The three rules are:

    1. PrintMaterialOnly:Edit PrintMaterialOnly form
      1. Input Parameters:
        1. Name: rft.isbn
        2. Operator: Is Empty
      2. Output Parameters:
        1. IsDisplay: False
    2. BookTypeOnly:Edit BookTypeOnly form
      1. Input Parameters:
        1. Name: rft.genre
        2. Operator: Not Equals
        3. Value: book
      2. Output Parameters:
        1. IsDisplay: False
    3. DisableEBookDisplay:Edit DisableEBookDisplay form
      1. Input Parameters:
        1. Name: rft.subject
        2. Operator: Contains
        3. Value: Electronic books, Electronic books.
      2. Output Parameters:
        1. IsDisplay: False
  7. Next, edit the Default Rule for this service:Edit Default Rule form

    1. Output Parameters:
      1. IsDisplay: True
  8. Check on the General Services page to make sure it is “Active”. Then you should be able to see the OpenLibrary Link in Primo records for all print books with ISBNs.

Adding the custom.js code to your Primo view

If you do not have any custom javascript in your library's customization package for Primo, simply replace the default custom.js file included in your view ([your Primo Dev Env root]/views/[your custom view folder]/js/custom.js) with the one included in this repository.

If you already have some customized javascript code in your view's customization package, you will need to first check whether any of the following AngularJS/Primo directives are already being used as components in your custom code:

  1. prmRequestServicesAfter
  2. almaHowovpAfter
  3. prmAlmaViewitItemsAfter

If none of those directives are used as components in your existing custom.js, you can simply paste lines 16 ("/* Create reusable function for checking ISBNs */") through 178 (the "})" just before the closing "})();") at the end of your custom.js, right before the file's final "})();."

If ANY of the above directives is already being used as a component in your custom.js, you will need to incorporate the controller code used for that component in this repo into the existing controller code for that component in your custom.js because AngularJS does not allow a directive to be used as a component more than once (i.e, by multiple controllers). Some understanding of AngularJS coding is necessary to incorporate the code into your own existing custom.js.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published