From d0845432d8e96bdfeea0db7765a8faef34d1c3f1 Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 27 Jul 2007 17:40:17 +0000 Subject: [PATCH] add support for authority export git-svn-id: svn://svn.open-ils.org/ILS/trunk@7597 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm b/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm index fba67a898b..e452cb19a0 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm @@ -54,7 +54,12 @@ sub handler { return 200 unless (@records); - my $holdings = $cgi->param('holdings'); + my $type = $cgi->param('rectype') || 'biblio'; + if ($type ne 'biblio && $type ne 'authority') { + die "Bad record type: $type"; + } + + my $holdings = $cgi->param('holdings') if ($type eq 'biblio'); my $location = $cgi->param('location') || 'gaaagpl'; # just because... my $format = $cgi->param('format') || 'USMARC'; @@ -73,8 +78,8 @@ sub handler { } if ($format ne 'XML') { - my $type = 'MARC::File::' . $format; - $type->require; + my $ftype = 'MARC::File::' . $format; + $ftype->require; } my $ses = OpenSRF::AppSession->create('open-ils.cstore'); @@ -124,7 +129,7 @@ sub handler { try { local $SIG{ALRM} = sub { die "TIMEOUT\n" }; alarm(1); - $bib = $ses->request( 'open-ils.cstore.direct.biblio.record_entry.retrieve', $i, $flesh )->gather(1); + $bib = $ses->request( "open-ils.cstore.direct.$type.record_entry.retrieve", $i, $flesh )->gather(1); alarm(0); } otherwise { warn "\n!!!!!! Timed out trying to read record $i\n"; -- 2.11.0