Changeset 15872 for gsdl/trunk/perllib/plugins/MetadataCSVPlugin.pm
- Timestamp:
- 2008-06-05T09:29:32+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/plugins/MetadataCSVPlugin.pm
r15865 r15872 1 1 ########################################################################### 2 2 # 3 # MetadataCSVPlug .pm -- A plugin for metadata in comma-separated value format3 # MetadataCSVPlugin.pm -- A plugin for metadata in comma-separated value format 4 4 # 5 5 # A component of the Greenstone digital library software … … 25 25 ########################################################################### 26 26 27 package MetadataCSVPlug ;27 package MetadataCSVPlugin; 28 28 29 29 30 use Bas Plug;30 use BasePlugin; 31 31 use strict; 32 32 33 33 34 34 sub BEGIN { 35 @MetadataCSVPlug ::ISA = ('BasPlug');35 @MetadataCSVPlugin::ISA = ('BasePlugin'); 36 36 } 37 37 … … 39 39 my $arguments = 40 40 [ { 'name' => "block_exp", 41 'desc' => "{Bas Plug.block_exp}",41 'desc' => "{BasePlugin.block_exp}", 42 42 'type' => "regexp", 43 43 'reqd' => "no", … … 45 45 46 46 47 my $options = { 'name' => "MetadataCSVPlug ",48 'desc' => "{MetadataCSVPlug .desc}",47 my $options = { 'name' => "MetadataCSVPlugin", 48 'desc' => "{MetadataCSVPlugin.desc}", 49 49 'abstract' => "no", 50 50 'inherits' => "yes", … … 58 58 push(@$pluginlist, $class); 59 59 60 if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}61 if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};60 push(@{$hashArgOptLists->{"ArgList"}},@{$arguments}); 61 push(@{$hashArgOptLists->{"OptList"}},$options); 62 62 63 my $self = new Bas Plug($pluginlist, $inputargs, $hashArgOptLists);63 my $self = new BasePlugin($pluginlist, $inputargs, $hashArgOptLists); 64 64 65 65 return bless $self, $class; … … 74 74 75 75 76 # We don't want any other plugins to see .csv files76 # Used by BasePlugin read to block this file 77 77 sub get_default_block_exp 78 78 { … … 91 91 return undef; 92 92 } 93 print STDERR "\n<Processing n='$file' p='MetadataCSVPlug '>\n" if ($gli);94 print STDERR "MetadataCSVPlug : processing $file\n" if ($self->{'verbosity'}) > 1;93 print STDERR "\n<Processing n='$file' p='MetadataCSVPlugin'>\n" if ($gli); 94 print STDERR "MetadataCSVPlugin: processing $file\n" if ($self->{'verbosity'}) > 1; 95 95 96 96 # Read the CSV file to get the metadata … … 98 98 open(CSV_FILE, "$filename"); 99 99 my $csv_file_reader = new multiread(); 100 $csv_file_reader->set_handle('MetadataCSVPlug ::CSV_FILE');100 $csv_file_reader->set_handle('MetadataCSVPlugin::CSV_FILE'); 101 101 $csv_file_reader->read_file(\$csv_file_content); 102 102 close(CSV_FILE); … … 118 118 119 119 if (!$found_filename_field) { 120 print STDERR "MetadataCSVPlug Error: No Filename field in CSV file: $filename\n";120 print STDERR "MetadataCSVPlugin Error: No Filename field in CSV file: $filename\n"; 121 121 return -1; # error 122 122 } … … 153 153 # The line must be formatted incorrectly 154 154 else { 155 print STDERR "MetadataCSVPlug Error: Badly formatted CSV line: $csv_line.\n";155 print STDERR "MetadataCSVPlugin Error: Badly formatted CSV line: $csv_line.\n"; 156 156 last; 157 157 } … … 163 163 my $csv_line_filename_array = $csv_line_metadata{"Filename"}; 164 164 if (!defined $csv_line_filename_array) { 165 print STDERR "MetadataCSVPlug Error: No Filename metadata in CSV line: $orig_csv_line\n";165 print STDERR "MetadataCSVPlugin Error: No Filename metadata in CSV line: $orig_csv_line\n"; 166 166 next; 167 167 }
Note:
See TracChangeset
for help on using the changeset viewer.