Ignore:
Timestamp:
2017-03-13T11:12:37+13:00 (7 years ago)
Author:
kjdon
Message:

renamed EncodingUtil to CommonUtil, BasePlugin to BaseImporter. The idea is that only top level plugins that you can specify in your collection get to have plugin in their name. Modified all other plugins to reflect these name changes

File:
1 moved

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/CommonUtil.pm

    r31491 r31492  
    11###########################################################################
    22#
    3 # EncodingUtil.pm -- base class for file and directory plugins - aims to
    4 # handle all encoding stuff, to keep it in one place
     3# CommonUtil.pm -- base class for file and directory plugins - aims to
     4# handle all encoding stuff, blocking stuff, to keep it in one place
    55# A component of the Greenstone digital library software
    66# from the New Zealand Digital Library Project at the
     
    2525###########################################################################
    2626
    27 package EncodingUtil;
     27package CommonUtil;
    2828
    2929use strict;
     
    3939
    4040BEGIN {
    41     @EncodingUtil::ISA = ( 'PrintInfo' );
     41    @CommonUtil::ISA = ( 'PrintInfo' );
    4242}
    4343
    4444our $encoding_list =
    4545    [ { 'name' => "ascii",
    46     'desc' => "{BasePlugin.encoding.ascii}" },
     46    'desc' => "{BaseImporter.encoding.ascii}" },
    4747      { 'name' => "utf8",
    48     'desc' => "{BasePlugin.encoding.utf8}" },
     48    'desc' => "{BaseImporter.encoding.utf8}" },
    4949      { 'name' => "unicode",
    50     'desc' => "{BasePlugin.encoding.unicode}" } ];
     50    'desc' => "{BaseImporter.encoding.unicode}" } ];
    5151
    5252
     
    6363our $encoding_plus_auto_list =
    6464    [ { 'name' => "auto",
    65     'desc' => "{BasePlugin.filename_encoding.auto}" },
     65    'desc' => "{BaseImporter.filename_encoding.auto}" },
    6666      { 'name' => "auto-language-analysis",
    67     'desc' => "{BasePlugin.filename_encoding.auto_language_analysis}" }, # textcat
     67    'desc' => "{BaseImporter.filename_encoding.auto_language_analysis}" }, # textcat
    6868      { 'name' => "auto-filesystem-encoding",
    69     'desc' => "{BasePlugin.filename_encoding.auto_filesystem_encoding}" }, # locale
     69    'desc' => "{BaseImporter.filename_encoding.auto_filesystem_encoding}" }, # locale
    7070      { 'name' => "auto-fl",
    71     'desc' => "{BasePlugin.filename_encoding.auto_fl}" }, # locale followed by textcat
     71    'desc' => "{BaseImporter.filename_encoding.auto_fl}" }, # locale followed by textcat
    7272      { 'name' => "auto-lf",
    73     'desc' => "{BasePlugin.filename_encoding.auto_lf}" } ]; # texcat followed by locale
     73    'desc' => "{BaseImporter.filename_encoding.auto_lf}" } ]; # texcat followed by locale
    7474
    7575push(@{$encoding_plus_auto_list},@{$encoding_list});
     
    7777my $arguments =
    7878    [  { 'name' => "block_exp",
    79      'desc' => "{BasePlugin.block_exp}",
     79     'desc' => "{BaseImporter.block_exp}",
    8080     'type' => "regexp",
    8181     'deft' => "",
    8282     'reqd' => "no" },
    8383       { 'name' => "no_blocking",
    84      'desc' => "{BasePlugin.no_blocking}",
     84     'desc' => "{BaseImporter.no_blocking}",
    8585     'type' => "flag",
    8686     'reqd' => "no"},
    8787       { 'name' => "filename_encoding",
    88      'desc' => "{BasePlugin.filename_encoding}",
     88     'desc' => "{BaseImporter.filename_encoding}",
    8989     'type' => "enum",
    9090     'deft' => "auto",
     
    9393    ];
    9494
    95 my $options = { 'name'     => "EncodingUtil",
    96         'desc'     => "{EncodingUtil.desc}",
     95my $options = { 'name'     => "CommonUtil",
     96        'desc'     => "{CommonUtil.desc}",
    9797        'abstract' => "yes",
    9898        'inherits' => "no",
     
    140140    my $filename_encoding =  $self->guess_filesystem_encoding(); 
    141141       
    142     # copied this from set_Source_metadata in BasePlugin
     142    # copied this from set_Source_metadata in BaseImporter
    143143    if ((defined $filename_encoding) && ($filename_encoding ne "ascii")) {
    144144    # Use filename_encoding to map raw filename to a Perl unicode-aware string
     
    267267    my $outhandle = $self->{'outhandle'};
    268268
    269     print $outhandle "****!!!!**** BasePlugin::filename_to_utf8_metadata now deprecated\n";
     269    print $outhandle "****!!!!**** BaseImporter::filename_to_utf8_metadata now deprecated\n";
    270270    my ($cpackage,$cfilename,$cline,$csubr,$chas_args,$cwantarray) = caller(0);
    271271    print $outhandle "Calling method: $cfilename:$cline $cpackage->$csubr\n";
     
    363363    {
    364364    if ($self->{'verbosity'}) {
    365         gsprintf($outhandle, "BasePlugin: {ReadTextFile.unsupported_encoding}\n", $text, $best_encoding, "undef");
     365        gsprintf($outhandle, "BaseImporter: {ReadTextFile.unsupported_encoding}\n", $text, $best_encoding, "undef");
    366366    }
    367367    $best_encoding = undef;
Note: See TracChangeset for help on using the changeset viewer.