How do we list links to accessibility and other information from our database providers?
Answer
We are storing links to information about accessibility and a few other categories in Alma vendor records. Using the vendor records allows us to have a central repository for this information to be used for all four colleges. Alma's vendor APIs allow us to dynamically extract this information and display it on web pages. If a link changes or we need to add or remove a vendor, we can do that once in Alma and the changes will roll out to each web page that draws upon this data.
The basic approach to storing this data in Alma vendor records for retrieval via the APIs comes comes from a presentation by Ken Herold at ELUNA Developers Day+ 2023.
Note that when you make a change, addition, or deletion as described below, the change will not take effect immediately, because, to ensure a quick page load, the API response is cached. A script runs a few times a day to update the cache file.
How to add or change a link
We store this data in Access Provider-type vendors. (Note that some access-provider-type vendors have additional active types, such as Material Provider. That's ok—the only requirement is that they have Access Provider checked.) In the record, go to the Contact Information tab. We use the Web Addresses pane to enter the needed URLs. Each URL that you want to appear on the page must have a description indicating what kind of link it is. It's ok to add other URLs to the list without including one of the approved comments—in this case the URL will remain in the vendor record but not be included in the provider list we are creating.
Here are the types of comments that are relevant to our process:
Comment | Meaning / Use |
---|---|
ACCESSIBILITY | Link to a page describing the vendor's approach to accessibility. If one does not exist and instead we have been given a VPAT, we should upload the VPAT to the library web server and link to it there. |
PRIVACY | Normally this will be a link to the platform's privacy policy. |
DEI | Link to a statement from the provider about their approach to diversity, equity, and inclusion. Only some providers have this. |
INFO | Page that provides information about the provider of the resource. Avoid linking to marketing-heavy pages from the provider. In many cases we will not supply an info link. |
The comments above are case-sensitive—they must be all-caps.
In some cases a provider supplies multiple products with different accessibility and/or privacy policies. In that case, indicate the specific platform on the Note section.
Provider description
To provide a brief description of the provider (e.g. "Ovid Technologies is a subsidiary of the publicly traded Dutch company Wolters Kluwer."), add a note to the vendor record Notes tab preceded by the string DESC: like so:
It is OK to add other notes to the vendor record. Only notes beginning with DESC: will be used by the script.
Embedding the HTML output in a page
The following code snippet will load the list on a page in the losrios.edu domain. (If you try to load it on a different domain, the browser will show a CORS error.) It includes a spinner icon in case of a delay in loading the data, but normally there is no delay.
<div id="lr-vendor-content"> <div class="container"> <p class="center">Loading...</p> <p class="center"> <i class="fa fa-spinner fa-lg fa-spin" aria-hidden="true"></i> </p> </div> </div> <script src="https://library.losrios.edu/utilities/vendor-links/vendor-links.js"></script>
The intended destination of the HTML-formatted data is LibGuides. Therefore:
- the HTML includes certain classes specific to Bootstrap 3.3.7, which is what the current version of LibGuides uses;
- it uses the FontAwesome icon framework version 4.7.0, which LibGuides loads;
- the script that it brings to the page requires jQuery, which is included on LibGuides pages.
This means that if you load the script on pages that don't have these resources, it will probably not display well (and without jQuery it will fail entirely—if it's important to load it elsewhere it can be rewritten to not use jQuery).
Checking links
Because the URLs do not reside in LibGuides, you cannot use the LibGuides URL checker to identify bad links. To check the links, load the page and use a browser extension (many exist) to identify problematic URLs.
Background processes
One PHP script queries the Retrieve Vendors API and looks for vendors that are access providers and have LRCCD in the vendor name. It writes the codes of these vendors, comma-delimited, to a text file on our server. This means that if we add a database and want a new vendor added to the list, we simply need to add the vendor to Alma. This script is set up to create a new cache file whenever it finds that the existing cache file is more than 36 hours old.
A second script retrieves this file and loops through the list. For each vendor code, it queries the Get Vendor API, extracts relevant data from its response, adds that data to a new JSON object that includes all vendors it finds that have at least privacy or accessibility links, and writes that object to a file. This file is a compact data source compared to the complete API payloads, so our JavaScript will be able to quickly parse it and write the info to the page as HTML. A web service triggers this script a few times a day, so changes we make in Alma will normally be reflected within a few hours.
The JavaScript we include on the LibGuides page retrieves the cached file from the second script via AJAX. It parses the JSON object, loops through its members and writes the data to HTML.