Ignore:
Timestamp:
2008-07-14T14:57:38+12:00 (16 years ago)
Author:
kjdon
Message:

global block pass: read_block is no more, use can_process_this_file to see whether a file is for us or not. extra arg (block_hash) to read, read_into_doc_obj, metadata_read etc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/plugins/FOXPlugin.pm

    r15872 r16392  
    9393sub read {
    9494    my $self = shift (@_);
    95     my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $total_count, $gli) = @_;
     95    my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $processor, $maxdocs, $total_count, $gli) = @_;
    9696 
    97     #check for associate_ext, blocking etc, are we processing this file?
    98     my ($block_status,$fullname) = $self->read_block(@_);   
    99     return $block_status if ((!defined $block_status) || ($block_status==0));
     97    # can we process this file??
     98    my ($filename_full_path, $filename_no_path) = &util::get_full_filenames($base_dir, $file);
     99    return undef unless $self->can_process_this_file($filename_full_path);
    100100
    101101    print STDERR "<Processing n='$file' p='FOXPlugin'>\n" if ($gli);
    102102    print STDERR "FOXPlugin: processing $file\n" if $self->{'verbosity'} > 1;
    103103
    104     my ($parent_dir) = $fullname =~ /^(.*)\/[^\/]+\.dbf$/i;
     104    my ($parent_dir) = $filename_full_path =~ /^(.*)\/[^\/]+\.dbf$/i;
    105105
    106106    # open the file
    107     if (!open (FOXBASEIN, $fullname)) {
     107    if (!open (FOXBASEIN, $filename_full_path)) {
    108108    if ($gli) {
    109         print STDERR "<ProcessingError n='$file' r='Could not read $fullname'>\n";
    110     }
    111     print STDERR "FOXPlugin::read - couldn't read $fullname\n";
     109        print STDERR "<ProcessingError n='$file' r='Could not read $filename_full_path'>\n";
     110    }
     111    print STDERR "FOXPlugin::read - couldn't read $filename_full_path\n";
    112112    return -1; # error in processing
    113113    }
     
    141141        print STDERR "<ProcessingError n='$file' r='Does not seem to be a Foxbase file'>\n";
    142142    }
    143     print STDERR "FOXPlugin:read - $fullname doesn't seem to be a Foxbase file\n";
     143    print STDERR "FOXPlugin:read - $filename_full_path doesn't seem to be a Foxbase file\n";
    144144    return -1;
    145145    }
     
    163163
    164164    # open the dbt file if we need to
    165     my $dbtfullname = $fullname;
    166     if ($fullname =~ /f$/) {
     165    my $dbtfullname = $filename_full_path;
     166    if ($filename_full_path =~ /f$/) {
    167167    $dbtfullname =~ s/f$/t/;
    168168    } else {
Note: See TracChangeset for help on using the changeset viewer.