The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

WebService::ILS - Standardised library discovery/circulation services

SYNOPSIS

use WebService::ILS::<Provider Subclass>;
my $ils = WebService::ILS::<Provider Subclass>->new({
    client_id => $client_id,
    client_secret => $client_secret
});
my %search_params = (
    query => "Some keyword",
    sort => "rating",
);
my $result = $ils->search(\%search_params);
foreach (@{ $result->{items} }) {
    ...
}
foreach (2..$result->{pages}) {
    $search_params{page} = $_;
    my $next_results = $ils->search(\%search_params);
    ...
}

or

my $native_result = $ils->native_search(\%native_search_params);

DESCRIPTION

WebService::ILS is an attempt to create a standardised interface for online library services providers.

In addition, native API interface is provided.

Here we will describe constructor parameters and methods common to all service providers. Diversions and native interfaces are documented in corresponding modules.

Supported service providers

WebService::ILS::OverDrive::Library

OverDrive Library API https://developer.overdrive.com/discovery-apis

WebService::ILS::OverDrive::Patron

OverDrive Circulation API https://developer.overdrive.com/circulation-apis

TESTING ENVIRONMENT

Testing WebService::ILS modules is extremely difficult. It requires test accounts with vendors, sometimes special setup for handling redirect URLs.

In that respect for building purposes, all tests are skipped by default. If you want to run tests for vendor specific modules during the build, you need to set the corresponding WEBSERVICE_ILS_TEST_* env vars to true, and supply values in vendor specific env vars. Those vendor specific vars correspond to CONSTRUCTOR params.

TESTING OverDrive API

WEBSERVICE_ILS_TEST_OVERDRIVE_LIBRARY

When set to true turns on tests from t/overdrve_library.t, which test WebService::ILS::OverDrive::Library module

WEBSERVICE_ILS_TEST_OVERDRIVE_PATRON

When set to true turns on tests from t/overdrve_patron.t, which test WebService::ILS::OverDrive::Patron module

WEBSERVICE_ILS_TEST_OVERDRIVE_AUTH

When set to true turns on tests from t/overdrve_auth.t, which test OverDrive Granted (3-legged) authentication mechanism. It is separated because of the challenges it presents

OverDrive account vars

OVERDRIVE_TEST_CLIENT_ID
OVERDRIVE_TEST_CLIENT_SECRET
OVERDRIVE_TEST_LIBRARY_ID library and auth
OVERDRIVE_TEST_WEBSITE_ID patron only
OVERDRIVE_TEST_AUTHORIZATION_NAME patron only
OVERDRIVE_TEST_USER_ID patron only
OVERDRIVE_TEST_USER_PASSWORD patron only
OVERDRIVE_TEST_AUTH_REDIRECT_URL auth only

TESTING OneClickDigital API

WEBSERVICE_ILS_TEST_ONECLICKDIGITAL_PARTNER

When set to true turns on tests from t/oneclickdigital.t, which test WebService::ILS::OneClickDigital::Partner and WebService::ILS::OneClickDigital::PartnerPatron modules

WEBSERVICE_ILS_TEST_ONECLICKDIGITAL_PATRON

When set to true turns on tests from t/oneclickdigital.t, which test WebService::ILS::OneClickDigital::Patron module

WEBSERVICE_ILS_TEST_ONECLICKDIGITAL

When set to true turns on all tests from t/overdrve_auth.t. Same as WEBSERVICE_ILS_TEST_ONECLICKDIGITAL_PARTNER and WEBSERVICE_ILS_TEST_ONECLICKDIGITAL_PATRON both set to true.

OneClickDigital account vars

ONECLICKDIGITAL_TEST_CLIENT_SECRET
ONECLICKDIGITAL_TEST_LIBRARY_ID
ONECLICKDIGITAL_TEST_USER_ID patron only
ONECLICKDIGITAL_TEST_USER_PASSWORD patron only
ONECLICKDIGITAL_TEST_USER_EMAIL partner only
ONECLICKDIGITAL_TEST_USER_BARCODE partner only

Only one of ONECLICKDIGITAL_TEST_USER_EMAIL (preferred) and ONECLICKDIGITAL_TEST_USER_BARCODE needs to be supplied.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 109:

You forgot a '=back' before '=head1'