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

    r16247 r16392  
    491491{
    492492    my $self = shift (@_); 
    493     my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $total_count, $gli) = @_;
    494    
    495     # check the process_exp and block_exp thing
    496     my ($block_status,$filename) = $self->read_block(@_);   
    497     return $block_status if ((!defined $block_status) || ($block_status==0));
    498    
     493    my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $processor, $maxdocs, $total_count, $gli) = @_;
     494       
    499495    # get the input file
    500496    my $input_filename = $file;
     
    523519   
    524520    # call the parent read_into_doc_obj
    525     my ($process_status,$doc_obj) = $self->SUPER::read_into_doc_obj($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $total_count, $gli);
     521    my ($process_status,$doc_obj) = $self->SUPER::read_into_doc_obj($pluginfo, $base_dir, $file, $block_hash, $metadata, $processor, $maxdocs, $total_count, $gli);
    526522   
    527523    return ($process_status,$doc_obj);
     
    554550    my $self = shift (@_);
    555551   
    556     return q^(?i)\.(gif|jpe?g|jpe|jpg|png|css)$^;
     552    #return q^(?i)\.(gif|jpe?g|jpe|jpg|png|css)$^;
     553    return "";
    557554}
    558555
     
    567564{
    568565    my $self =shift (@_);
    569     my ($filename) = @_;
    570     my $html_fname = $filename;
     566    my ($filename_full_path, $block_hash) = @_;
     567
     568    my $html_fname = $filename_full_path;
    571569    my @file_blocks;
    572570   
    573     my ($language, $encoding) = $self->textcat_get_language_encoding ($filename);
     571    my ($language, $encoding) = $self->textcat_get_language_encoding ($filename_full_path);
    574572
    575573    # read in file ($text will be in utf8)
    576574    my $text = "";
    577     $self->read_file ($filename, $encoding, $language, \$text);
     575    $self->read_file ($filename_full_path, $encoding, $language, \$text);
    578576    my $textref = \$text;
    579577    my $opencom = '(?:<!--|&lt;!(?:&mdash;|&#151;|--))';
     
    600598    if ($link !~ m@^/@ && $link !~ m/^([A-Z]:?)\\/) {
    601599        # Turn relative file path into full path
    602         my $dirname = &File::Basename::dirname($filename);
     600        my $dirname = &File::Basename::dirname($filename_full_path);
    603601        $link = &util::filename_cat($dirname, $link);
    604602    }
    605603    $link = $self->eval_dir_dots($link);
    606604   
    607     $self->{'file_blocks'}->{$link} = 1;
     605    $block_hash->{'file_blocks'}->{$link} = 1;
    608606    }
    609607}
Note: See TracChangeset for help on using the changeset viewer.