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 $abs_path = abs_path($0);
18 $abs_path =~ s#/[^/]*$#/#;
20 my $isis_file = '/data/isis_data/ps/LIBRI/LIBRI';
22 my $lookup = new WebPAC::Lookup(
23 lookup_file => "$abs_path/conf/lookup/isis.pm",
26 my $isis = new WebPAC::Input::ISIS(
27 code_page => 'ISO-8859-2', # application encoding
31 my $maxmfn = $isis->open(
32 filename => $isis_file,
33 code_page => '852', # database encoding
38 my $db = new WebPAC::DB(
42 my $n = new WebPAC::Normalize::XML(
43 # filter => { 'foo' => sub { shift } },
45 lookup_regex => $lookup->regex,
51 xml_file => "$abs_path/conf/normalize/isis_ffzg.xml",
54 my $out = new WebPAC::Output::TT(
55 include_path => "$abs_path/conf/output/tt",
56 filters => { foo => sub { shift } },
59 my $est = new WebPAC::Output::Estraier(
60 url => 'http://localhost:1978/node/webpac2',
66 while (my $row = $isis->fetch) {
68 my $mfn = $row->{'000'}->[0] || die "can't find MFN";
70 my $ds = $n->data_structure($row);
72 # print STDERR Dumper($row, $ds);
74 my $html = $out->apply(
75 template => 'html_ffzg.tt',
81 my $file = sprintf('out/%02d.html', $mfn );
82 open(my $fh, '>', $file) or die "can't open $file: $!";
86 $html =~ s#\s*[\n\r]+\s*##gs;