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 |
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}; |
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"; |
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 { |
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}; |