/[webpac2]/trunk/run.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 /trunk/run.pl

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

revision 423 by dpavlin, Wed Mar 22 00:18:56 2006 UTC revision 430 by dpavlin, Mon Apr 17 15:09:54 2006 UTC
# Line 13  use WebPAC::Input 0.03; Line 13  use WebPAC::Input 0.03;
13  use WebPAC::Store 0.03;  use WebPAC::Store 0.03;
14  use WebPAC::Normalize::XML;  use WebPAC::Normalize::XML;
15  use WebPAC::Output::TT;  use WebPAC::Output::TT;
 use WebPAC::Output::Estraier '0.10';  
16  use YAML qw/LoadFile/;  use YAML qw/LoadFile/;
17  use Getopt::Long;  use Getopt::Long;
18  use File::Path;  use File::Path;
# Line 76  $config = LoadFile($config); Line 75  $config = LoadFile($config);
75  print "config = ",Dumper($config) if ($debug);  print "config = ",Dumper($config) if ($debug);
76    
77  die "no databases in config file!\n" unless ($config->{databases});  die "no databases in config file!\n" unless ($config->{databases});
78    my $use_indexer = $config->{use_indexer} || 'hyperestraier';
79    
80  my $total_rows = 0;  my $total_rows = 0;
81  my $start_t = time();  my $start_t = time();
# Line 86  while (my ($database, $db_config) = each Line 86  while (my ($database, $db_config) = each
86    
87          my $log = _new WebPAC::Common()->_get_logger();          my $log = _new WebPAC::Common()->_get_logger();
88    
89          #          my $indexer;
90          # open Hyper Estraier database  
91          #          if ($use_indexer eq 'hyperestraier') {
92    
93          my $est_config = $config->{hyperestraier} || $log->logdie("can't find 'hyperestraier' part in confguration");                  #
94          $est_config->{database} = $database;                  # open Hyper Estraier database
95          $est_config->{clean} = $clean;                  #
96          $est_config->{label} = $db_config->{name};  
97                    use WebPAC::Output::Estraier '0.10';
98                    my $est_config = $config->{hyperestraier} || $log->logdie("can't find 'hyperestraier' part in confguration");
99                    $est_config->{database} = $database;
100                    $est_config->{clean} = $clean;
101                    $est_config->{label} = $db_config->{name};
102    
103                    $indexer = new WebPAC::Output::Estraier( %{ $est_config } );
104            } else {
105                    $log->logdie("unknown use_indexer: $use_indexer");
106            }
107    
108          my $est = new WebPAC::Output::Estraier( %{ $est_config } );          $log->logide("can't continue without valid indexer") unless ($indexer);
109    
110          #          #
111          # now WebPAC::Store          # now WebPAC::Store
# Line 199  while (my ($database, $db_config) = each Line 209  while (my ($database, $db_config) = each
209    
210                          my $ds = $n->data_structure($row);                          my $ds = $n->data_structure($row);
211    
212                          $est->add(                          $indexer->add(
213                                  id => $input->{name} . "/" . $mfn,                                  id => $input->{name} . "/" . $mfn,
214                                  ds => $ds,                                  ds => $ds,
215                                  type => $config->{hyperestraier}->{type},                                  type => $config->{$use_indexer}->{type},
216                          );                          );
217    
218                          $total_rows++;                          $total_rows++;
# Line 217  while (my ($database, $db_config) = each Line 227  while (my ($database, $db_config) = each
227                  )                  )
228          );          );
229    
230          #          if ($use_indexer eq 'hyperestraier') {
231          # add Hyper Estraier links to other databases                  #
232          #                  # add Hyper Estraier links to other databases
233          if (ref($db_config->{links}) eq 'ARRAY') {                  #
234                  foreach my $link (@{ $db_config->{links} }) {                  if (ref($db_config->{links}) eq 'ARRAY') {
235                          $log->info("adding link $database -> $link->{to} [$link->{credit}]");                          foreach my $link (@{ $db_config->{links} }) {
236                          $est->add_link(                                  $log->info("adding link $database -> $link->{to} [$link->{credit}]");
237                                  from => $database,                                  $indexer->add_link(
238                                  to => $link->{to},                                          from => $database,
239                                  credit => $link->{credit},                                          to => $link->{to},
240                          );                                          credit => $link->{credit},
241                                    );
242                            }
243                  }                  }
244            } else {
245                    $log->warn("links not implemented for $use_indexer");
246          }          }
247    
248  }  }

Legend:
Removed from v.423  
changed lines
  Added in v.430

  ViewVC Help
Powered by ViewVC 1.1.26