17 |
|
|
18 |
my $webpac = new WebPAC( |
my $webpac = new WebPAC( |
19 |
code_page => 'ISO-8859-2', |
code_page => 'ISO-8859-2', |
20 |
limit_mfn => 100, |
limit_mfn => 500, |
21 |
# debug => 1, |
# debug => 1, |
22 |
) || die; |
) || die; |
23 |
|
|
52 |
|
|
53 |
my @ds = $webpac->data_structure($rec); |
my @ds = $webpac->data_structure($rec); |
54 |
|
|
55 |
if ($log->is_debug) { |
if (0 && $log->is_debug) { |
56 |
$log->debug("rec = ",Dumper($rec)); |
$log->debug("rec = ",Dumper($rec)); |
57 |
$log->debug("ds = ",Dumper(\@ds)); |
$log->debug("ds = ",Dumper(\@ds)); |
58 |
} |
} |
62 |
my $filename = $webpac->{'current_filename'}; |
my $filename = $webpac->{'current_filename'}; |
63 |
|
|
64 |
if ($filename) { |
if ($filename) { |
65 |
open(OUT,"> $filename") || $log->logdie("can't open output '$filename': $!"); |
$webpac->output_file( |
66 |
print OUT $webpac->output( |
file => $filename, |
67 |
template => 'html.tt', |
template => 'html.tt', |
68 |
data => \@ds, |
data => \@ds, |
69 |
headline => $webpac->{'headline'}, |
headline => $webpac->{'headline'}, |
70 |
); |
); |
|
close(OUT); |
|
71 |
} else { |
} else { |
72 |
print $webpac->output( |
print $webpac->output( |
73 |
template => 'text.tt', |
template => 'text.tt', |
109 |
|
|
110 |
} |
} |
111 |
|
|
112 |
if ($log->is_debug) { |
foreach my $t (keys %{$thes}) { |
113 |
|
|
114 |
|
my @e = $thes->{$t}->elements; |
115 |
|
if (! @e) { |
116 |
|
$log->logwarn("no elements in sorted index $t?"); |
117 |
|
next; |
118 |
|
} |
119 |
|
|
120 |
|
$log->debug("saving sorted index $t [".scalar(@e)." elements]"); |
121 |
|
|
122 |
|
$webpac->output_file( |
123 |
|
file => "./out/thes_$t.html", |
124 |
|
template => 'index.tt', |
125 |
|
data => \@e, |
126 |
|
index_name => $t, |
127 |
|
); |
128 |
|
} |
129 |
|
|
130 |
|
if (0 && $log->is_debug) { |
131 |
$log->debug("lookup hash: ",Dumper($webpac->{'lookup'})); |
$log->debug("lookup hash: ",Dumper($webpac->{'lookup'})); |
132 |
$log->debug("data hash: ",Dumper($webpac->{'data'})); |
$log->debug("data hash: ",Dumper($webpac->{'data'})); |
133 |
foreach my $t (keys %{$thes}) { |
foreach my $t (keys %{$thes}) { |