Changeset 3629


Ignore:
Timestamp:
2002-12-10T17:44:16+13:00 (21 years ago)
Author:
jrm21
Message:

need to look for associated files in the assocfilepath, if this metadata
exists. This is not necessarily the same directory as doc.xml is in -
for example if using the -groupsize option to put more than one doc in
each .xml file.

File:
1 edited

Legend:

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

    r3540 r3629  
    149149    $self->{'doc_obj'}->get_metadata($self->{'doc_obj'}->get_top_section(), "gsdlassocfile");
    150150
    151     my $parent_dir = $self->{'filename'};
    152     $parent_dir =~ s/[^\\\/]*$//;
     151    # for when "assocfilepath" isn't the same directory that doc.xml is in...
     152    my $assoc_filepath_list= $self->{'doc_obj'}->get_metadata($self->{'doc_obj'}->get_top_section(), "assocfilepath");
     153
     154    my $assoc_filepath=shift (@$assoc_filepath_list);
     155    if (defined ($assoc_filepath)) {
     156    # make absolute rather than relative...
     157    $self->{'filename'} =~ m@^(.*[\\/]archives)@;
     158    $assoc_filepath = "$1/$assoc_filepath/";
     159    } else {
     160    $assoc_filepath = $self->{'filename'};
     161    $assoc_filepath =~ s/[^\\\/]*$//;
     162    }
    153163
    154164    foreach my $assoc_file_info (@$assoc_files) {
    155165    my ($assoc_file, $mime_type, $dir) = split (":", $assoc_file_info);
    156     my $real_dir = &util::filename_cat($parent_dir, $assoc_file),
     166    my $real_dir = &util::filename_cat($assoc_filepath, $assoc_file),
    157167    my $assoc_dir = (defined $dir && $dir ne "")
    158168        ? &util::filename_cat($dir, $assoc_file) : $assoc_file;
Note: See TracChangeset for help on using the changeset viewer.