From: erickson Date: Thu, 11 Mar 2010 23:38:32 +0000 (+0000) Subject: added auto_overlay_exact option to queue import call, which uses new overlay/merge... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=24c0493ceaddfa19d524715ca9dc475a9a4b9f0a;p=Evergreen.git added auto_overlay_exact option to queue import call, which uses new overlay/merge functions git-svn-id: svn://svn.open-ils.org/ILS/trunk@15813 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 5d954258c0..41cfe824a9 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm @@ -493,6 +493,10 @@ sub import_queue { $query->{id} = {'not in' => $matched_recs} if @$matched_recs; } + if($$options{auto_overlay_exact}) { + auto_overlay_exact($type, $q_id, $$options{merge_profile}); + } + my $search = ($type eq 'bib') ? 'search_vandelay_queued_bib_record' : 'search_vandelay_queued_authority_record'; my $rec_ids = $e->$search($query, {idlist => 1}); @@ -501,6 +505,38 @@ sub import_queue { return {complete => 1}; } +sub auto_overlay_exact { + my $type = shift; + my $q_id = shift; + my $merge_profile = shift; + + my $e = new_editor(xact => 1); + + my $err; + try { + + $e->json_query( + { + from => [ + "vandelay.auto_overlay_${type}_queue", $q_id, $merge_profile + ] + }, + { + substream => 1, + discard => 1 + } + ); + + } catch Error with { + $err = shift; + $logger->error("vl: fatal error in auto-overlay: $err"); + $e->rollback; + }; + + $e->commit unless $err; + return undef; +} + # returns a list of queued record IDs for a given queue that # have at least one entry in the match table