From 10ec5a49fd043e64ab916803ff8130bf774f4a45 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 5 Sep 2008 14:03:42 +0000 Subject: [PATCH] for ease of UI dev, allow import and overlay records on same API call. overlay recs present in overlay map git-svn-id: svn://svn.open-ils.org/ILS/trunk@10542 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/Vandelay.pm | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm b/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm index 75ed18aa95..6cd1bbdcb1 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm @@ -366,25 +366,6 @@ __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, $args) = @_; my $e = new_editor(xact => 1, authtoken => $auth); @@ -396,12 +377,10 @@ sub import_record_list { return {complete => 1}; } -#open-ils.cat.biblio.record.xml.update - sub import_record_list_impl { my($self, $conn, $auth, $e, $rec_ids, $args) = @_; - my $overlay_map = $args->{overlay_map}; + my $overlay_map = $args->{overlay_map} || {}; my $type = $self->{record_type}; my $total = @$rec_ids; my $count = 0; @@ -413,12 +392,14 @@ sub import_record_list_impl { or return $e->die_event; my $record; - if($self->api_name =~ /overlay/) { + if(defined $overlay_map->{$rec_id}) { + $logger->info("vl: overlaying record $rec_id"); $record = $U->simplereq( 'open-ils.cat', 'open-ils.cat.biblio.record.xml.update', $auth, $overlay_map->{$rec_id}, $rec->marc); #$rec->bib_source); } else { + $logger->info("vl: importing new record"); $record = $U->simplereq( 'open-ils.cat', 'open-ils.cat.biblio.record.xml.import', -- 2.43.2