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

    r15865 r15872  
    11###########################################################################
    22#
    3 # ISISPlug.pm -- A plugin for CDS/ISIS databases
     3# ISISPlugin.pm -- A plugin for CDS/ISIS databases
    44#
    55# A component of the Greenstone digital library software
     
    2525###########################################################################
    2626
    27 package ISISPlug;
     27package ISISPlugin;
    2828
    2929
    3030use multiread;
    31 use SplitPlug;
     31use SplitTextFile;
    3232
    3333use strict;
    3434no strict 'refs'; # allow filehandles to be variables and viceversa
    3535
    36 # ISISPlug is a sub-class of SplitPlug.
     36# ISISPlugin is a sub-class of SplitTextFile.
    3737sub BEGIN {
    38     @ISISPlug::ISA = ('SplitPlug');
     38    @ISISPlugin::ISA = ('SplitTextFile');
    3939}
    4040
     
    4242my $arguments =
    4343    [ { 'name' => "process_exp",
    44     'desc' => "{BasPlug.process_exp}",
     44    'desc' => "{BasePlugin.process_exp}",
    4545    'type' => "regexp",
    4646    'reqd' => "no",
    4747    'deft' => &get_default_process_exp() },
    4848      { 'name' => "block_exp",
    49     'desc' => "{BasPlug.block_exp}",
     49    'desc' => "{BasePlugin.block_exp}",
    5050    'type' => "regexp",
    5151    'reqd' => "no",
     
    5353    'hiddengli' => "yes" },
    5454      { 'name' => "split_exp",
    55     'desc' => "{SplitPlug.split_exp}",
     55    'desc' => "{SplitTextFile.split_exp}",
    5656    'type' => "regexp",
    5757    'reqd' => "no",
     
    6161      # The interesting options
    6262      { 'name' => "entry_separator",
    63     'desc' => "{ISISPlug.entry_separator}",
     63    'desc' => "{ISISPlugin.entry_separator}",
    6464    'type' => "string",
    6565    'reqd' => "no",
    6666    'deft' => "<br>" },
    6767      { 'name' => "subfield_separator",
    68     'desc' => "{ISISPlug.subfield_separator}",
     68    'desc' => "{ISISPlugin.subfield_separator}",
    6969    'type' => "string",
    7070    'reqd' => "no",
     
    7272      ];
    7373
    74 my $options = { 'name'     => "ISISPlug",
    75         'desc'     => "{ISISPlug.desc}",
     74my $options = { 'name'     => "ISISPlugin",
     75        'desc'     => "{ISISPlugin.desc}",
    7676        'abstract' => "no",
    7777        'inherits' => "yes",
     
    104104    push(@$pluginlist, $class);
    105105
    106     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    107     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    108 
    109     my $self = new SplitPlug($pluginlist, $inputargs, $hashArgOptLists);
     106    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     107    push(@{$hashArgOptLists->{"OptList"}},$options);
     108
     109    my $self = new SplitTextFile($pluginlist, $inputargs, $hashArgOptLists);
    110110
    111111    if ($self->{'info_only'}) {
     
    157157
    158158    my $reader = new multiread();
    159     $reader->set_handle('ISISPlug::FILE');
     159    $reader->set_handle('ISISPlugin::FILE');
    160160    $reader->set_encoding($encoding);
    161161    $reader->read_file($textref);
     
    186186
    187187    # Report that we're processing the file
    188     print STDERR "\n<Processing n='$file' p='ISISPlug'>\n" if ($gli);
     188    print STDERR "\n<Processing n='$file' p='ISISPlugin'>\n" if ($gli);
    189189    print $outhandle "IsisPlug: processing $file\n" if ($self->{'verbosity'}) > 1;
    190190
     
    348348    my $fdtfiletext = "";
    349349    my $reader = new multiread();
    350     $reader->set_handle('ISISPlug::FDT_FILE');
     350    $reader->set_handle('ISISPlugin::FDT_FILE');
    351351    $reader->set_encoding($encoding);
    352352    $reader->read_file($fdtfiletext);
Note: See TracChangeset for help on using the changeset viewer.