17 |
|
|
18 |
my $webpac = new WebPAC( |
my $webpac = new WebPAC( |
19 |
code_page => 'ISO-8859-2', |
code_page => 'ISO-8859-2', |
20 |
limit_mfn => 500, |
# limit_mfn => 500, |
21 |
# debug => 1, |
# debug => 1, |
22 |
) || die; |
) || die; |
23 |
|
|
41 |
# { 'eval' => '"v901^a" eq "Deskriptor"', 'key' => 'a:v561^4:v562^4:v461^1', 'val' => 'v900' }, |
# { 'eval' => '"v901^a" eq "Deskriptor"', 'key' => 'a:v561^4:v562^4:v461^1', 'val' => 'v900' }, |
42 |
{ 'key' => 'a:v561^4:v562^4:v461^1', 'val' => 'v900' }, |
{ 'key' => 'a:v561^4:v562^4:v461^1', 'val' => 'v900' }, |
43 |
{ 'key' => '900_mfn:v900', 'val' => 'v000' }, |
{ 'key' => '900_mfn:v900', 'val' => 'v000' }, |
44 |
|
# tree structure |
45 |
|
{ 'eval' => 'length("v251") == 2', 'key' => 'root:v251', 'val' => 'v900' }, |
46 |
|
{ 'eval' => '"v251"', 'key' => 'code:v900', 'val' => 'v561^4:v251' }, |
47 |
], |
], |
48 |
); |
); |
49 |
|
|
141 |
} |
} |
142 |
} |
} |
143 |
|
|
144 |
|
# |
145 |
|
# tree dump implementation which shouldn't be here :-) |
146 |
|
# |
147 |
|
|
148 |
|
my $file = 'out/browse.html'; |
149 |
|
open(HTML, "> $file") || $log->logdie("can't open '$file'"); |
150 |
|
|
151 |
|
print HTML qq{ |
152 |
|
<html> |
153 |
|
<head> |
154 |
|
<title>Browse</title> |
155 |
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"/> |
156 |
|
</head> |
157 |
|
<body> |
158 |
|
<ul> |
159 |
|
}; |
160 |
|
|
161 |
|
foreach my $code (sort keys %{$webpac->{'lookup'}}) { |
162 |
|
|
163 |
|
my $l = $webpac->{'lookup'} || $log->logconfess("can't find lookup"); |
164 |
|
|
165 |
|
if ($code =~ m/^root:/) { |
166 |
|
my $v900 = shift @{ $l->{$code} } || $log->logconfess("can't lookup '$code'"); |
167 |
|
$code =~ s/^root:// || die; |
168 |
|
|
169 |
|
my $term = shift @{ $l->{"d:${v900}"} } || die; |
170 |
|
my $mfn = shift @{ $l->{"900_mfn:${v900}"} } || die; |
171 |
|
|
172 |
|
$log->info("$code -> $v900 : $term [$mfn]"); |
173 |
|
|
174 |
|
print HTML qq{ <li><a href="thes/$mfn.html">$term</a></li>\n} if (-e "out/thes/$mfn.html"); |
175 |
|
|
176 |
|
$log->logconfess("can't find 'a:${code}::'") unless ($l->{"a:${code}::"}); |
177 |
|
|
178 |
|
print HTML qq{ <ul>\n}; |
179 |
|
|
180 |
|
foreach my $l2_v900 (@{ $l->{"a:${code}::"} }) { |
181 |
|
|
182 |
|
my $l2_code = shift @{ $l->{"code:${l2_v900}"} } || die; |
183 |
|
my $l2_term = shift @{ $l->{"d:$l2_v900"} } || die; |
184 |
|
my $l2_mfn = shift @{ $l->{"900_mfn:${l2_v900}"} } || die; |
185 |
|
|
186 |
|
$log->info("$l2_code -> $l2_v900 : $l2_term [$l2_mfn]"); |
187 |
|
|
188 |
|
print HTML qq{ <li><a href="thes/$l2_mfn.html">$l2_term</a></li>\n} if (-e "out/thes/$l2_mfn.html"); |
189 |
|
|
190 |
|
print HTML qq{ <ul>\n}; |
191 |
|
|
192 |
|
foreach my $l3_v900 (@{ $l->{"a:${l2_code}:"} }) { |
193 |
|
|
194 |
|
my $l3_term = shift @{ $l->{"d:$l3_v900"} } || die; |
195 |
|
my $l3_mfn = shift @{ $l->{"900_mfn:${l3_v900}"} } || die; |
196 |
|
|
197 |
|
$log->info(" -> $l3_v900 : $l3_term [$l3_mfn]"); |
198 |
|
|
199 |
|
print HTML qq{ <li><a href="thes/$l3_mfn.html">$l3_term</a></li>\n} if (-e "out/thes/$l3_mfn.html"); |
200 |
|
} |
201 |
|
|
202 |
|
print HTML qq{ </ul>\n}; |
203 |
|
} |
204 |
|
print HTML qq{ </ul>\n}; |
205 |
|
} |
206 |
|
} |
207 |
|
|
208 |
|
print HTML qq{ |
209 |
|
</ul> |
210 |
|
</body> |
211 |
|
</html> |
212 |
|
}; |
213 |
|
|
214 |
$index->close; |
$index->close; |
215 |
|
|