/[webpac]/trunk2/all2all.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk2/all2all.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 424 by dpavlin, Sat Sep 11 22:32:06 2004 UTC revision 425 by dpavlin, Sat Sep 11 23:32:41 2004 UTC
# Line 56  $log->info("rows: $maxmfn"); Line 56  $log->info("rows: $maxmfn");
56    
57  $webpac->open_import_xml(type => 'isis_hidra_ths');  $webpac->open_import_xml(type => 'isis_hidra_ths');
58    
59  if(0) { # XXX  if(1) { # XXX
60    
61  while (my $rec = $webpac->fetch_rec) {  while (my $rec = $webpac->fetch_rec) {
62    
# Line 202  my @tree = ({ Line 202  my @tree = ({
202          lookup_v900     => sub { shift },          lookup_v900     => sub { shift },
203          lookup_term     => sub { shift @{$l->{"d:".$_[0]}} },          lookup_term     => sub { shift @{$l->{"d:".$_[0]}} },
204          lookup_mfn      => sub { shift @{$l->{"900_mfn:".$_[0]}} },          lookup_mfn      => sub { shift @{$l->{"900_mfn:".$_[0]}} },
205            have_children   => sub { $l->{"a:".$_[2].":".$_[1]} },
206            child_code      => sub { return "a:".$_[2].":".$_[1] },
207            style           => 'display: none',
208            },{
209            # 3 uži pojam
210            code_arr        => sub { @{$l->{$_[0]}} },
211            filter_code     => sub { shift },
212            lookup_v900     => sub { shift },
213            lookup_term     => sub { shift @{$l->{"d:".$_[1]}} },
214            lookup_mfn      => sub { shift @{$l->{"900_mfn:".$_[1]}} },
215          have_children   => sub { 0 },          have_children   => sub { 0 },
216          child_code      => sub { 0 },          child_code      => sub { 0 },
   
217  });  });
218    
219  unroll(0,'');  unroll(0,'');
# Line 236  sub unroll { Line 245  sub unroll {
245    
246                          $log->debug("$code -> $v900 : $term [$mfn]");                          $log->debug("$code -> $v900 : $term [$mfn]");
247    
248                          print HTML " " x $level .          
249                                  qq{<li><a href="#mfn$mfn" onClick="return hide_show('mfn$mfn');">$term</a>&nbsp;<a href="thes/$mfn.html">&raquo;</a></li>\n} if (-e "out/thes/$mfn.html");                          my $have_children = $tree[$level]->{'have_children'}->($code,$v900,$start_code);
250    
251                            my ($link_start,$link_end) = ('','');
252    
253                            ($link_start,$link_end) = (qq{<a href="#mfn$mfn" onClick="return hide_show('mfn$mfn');">},qq{</a>}) if ($have_children);
254    
255                          unless ($tree[$level]->{'have_children'}->($code,$v900)) {                          my $mfn_link = "thes/$mfn.html";
256                                  $log->warn("can't find children of $code at level $level");                          if (-e "out/$mfn_link") {
257                                    print HTML " " x $level .
258                                            qq{<li>${link_start}${term}${link_end}}.
259                                            qq{&nbsp;<a href="$mfn_link">&raquo;</a></li>\n};
260                            } else {
261                                    $log->warn("file 'out/$mfn_link' doesn't exist, skipping");
262                            }
263    
264                            unless ($have_children) {
265                                    $log->warn("doesn't have_children($code,$v900,$start_code)");
266                                  next;                                  next;
267                          }                          }
268                                                    
# Line 249  sub unroll { Line 271  sub unroll {
271                                  ($tree[$level]->{'style'} ? ' style="'.$tree[$level]->{'style'}.'"' : '').                                  ($tree[$level]->{'style'} ? ' style="'.$tree[$level]->{'style'}.'"' : '').
272                                  qq{>\n};                                  qq{>\n};
273    
274                          unroll($level+1, $tree[$level]->{'child_code'}->($code,$v900));                          unroll($level+1, $tree[$level]->{'child_code'}->($code,$v900,$start_code));
275                                                    
276                          print HTML " " x $level . qq{</ul>\n};                          print HTML " " x $level . qq{</ul>\n};
277    
# Line 263  print HTML qq{ Line 285  print HTML qq{
285  </html>  </html>
286  };  };
287    
288    close(HTML);
289    
290  $index->close;  $index->close;
291    
292  $log->info("elapsed time: ",$webpac->fmt_time(time() - $webpac->{'start_t'}));  $log->info("elapsed time: ",$webpac->fmt_time(time() - $webpac->{'start_t'}));

Legend:
Removed from v.424  
changed lines
  Added in v.425

  ViewVC Help
Powered by ViewVC 1.1.26