63 |
|
|
64 |
turn on extra validation of imput records, see L<WebPAC::Validation> |
turn on extra validation of imput records, see L<WebPAC::Validation> |
65 |
|
|
66 |
|
=item --marc-normalize conf/normalize/mapping.pl |
67 |
|
|
68 |
|
This option specifies normalisation file for MARC creation |
69 |
|
|
70 |
|
=item --marc-output out/marc/test.marc |
71 |
|
|
72 |
|
Optional path to output file |
73 |
|
|
74 |
=back |
=back |
75 |
|
|
76 |
=cut |
=cut |
84 |
my $only_filter; |
my $only_filter; |
85 |
my $stats = 0; |
my $stats = 0; |
86 |
my $validate_path; |
my $validate_path; |
87 |
|
my ($marc_normalize, $marc_output); |
88 |
|
|
89 |
GetOptions( |
GetOptions( |
90 |
"limit=i" => \$limit, |
"limit=i" => \$limit, |
96 |
"debug" => \$debug, |
"debug" => \$debug, |
97 |
"stats" => \$stats, |
"stats" => \$stats, |
98 |
"validate=s" => \$validate_path, |
"validate=s" => \$validate_path, |
99 |
|
"marc-normalize=s" => \$marc_normalize, |
100 |
|
"marc-output=s" => \$marc_output, |
101 |
); |
); |
102 |
|
|
103 |
$config = LoadFile($config); |
$config = LoadFile($config); |
122 |
$log->info("using $use_indexer indexing engine..."); |
$log->info("using $use_indexer indexing engine..."); |
123 |
} |
} |
124 |
|
|
125 |
|
# disable indexing when creating marc |
126 |
|
$use_indexer = undef if ($marc_normalize); |
127 |
|
|
128 |
my $total_rows = 0; |
my $total_rows = 0; |
129 |
my $start_t = time(); |
my $start_t = time(); |
130 |
|
|
238 |
my @norm_array = ref($input->{normalize}) eq 'ARRAY' ? |
my @norm_array = ref($input->{normalize}) eq 'ARRAY' ? |
239 |
@{ $input->{normalize} } : ( $input->{normalize} ); |
@{ $input->{normalize} } : ( $input->{normalize} ); |
240 |
|
|
241 |
|
if ($marc_normalize) { |
242 |
|
@norm_array = ( { |
243 |
|
path => $marc_normalize, |
244 |
|
output => $marc_output || 'out/marc/' . $database . '-' . $input->{name} . '.marc', |
245 |
|
} ); |
246 |
|
} |
247 |
|
|
248 |
foreach my $normalize (@norm_array) { |
foreach my $normalize (@norm_array) { |
249 |
|
|
250 |
my $normalize_path = $normalize->{path} || $log->logdie("can't find normalize path in config"); |
my $normalize_path = $normalize->{path} || $log->logdie("can't find normalize path in config"); |
256 |
$log->info("Using $normalize_path for normalization..."); |
$log->info("Using $normalize_path for normalization..."); |
257 |
|
|
258 |
my $marc_fh; |
my $marc_fh; |
259 |
if (my $path = $normalize->{marc21}) { |
if (my $path = $normalize->{output}) { |
260 |
open($marc_fh, '>', $path) || |
open($marc_fh, '>', $path) || |
261 |
$log->logdie("can't open MARC output $path: $!"); |
$log->logdie("can't open MARC output $path: $!"); |
262 |
|
|
335 |
# |
# |
336 |
# add Hyper Estraier links to other databases |
# add Hyper Estraier links to other databases |
337 |
# |
# |
338 |
if (ref($db_config->{links}) eq 'ARRAY') { |
if (ref($db_config->{links}) eq 'ARRAY' && $use_indexer) { |
339 |
foreach my $link (@{ $db_config->{links} }) { |
foreach my $link (@{ $db_config->{links} }) { |
340 |
if ($use_indexer eq 'hyperestraier') { |
if ($use_indexer eq 'hyperestraier') { |
341 |
$log->info("saving link $database -> $link->{to} [$link->{credit}]"); |
$log->info("saving link $database -> $link->{to} [$link->{credit}]"); |