[open-ils-commits] r10645 -
trunk/Open-ILS/src/perlmods/OpenILS/Application
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Sep 19 13:48:18 EDT 2008
Author: erickson
Date: 2008-09-19 13:48:15 -0400 (Fri, 19 Sep 2008)
New Revision: 10645
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm
Log:
using local authority create/overlay methods. some cleanup of overaly target handling
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm 2008-09-19 17:47:24 UTC (rev 10644)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm 2008-09-19 17:48:15 UTC (rev 10645)
@@ -18,6 +18,7 @@
use MIME::Base64;
use OpenILS::Application::AppUtils;
use OpenILS::Application::Cat::BibCommon;
+use OpenILS::Application::Cat::AuthCommon;
my $U = 'OpenILS::Application::AppUtils';
sub initialize {}
@@ -515,6 +516,9 @@
my %queues;
for my $rec_id (@$rec_ids) {
+
+ my $overlay_target = $overlay_map->{$rec_id};
+
if($type eq 'bib') {
my $rec = $e->retrieve_vandelay_queued_bib_record($rec_id)
@@ -524,10 +528,10 @@
$queues{$rec->queue} = 1;
my $record;
- if(defined $overlay_map->{$rec_id}) {
- $logger->info("vl: overlaying record $rec_id");
+ if(defined $overlay_target) {
+ $logger->info("vl: overlaying record $overlay_target");
$record = OpenILS::Application::Cat::BibCommon->biblio_record_replace_marc(
- $e, $rec_id, $rec->marc); #$rec->bib_source
+ $e, $overlay_target, $rec->marc); #$rec->bib_source
} else {
$logger->info("vl: importing new record");
$record = OpenILS::Application::Cat::BibCommon->biblio_record_xml_import(
@@ -548,25 +552,17 @@
$queues{$rec->queue} = 1;
my $record;
- if(defined $overlay_map->{$rec_id}) {
- $logger->info("vl: overlaying record $rec_id");
- $record = $U->simplereq(
- 'open-ils.cat',
- 'open-ils.cat.authority.record.overlay',
- $auth, $overlay_map->{$rec_id}, $rec->marc); #$rec->bib_source);
+ if(defined $overlay_target) {
+ $logger->info("vl: overlaying record $overlay_target");
+ $record = OpenILS::Utils::Cat::AuthCommon->overlay_authority_record(
+ $overlay_target, $rec->marc); #$source);
} else {
$logger->info("vl: importing new record");
- $record = $U->simplereq(
- 'open-ils.cat',
- 'open-ils.cat.authority.record.import',
- $auth, $rec->marc); #$rec->bib_source);
+ $record = OpenILS::Utils::Cat::AuthCommon->import_authority_record(
+ $rec->marc) #$source);
}
- if($U->event_code($record)) {
- $e->rollback;
- return $record;
- }
-
+ return $record if $U->event_code($record);
$rec->imported_as($record->id);
$rec->import_time('now');
$e->update_vandelay_queued_authority_record($rec) or return $e->die_event;
More information about the open-ils-commits
mailing list