9 |
|
|
10 |
use WebPAC::Lookup; |
use WebPAC::Lookup; |
11 |
use WebPAC::Input::ISIS; |
use WebPAC::Input::ISIS; |
12 |
use WebPAC::DB; |
use WebPAC::DB 0.02; |
13 |
use WebPAC::Normalize::XML; |
use WebPAC::Normalize::XML; |
14 |
use WebPAC::Output::TT; |
use WebPAC::Output::TT; |
15 |
use WebPAC::Output::Estraier; |
use WebPAC::Output::Estraier; |
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"); |