Changeset 22330

Show
Ignore:
Timestamp:
30.06.2010 13:31:14 (10 years ago)
Author:
kjdon
Message:

we want to store the original file name not the tidy filename as the source file

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/HTMLPlugin.pm

    r21800 r22330  
    269269    my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $processor, $maxdocs, $total_count, $gli) = @_; 
    270270         
     271    my ($filename_full_path, $filename_no_path) = &util::get_full_filenames($base_dir, $file); 
    271272    # get the input file 
    272273    my $input_filename = $file; 
    273274    my ($tailname, $dirname, $suffix) = &File::Basename::fileparse($input_filename, "\\.[^\\.]+\$"); 
    274275    $suffix = lc($suffix);    
    275      
     276    my $tidy_filename; 
    276277    if (($self->{'use_realistic_book'}) || ($self->{'old_style_HDL'})) 
    277278    { 
     
    284285    # get the tidied file 
    285286    #my $tidy_filename = $self->tmp_tidy_file($input_filename); 
    286     my $tidy_filename = $self->convert_tidy_or_oldHDL_file($input_filename); 
     287    $tidy_filename = $self->convert_tidy_or_oldHDL_file($input_filename); 
    287288     
    288289    # derive tmp filename from input filename 
     
    296297    # call the parent read_into_doc_obj 
    297298    my ($process_status,$doc_obj) = $self->SUPER::read_into_doc_obj($pluginfo, $base_dir, $file, $block_hash, $metadata, $processor, $maxdocs, $total_count, $gli); 
    298      
     299    if (($self->{'use_realistic_book'}) || ($self->{'old_style_HDL'})) 
     300    { 
     301    # now we need to reset the filenames in the doc obj so that the converted filenames are not used 
     302    my $collect_file = &util::filename_within_collection($filename_full_path); 
     303    $doc_obj->set_source_filename ($collect_file, $self->{'file_rename_method'});  
     304    ## set_source_filename does not set the doc_obj source_path which is used in archives dbs for incremental 
     305    # build. so set it manually. 
     306    $doc_obj->{'source_path'} = $filename_full_path; 
     307    my $collect_conv_file = &util::filename_within_collection($tidy_filename); 
     308    $doc_obj->set_converted_filename($collect_conv_file); 
     309    $self->set_Source_metadata($doc_obj, $filename_no_path); 
     310    } 
    299311    return ($process_status,$doc_obj); 
    300312}