Ignore:
Timestamp:
2008-06-05T09:29:32+12:00 (16 years ago)
Author:
kjdon
Message:

plugin overhaul: plugins renamed to xxPlugin, and in some cases the names are made more sensible. They now use the new base plugins. Hopefully we have better code reuse. Some of the plugins still need work done as I didn't want to spend another month doing this before committing it. Alos, I haven't really tested anything yet...

File:
1 edited

Legend:

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

    r15865 r15872  
    11###########################################################################
    22#
    3 # MetadataCSVPlug.pm -- A plugin for metadata in comma-separated value format
     3# MetadataCSVPlugin.pm -- A plugin for metadata in comma-separated value format
    44#
    55# A component of the Greenstone digital library software
     
    2525###########################################################################
    2626
    27 package MetadataCSVPlug;
     27package MetadataCSVPlugin;
    2828
    2929
    30 use BasPlug;
     30use BasePlugin;
    3131use strict;
    3232
    3333
    3434sub BEGIN {
    35     @MetadataCSVPlug::ISA = ('BasPlug');
     35    @MetadataCSVPlugin::ISA = ('BasePlugin');
    3636}
    3737
     
    3939my $arguments =
    4040    [ { 'name' => "block_exp",
    41     'desc' => "{BasPlug.block_exp}",
     41    'desc' => "{BasePlugin.block_exp}",
    4242    'type' => "regexp",
    4343    'reqd' => "no",
     
    4545
    4646
    47 my $options = { 'name'     => "MetadataCSVPlug",
    48         'desc'     => "{MetadataCSVPlug.desc}",
     47my $options = { 'name'     => "MetadataCSVPlugin",
     48        'desc'     => "{MetadataCSVPlugin.desc}",
    4949        'abstract' => "no",
    5050        'inherits' => "yes",
     
    5858    push(@$pluginlist, $class);
    5959
    60     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    61     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
     60    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     61    push(@{$hashArgOptLists->{"OptList"}},$options);
    6262
    63     my $self = new BasPlug($pluginlist, $inputargs, $hashArgOptLists);
     63    my $self = new BasePlugin($pluginlist, $inputargs, $hashArgOptLists);
    6464
    6565    return bless $self, $class;
     
    7474
    7575
    76 # We don't want any other plugins to see .csv files
     76# Used by BasePlugin read to block this file
    7777sub get_default_block_exp
    7878{
     
    9191    return undef;
    9292    }
    93     print STDERR "\n<Processing n='$file' p='MetadataCSVPlug'>\n" if ($gli);
    94     print STDERR "MetadataCSVPlug: processing $file\n" if ($self->{'verbosity'}) > 1;
     93    print STDERR "\n<Processing n='$file' p='MetadataCSVPlugin'>\n" if ($gli);
     94    print STDERR "MetadataCSVPlugin: processing $file\n" if ($self->{'verbosity'}) > 1;
    9595
    9696    # Read the CSV file to get the metadata
     
    9898    open(CSV_FILE, "$filename");
    9999    my $csv_file_reader = new multiread();
    100     $csv_file_reader->set_handle('MetadataCSVPlug::CSV_FILE');
     100    $csv_file_reader->set_handle('MetadataCSVPlugin::CSV_FILE');
    101101    $csv_file_reader->read_file(\$csv_file_content);
    102102    close(CSV_FILE);
     
    118118
    119119    if (!$found_filename_field) {
    120     print STDERR "MetadataCSVPlug Error: No Filename field in CSV file: $filename\n";
     120    print STDERR "MetadataCSVPlugin Error: No Filename field in CSV file: $filename\n";
    121121    return -1; # error
    122122    }
     
    153153        # The line must be formatted incorrectly
    154154        else {
    155         print STDERR "MetadataCSVPlug Error: Badly formatted CSV line: $csv_line.\n";
     155        print STDERR "MetadataCSVPlugin Error: Badly formatted CSV line: $csv_line.\n";
    156156        last;
    157157        }
     
    163163    my $csv_line_filename_array = $csv_line_metadata{"Filename"};
    164164    if (!defined $csv_line_filename_array) {
    165         print STDERR "MetadataCSVPlug Error: No Filename metadata in CSV line: $orig_csv_line\n";
     165        print STDERR "MetadataCSVPlugin Error: No Filename metadata in CSV line: $orig_csv_line\n";
    166166        next;
    167167    }
Note: See TracChangeset for help on using the changeset viewer.