/[webpac]/trunk/all2xml.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/all2xml.pl

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

revision 678 by dpavlin, Sun Feb 27 23:07:35 2005 UTC revision 679 by dpavlin, Mon Feb 28 10:01:34 2005 UTC
# Line 64  my %type2tag = ( Line 64  my %type2tag = (
64          'excel' => 'column',          'excel' => 'column',
65          'marc' => 'marc',          'marc' => 'marc',
66          'feed' => 'feed',          'feed' => 'feed',
         'dbf' => 'isis',        # special case, re-use isis import_xml  
67  );  );
68    
69  my $cache;      # for cacheing  my $cache;      # for cacheing
# Line 226  sub data2xml { Line 225  sub data2xml {
225    
226                  my ($swish,$display);                  my ($swish,$display);
227    
228                  my $tag = $type2tag{$type} || die "can't find which tag to use for type $type";                  my $tag = $cfg->val($database, 'import_xml_tag') || $type2tag{$type} || die "can't find which tag to use for type $type";
229    
230                  # is this field page-by-page?                  # is this field page-by-page?
231                  my $iterate_by_page = $config->{indexer}->{$field}->{iterate_by_page};                  my $iterate_by_page = $config->{indexer}->{$field}->{iterate_by_page};
# Line 668  foreach my $database ($cfg->Sections) { Line 667  foreach my $database ($cfg->Sections) {
667                  print STDERR "opening lookup file '$lookup_file'\n";                  print STDERR "opening lookup file '$lookup_file'\n";
668          }          }
669    
670          my $import_xml_file = "./import_xml/$type.xml";          my $import_xml_type = $cfg->val($database, 'import_xml_file') || $type;
671            my $import_xml_file = "./import_xml/$import_xml_type.xml";
672    
673          if (! -r $import_xml_file) {          if (! -r $import_xml_file) {
674                  print STDERR "ERROR: file $import_xml_file not readable skipping!\n";                  print STDERR "ERROR: file $import_xml_file not readable skipping!\n";
# Line 681  foreach my $database ($cfg->Sections) { Line 681  foreach my $database ($cfg->Sections) {
681          my $type_base = $type;          my $type_base = $type;
682          $type_base =~ s/_.+$//g;          $type_base =~ s/_.+$//g;
683    
684          $config=XMLin($import_xml_file, ForceArray => [ $type2tag{$type_base}, 'config', 'format' ], ForceContent => 1 );          my $tag = $cfg->val($database, 'import_xml_tag') || $type2tag{$type_base} || die "can't find which tag to use for type $type";
685            $config=XMLin($import_xml_file, ForceArray => [ $tag, 'config', 'format' ], ForceContent => 1 );
686    
687          # helper for progress bar          # helper for progress bar
688          sub fmt_time {          sub fmt_time {
# Line 743  foreach my $database ($cfg->Sections) { Line 744  foreach my $database ($cfg->Sections) {
744          }          }
745    
746          # now read database          # now read database
 print STDERR "using: $type...\n";  
747    
748          # erase cache for tags by order in this database          # erase cache for tags by order in this database
749          delete $cache->{tags_by_order};          delete $cache->{tags_by_order};

Legend:
Removed from v.678  
changed lines
  Added in v.679

  ViewVC Help
Powered by ViewVC 1.1.26