Changeset 1401 for trunk


Ignore:
Timestamp:
2000-08-15T10:51:03+12:00 (24 years ago)
Author:
davidb
Message:

Fixed small problem with associated files.

File:
1 edited

Legend:

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

    r1269 r1401  
    149149    # add the associated files
    150150    my $assoc_files = $doc_obj->get_metadata($doc_obj->get_top_section(), "gsdlassocfile");
    151     my ($assoc_file_info, $afile);
    152     foreach $assoc_file_info (@$assoc_files) {
     151    my ($assoc_file_info);
     152
     153    foreach $assoc_file_info (@$assoc_files)
     154    {
    153155        my ($assoc_file, $mime_type, $dir) = split (":", $assoc_file_info);
    154         if (defined $dir && $dir =~ /\w/) {
    155         $afile = &util::filename_cat($dir, $assoc_file);
    156         } else {
    157         $afile = $assoc_file;
    158         }
    159         $doc_obj->associate_file(&util::filename_cat($parent_dir, $assoc_file),
    160                      $afile, $mime_type);
     156        my $real_dir = &util::filename_cat($parent_dir, $assoc_file),
     157        my $assoc_dir = (defined $dir && $dir ne "")
     158        ? &util::filename_cat($dir, $assoc_file) : $assoc_file;
     159        $doc_obj->associate_file($real_dir, $assoc_dir, $mime_type);
     160       
    161161    }
    162162    $doc_obj->delete_metadata($doc_obj->get_top_section(), "gsdlassocfile");
    163    
     163
    164164    # add metadata passed in from elsewhere
    165165    $self->extra_metadata ($doc_obj, $doc_obj->get_top_section(), $metadata);
     
    169169
    170170    # assume the document has an OID already
    171    
     171
    172172    # process the document
    173173    $processor->process($doc_obj, $file);
     
    177177    last unless defined $gml && $gml =~ /\w/;
    178178    } # while(1) document level
    179 
     179   
    180180    return $no_docs; # no of docs processed
    181181}
Note: See TracChangeset for help on using the changeset viewer.