/[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 512 by dpavlin, Mon May 15 18:27:15 2006 UTC revision 516 by dpavlin, Tue May 16 15:23:12 2006 UTC
# Line 14  use WebPAC::Store 0.03; Line 14  use WebPAC::Store 0.03;
14  use WebPAC::Normalize::XML;  use WebPAC::Normalize::XML;
15  use WebPAC::Normalize::Set;  use WebPAC::Normalize::Set;
16  use WebPAC::Output::TT;  use WebPAC::Output::TT;
17    use WebPAC::Validate;
18  use YAML qw/LoadFile/;  use YAML qw/LoadFile/;
19  use Getopt::Long;  use Getopt::Long;
20  use File::Path;  use File::Path;
# Line 63  C<.xml> to C<.pl> Line 64  C<.xml> to C<.pl>
64  disable indexing and dump statistics about field and subfield  disable indexing and dump statistics about field and subfield
65  usage for each input  usage for each input
66    
67    =item --validate path/to/validation_file
68    
69    turn on extra validation of imput records, see L<WebPAC::Validation>
70    
71  =back  =back
72    
73  =cut  =cut
# Line 76  my $debug = 0; Line 81  my $debug = 0;
81  my $only_filter;  my $only_filter;
82  my $force_set = 0;  my $force_set = 0;
83  my $stats = 0;  my $stats = 0;
84    my $validate_path;
85    
86  GetOptions(  GetOptions(
87          "limit=i" => \$limit,          "limit=i" => \$limit,
# Line 87  GetOptions( Line 93  GetOptions(
93          "debug" => \$debug,          "debug" => \$debug,
94          "force-set" => \$force_set,          "force-set" => \$force_set,
95          "stats" => \$stats,          "stats" => \$stats,
96            "validate=s" => \$validate_path,
97  );  );
98    
99  $config = LoadFile($config);  $config = LoadFile($config);
# Line 98  die "no databases in config file!\n" unl Line 105  die "no databases in config file!\n" unl
105  my $log = _new WebPAC::Common()->_get_logger();  my $log = _new WebPAC::Common()->_get_logger();
106  $log->info( "-" x 79 );  $log->info( "-" x 79 );
107    
108    my $validate;
109    $validate = new WebPAC::Validate(
110            path => $validate_path,
111    ) if ($validate_path);
112    
113  my $use_indexer = $config->{use_indexer} || 'hyperestraier';  my $use_indexer = $config->{use_indexer} || 'hyperestraier';
114  if ($stats) {  if ($stats) {
115          $log->debug("option --stats disables update of indexing engine...");          $log->debug("option --stats disables update of indexing engine...");
# Line 262  while (my ($database, $db_config) = each Line 274  while (my ($database, $db_config) = each
274                                  push @{ $row->{'000'} }, $pos;                                  push @{ $row->{'000'} }, $pos;
275                          }                          }
276    
277    
278                            if ($validate) {
279                                    my @errors = $validate->validate_errors( $row );
280                                    $log->error( "MFN $mfn validation errors:\n", join("\n", @errors) ) if (@errors);
281                            }
282    
283                                                                    
284                          my $ds;                          my $ds;
285                          if ($n) {                          if ($n) {

Legend:
Removed from v.512  
changed lines
  Added in v.516

  ViewVC Help
Powered by ViewVC 1.1.26