Changeset 15872 for gsdl/trunk/perllib/plugins/MARCPlugin.pm
- Timestamp:
- 2008-06-05T09:29:32+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/plugins/MARCPlugin.pm
r15865 r15872 1 1 ########################################################################### 2 2 # 3 # MARCPlug .pm -- basic MARC plugin3 # MARCPlugin.pm -- basic MARC plugin 4 4 # 5 5 # A component of the Greenstone digital library software … … 25 25 ########################################################################### 26 26 27 package MARCPlug ;28 29 use Split Plug;27 package MARCPlugin; 28 29 use SplitTextFile; 30 30 31 31 use unicode; … … 36 36 37 37 sub BEGIN { 38 @MARCPlug ::ISA = ('SplitPlug');38 @MARCPlugin::ISA = ('SplitTextFile'); 39 39 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan"); 40 40 } … … 42 42 my $arguments = 43 43 [ { 'name' => "metadata_mapping", 44 'desc' => "{MARCPlug .metadata_mapping}",44 'desc' => "{MARCPlugin.metadata_mapping}", 45 45 'type' => "string", 46 46 'deft' => "marctodc.txt", … … 53 53 'reqd' => "no" }, 54 54 { 'name' => "process_exp", 55 'desc' => "{Bas Plug.process_exp}",55 'desc' => "{BasePlugin.process_exp}", 56 56 'type' => "regexp", 57 57 'reqd' => "no", 58 58 'deft' => &get_default_process_exp() }, 59 59 { 'name' => "split_exp", 60 'desc' => "{Split Plug.split_exp}",60 'desc' => "{SplitTextFile.split_exp}", 61 61 'type' => "regexp", 62 62 'reqd' => "no", … … 64 64 ]; 65 65 66 my $options = { 'name' => "MARCPlug ",67 'desc' => "{MARCPlug .desc}",66 my $options = { 'name' => "MARCPlugin", 67 'desc' => "{MARCPlugin.desc}", 68 68 'abstract' => "no", 69 69 'inherits' => "yes", … … 81 81 push(@$pluginlist, $class); 82 82 83 if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}84 if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};85 86 my $self = new Split Plug($pluginlist, $inputargs, $hashArgOptLists);83 push(@{$hashArgOptLists->{"ArgList"}},@{$arguments}); 84 push(@{$hashArgOptLists->{"OptList"}},$options); 85 86 my $self = new SplitTextFile($pluginlist, $inputargs, $hashArgOptLists); 87 87 88 88 # 'metadata_mapping' was used in two ways in the plugin: as a plugin … … 119 119 { 120 120 121 my $msg = "MARCPlug ERROR: Can't locate mapping file \"" .121 my $msg = "MARCPlugin ERROR: Can't locate mapping file \"" . 122 122 $self->{'metadata_mapping_file'} . "\".\n" . 123 123 " No marc files can be processed.\n"; … … 245 245 push(@marc_entries,$marc); 246 246 $$textref .= $marc->as_formatted(); 247 $$textref .= "\n\n"; # for Split Plug- see default_split_exp above...247 $$textref .= "\n\n"; # for SplitTextFile - see default_split_exp above... 248 248 } 249 249 … … 254 254 255 255 # do plugin specific processing of doc_obj 256 # This gets done for each record found by Split Plugin marc files.256 # This gets done for each record found by SplitTextFile in marc files. 257 257 sub process { 258 258 my $self = shift (@_); … … 264 264 if (! defined($self->{'metadata_mapping'})) 265 265 { 266 print $outhandle "MARCPlug : no metadata file! Can't process $file\n";266 print $outhandle "MARCPlugin: no metadata file! Can't process $file\n"; 267 267 return undef; 268 268 } 269 269 270 print STDERR "<Processing n='$file' p='MARCPlug '>\n" if ($gli);271 print $outhandle "MARCPlug : processing $file\n"270 print STDERR "<Processing n='$file' p='MARCPlugin'>\n" if ($gli); 271 print $outhandle "MARCPlugin: processing $file\n" 272 272 if $self->{'verbosity'} > 1; 273 273
Note:
See TracChangeset
for help on using the changeset viewer.