]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#1673870: Handle OverDrive ebook checkout and download
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Tue, 4 Jul 2017 23:20:11 +0000 (16:20 -0700)
committerBill Erickson <berickxx@gmail.com>
Fri, 1 Sep 2017 20:06:50 +0000 (16:06 -0400)
commit904875cd9cfceeb8681c4d2befa878b61ed65a06
tree9a5b81aff4c02c3cfd89fb14b2782615a577717c
parent8a9ba80dd1533138773762a5d3ee4c030b2c92bc
LP#1673870: Handle OverDrive ebook checkout and download

The workflow for checking out and downloading a title via the OverDrive
API is relatively complex:

1. Check out a title.

2. Lock in a specific format for the checked-out title.  Once you lock
in a format, you can only download the title in that format -- except
that the browser-based OverDrive Read and OverDrive Listen formats are
always available (if supported for that title), even if you've locked in
another format.

3. Request a link for downloading the title in the specified format.
Download links are dynamically generated and only work for 60 seconds
from the time of your request.

To simplify the process, we require the user to lock in a format during
checkout.  Then, when the user clicks the Download button, we request a
download link; OverDrive responds with a URL, and we immediately
redirect the current browser tab/window to that URL.

A new API call, open-ils.ebook_api.title.get_download_link, has been
added for requesting the download link.  Since API calls are not
vendor-specific, we also add support for the new method in the test
module, complete with unit test.

Supplementary fixes:

- show spinner in My Account while loading from ebook API
- ensure session ID is available to ebook object during transactions
- fix display of ebook formats

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/EbookAPI.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/EbookAPI/OverDrive.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/EbookAPI/Test.pm
Open-ILS/src/perlmods/live_t/20-lp1541559-ebook-api.t
Open-ILS/src/templates/opac/parts/ebook_api/avail_js.tt2
Open-ILS/web/js/ui/default/opac/ebook_api/ebook.js
Open-ILS/web/js/ui/default/opac/ebook_api/loggedin.js