14 |
use WebPAC::Output::TT; |
use WebPAC::Output::TT; |
15 |
use WebPAC::Output::Estraier; |
use WebPAC::Output::Estraier; |
16 |
|
|
17 |
|
my $limit = shift @ARGV; |
18 |
|
|
19 |
my $abs_path = abs_path($0); |
my $abs_path = abs_path($0); |
20 |
$abs_path =~ s#/[^/]*$#/#; |
$abs_path =~ s#/[^/]*$#/#; |
21 |
|
|
27 |
|
|
28 |
my $isis = new WebPAC::Input::ISIS( |
my $isis = new WebPAC::Input::ISIS( |
29 |
code_page => 'ISO-8859-2', # application encoding |
code_page => 'ISO-8859-2', # application encoding |
30 |
limit_mfn => 50, |
limit_mfn => $limit, |
31 |
); |
); |
32 |
|
|
33 |
my $maxmfn = $isis->open( |
my $maxmfn = $isis->open( |
65 |
database => 'ps', |
database => 'ps', |
66 |
); |
); |
67 |
|
|
68 |
while (my $row = $isis->fetch) { |
my $total_rows = 0; |
69 |
|
|
70 |
|
for ( 0 ... $isis->size ) { |
71 |
|
|
72 |
|
my $row = $isis->fetch || next; |
73 |
|
|
74 |
my $mfn = $row->{'000'}->[0] || die "can't find MFN"; |
my $mfn = $row->{'000'}->[0] || die "can't find MFN"; |
75 |
|
|
77 |
|
|
78 |
# print STDERR Dumper($row, $ds); |
# print STDERR Dumper($row, $ds); |
79 |
|
|
80 |
my $html = $out->apply( |
# my $html = $out->apply( |
81 |
template => 'html_ffzg.tt', |
# template => 'html_ffzg.tt', |
82 |
data => $ds, |
# data => $ds, |
83 |
); |
# ); |
84 |
|
# |
85 |
# create test output |
# # create test output |
86 |
|
# |
87 |
my $file = sprintf('out/%02d.html', $mfn ); |
# my $file = sprintf('out/%02d.html', $mfn ); |
88 |
open(my $fh, '>', $file) or die "can't open $file: $!"; |
# open(my $fh, '>', $file) or die "can't open $file: $!"; |
89 |
print $fh $html; |
# print $fh $html; |
90 |
close($fh); |
# close($fh); |
91 |
|
# |
92 |
$html =~ s#\s*[\n\r]+\s*##gs; |
# $html =~ s#\s*[\n\r]+\s*##gs; |
93 |
|
# |
94 |
# print STDERR $html; |
# print STDERR $html; |
95 |
|
|
96 |
$est->add( |
$est->add( |
99 |
type => 'search', |
type => 'search', |
100 |
); |
); |
101 |
|
|
102 |
|
$total_rows++; |
103 |
|
|
104 |
}; |
}; |
105 |
|
|
106 |
|
my $log = $lookup->_get_logger; |
107 |
|
|
108 |
|
$log->info("$total_rows records indexed"); |