383 |
next; |
next; |
384 |
} |
} |
385 |
|
|
386 |
next if ($only_input && ($input_name !~ m#$only_input#i && $input->{type} !~ m#$only_input#i)); |
next if defined $only_input && $input_name !~ m#$only_input#i; |
387 |
|
|
388 |
my $type = lc($input->{type}); |
my $type = lc($input->{type}); |
389 |
|
|
542 |
} |
} |
543 |
|
|
544 |
my $rules = $parser->normalize_rules($database,$input_name); |
my $rules = $parser->normalize_rules($database,$input_name); |
545 |
$log->logwarn("no normalize rules for $database/$input_name") unless $rules; |
if ( ! $rules ) { |
546 |
|
$log->logwarn("no normalize rules for $database/$input_name", $input_db->input_module->can('normalize') ? " using normalize from input module" : ''); |
547 |
|
next; |
548 |
|
} |
549 |
|
|
550 |
$log->debug("parsed normalize rules:\n$rules"); |
$log->debug("parsed normalize rules:\n$rules"); |
551 |
|
|
619 |
next; # validation doesn't create any output |
next; # validation doesn't create any output |
620 |
} |
} |
621 |
|
|
622 |
|
my $ds; |
623 |
|
|
624 |
if ($rules) { |
if ($rules) { |
625 |
|
|
626 |
my $ds = WebPAC::Normalize::data_structure( |
$ds = WebPAC::Normalize::data_structure( |
627 |
row => $row, |
row => $row, |
628 |
rules => $rules, |
rules => $rules, |
629 |
lookup => $lookup_hash, |
lookup => $lookup_hash, |
640 |
}, |
}, |
641 |
); |
); |
642 |
|
|
643 |
$log->debug("ds = ", sub { dump($ds) }); |
} elsif ( $input_db->input_module->can('normalize') ) { |
644 |
|
$ds = $input_db->input_module->normalize( $mfn ); |
645 |
if ( $ds ) { |
} |
646 |
|
|
647 |
$store->save_ds( |
if ( $ds ) { |
648 |
database => $database, |
$log->debug("ds = ", sub { dump($ds) }); |
|
input => $input_name, |
|
|
id => $mfn, |
|
|
ds => $ds, |
|
|
) if !$stats; |
|
|
|
|
|
$indexer->add( |
|
|
id => "${input_name}/${mfn}", |
|
|
ds => $ds, |
|
|
type => $config->get($indexer_config)->{type}, |
|
|
) if $indexer; |
|
649 |
|
|
650 |
foreach my $out ( @output_modules ) { |
$store->save_ds( |
651 |
$out->add( $mfn, $ds ) if $out->can('add'); |
database => $database, |
652 |
} |
input => $input_name, |
653 |
|
id => $mfn, |
654 |
|
ds => $ds, |
655 |
|
) if !$stats; |
656 |
|
|
657 |
|
$indexer->add( |
658 |
|
id => "${input_name}/${mfn}", |
659 |
|
ds => $ds, |
660 |
|
type => $config->get($indexer_config)->{type}, |
661 |
|
) if $indexer; |
662 |
|
|
663 |
} else { |
foreach my $out ( @output_modules ) { |
664 |
$log->warn("record $pos didn't produce any output after normalization rules!") unless $marc; |
$out->add( $mfn, $ds ) if $out->can('add'); |
665 |
} |
} |
|
} |
|
666 |
|
|
667 |
|
} else { |
668 |
|
$log->warn("record $pos didn't produce any output after normalization rules!") unless $marc; |
669 |
|
} |
670 |
if ($marc) { |
if ($marc) { |
671 |
my $i = 0; |
my $i = 0; |
672 |
|
|