Changeset 15872 for gsdl/trunk/perllib/plugins/LOMPlugin.pm
- Timestamp:
- 2008-06-05T09:29:32+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/plugins/LOMPlugin.pm
r15865 r15872 1 1 ########################################################################### 2 2 # 3 # LOMPlug .pm -- plugin for import the collection from LOM3 # LOMPlugin.pm -- plugin for import the collection from LOM 4 4 # 5 5 # A component of the Greenstone digital library software … … 27 27 ### Note this plugin currently can't download source documents from outside if you are behind a firewall. 28 28 29 package LOMPlug ;30 31 use BasPlug;29 package LOMPlugin; 30 31 use ReadTextFile; 32 32 use MetadataPass; 33 33 use XMLParser; … … 35 35 36 36 sub BEGIN { 37 @ISA = (' BasPlug', 'MetadataPass');37 @ISA = ('ReadTextFile', 'MetadataPass'); 38 38 } 39 39 … … 44 44 my $arguments = 45 45 [ { 'name' => "process_exp", 46 'desc' => "{ BasPlug.process_exp}",46 'desc' => "{ReadTextFile.process_exp}", 47 47 'type' => "string", 48 48 'deft' => &get_default_process_exp(), 49 49 'reqd' => "no" }, 50 50 { 'name' => "root_tag", 51 'desc' => "{LOMPlug .root_tag}",51 'desc' => "{LOMPlugin.root_tag}", 52 52 'type' => "regexp", 53 53 'deft' => q/^(?i)lom$/, 54 54 'reqd' => "no" }, 55 55 { 'name' => "check_timestamp", 56 'desc' => "{LOMPlug .check_timestamp}",56 'desc' => "{LOMPlugin.check_timestamp}", 57 57 'type' => "flag" }, 58 58 { 'name' => "download_srcdocs", 59 'desc' => "{LOMPlug .download_srcdocs}",59 'desc' => "{LOMPlugin.download_srcdocs}", 60 60 'type' => "regexp", 61 61 'deft' => "", 62 62 'reqd' => "no" }]; 63 63 64 my $options = { 'name' => "LOMPlug ",65 'desc' => "{LOMPlug .desc}",64 my $options = { 'name' => "LOMPlugin", 65 'desc' => "{LOMPlugin.desc}", 66 66 'inherits' => "yes", 67 67 'args' => $arguments }; … … 75 75 push(@$pluginlist, $class); 76 76 77 if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}78 if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};77 push(@{$hashArgOptLists->{"ArgList"}},@{$arguments}); 78 push(@{$hashArgOptLists->{"OptList"}},$options); 79 79 80 $self = new BasPlug($pluginlist, $inputargs, $hashArgOptLists); 80 $self = new ReadTextFile($pluginlist, $inputargs, $hashArgOptLists); 81 82 if ($self->{'info_only'}) { 83 # don't worry about creating the XML parser as all we want is the 84 # list of plugin options 85 return bless $self, $class; 86 } 81 87 82 88 #create XML::Parser object for parsing dublin_core.xml files … … 120 126 $file =~ s/^[\/\\]+//; # $file often begins with / so we'll tidy it up 121 127 122 print $outhandle "LOMPlug : extracting metadata from $file\n"128 print $outhandle "LOMPlugin: extracting metadata from $file\n" 123 129 if $self->{'verbosity'} > 1; 124 130 … … 131 137 132 138 if ($@) { 133 print $outhandle "LOMPlug : skipping $filename as not conformant to LOM syntax\n" if ($self->{'verbosity'} > 1);139 print $outhandle "LOMPlugin: skipping $filename as not conformant to LOM syntax\n" if ($self->{'verbosity'} > 1); 134 140 print $outhandle "\n Perl Error:\n $@\n" if ($self->{'verbosity'}>2); 135 141 return 0; … … 262 268 my $outhandle = $self->{'outhandle'}; 263 269 264 print STDERR "<Processing n='$file' p='LOMPlug '>\n" if ($gli);270 print STDERR "<Processing n='$file' p='LOMPlugin'>\n" if ($gli); 265 271 266 272 print $outhandle "LOMPLug: processing $file\n";
Note:
See TracChangeset
for help on using the changeset viewer.