Ignore:
Timestamp:
2010-12-09T00:10:10+13:00 (13 years ago)
Author:
max
Message:

Setting the values to store as block files is now done through an API call to BasePlugin. This way, anything uniform requirement (such as putting in both C:\... and c:\... entries for Windows) can be done in one place.

File:
1 edited

Legend:

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

    r23212 r23419  
    214214    my $self = shift (@_);
    215215    my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $gli) = @_;
    216 
     216   
    217217    my $filename_full_path = &util::filename_cat($base_dir, $file);
    218218    return undef unless $self->can_process_this_file($filename_full_path);   
    219219
    220     $block_hash->{'metadata_files'}->{$filename_full_path} = 1;
     220    if ($ENV{'GSDLOS'} =~ m/^windows$/) {
     221       
     222        my $lower_drive = $filename_full_path;
     223        $lower_drive =~ s/^([A-Z]):/\l$1:/i;
     224       
     225        my $upper_drive = $filename_full_path;
     226        $upper_drive =~ s/^([A-Z]):/\u$1:/i;
     227       
     228        $block_hash->{'metadata_files'}->{$lower_drive} = 1;
     229        $block_hash->{'metadata_files'}->{$upper_drive} = 1;       
     230    }
     231    else {
     232        $block_hash->{'metadata_files'}->{$filename_full_path} = 1;
     233    }
    221234
    222235    return 1;
     
    235248    $self->{'metadata-file'} = $file;
    236249    $self->{'metadata-filename'} = $filename;
    237 
     250   
    238251    my $outhandle = $self->{'outhandle'};
    239252   
     
    241254    print $outhandle "MetadataXMLPlugin: processing $file\n" if ($self->{'verbosity'})> 1;
    242255    # add the file to the block list so that it won't be processed in read, as we will do all we can with it here
    243     $block_hash->{'file_blocks'}->{$filename} = 1;
     256    $self->block_filename($block_hash,$filename);
    244257
    245258    $self->{'metadataref'} = $extrametadata;
Note: See TracChangeset for help on using the changeset viewer.