greenstone.org greenstone wiki greenstone trac planet greenstone

Changeset 17720

Show
Ignore:
Timestamp:
2008-11-06 11:00:15 (2 months ago)
Author:
kjdon
Message:

renamed DBPlugin to DatabasePlugin?, and changed the name inside the file

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gsdl/trunk/perllib/plugins/DatabasePlugin.pm

    r17026 r17720  
    11########################################################################### 
    22# 
    3 # DBPlugin.pm -- plugin to import records from a database 
     3# DatabasePlugin.pm -- plugin to import records from a database 
    44#  
    55# A component of the Greenstone digital library software 
     
    3434# Mar, Apr 2003 
    3535 
    36 package DBPlugin; 
     36package DatabasePlugin; 
    3737 
    3838use strict; 
     
    4343 
    4444sub BEGIN { 
    45     @DBPlugin::ISA = ('AutoExtractMetadata'); 
     45    @DatabasePlugin::ISA = ('AutoExtractMetadata'); 
    4646} 
    4747 
     
    5353        'reqd' => "no" }]; 
    5454 
    55 my $options = { 'name'     => "DBPlugin", 
     55my $options = { 'name'     => "DatabasePlugin", 
    5656                'desc'     => "{DBPlugin.desc}", 
    5757                'abstract' => "no", 
     
    8989    my $verbosity = $self->{'verbosity'}; 
    9090 
    91     print STDERR "<Processing n='$file' p='DBPlugin'>\n" if ($gli); 
    92     print $outhandle "DBPlugin: processing $file\n"  
     91    print STDERR "<Processing n='$file' p='DatabasePlugin'>\n" if ($gli); 
     92    print $outhandle "DatabasePlugin: processing $file\n"  
    9393        if $self->{'verbosity'} > 1; 
    9494    
     
    121121    # read in config file. 
    122122    if (!open (CONF, $filename_full_path)) { 
    123             print $outhandle "DBPlugin: can't read $filename_full_path: $!\n"; 
     123            print $outhandle "DatabasePlugin: can't read $filename_full_path: $!\n"; 
    124124            return 0; 
    125125    }  
     
    140140                $callback =~ /[\`]|\|\-/) { 
    141141                # no backticks or functions that start new processes allowed 
    142                 print $outhandle "DBPlugin: bad function in callback\n"; 
     142                print $outhandle "DatabasePlugin: bad function in callback\n"; 
    143143                return 0; 
    144144            } 
     
    147147            my $ret = eval "\$callbacks{'$fieldname'} = $callback ; 1"; 
    148148            if (!defined($ret)) { 
    149                 print $outhandle "DBPlugin: error eval'ing callback: $@\n"; 
     149                print $outhandle "DatabasePlugin: error eval'ing callback: $@\n"; 
    150150                exit(1); 
    151151            } 
    152152            $callback=""; 
    153             print $outhandle "DBPlugin: callback registered for '$fieldname'\n" 
     153            print $outhandle "DatabasePlugin: callback registered for '$fieldname'\n" 
    154154                if $dbplug_debug; 
    155155        } elsif ($callback) { 
     
    171171                    chomp $err; 
    172172                    $err =~ s/\.$//; # remove a trailing . 
    173                     print $outhandle "DBPlugin: error evaluating `$statement'\n"; 
     173                    print $outhandle "DatabasePlugin: error evaluating `$statement'\n"; 
    174174                    print $outhandle " $err (in $filename_full_path)\n"; 
    175175                    return 0; # there was an error reading the config file 
     
    180180                $statement = ""; 
    181181            } else { 
    182                 print $outhandle "DBPlugin: skipping statement `$statement'\n"; 
     182                print $outhandle "DatabasePlugin: skipping statement `$statement'\n"; 
    183183            } 
    184184            $statement = ""; 
     
    189189     
    190190    if (!defined($db)) { 
    191         print $outhandle "DBPlugin: error: $filename_full_path does not specify a db!\n"; 
     191        print $outhandle "DatabasePlugin: error: $filename_full_path does not specify a db!\n"; 
    192192        return 0; 
    193193    } 
    194194    if (!defined($sql_query)) { 
    195         print $outhandle "DBPlugin: error: no SQL query specified!\n"; 
     195        print $outhandle "DatabasePlugin: error: no SQL query specified!\n"; 
    196196        return 0; 
    197197    } 
     
    200200 
    201201    if (!defined($dbhandle)) { 
    202         die "DBPlugin: could not connect to database, exiting.\n"; 
     202        die "DatabasePlugin: could not connect to database, exiting.\n"; 
    203203    } 
    204204    if (defined($dbplug_debug) && $dbplug_debug==1) { 
    205         print $outhandle "DBPlugin (debug): connected ok\n"; 
     205        print $outhandle "DatabasePlugin (debug): connected ok\n"; 
    206206    } 
    207207 
     
    233233        if (defined($db_to_greenstone_fields{$fieldname})) { 
    234234            if (defined($dbplug_debug) && $dbplug_debug==1) { 
    235                 print $outhandle "DBPlugin (debug): mapping db field " 
     235                print $outhandle "DatabasePlugin (debug): mapping db field " 
    236236                    . "'$fieldname' to " 
    237237                        . $db_to_greenstone_fields{$fieldname} . "\n"; 
     
    251251    while (scalar(@row_array)) { 
    252252        if (defined($dbplug_debug) && $dbplug_debug==1) { 
    253             print $outhandle "DBPlugin (debug): retrieved a row from query\n"; 
     253            print $outhandle "DatabasePlugin (debug): retrieved a row from query\n"; 
    254254        } 
    255255 
     
    356356    # check "$sth->err" if empty array for error 
    357357    if ($statement_hand->err) { 
    358         print $outhandle "DBPlugin: received error: \"" . 
     358        print $outhandle "DatabasePlugin: received error: \"" . 
    359359            $statement_hand->errstr . "\"\n"; 
    360360    } 
     
    368368 
    369369    if (defined($dbplug_debug) && $dbplug_debug==1) { 
    370         print $outhandle "DBPlugin: imported $count DB records as documents.\n"; 
     370        print $outhandle "DatabasePlugin: imported $count DB records as documents.\n"; 
    371371    } 
    372372    $count;