[open-ils-commits] r13224 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Search (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon May 25 00:46:48 EDT 2009


Author: dbs
Date: 2009-05-25 00:46:45 -0400 (Mon, 25 May 2009)
New Revision: 13224

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Serial.pm
Log:
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.


Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Serial.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Serial.pm	2009-05-25 03:48:24 UTC (rev 13223)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Serial.pm	2009-05-25 04:46:45 UTC (rev 13224)
@@ -108,4 +108,30 @@
 	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;



More information about the open-ils-commits mailing list