[open-ils-commits] r11187 - trunk/Open-ILS/src/perlmods/OpenILS/Application

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Nov 14 13:46:06 EST 2008


Author: miker
Date: 2008-11-14 13:46:01 -0500 (Fri, 14 Nov 2008)
New Revision: 11187

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm
Log:
polute metabib.full_rec with non-filing trimmed versions of 245a

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm	2008-11-14 18:31:19 UTC (rev 11186)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm	2008-11-14 18:46:01 UTC (rev 11187)
@@ -915,6 +915,30 @@
 
 			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");



More information about the open-ils-commits mailing list