From: miker Date: Fri, 14 Nov 2008 18:46:01 +0000 (+0000) Subject: polute metabib.full_rec with non-filing trimmed versions of 245a X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2824d1ff513d1af1e7bf4d27a8648d48723f5ec8;p=Evergreen.git polute metabib.full_rec with non-filing trimmed versions of 245a git-svn-id: svn://svn.open-ils.org/ILS/trunk@11187 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm b/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm index 0a3cbd4372..500281e79d 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm @@ -915,6 +915,30 @@ sub _marcxml_to_full_rows { push @ns_list, $ns; } + + if ($xmltype eq 'metabib' and $tag eq '245') { + $tag = 'tnf'; + + for my $data ( @{$tagline->getChildrenByTagName('subfield')} ) { + next unless ($data and $data->getAttribute( "code" ) eq 'a'); + + $ns = $type->new; + + $ns->tag( $tag ); + $ns->ind1( $ind1 ); + $ns->ind2( $ind2 ); + $ns->subfield( $data->getAttribute( "code" ) ); + my $val = substr( $data->textContent, $ind2 ); + $val = NFD($val); + $val =~ s/\pM+//sgo; + $val =~ s/\pC+//sgo; + $val =~ s/\W+$//sgo; + $val =~ s/(\d{4})-(\d{4})/$1 $2/sgo; + $ns->value( lc($val) ); + + push @ns_list, $ns; + } + } } $log->debug("Returning ".scalar(@ns_list)." Fieldmapper nodes from $xmltype xml");