Changeset 23279

Show
Ignore:
Timestamp:
03.11.2010 10:47:16 (9 years ago)
Author:
kjdon
Message:

in extra_metadata, new special case for gsdlzipfilename metadata - if set, it means that the file had come from a zip, so the source_path of the doc obj needs to be set to the zip file, otherwise incremental import doesn't work.

Files:
1 modified

Legend:

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

    r23212 r23279  
    11141114        $doc_obj->add_utf8_metadata ($cursection, "equivlink", $equiv_form);  
    11151115    } 
     1116    elsif ($field eq "gsdlzipfilename") { 
     1117        # special case for when files have come out of a zip. source_path  
     1118        # (used for archives dbs and keeping track for incremental import) 
     1119        # must be set to the zip file name 
     1120        my $zip_filename = $metadata->{$field}; 
     1121        # overwrite the source_path 
     1122        $doc_obj->{'source_path'} = $zip_filename; 
     1123        # and set the metadata 
     1124        $zip_filename = &util::filename_within_collection($zip_filename); 
     1125        $zip_filename = $doc_obj->encode_filename($zip_filename, $self->{'file_rename_method'}); 
     1126        $doc_obj->add_utf8_metadata ($cursection, $field, $zip_filename); 
     1127    } 
    11161128    elsif (ref ($metadata->{$field}) eq "ARRAY") { 
    11171129        map {