Changeset 23279


Ignore:
Timestamp:
11/03/10 10:47:16 (10 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.

File:
1 edited

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 {
Note: See TracChangeset for help on using the changeset viewer.