Changeset 14176

Show
Ignore:
Timestamp:
13.06.2007 16:24:36 (12 years ago)
Author:
qq6
Message:

modified by Shaoqun

Files:
1 modified

Legend:

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

    r14174 r14176  
    371371    # add NoText metadata which can be used to suppress the dummy text 
    372372    $doc_obj->add_metadata ($section, "NoText", "1"); 
    373      
    374          
     373 
    375374    if ($type eq "unknown" && $image_type) { 
    376375    $type = $image_type; 
     
    685684{ 
    686685    my $self = shift (@_); 
    687     my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $total_count, $gli) = @_; 
    688  
    689     my ($process_status,$doc_obj) = $self->read_into_doc_obj(@_); 
     686    my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $total_count, $gli) = @_;    my ($process_status,$doc_obj) = $self->read_into_doc_obj(@_); 
    690687 
    691688    if ((defined $process_status) && ($process_status == 1)) { 
     
    744741    if (defined($txtfile)&& $txtfile ne "") { 
    745742        $self->process_text ($self->{'base_dir'}.$txtfile, $txtfile, $doc_obj, $self->{'current_section'}); 
     743            $doc_obj->set_metadata_element($self->{'current_section'},"NoText","0"); 
    746744    } else { 
    747745        # otherwise add in some dummy text 
     
    749747        my $text = &gsprintf::lookup_string("{BasPlug.dummy_text}",1); 
    750748        $doc_obj->add_utf8_text($self->{'current_section'}, $text); 
     749            $doc_obj->add_metadata($self->{'current_section'},"NoText","1");  
    751750    } 
    752751    } elsif ($element eq "Metadata") { 
     
    851850 
    852851    $doc_obj->add_metadata ($topsection, "Source", $file); 
    853  
    854852 
    855853    open (ITEMFILE, $filename) || die "couldn't open $filename\n"; 
     
    874872        # the page number becomes the Title 
    875873        $doc_obj->set_utf8_metadata_element($cursection, 'Title', $pagenum); 
    876         # add NoText metadata which can be used to suppress the dummy text 
    877         $doc_obj->add_metadata($cursection, "NoText", "1"); 
    878  
     874      
    879875        # process the image for this page if there is one 
    880876        if (defined $imgname && $imgname ne "") { 
     
    889885        if (defined $txtname && $txtname ne "") { 
    890886        my $result2 = $self->process_text ($dir.$txtname, $txtname, $doc_obj, $cursection); 
     887                
    891888        if (!defined $result2) { 
    892889            print "PagedImgPlug: couldn't process text file \"$dir.$txtname\" for item \"$filename\"\n"; 
     890        } 
     891                else{ 
     892            $doc_obj->set_metadata_element($cursection, "NoText", "0"); 
    893893        } 
    894894        } else { 
    895895        # otherwise add in some dummy text  
    896896        $doc_obj->add_text($cursection, &gsprintf::lookup_string("{BasPlug.dummy_text}")); 
    897         } 
     897                 # add NoText metadata which can be used to suppress the dummy text 
     898         } 
    898899    } 
    899900    }