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 --validate-delimiters path/to/validate_delimiters_file |
72 |
|
|
73 |
|
this option is used with C<--validate> to turn on extra validation of |
74 |
|
delimiters. If file is non existant, it will be created on first run. |
75 |
|
|
76 |
=item --marc-generate |
=item --marc-generate |
77 |
|
|
78 |
Generate MARC file. This will automatically be on if file contains C<marc*> directives. |
Generate MARC file. This will automatically be on if file contains C<marc*> directives. |
113 |
my $only_filter; |
my $only_filter; |
114 |
my $stats = 0; |
my $stats = 0; |
115 |
my $validate_path; |
my $validate_path; |
116 |
|
my $validate_delimiters_path; |
117 |
my $marc_generate = 1; |
my $marc_generate = 1; |
118 |
my $marc_lint = 1; |
my $marc_lint = 1; |
119 |
my $marc_dump = 0; |
my $marc_dump = 0; |
134 |
"debug+" => \$debug, |
"debug+" => \$debug, |
135 |
"stats" => \$stats, |
"stats" => \$stats, |
136 |
"validate=s" => \$validate_path, |
"validate=s" => \$validate_path, |
137 |
|
"validate-delimiters=s" => \$validate_delimiters_path, |
138 |
"marc-generate!" => \$marc_generate, |
"marc-generate!" => \$marc_generate, |
139 |
"marc-lint!" => \$marc_lint, |
"marc-lint!" => \$marc_lint, |
140 |
"marc-dump!" => \$marc_dump, |
"marc-dump!" => \$marc_dump, |
144 |
"help" => \$help, |
"help" => \$help, |
145 |
); |
); |
146 |
|
|
147 |
|
$marc_generate = 0 if ( $validate_delimiters_path ); |
148 |
|
|
149 |
pod2usage(-verbose => 2) if ($help); |
pod2usage(-verbose => 2) if ($help); |
150 |
|
|
151 |
my $config = new WebPAC::Config( path => $config_path ); |
my $config = new WebPAC::Config( path => $config_path ); |
172 |
$log->info("created merge batch file $estcmd_path"); |
$log->info("created merge batch file $estcmd_path"); |
173 |
} |
} |
174 |
|
|
|
|
|
175 |
my $validate; |
my $validate; |
176 |
$validate = new WebPAC::Validate( |
$validate = new WebPAC::Validate( |
177 |
path => $validate_path, |
path => $validate_path, |
178 |
delimiters => $config->webpac('delimiters'), |
delimiters => $config->webpac('delimiters'), |
179 |
) if ($validate_path); |
delimiters_path => $validate_delimiters_path, |
180 |
|
) if ($validate_path || $validate_delimiters_path); |
181 |
|
|
182 |
my $use_indexer = $config->use_indexer; |
my $use_indexer = $config->use_indexer; |
183 |
$stats ||= $validate; |
$stats ||= $validate; |
570 |
print $report_fh "$errors\n" if ($report_fh); |
print $report_fh "$errors\n" if ($report_fh); |
571 |
} |
} |
572 |
|
|
573 |
print $report_fh "\nAll possible subfields/delimiter templates:\n", $validate->delimiters_templates, "\n\n"; |
print $report_fh "\nAll possible subfields/delimiter templates:\n", $validate->delimiters_templates( report => 1, current_input => 1 ), "\n\n"; |
574 |
|
|
575 |
|
# must be last thing that touches $validate for this input |
576 |
|
$validate->reset; |
577 |
} |
} |
578 |
|
|
579 |
if ($stats) { |
if ($stats) { |
586 |
$marc->finish if ($marc); |
$marc->finish if ($marc); |
587 |
|
|
588 |
# close report |
# close report |
589 |
close($report_fh) if ($report_fh) |
close($report_fh) if ($report_fh); |
|
|
|
590 |
} |
} |
591 |
|
|
592 |
eval { $indexer->finish } if ($indexer && $indexer->can('finish')); |
eval { $indexer->finish } if ($indexer && $indexer->can('finish')); |
613 |
$log->info("all parallel processes finished"); |
$log->info("all parallel processes finished"); |
614 |
} |
} |
615 |
|
|
616 |
|
# save new delimiters if needed |
617 |
|
$validate->save_delimiters_templates if ( $validate ); |
618 |
|
|
619 |
# |
# |
620 |
# handle links or merge after indexing |
# handle links or merge after indexing |
621 |
# |
# |