From: erickson Date: Thu, 4 Sep 2008 02:43:30 +0000 (+0000) Subject: added an overlay version of the queued bib import X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=aeba2304c1b0e61b4da1c72efa0f5d3b1e93f1fe;p=Evergreen.git added an overlay version of the queued bib import git-svn-id: svn://svn.open-ils.org/ILS/trunk@10529 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm b/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm index 45935407ec..4156418be2 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm @@ -366,19 +366,42 @@ __PACKAGE__->register_method( record_type => 'auth' ); +__PACKAGE__->register_method( + api_name => "open-ils.vandelay.bib_record.list.overlay", + method => 'import_record_list', + api_level => 1, + argc => 2, + stream => 1, + record_type => 'bib' +); + +__PACKAGE__->register_method( + api_name => "open-ils.vandelay.auth_record.list.overlay", + method => 'import_record_list', + api_level => 1, + argc => 2, + stream => 1, + record_type => 'auth' +); + + sub import_record_list { - my($self, $conn, $auth, $rec_ids) = @_; + my($self, $conn, $auth, $rec_ids, $args) = @_; my $e = new_editor(xact => 1, authtoken => $auth); return $e->die_event unless $e->checkauth; - my $err = import_record_list_impl($self, $conn, $auth, $e, $rec_ids); + $args ||= {}; + my $err = import_record_list_impl($self, $conn, $auth, $e, $rec_ids, $args); return $err if $err; $e->commit; return {complete => 1}; } +#open-ils.cat.biblio.record.xml.update + sub import_record_list_impl { - my($self, $conn, $auth, $e, $rec_ids) = @_; + my($self, $conn, $auth, $e, $rec_ids, $args) = @_; + my $overlay_map = $args->{overlay_map}; my $type = $self->{record_type}; my $total = @$rec_ids; my $count = 0; @@ -389,10 +412,18 @@ sub import_record_list_impl { my $rec = $e->retrieve_vandelay_queued_bib_record($rec_id) or return $e->die_event; - my $record = $U->simplereq( - 'open-ils.cat', - 'open-ils.cat.biblio.record.xml.import', - $auth, $rec->marc ); #$rec->bib_source); + my $record; + if($self->api_name =~ /overlay/) { + $record = $U->simplereq( + 'open-ils.cat', + 'open-ils.cat.biblio.record.xml.update', + $auth, $overlay_map->{$rec_id}, $rec->marc); #$rec->bib_source); + } else { + $record = $U->simplereq( + 'open-ils.cat', + 'open-ils.cat.biblio.record.xml.import', + $auth, $rec->marc); #$rec->bib_source); + } if($U->event_code($record)) { $e->rollback;