28 |
|
|
29 |
while (my ($database, $db_config) = each %{ $config->{databases} }) { |
while (my ($database, $db_config) = each %{ $config->{databases} }) { |
30 |
|
|
|
my $type = lc($db_config->{input}->{type}); |
|
|
|
|
|
die "I know only how to handle input type isis, not '$type'!\n" unless ($type eq 'isis'); |
|
|
|
|
31 |
my $abs_path = abs_path($0); |
my $abs_path = abs_path($0); |
32 |
$abs_path =~ s#/[^/]*$#/#; |
$abs_path =~ s#/[^/]*$#/#; |
33 |
|
|
|
my $lookup = new WebPAC::Lookup( |
|
|
lookup_file => $db_config->{input}->{lookup}, |
|
|
); |
|
|
|
|
34 |
my $db_path = $config->{webpac}->{db_path} . '/' . $database; |
my $db_path = $config->{webpac}->{db_path} . '/' . $database; |
35 |
|
|
|
|
|
|
my $log = $lookup->_get_logger; |
|
|
$log->info("working on $database in $db_path"); |
|
|
|
|
36 |
my $db = new WebPAC::Store( |
my $db = new WebPAC::Store( |
37 |
path => $db_path, |
path => $db_path, |
38 |
database => $database, |
database => $database, |
39 |
debug => 1, |
debug => 1, |
40 |
); |
); |
41 |
|
|
42 |
|
my $log = $db->_get_logger; |
43 |
|
$log->info("working on $database in $db_path"); |
44 |
|
|
45 |
my $est_config = $config->{hyperestraier} || $log->logdie("can't find 'hyperestraier' part in confguration"); |
my $est_config = $config->{hyperestraier} || $log->logdie("can't find 'hyperestraier' part in confguration"); |
46 |
$est_config->{database} = $database; |
$est_config->{database} = $database; |
47 |
|
|
63 |
} |
} |
64 |
|
|
65 |
foreach my $input (@inputs) { |
foreach my $input (@inputs) { |
66 |
|
|
67 |
|
my $type = lc($input->{type}); |
68 |
|
|
69 |
|
die "I know only how to handle input type isis, not '$type'!\n" unless ($type eq 'isis'); |
70 |
|
|
71 |
|
my $lookup = new WebPAC::Lookup( |
72 |
|
lookup_file => $input->{lookup}, |
73 |
|
); |
74 |
|
|
75 |
$log->info("working on input $input->{path} [$input->{type}]"); |
$log->info("working on input $input->{path} [$input->{type}]"); |
76 |
|
|
77 |
my $isis = new WebPAC::Input::ISIS( |
my $isis = new WebPAC::Input::ISIS( |
78 |
code_page => $config->{webpac}->{webpac_encoding}, |
code_page => $config->{webpac}->{webpac_encoding}, |
79 |
limit_mfn => $input->{limit}, |
limit_mfn => $input->{limit}, |
80 |
|
lookup => $lookup, |
81 |
); |
); |
82 |
|
|
83 |
my $maxmfn = $isis->open( |
my $maxmfn = $isis->open( |
85 |
code_page => $input->{encoding}, # database encoding |
code_page => $input->{encoding}, # database encoding |
86 |
); |
); |
87 |
|
|
88 |
|
$log->info( Dumper($lookup->{_lookup_data}) ); |
89 |
|
|
90 |
my $n = new WebPAC::Normalize::XML( |
my $n = new WebPAC::Normalize::XML( |
91 |
# filter => { 'foo' => sub { shift } }, |
# filter => { 'foo' => sub { shift } }, |
92 |
db => $db, |
db => $db, |