Ignore:
Timestamp:
2005-07-06T15:27:45+12:00 (19 years ago)
Author:
kjdon
Message:

Jeffrey's new parsing modifications, committed approx 6 July, 15.16

File:
1 edited

Legend:

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

    r9494 r10218  
    6969
    7070sub new {
    71     my $class = shift (@_);
    72     my $self = new SplitPlug ($class, @_);
    73     $self->{'plugin_type'} = "MARCPlug";
    74     my $metadata_mapping;
    75 
    76     if (!parsargv::parse(\@_,
    77              q^metadata_mapping/.*/marctodc.txt^, \$metadata_mapping,
    78              "allow_extra_options")) {
    79 
    80     print STDERR "\nIncorrect options passed to MARCPlug, check your collect.cfg configuration file\n";
    81     $self->print_txt_usage("");  # Use default resource bundle
    82     die "\n";
    83     }
    84 
    85 
    86     $self->{'mm_file'} = $metadata_mapping; # relative to etc dir
    87 
    88     # 14-05-02 To allow for proper inheritance of arguments - John Thompson
    89     my $option_list = $self->{'option_list'};
    90     push( @{$option_list}, $options );
     71    my ($class) = shift (@_);
     72    my ($pluginlist,$inputargs,$hashArgOptLists) = @_;
     73    push(@$pluginlist, $class);
     74
     75    if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
     76    if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
     77
     78    my $self = (defined $hashArgOptLists)? new SplitPlug($pluginlist,$inputargs,$hashArgOptLists): new SplitPlug($pluginlist,$inputargs);
    9179
    9280    return bless $self, $class;
     
    10189    # read in the metadata mapping file
    10290    my $mm_file =
    103     &util::filename_cat( $ENV{'GSDLHOME'}, "etc", $self->{'mm_file'} );
     91    &util::filename_cat( $ENV{'GSDLHOME'}, "etc", $self->{'metadata_mapping'} );
    10492
    10593    if (!-e $mm_file)
     
    10795
    10896    my $msg = "MARCPlug ERROR: Can't locate mapping file \"" .
    109         $self->{'mm_file'} . "\".\n    This file should be at $mm_file\n" .
     97        $self->{'metadata_mapping'} . "\".\n    This file should be at $mm_file\n" .
    11098        "    No marc files can be processed.\n";
    11199
    112100    print $outhandle $msg;
    113101    print $failhandle $msg;
    114     $self->{'mm_file'} = undef;
     102    $self->{'metadata_mapping'} = undef;
    115103    # We pick up the error in process() if there is no $mm_file
    116104    # If we exit here, then pluginfo.pl will exit too!
     
    222210    my $filename = &util::filename_cat($base_dir, $file);
    223211
    224     if (! defined($self->{'mm_file'}))
     212    if (! defined($self->{'metadata_mapping'}))
    225213    {
    226214    print $outhandle "MARCPlug: no metadata file! Can't process $file\n";
Note: See TracChangeset for help on using the changeset viewer.