Ignore:
Timestamp:
2008-07-14T14:43:50+12:00 (16 years ago)
Author:
kjdon
Message:

global block pass: now uses process_exp instead of block_exp. during metadata_read the file is added to the block list in so its not processed again in read

File:
1 edited

Legend:

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

    r15872 r16386  
    101101
    102102my $arguments = [
    103       { 'name' => "block_exp",
    104     'desc' => "{BasePlugin.block_exp}",
     103      { 'name' => "process_exp",
     104    'desc' => "{BasePlugin.process_exp}",
    105105    'type' => "regexp",
    106106    'reqd' => "no",
    107     'deft' => &get_default_block_exp() }
     107    'deft' => &get_default_process_exp() }
     108
    108109];
    109110
     
    162163}
    163164
    164 # We don't want any other plugins to see metadata.xml files
    165 # block exp are currently only used in the read bit
    166 sub get_default_block_exp
    167 {
    168     return q^metadata\.xml$^;
    169 }
    170165
    171166sub metadata_read
    172167{
    173168    my $self = shift (@_);
    174     my ($pluginfo, $base_dir, $file, $metadata, $extrametakeys, $extrametadata,
     169    my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $extrametakeys, $extrametadata,
    175170$processor, $maxdocs, $gli) = @_;
    176171
     
    182177    print STDERR "\n<Processing n='$file' p='MetadataXMLPlugin'>\n" if ($gli);
    183178    print STDERR "MetadataXMLPlugin: processing $file\n" if ($self->{'verbosity'})> 1;
    184 
     179    # 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
     180    $block_hash->{'file_blocks'}->{$filename} = 1;
    185181    $self->{'metadataref'} = $extrametadata;
    186182    $self->{'metakeysref'} = $extrametakeys;
     
    197193    return -1; #error
    198194    }
     195
    199196    return 1;
    200197
Note: See TracChangeset for help on using the changeset viewer.