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

    r15925 r16392  
    557557
    558558# Override ConvertBinaryFile read
    559 # Needed so multiple .item files generate are sent down secondary plugin
     559# Needed so multiple .item files generated are sent down secondary plugin
    560560
    561561sub read {
    562562    my $self = shift (@_);
    563     my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $total_count, $gli) = @_;
     563    my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $processor, $maxdocs, $total_count, $gli) = @_;
    564564
    565565    $self->{'gli'} = $gli;
     
    570570    my $outhandle = $self->{'outhandle'};
    571571   
    572     my ($block_status,$filename) = $self->read_block(@_);
    573     return $block_status if ((!defined $block_status) || ($block_status==0));
     572    my ($filename_full_path, $filename_no_path) = &util::get_full_filenames($base_dir, $file);
     573    return undef unless $self->can_process_this_file($filename_full_path);
     574
    574575    $file =~ s/^[\/\\]+//; # $file often begins with / so we'll tidy it up
    575576       
     
    580581    my $conv_filename_list = [];
    581582
    582     $conv_filename_list = $self->tmp_area_convert_file($output_ext, $filename);
     583    $conv_filename_list = $self->tmp_area_convert_file($output_ext, $filename_full_path);
    583584   
    584585    if (scalar(@$conv_filename_list)==0) {
     
    611612    my ($rv,$doc_obj)
    612613        = $secondary_plugin->read_into_doc_obj ($pluginfo,"", $conv_filename,
    613                             $metadata, $processor, $maxdocs, $total_count,
     614                            $block_hash, $metadata, $processor, $maxdocs, $total_count,
    614615                            $gli);
    615616
     
    619620
    620621    # Override previous gsdlsourcefilename set by secondary plugin
    621     my $collect_file = &util::filename_within_collection($filename);
     622    my $collect_file = &util::filename_within_collection($filename_full_path);
    622623    my $collect_conv_file = &util::filename_within_collection($conv_filename);
    623624    $doc_obj->set_source_filename ($collect_file);
     
    627628    $self->set_Source_metadata($doc_obj, $filemeta);
    628629    $doc_obj->set_utf8_metadata_element($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}");
    629     $doc_obj->set_utf8_metadata_element($doc_obj->get_top_section(), "FileSize", (-s $filename));
     630    $doc_obj->set_utf8_metadata_element($doc_obj->get_top_section(), "FileSize", (-s $filename_full_path));
    630631   
    631632    if ($self->{'cover_image'}) {
    632         $self->associate_cover_image($doc_obj, $filename);
     633        $self->associate_cover_image($doc_obj, $filename_full_path);
    633634    }
    634635   
Note: See TracChangeset for help on using the changeset viewer.