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

    r15865 r15872  
    11###########################################################################
    22#
    3 # GMLPlug.pm --
     3# GMLPlugin.pm --
    44# A component of the Greenstone digital library software
    55# from the New Zealand Digital Library Project at the
     
    2929# 12/05/02 Added usage datastructure - John Thompson
    3030
    31 package GMLPlug;
    32 
    33 use BasPlug;
     31package GMLPlugin;
     32
     33use BasePlugin;
    3434use util;
    3535use doc;
     
    3939
    4040sub BEGIN {
    41     @GMLPlug::ISA = ('BasPlug');
     41    @GMLPlugin::ISA = ('BasePlugin');
    4242}
    4343
    4444my $arguments =
    4545    [ { 'name' => "process_exp",
    46     'desc' => "{BasPlug.process_exp}",
     46    'desc' => "{BasePlugin.process_exp}",
    4747    'type' => "regexp",
    4848    'deft' =>  &get_default_process_exp() }
    4949    ];
    5050
    51 my $options = { 'name'     => "GMLPlug",
    52         'desc'     => "{GMLPlug.desc}",
     51my $options = { 'name'     => "GMLPlugin",
     52        'desc'     => "{GMLPlugin.desc}",
    5353        'abstract' => "no",
    5454        'inherits' => "yes",
     
    6060    push(@$pluginlist, $class);
    6161
    62     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    63     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    64 
    65     my $self = new BasPlug($pluginlist, $inputargs, $hashArgOptLists);
     62    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     63    push(@{$hashArgOptLists->{"OptList"}},$options);
     64
     65    my $self = new BasePlugin($pluginlist, $inputargs, $hashArgOptLists);
    6666
    6767    return bless $self, $class;
     
    8888    $file =~ s/^[\/\\]+//; # $file often begins with / so we'll tidy it up
    8989
    90     print STDERR "<Processing n='$file' p='GMLPlug'>\n" if ($gli);
    91     print $outhandle "GMLPlug: processing $file\n";
     90    print STDERR "<Processing n='$file' p='GMLPlugin'>\n" if ($gli);
     91    print $outhandle "GMLPlugin: processing $file\n";
    9292
    9393    my $parent_dir = $file;
     
    9999        print STDERR "<ProcessingError n='$file' r='Could not read $filename'>\n";
    100100    }
    101     print $outhandle "GMLPlug::read - couldn't read $filename\n";
     101    print $outhandle "GMLPlugin::read - couldn't read $filename\n";
    102102    return -1;
    103103    }
     
    130130        if ($gml =~ /^\s*([^>]*)>(.*)$/so) {
    131131            $tags = $1 if defined $1;
    132             $text = &GMLPlug::_unescape_text($2);
     132            $text = &GMLPlugin::_unescape_text($2);
    133133
    134134        } else {
    135             print $outhandle "GMLPlug::read - error in file $filename\n";
     135            print $outhandle "GMLPlugin::read - error in file $filename\n";
    136136            print $outhandle "text: \"$gml\"\n";
    137137            last;
     
    158158        # could be stored as either attributes or ....
    159159        while ((defined $tags) && ($tags =~ s/^\s*(\S+)=\"([^\"]*)\"//o)) {
    160             $doc_obj->add_utf8_metadata($section, $1, &GMLPlug::_unescape_text($2))
     160            $doc_obj->add_utf8_metadata($section, $1, &GMLPlugin::_unescape_text($2))
    161161            if (defined $1 and defined $2);
    162162
     
    183183                $tagname =~ s/^&\#47;/\//;
    184184               
    185                 $doc_obj->add_utf8_metadata($section, $tagname, &GMLPlug::_unescape_text($tagvalue));
     185                $doc_obj->add_utf8_metadata($section, $tagname, &GMLPlugin::_unescape_text($tagvalue));
    186186            }
    187187            }
Note: See TracChangeset for help on using the changeset viewer.