/[webpac2]/trunk/lib/WebPAC/Output/Estraier.pm
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 /trunk/lib/WebPAC/Output/Estraier.pm

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

revision 291 by dpavlin, Sun Dec 18 23:34:24 2005 UTC revision 303 by dpavlin, Mon Dec 19 23:29:25 2005 UTC
# Line 90  sub new { Line 90  sub new {
90          my $url = $self->{masterurl} . '/node/' . $self->{database};          my $url = $self->{masterurl} . '/node/' . $self->{database};
91          $self->{url} = $url;          $self->{url} = $url;
92    
93          $log->info("opening Hyper Estraier index $self->{url}");          $log->debug("opening index $self->{url}");
94    
95          my $nodes = $self->master( action => 'nodelist' );          my $nodes = $self->master( action => 'nodelist' );
96    
97          $log->debug("nodes found: $nodes");          $log->debug("nodes found: $nodes");
98    
99          if ($nodes !~ m/^$self->{database}\t/sm) {          if ($nodes !~ m/^$self->{database}\t/sm) {
100                  $log->info("creating index $url");                  $log->warn("creating index $url");
101                  $self->master(                  $self->master(
102                          action => 'nodeadd',                          action => 'nodeadd',
103                          name => $self->{database},                          name => $self->{database},
# Line 109  sub new { Line 109  sub new {
109          $self->{'db'}->set_auth($self->{'user'}, $self->{passwd});          $self->{'db'}->set_auth($self->{'user'}, $self->{passwd});
110    
111          my $encoding = $self->{'encoding'} || 'ISO-8859-2';          my $encoding = $self->{'encoding'} || 'ISO-8859-2';
112          $log->info("using encoding $encoding");          $log->info("using index $self->{url} with encoding $encoding");
113    
114          $self->{'iconv'} = new Text::Iconv($encoding, 'UTF-8') or          $self->{'iconv'} = new Text::Iconv($encoding, 'UTF-8') or
115                  $log->logdie("can't create conversion from $encoding to UTF-8");                  $log->logdie("can't create conversion from $encoding to UTF-8");
# Line 263  sub add_link { Line 263  sub add_link {
263    
264          $log->debug("got labels: ", join("|", @labels));          $log->debug("got labels: ", join("|", @labels));
265    
266          @labels = grep(/^$args->{to}/, @labels);          @labels = grep(/^$args->{to}\t/, @labels);
267            my $label = shift @labels;
268          my (undef,$label) = split(/\t/, shift @labels);          $label = split(/\t/, $label)->[1] if ($label);
269    
270          if (! $label) {          if (! $label) {
271                  $log->warn("can't find label for $args->{to}, skipping link creaton");                  $log->warn("can't find label for $args->{to}, skipping link creaton");

Legend:
Removed from v.291  
changed lines
  Added in v.303

  ViewVC Help
Powered by ViewVC 1.1.26