Changeset 32147

Show
Ignore:
Timestamp:
20.02.2018 09:48:21 (7 months ago)
Author:
kjdon
Message:

take the image and ocr files from nzdl-storage instead of copying them into import

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/model-sites-dev/pei-jones/collect/written-works/perllib/plugins/PJPlugin.pm

    r31940 r32147  
    1818                'inherits' => "yes", 
    1919                'args'     => $arguments }; 
     20 
     21my $files_dir ="/nzdl-storage/other-projects/pei-jones/Jones_Collection/"; 
     22 
     23sub begin { 
     24    my $self = shift (@_); 
     25    my ($pluginfo, $base_dir, $processor, $maxdocs) = @_; 
     26 
     27    # Save base_dir for use in file cache                                                                                               
     28    $self->{'base_dir'} = $files_dir; 
     29} 
     30 
    2031 
    2132sub new { 
     
    8293        $doc_obj->set_utf8_metadata_element($cursection, 'Title', $pagenum); 
    8394      
     95        print STDERR "image file $files_dir$imgname\n"; 
     96          
    8497        # process the image for this page if there is one 
    8598        if (defined $imgname && $imgname ne "") { 
    86         my $result1 = $self->process_image($dir.$imgname, $imgname, $doc_obj, $cursection, $rotate); 
     99        my $result1 = $self->process_image($files_dir.$imgname, $imgname, $doc_obj, $cursection, $rotate); 
    87100        if (!defined $result1) 
    88101        { 
    89             print "PagedImagePlugin: couldn't process image \"$dir$imgname\" for item \"$filename_full_path\"\n"; 
     102            print "PagedImagePlugin: couldn't process image \"$files_dir$imgname\" for item \"$filename_full_path\"\n"; 
    90103        } 
    91104        } 
    92105        # process the text file if one is there 
    93106        if (defined $txtname && $txtname ne "") { 
    94         my $result2 = $self->process_text ($dir.$txtname, $txtname, $doc_obj, $cursection); 
     107        my $result2 = $self->process_text ($files_dir.$txtname, $txtname, $doc_obj, $cursection); 
    95108                
    96109        if (!defined $result2) { 
    97             print "PagedImagePlugin: couldn't process text file \"$dir.$txtname\" for item \"$filename_full_path\"\n"; 
     110            print "PagedImagePlugin: couldn't process text file \"$files_dir.$txtname\" for item \"$filename_full_path\"\n"; 
    98111            $self->add_dummy_text($doc_obj, $cursection); 
    99112        }