| 1 | package Koha::Contrib::ARK::Writer; | ||
| 2 | # ABSTRACT: Write biblio records into Koha Catalog | ||
| 3 | $Koha::Contrib::ARK::Writer::VERSION = '1.0.5'; | ||
| 4 | use Moose; | ||
| 5 | use Modern::Perl; | ||
| 6 | use C4::Biblio; | ||
| 7 | |||
| 8 | with 'MooseX::RW::Writer'; | ||
| 9 | |||
| 10 | |||
| 11 | has ark => ( is => 'rw', isa => 'Koha::Contrib::ARK' ); | ||
| 12 | |||
| 13 | |||
| 14 | sub write { | ||
| 15 | my ($self, $biblionumber, $record) = @_; | ||
| 16 | |||
| 17 | return unless $record; | ||
| 18 | |||
| 19 | my $a = $self->ark; | ||
| 20 | if ($a->doit) { | ||
| 21 | my $fc = GetFrameworkCode($biblionumber); | ||
| 22 | ModBiblio( $record->as('Legacy'), $biblionumber, $fc ); | ||
| 23 | } | ||
| 24 | $a->current->{after} = Koha::Contrib::ARK::tojson($record) | ||
| 25 | if $a->debug; | ||
| 26 | } | ||
| 27 | |||
| 28 | |||
| 29 | 1; | ||
| 30 | |||
| 31 | __END__ | ||
| 32 | |||
| 33 | =pod | ||
| 34 | |||
| 35 | =encoding UTF-8 | ||
| 36 | |||
| 37 | =head1 NAME | ||
| 38 | |||
| 39 | Koha::Contrib::ARK::Writer - Write biblio records into Koha Catalog | ||
| 40 | |||
| 41 | =head1 VERSION | ||
| 42 | |||
| 43 | version 1.0.5 | ||
| 44 | |||
| 45 | =head1 ATTRIBUTES | ||
| 46 | |||
| 47 | =head2 ark | ||
| 48 | |||
| 49 | L<Koha::Contrib::ARK> object. | ||
| 50 | |||
| 51 | =head1 AUTHOR | ||
| 52 | |||
| 53 | Frédéric Demians <f.demians@tamil.fr> | ||
| 54 | |||
| 55 | =head1 COPYRIGHT AND LICENSE | ||
| 56 | |||
| 57 | This software is Copyright (c) 2020 by Fréderic Demians. | ||
| 58 | |||
| 59 | This is free software, licensed under: | ||
| 60 | |||
| 61 | The GNU General Public License, Version 3, June 2007 | ||
| 62 | |||
| 63 | =cut |