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

    r16104 r16392  
    118118sub metadata_read {
    119119    my $self = shift (@_); 
    120     my ($pluginfo, $base_dir, $file, $metadata, $extrametakeys, $extrametadata, $processor, $maxdocs, $gli) = @_;
     120    my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $extrametakeys, $extrametadata, $processor, $maxdocs, $gli) = @_;
    121121
    122122    # returns 1 if matches process_exp, and has done blocking in the meantime
    123     my $matched = $self->SUPER::metadata_read($pluginfo, $base_dir, $file,
     123    my $matched = $self->SUPER::metadata_read($pluginfo, $base_dir, $file,
     124                          $block_hash,
    124125                          $metadata, $extrametakeys,
    125126                          $extrametadata, $processor,
     
    192193sub read {
    193194    my $self = shift (@_);
    194     my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $total_count, $gli) = @_;
     195    my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $processor, $maxdocs, $total_count, $gli) = @_;
    195196    my $outhandle = $self->{'outhandle'};
    196197    my $verbosity = $self->{'verbosity'};
    197198
    198     #check process and block exps, smart block, etc
    199     my ($block_status,$filename) = $self->read_block(@_);   
    200     return $block_status if ((!defined $block_status) || ($block_status==0));
     199    # can we process this file??
     200    my ($filename_full_path, $filename_no_path) = &util::get_full_filenames($base_dir, $file);
     201    return undef unless $self->can_process_this_file($filename_full_path);
    201202
    202203    $file =~ s/^[\/\\]+//; # $file often begins with / so we'll tidy it up
     
    232233
    233234    # create a new document
    234     my $doc_obj = new doc ($filename, "indexed_doc");
     235    my $doc_obj = new doc ($filename_full_path, "indexed_doc");
    235236    $doc_obj->set_OIDtype ($processor->{'OIDtype'}, $processor->{'OIDmetadata'});
    236237    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Language", $language);
     
    240241    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "SourceSegment", "$segment");
    241242    if ($self->{'cover_image'}) {
    242         $self->associate_cover_image($doc_obj, $filename);
     243        $self->associate_cover_image($doc_obj, $filename_full_path);
    243244    }
    244245    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}");
Note: See TracChangeset for help on using the changeset viewer.