12 |
use WebPAC::Store 0.14; |
use WebPAC::Store 0.14; |
13 |
use WebPAC::Normalize 0.22; |
use WebPAC::Normalize 0.22; |
14 |
use WebPAC::Output::TT; |
use WebPAC::Output::TT; |
15 |
use WebPAC::Validate 0.06; |
use WebPAC::Validate 0.11; |
16 |
use WebPAC::Output::MARC; |
use WebPAC::Output::MARC; |
17 |
use WebPAC::Config; |
use WebPAC::Config; |
18 |
use Getopt::Long; |
use Getopt::Long; |
68 |
|
|
69 |
turn on extra validation of imput records, see L<WebPAC::Validation> |
turn on extra validation of imput records, see L<WebPAC::Validation> |
70 |
|
|
71 |
|
=item --marc-generate |
72 |
|
|
73 |
|
Generate MARC file. This will automatically be on if file contains C<marc*> directives. |
74 |
|
You can use this option as C<--no-marc-generate> to disable MARC generation. |
75 |
|
|
76 |
=item --marc-lint |
=item --marc-lint |
77 |
|
|
78 |
By default turned on if normalisation file has C<marc*> directives. You can disable lint |
By default turned on if normalisation file has C<marc*> directives. You can disable lint |
108 |
my $only_filter; |
my $only_filter; |
109 |
my $stats = 0; |
my $stats = 0; |
110 |
my $validate_path; |
my $validate_path; |
111 |
|
my $marc_generate = 1; |
112 |
my $marc_lint = 1; |
my $marc_lint = 1; |
113 |
my $marc_dump = 0; |
my $marc_dump = 0; |
114 |
my $parallel = 0; |
my $parallel = 0; |
128 |
"debug+" => \$debug, |
"debug+" => \$debug, |
129 |
"stats" => \$stats, |
"stats" => \$stats, |
130 |
"validate=s" => \$validate_path, |
"validate=s" => \$validate_path, |
131 |
|
"marc-generate!" => \$marc_generate, |
132 |
"marc-lint!" => \$marc_lint, |
"marc-lint!" => \$marc_lint, |
133 |
"marc-dump!" => \$marc_dump, |
"marc-dump!" => \$marc_dump, |
134 |
"parallel=i" => \$parallel, |
"parallel=i" => \$parallel, |
167 |
my $validate; |
my $validate; |
168 |
$validate = new WebPAC::Validate( |
$validate = new WebPAC::Validate( |
169 |
path => $validate_path, |
path => $validate_path, |
170 |
|
delimiters => $config->webpac('delimiters'), |
171 |
) if ($validate_path); |
) if ($validate_path); |
172 |
|
|
173 |
|
|
439 |
} |
} |
440 |
|
|
441 |
my $marc; |
my $marc; |
442 |
if ($parser->have_rules( 'marc', $database, $input_name )) { |
if ($marc_generate && $parser->have_rules( 'marc', $database, $input_name )) { |
443 |
$marc = new WebPAC::Output::MARC( |
$marc = new WebPAC::Output::MARC( |
444 |
path => "out/marc/${database}-${input_name}.marc", |
path => "out/marc/${database}-${input_name}.marc", |
445 |
lint => $marc_lint, |
lint => $marc_lint, |
545 |
$marc->add( |
$marc->add( |
546 |
id => $mfn . ( $i ? "/$i" : '' ), |
id => $mfn . ( $i ? "/$i" : '' ), |
547 |
fields => $fields, |
fields => $fields, |
548 |
leader => WebPAC::Normalize::marc_leader(), |
leader => WebPAC::Normalize::_get_marc_leader(), |
549 |
row => $row, |
row => $row, |
550 |
); |
); |
551 |
$i++; |
$i++; |
561 |
$log->info("validation errors:\n$errors\n" ); |
$log->info("validation errors:\n$errors\n" ); |
562 |
print $report_fh "$errors\n" if ($report_fh); |
print $report_fh "$errors\n" if ($report_fh); |
563 |
} |
} |
564 |
|
|
565 |
|
print $report_fh "\nAll possible subfields/delimiter templates:\n", $validate->delimiters_templates( report => 1 ), "\n\n"; |
566 |
} |
} |
567 |
|
|
568 |
if ($stats) { |
if ($stats) { |