Bug 14957: Merge rules system for merging of MARC records
[koha.git] / misc / maintenance / process_record_through_filter.pl
1 #!/usr/bin/perl
2
3 # This script is intended for testing RecordProcessor filters. To use it
4 # run the script like so:
5 # > perl process_record_through_filter.pl ${BIBLIONUMBER} ${FILTER}
6
7 use strict;
8 use warnings;
9
10 use Koha::Script;
11 use Koha::RecordProcessor;
12 use C4::Biblio qw( GetMarcBiblio );
13
14 my $record = GetMarcBiblio({ biblionumber => $ARGV[0] });
15
16 print "Before: " . $record->as_formatted() . "\n";
17 my $processor = Koha::RecordProcessor->new( { filters => ( $ARGV[1] ) });
18 $record = $processor->process($record);
19 print "After : " . $record->as_formatted() . "\n";