From 29f004c9a4c29ac3c0bf43d65ec2470f813a6003 Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 7 Jul 2006 09:34:09 +0000 Subject: [PATCH] Ingest update git-svn-id: svn://svn.open-ils.org/ILS/trunk@4925 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/perlmods/OpenILS/Application/Ingest.pm | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm b/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm index 3b8133c080..7dabc28294 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm @@ -194,6 +194,37 @@ __PACKAGE__->register_method( stream => 1, ); +sub rw_biblio_ingest_stream_import { + my $self = shift; + my $client = shift; + + OpenILS::Application::Ingest->post_init(); + + my $ses = OpenSRF::AppSession->create('open-ils.cstore'); + + while (my ($resp) = $client->recv( count => 1, timeout => 5 )) { + + my $bib = $resp->content; + last unless (defined $bib); + + $log->debug("Running open-ils.ingest.full.biblio.xml.readonly ..."); + my ($res) = $self->method_lookup("open-ils.ingest.full.biblio.xml.readonly")->run($bib->marc); + + $_->source($bib->id) for (@{$res->{field_entries}}); + $_->record($bib->id) for (@{$res->{full_rec}}); + + $client->respond( @{$res->{field_entries}} + @{$res->{full_rec}} ); + } + + return undef; +} +__PACKAGE__->register_method( + api_name => "open-ils.ingest.full.biblio.bib_stream.import", + method => "rw_biblio_ingest_stream_import", + api_level => 1, + stream => 1, +); + # -------------------------------------------------------------------------------- # MARC index extraction -- 2.11.0