/[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 256 by dpavlin, Fri Dec 16 01:47:20 2005 UTC revision 303 by dpavlin, Mon Dec 19 23:29:25 2005 UTC
# Line 17  WebPAC::Output::Estraier - Create Hyper Line 17  WebPAC::Output::Estraier - Create Hyper
17    
18  =head1 VERSION  =head1 VERSION
19    
20  Version 0.05  Version 0.07
21    
22  =cut  =cut
23    
24  our $VERSION = '0.05';  our $VERSION = '0.07';
25    
26  =head1 SYNOPSIS  =head1 SYNOPSIS
27    
# 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 239  sub master { Line 239  sub master {
239                  validate => 'master',                  validate => 'master',
240                  rest_url => $self->{masterurl} . '/master?action=' . $action ,                  rest_url => $self->{masterurl} . '/master?action=' . $action ,
241                  action => $action,                  action => $action,
242                    %{ $args },
243          );          );
244  }  }
245    
# Line 262  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");
# Line 322  sub estcall { Line 323  sub estcall {
323                  $del = '&';                  $del = '&';
324          }          }
325    
326          $url_args =~ s#^\&#?# if ($url =~ m#\?#);          $url .= $url_args if ($url_args);
         $url .= $url_args;  
327    
328          $log->debug("calling $url");          $log->debug("calling $url");
329    

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

  ViewVC Help
Powered by ViewVC 1.1.26