1 package Koha::REST::V1::ERM::EHoldings::Packages;
3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # Koha is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with Koha; if not, see <http://www.gnu.org/licenses>.
20 use Mojo::Base 'Mojolicious::Controller';
22 use Scalar::Util qw( blessed );
23 use Try::Tiny qw( catch try );
25 use Koha::REST::V1::ERM::EHoldings::Packages::Manual;
26 use Koha::REST::V1::ERM::EHoldings::Packages::EBSCO;
37 my $provider = C4::Context->preference('ERMProvider');
38 if ( $provider eq 'ebsco' ) {
39 return Koha::REST::V1::ERM::EHoldings::Packages::EBSCO::list(@_);
41 return Koha::REST::V1::ERM::EHoldings::Packages::Manual::list(@_);
47 Controller function that handles retrieving a single Koha::ERM::EHoldings::Package object
52 my $provider = C4::Context->preference('ERMProvider');
53 if ( $provider eq 'ebsco' ) {
54 return Koha::REST::V1::ERM::EHoldings::Packages::EBSCO::get(@_);
56 return Koha::REST::V1::ERM::EHoldings::Packages::Manual::get(@_);
62 Controller function that handles adding a new Koha::ERM::EHoldings::Package object
67 my $provider = C4::Context->preference('ERMProvider');
68 if ( $provider eq 'ebsco' ) {
71 return Koha::REST::V1::ERM::EHoldings::Packages::Manual::add(@_);
77 Controller function that handles updating a Koha::ERM::EHoldings::Package object
82 my $provider = C4::Context->preference('ERMProvider');
83 if ( $provider eq 'ebsco' ) {
86 return Koha::REST::V1::ERM::EHoldings::Packages::Manual::update(@_);
95 my $provider = C4::Context->preference('ERMProvider');
96 if ( $provider eq 'ebsco' ) {
99 return Koha::REST::V1::ERM::EHoldings::Packages::Manual::update(@_);