From 373899d375e55e71bdcded2879994e2f17aa6c51 Mon Sep 17 00:00:00 2001 From: dbs Date: Mon, 25 May 2009 04:46:45 +0000 Subject: [PATCH] Add a serial search method that returns an array of MFHD hashes for a given bib record This enables libraries to display multiple MFHD records per bib record, for example if a library has serial holdings for a given journal in microfiche, microfilm, and print, the holdings can be represented separately. Note that we are not currently identifying which MFHD record is providing the holdings coverage; the likely short-term plan will be to display location information such as 852 $c. git-svn-id: svn://svn.open-ils.org/ILS/trunk@13224 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/Search/Serial.pm | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Search/Serial.pm b/Open-ILS/src/perlmods/OpenILS/Application/Search/Serial.pm index ee827c041..b7188e2bf 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Search/Serial.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Search/Serial.pm @@ -108,4 +108,30 @@ __PACKAGE__->register_method( note => "Given a bibliographic record ID, return MFHD holdings" ); +sub bib_to_mfhd { + my ($self, $client, $bib) = @_; + + my $mfhd; + + my $e = OpenILS::Utils::CStoreEditor->new(); + my $serials = $e->search_serial_record_entry({ record => $bib }); + if (!ref $serials) { + return undef; + } + + my $u = OpenILS::Utils::MFHDParser->new(); + foreach (@$serials) { + push(@$mfhd, $u->generate_svr($_->marc)); + } + + return $mfhd; +} + +__PACKAGE__->register_method( + method => "bib_to_mfhd", + api_name => "open-ils.search.serial.record.bib.retrieve", + argc => 1, + note => "Given a bibliographic record ID, return MFHD holdings" +); + 1; -- 2.11.0