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/MetadataCSVPlugin.pm

    r15872 r16386  
    3737
    3838
    39 my $arguments =
    40     [ { 'name' => "block_exp",
    41     'desc' => "{BasePlugin.block_exp}",
     39my $arguments = [
     40      { 'name' => "process_exp",
     41    'desc' => "{BasePlugin.process_exp}",
    4242    'type' => "regexp",
    4343    'reqd' => "no",
    44     'deft' => &get_default_block_exp() } ];
     44    'deft' => &get_default_process_exp() }
     45
     46];
    4547
    4648
     
    6769
    6870
    69 # Not used, just here to prevent a warning
    7071sub get_default_process_exp
    7172{
     
    7374}
    7475
    75 
    76 # Used by BasePlugin read to block this file
    77 sub get_default_block_exp
    78 {
    79     return q^(?i)\.csv$^;
    80 }
    81 
    82 
    8376sub metadata_read
    8477{
    8578    my $self = shift (@_);
    86     my ($pluginfo, $base_dir, $file, $metadata, $extrametakeys, $extrametadata, $processor, $maxdocs, $gli) = @_;
     79    my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $extrametakeys, $extrametadata, $processor, $maxdocs, $gli) = @_;
    8780
    8881    # Read metadata from CSV files
     
    9386    print STDERR "\n<Processing n='$file' p='MetadataCSVPlugin'>\n" if ($gli);
    9487    print STDERR "MetadataCSVPlugin: processing $file\n" if ($self->{'verbosity'}) > 1;
     88
     89    # 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
     90    $block_hash->{'file_blocks'}->{$filename} = 1;
    9591
    9692    # Read the CSV file to get the metadata
Note: See TracChangeset for help on using the changeset viewer.