8 |
|
|
9 |
use WebPAC::Common 0.02; |
use WebPAC::Common 0.02; |
10 |
use WebPAC::Lookup; |
use WebPAC::Lookup; |
11 |
use WebPAC::Input 0.03; |
use WebPAC::Input 0.07; |
12 |
use WebPAC::Store 0.03; |
use WebPAC::Store 0.03; |
13 |
use WebPAC::Normalize; |
use WebPAC::Normalize 0.11; |
14 |
use WebPAC::Output::TT; |
use WebPAC::Output::TT; |
15 |
use WebPAC::Validate; |
use WebPAC::Validate; |
16 |
use WebPAC::Output::MARC; |
use WebPAC::Output::MARC; |
233 |
|
|
234 |
my $input_db = new WebPAC::Input( |
my $input_db = new WebPAC::Input( |
235 |
module => $input_module, |
module => $input_module, |
236 |
code_page => $config->{webpac}->{webpac_encoding}, |
encoding => $config->{webpac}->{webpac_encoding}, |
237 |
limit => $limit || $input->{limit}, |
limit => $limit || $input->{limit}, |
238 |
offset => $offset, |
offset => $offset, |
239 |
lookup => $lookup, |
lookup_coderef => sub { |
240 |
|
my $rec = shift || return; |
241 |
|
$lookup->add( $rec ); |
242 |
|
}, |
243 |
recode => $input->{recode}, |
recode => $input->{recode}, |
244 |
stats => $stats, |
stats => $stats, |
245 |
); |
); |
317 |
type => $config->{$use_indexer}->{type}, |
type => $config->{$use_indexer}->{type}, |
318 |
) if ($indexer && $ds); |
) if ($indexer && $ds); |
319 |
|
|
320 |
$marc->add( |
if ($marc) { |
321 |
id => $mfn, |
my $i = 0; |
322 |
fields => [ WebPAC::Normalize::_get_marc_fields() ], |
|
323 |
leader => WebPAC::Normalize::marc_leader(), |
while (my $fields = WebPAC::Normalize::_get_marc_fields( fetch_next => 1 ) ) { |
324 |
row => $row, |
$marc->add( |
325 |
) if ($marc); |
id => $mfn . ( $i ? "/$i" : '' ), |
326 |
|
fields => $fields, |
327 |
|
leader => WebPAC::Normalize::marc_leader(), |
328 |
|
row => $row, |
329 |
|
); |
330 |
|
$i++; |
331 |
|
} |
332 |
|
|
333 |
|
$log->info("Created $i instances of MFN $mfn\n") if ($i > 1); |
334 |
|
} |
335 |
|
|
336 |
$total_rows++; |
$total_rows++; |
337 |
} |
} |