- Timestamp:
- 2022-08-25T09:13:34+12:00 (20 months ago)
- Location:
- main/trunk/greenstone2/perllib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/CSVDeprecatedPlugin.pm
r36479 r36481 1 1 ########################################################################### 2 2 # 3 # CSV Plugin.pm -- A plugin for files in comma-separated value format3 # CSVDeprecatedPlugin.pm -- A plugin for files in comma-separated value format 4 4 # 5 5 # A component of the Greenstone digital library software … … 25 25 ########################################################################### 26 26 27 package CSV Plugin;27 package CSVDeprecatedPlugin; 28 28 29 29 use SplitTextFile; … … 36 36 use Text::CSV; 37 37 38 # CSV Plugin is a sub-class of SplitTextFile.38 # CSVDeprecatedPlugin is a sub-class of SplitTextFile. 39 39 sub BEGIN { 40 @CSV Plugin::ISA = ('MetadataRead', 'SplitTextFile', 'CSVFieldSeparator');40 @CSVDeprecatedPlugin::ISA = ('MetadataRead', 'SplitTextFile', 'CSVFieldSeparator'); 41 41 } 42 42 … … 58 58 59 59 60 my $options = { 'name' => "CSV Plugin",61 'desc' => "{CSV Plugin.desc}",60 my $options = { 'name' => "CSVDeprecatedPlugin", 61 'desc' => "{CSVDeprecatedPlugin.desc}", 62 62 'abstract' => "no", 63 63 'inherits' => "yes", -
main/trunk/greenstone2/perllib/plugins/CSVPlugin.pm
r36480 r36481 25 25 ########################################################################### 26 26 27 package NewCSVPlugin;27 package CSVPlugin; 28 28 29 29 use extrametautil; … … 40 40 41 41 sub BEGIN { 42 @ NewCSVPlugin::ISA = ('MetadataRead', 'ReadTextFile', 'CSVFieldSeparator');42 @CSVPlugin::ISA = ('MetadataRead', 'ReadTextFile', 'CSVFieldSeparator'); 43 43 binmode(STDERR, ":utf8"); 44 44 … … 61 61 62 62 63 my $options = { 'name' => " NewCSVPlugin",63 my $options = { 'name' => "CSVPlugin", 64 64 'desc' => "{CSVPlugin.desc}", 65 65 'abstract' => "no", … … 133 133 return undef unless $self->can_process_this_file_for_metadata($filename_full_path); 134 134 135 print STDERR "\n<Processing n='$file' p=' NewCSVPlugin'>\n" if ($gli);136 print STDERR " NewCSVPlugin: processing $file\n" if ($self->{'verbosity'}) > 1;135 print STDERR "\n<Processing n='$file' p='CSVPlugin'>\n" if ($gli); 136 print STDERR "CSVPlugin: processing $file\n" if ($self->{'verbosity'}) > 1; 137 137 138 138 my $outhandle = $self->{'outhandle'}; … … 145 145 my ($language, $content_encoding) = $self->textcat_get_language_encoding ($filename_full_path); 146 146 if ($self->{'verbosity'} > 2) { 147 print $outhandle " NewCSVPlugin: reading $file as ($content_encoding,$language)\n";147 print $outhandle "CSVPlugin: reading $file as ($content_encoding,$language)\n"; 148 148 } 149 149 # store these values for read … … 391 391 my ($outhandle, $failhandle, $gli, $file, $error) = @_; 392 392 393 print $outhandle " NewCSVPlugin Error: $file: $error\n";394 print $failhandle " NewCSVPlugin Error: $file: $error\n";393 print $outhandle "CSVPlugin Error: $file: $error\n"; 394 print $failhandle "CSVPlugin Error: $file: $error\n"; 395 395 print STDERR "<ProcessingError n='$file' r='$error'/>\n" if ($gli); 396 396 } -
main/trunk/greenstone2/perllib/plugins/MetadataCSVDeprecatedPlugin.pm
r36479 r36481 1 1 ########################################################################### 2 2 # 3 # MetadataCSV Plugin.pm -- A plugin for metadata in comma-separated value format3 # MetadataCSVDeprecatedPlugin.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 MetadataCSV Plugin;27 package MetadataCSVDeprecatedPlugin; 28 28 29 29 … … 43 43 # methods with identical signatures take precedence in the order given in the ISA list. 44 44 sub BEGIN { 45 @MetadataCSV Plugin::ISA = ('MetadataRead', 'BaseImporter', 'CSVFieldSeparator');45 @MetadataCSVDeprecatedPlugin::ISA = ('MetadataRead', 'BaseImporter', 'CSVFieldSeparator'); 46 46 } 47 47 … … 58 58 59 59 60 my $options = { 'name' => "MetadataCSV Plugin",61 'desc' => "{MetadataCSV Plugin.desc}",60 my $options = { 'name' => "MetadataCSVDeprecatedPlugin", 61 'desc' => "{MetadataCSVDeprecatedPlugin.desc}", 62 62 'abstract' => "no", 63 63 'inherits' => "yes", … … 115 115 return undef unless $self->can_process_this_file_for_metadata($filename_full_path); 116 116 117 print STDERR "\n<Processing n='$file' p='MetadataCSV Plugin'>\n" if ($gli);118 print STDERR "MetadataCSV Plugin: processing $file\n" if ($self->{'verbosity'}) > 1;117 print STDERR "\n<Processing n='$file' p='MetadataCSVDeprecatedPlugin'>\n" if ($gli); 118 print STDERR "MetadataCSVDeprecatedPlugin: processing $file\n" if ($self->{'verbosity'}) > 1; 119 119 120 120 my $outhandle = $self->{'outhandle'}; … … 129 129 open(CSV_FILE, "$filename_full_path"); 130 130 my $csv_file_reader = new multiread(); 131 $csv_file_reader->set_handle('MetadataCSV Plugin::CSV_FILE');131 $csv_file_reader->set_handle('MetadataCSVDeprecatedPlugin::CSV_FILE'); 132 132 $csv_file_reader->read_file(\$csv_file_content); 133 133 134 # Would be nice if MetadataCSV Plugin was extended to support a minus134 # Would be nice if MetadataCSVDeprecatedPlugin was extended to support a minus 135 135 # option to choose the character encoding the CSV file is in 136 136 # For now we will assume it is always in UTF8 … … 280 280 my ($outhandle, $failhandle, $gli, $file, $error) = @_; 281 281 282 print $outhandle "MetadataCSV Plugin Error: $file: $error\n";283 print $failhandle "MetadataCSV Plugin Error: $file: $error\n";282 print $outhandle "MetadataCSVDeprecatedPlugin Error: $file: $error\n"; 283 print $failhandle "MetadataCSVDeprecatedPlugin Error: $file: $error\n"; 284 284 print STDERR "<ProcessingError n='$file' r='$error'/>\n" if ($gli); 285 285 } -
main/trunk/greenstone2/perllib/strings.properties
r35401 r36481 882 882 CSVFieldSeparator.metadata_value_separator: The character you've consistently used to separate multiple metadata values for a single metadata field within a cell of the csv spreadsheet. If you used the vertical bar as the separator character, then set metadata_value_separator to \| (backslash vertical bar). 883 883 884 CSVPlugin.desc:A plugin for files in comma-separated value format. A new document will be created for each line of the file. 884 CSVPlugin.desc:A plugin for files in comma-separated value format. Metadata can be assigned to source documents (specified in the Filename field), or new documents created for each line of the file. 885 886 CSVDeprecatedPlugin.desc:An old plugin for files in comma-separated value format. A new document will be created for each line of the file. 885 887 886 888 DateExtractor.desc:Helper extractor plugin for extracting historical date information from text. … … 1140 1142 MediaWikiPlugin.remove_title_suffix_exp:A Perl regular expression to trim the extracted title. For example, \\s-(.+) will trim title contents after "-". 1141 1143 1142 MetadataCSV Plugin.desc:Aplugin for metadata in comma-separated value format. The Filename field in the CSV file is used to determine which document the metadata belongs to.1144 MetadataCSVDeprecatedPlugin.desc:An old plugin for metadata in comma-separated value format. The Filename field in the CSV file is used to determine which document the metadata belongs to. 1143 1145 1144 1146 MetadataPass.desc:On-the-side base class to BaseImporter that supports metadata plugins utilise metadata_read pass of import.pl
Note:
See TracChangeset
for help on using the changeset viewer.