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/DBPlugin.pm

    r16104 r16392  
    8080sub read {
    8181    my $self = shift (@_);
    82     my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs,$total_count,$gli) = @_;
     82    my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $processor, $maxdocs,$total_count,$gli) = @_;
    8383       
    8484     #see if we can handle the passed file...
    85      my ($block_status,$filename) = $self->read_block(@_);   
    86      return $block_status if ((!defined $block_status) || ($block_status==0));
    87 
     85    my ($filename_full_path, $filename_no_path) = &util::get_full_filenames($base_dir, $file);
     86    return undef unless $self->can_process_this_file($filename_full_path);
     87   
    8888    my $outhandle = $self->{'outhandle'};
    8989    my $verbosity = $self->{'verbosity'};
     
    120120
    121121    # read in config file.
    122     if (!open (CONF, $filename)) {
    123         print $outhandle "DBPlugin: can't read $filename: $!\n";
     122    if (!open (CONF, $filename_full_path)) {
     123        print $outhandle "DBPlugin: can't read $filename_full_path: $!\n";
    124124        return 0;
    125125    }
     
    172172            $err =~ s/\.$//; # remove a trailing .
    173173            print $outhandle "DBPlugin: error evaluating `$statement'\n";
    174             print $outhandle " $err (in $filename)\n";
     174            print $outhandle " $err (in $filename_full_path)\n";
    175175            return 0; # there was an error reading the config file
    176176        }
     
    189189   
    190190    if (!defined($db)) {
    191     print $outhandle "DBPlugin: error: $filename does not specify a db!\n";
     191    print $outhandle "DBPlugin: error: $filename_full_path does not specify a db!\n";
    192192    return 0;
    193193    }
     
    254254
    255255    # create a new document
    256     my $doc_obj = new doc ($filename, "indexed_doc");
     256    my $doc_obj = new doc ($filename_full_path, "indexed_doc");
    257257    $doc_obj->set_OIDtype ($processor->{'OIDtype'}, $processor->{'OIDmetadata'});
    258258    my $cursection = $doc_obj->get_top_section();
     
    272272
    273273    if ($self->{'cover_image'}) {
    274         $self->associate_cover_image($doc_obj, $filename);
     274        $self->associate_cover_image($doc_obj, $filename_full_path);
    275275    }
    276276    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}");
Note: See TracChangeset for help on using the changeset viewer.