6 use File::Temp qw/tempdir/;
11 use WebPAC::Input::ISIS;
13 use WebPAC::Normalize::XML;
14 use WebPAC::Output::TT;
15 use WebPAC::Output::Estraier;
17 my $limit = shift @ARGV;
19 my $abs_path = abs_path($0);
20 $abs_path =~ s#/[^/]*$#/#;
22 my $isis_file = '/data/isis_data/ps/LIBRI/LIBRI';
24 my $lookup = new WebPAC::Lookup(
25 lookup_file => "$abs_path/conf/lookup/isis.pm",
28 my $isis = new WebPAC::Input::ISIS(
29 code_page => 'ISO-8859-2', # application encoding
33 my $maxmfn = $isis->open(
34 filename => $isis_file,
35 code_page => '852', # database encoding
40 my $db = new WebPAC::DB(
44 my $n = new WebPAC::Normalize::XML(
45 # filter => { 'foo' => sub { shift } },
47 lookup_regex => $lookup->regex,
53 xml_file => "$abs_path/conf/normalize/isis_ffzg.xml",
56 my $out = new WebPAC::Output::TT(
57 include_path => "$abs_path/conf/output/tt",
58 filters => { foo => sub { shift } },
61 my $est = new WebPAC::Output::Estraier(
62 url => 'http://localhost:1978/node/webpac2',
70 for ( 0 ... $isis->size ) {
72 my $row = $isis->fetch || next;
74 my $mfn = $row->{'000'}->[0] || die "can't find MFN";
76 my $ds = $n->data_structure($row);
78 # print STDERR Dumper($row, $ds);
80 # my $html = $out->apply(
81 # template => 'html_ffzg.tt',
85 # # create test output
87 # my $file = sprintf('out/%02d.html', $mfn );
88 # open(my $fh, '>', $file) or die "can't open $file: $!";
92 # $html =~ s#\s*[\n\r]+\s*##gs;
106 my $log = $lookup->_get_logger;
108 $log->info("$total_rows records indexed");