Ignore:
Timestamp:
2006-01-24T10:29:34+13:00 (18 years ago)
Author:
kjdon
Message:

made all plugins that implement read() call read_block to check process_exp, block_exp, smart blocking, cover image blocking etc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/PagedImgPlug.pm

    r10613 r11090  
    539539    my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $total_count, $gli) = @_;
    540540    my $outhandle   = $self->{'outhandle'};
    541     my $smart_block = $self->{'smart_block'};
    542    
    543     my $filename = &util::filename_cat($base_dir, $file);
    544    
    545     if ($self->associate_with($file,$filename,$metadata)) {
    546     # a form of smart block
    547     $self->{'num_blocked'} ++;
    548     return 0; # blocked
    549     }
    550    
    551     if ($smart_block) {
    552     if (defined $self->{'file_blocks'}->{$filename} && $self->{'file_blocks'}->{$filename} == 1){
    553         $self->{'num_blocked'} ++;
    554         return 0; # blocked
    555     }
    556     } elsif ($self->{'block_exp'} ne "" && $filename =~ /$self->{'block_exp'}/) {
    557     $self->{'num_blocked'} ++;
    558     return 0; # blocked
    559     }
    560    
    561     if ($filename !~ /$self->{'process_exp'}/ || !-f $filename) {
    562     return undef;
    563     }
     541   
     542    #check process and block exps, smart block, etc
     543    my ($block_status,$filename) = $self->read_block(@_);   
     544    return $block_status if ((!defined $block_status) || ($block_status==0));
    564545   
    565546    print $outhandle "PagedImgPlug processing \"$filename\"\n"
     
    731712    # assign pagenum as  what??
    732713    my $pagenum = $_{'pagenum'}; #TODO!!
    733     $doc_obj->set_utf8_metadata_element($self->{'current_section'}, 'PageNum', $pagenum);
     714    if (defined $pagenum) {
     715        $doc_obj->set_utf8_metadata_element($self->{'current_section'}, 'PageNum', $pagenum);
     716    }
    734717    my ($imgfile) = $_{'imgfile'};
    735718    if (defined $imgfile) {
     
    832815    $doc_obj->set_OIDtype ($processor->{'OIDtype'});
    833816    my $topsection = $doc_obj->get_top_section();
     817    $doc_obj->add_utf8_metadata($topsection, "Plugin", "$self->{'plugin_type'}");
     818    $doc_obj->add_metadata($topsection, "FileFormat", "PagedImg");
    834819
    835820    if ($self->{'documenttype'} eq 'paged') {
     
    849834    next unless $line =~ /\w/;
    850835    chomp $line;
     836    next if $line =~ /^#/; # ignore comment lines
    851837    if ($line =~ /^<([^>]*)>\s*(.*?)\s*$/) {
    852838        $doc_obj->set_utf8_metadata_element ($topsection, $1, $2);
Note: See TracChangeset for help on using the changeset viewer.