Changeset 8716 for trunk/gsdl/perllib/plugins
- Timestamp:
- 2004-12-01T16:14:11+13:00 (20 years ago)
- Location:
- trunk/gsdl/perllib/plugins
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/ArcPlug.pm
r6408 r8716 39 39 40 40 BEGIN { 41 @ ISA = ('BasPlug');41 @ArcPlug::ISA = ('BasPlug'); 42 42 } 43 43 -
trunk/gsdl/perllib/plugins/BasPlug.pm
r8678 r8716 143 143 sub get_arguments 144 144 { 145 local$self = shift(@_);146 local$optionlistref = $self->{'option_list'};147 local@optionlist = @$optionlistref;148 local$pluginoptions = pop(@$optionlistref);149 local$pluginarguments = $pluginoptions->{'args'};145 my $self = shift(@_); 146 my $optionlistref = $self->{'option_list'}; 147 my @optionlist = @$optionlistref; 148 my $pluginoptions = pop(@$optionlistref); 149 my $pluginarguments = $pluginoptions->{'args'}; 150 150 return $pluginarguments; 151 151 } … … 154 154 sub print_xml_usage 155 155 { 156 local$self = shift(@_);156 my $self = shift(@_); 157 157 158 158 # XML output is always in UTF-8 … … 166 166 sub print_xml 167 167 { 168 local$self = shift(@_);169 170 local$optionlistref = $self->{'option_list'};171 local@optionlist = @$optionlistref;172 local$pluginoptions = pop(@$optionlistref);168 my $self = shift(@_); 169 170 my $optionlistref = $self->{'option_list'}; 171 my @optionlist = @$optionlistref; 172 my $pluginoptions = pop(@$optionlistref); 173 173 return if (!defined($pluginoptions)); 174 174 … … 197 197 sub print_txt_usage 198 198 { 199 local$self = shift(@_);199 my $self = shift(@_); 200 200 201 201 # Print the usage message for a plugin (recursively) 202 local$descoffset = $self->determine_description_offset(0);202 my $descoffset = $self->determine_description_offset(0); 203 203 $self->print_plugin_usage($descoffset, 1); 204 204 } … … 207 207 sub determine_description_offset 208 208 { 209 local$self = shift(@_);210 local$maxoffset = shift(@_);211 212 local$optionlistref = $self->{'option_list'};213 local@optionlist = @$optionlistref;214 local$pluginoptions = pop(@$optionlistref);209 my $self = shift(@_); 210 my $maxoffset = shift(@_); 211 212 my $optionlistref = $self->{'option_list'}; 213 my @optionlist = @$optionlistref; 214 my $pluginoptions = pop(@$optionlistref); 215 215 return $maxoffset if (!defined($pluginoptions)); 216 216 217 217 # Find the length of the longest option string of this plugin 218 local$pluginargs = $pluginoptions->{'args'};218 my $pluginargs = $pluginoptions->{'args'}; 219 219 if (defined($pluginargs)) { 220 local$longest = &PrintUsage::find_longest_option_string($pluginargs);220 my $longest = &PrintUsage::find_longest_option_string($pluginargs); 221 221 if ($longest > $maxoffset) { 222 222 $maxoffset = $longest; … … 233 233 sub print_plugin_usage 234 234 { 235 local$self = shift(@_);236 local$descoffset = shift(@_);237 local$isleafclass = shift(@_);238 239 local$optionlistref = $self->{'option_list'};240 local@optionlist = @$optionlistref;241 local$pluginoptions = pop(@$optionlistref);235 my $self = shift(@_); 236 my $descoffset = shift(@_); 237 my $isleafclass = shift(@_); 238 239 my $optionlistref = $self->{'option_list'}; 240 my @optionlist = @$optionlistref; 241 my $pluginoptions = pop(@$optionlistref); 242 242 return if (!defined($pluginoptions)); 243 243 244 local$pluginname = $pluginoptions->{'name'};245 local$pluginargs = $pluginoptions->{'args'};246 local$plugindesc = $pluginoptions->{'desc'};244 my $pluginname = $pluginoptions->{'name'}; 245 my $pluginargs = $pluginoptions->{'args'}; 246 my $plugindesc = $pluginoptions->{'desc'}; 247 247 248 248 # Produce the usage information using the data structure above … … 257 257 if (defined($pluginargs)) { 258 258 # Calculate the column offset of the option descriptions 259 local$optiondescoffset = $descoffset + 2; # 2 spaces between options & descriptions259 my $optiondescoffset = $descoffset + 2; # 2 spaces between options & descriptions 260 260 261 261 if ($isleafclass) { … … 486 486 487 487 $self->extra_metadata ($doc_obj, $doc_obj->get_top_section(), $metadata); 488 488 489 489 # do plugin specific processing of doc_obj 490 return -1 unless defined ($self->process (\$text, $pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli)); 491 490 unless (defined ($self->process (\$text, $pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli))) { 491 $text = ''; 492 undef $text; 493 return -1; 494 } 495 $text=''; 496 undef $text; 497 492 498 # do any automatic metadata extraction 493 499 $self->auto_extract_metadata ($doc_obj); … … 495 501 # add an OID 496 502 # see if there is a plugin-specific set_OID function... 497 if (defined ($self->can( set_OID))) {503 if (defined ($self->can('set_OID'))) { 498 504 # it will need $doc_obj to set the Identifier metadata... 499 505 $self->set_OID($doc_obj); … … 507 513 508 514 $self->{'num_processed'} ++; 509 515 undef $doc_obj; 510 516 return 1; # processed the file 511 517 } -
trunk/gsdl/perllib/plugins/GAPlug.pm
r7900 r8716 29 29 # to their DTD. 30 30 31 # 12/05/02 Added usage datastructure - John Thompson32 33 31 package GAPlug; 34 32 … … 36 34 37 35 sub BEGIN { 38 @ ISA = ('XMLPlug');36 @GAPlug::ISA = ('XMLPlug'); 39 37 } 40 38 -
trunk/gsdl/perllib/plugins/HTMLPlug.pm
r8668 r8716 45 45 46 46 sub BEGIN { 47 @ ISA = ('BasPlug');47 @HTMLPlug::ISA = ('BasPlug'); 48 48 } 49 49 -
trunk/gsdl/perllib/plugins/OAIPlug.pm
r8684 r8716 33 33 34 34 sub BEGIN { 35 @ ISA = ('BasPlug');35 @OAIPlug::ISA = ('BasPlug'); 36 36 } 37 37 -
trunk/gsdl/perllib/plugins/PDFPlug.pm
r8278 r8716 31 31 use unicode; 32 32 33 sub BEGIN { 33 34 @PDFPlug::ISA = ('ConvertToPlug'); 35 } 34 36 35 37 my $arguments = -
trunk/gsdl/perllib/plugins/RecPlug.pm
r8512 r8716 100 100 101 101 BEGIN { 102 @ ISA = ('BasPlug');102 @RecPlug::ISA = ('BasPlug'); 103 103 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan"); 104 104 } … … 238 238 239 239 # Re-order the files in the list so any directories ending with .all are moved to the end 240 for ( $i = scalar(@dir) - 1; $i >= 0; $i--) {240 for (my $i = scalar(@dir) - 1; $i >= 0; $i--) { 241 241 if (-d &util::filename_cat($dirname, $dir[$i]) && $dir[$i] =~ /\.all$/) { 242 242 push(@dir, splice(@dir, $i, 1)); … … 302 302 303 303 # Any new files are added to the end of @dir to get processed by the loop 304 my $j; 304 305 foreach my $subfilenow (@dirnow) { 305 306 for ($j = 0; $j < $num_files; $j++) { -
trunk/gsdl/perllib/plugins/SplitPlug.pm
r8121 r8716 41 41 42 42 use BasPlug; 43 # SplitPlug is a sub-class of BasPlug.44 @SplitPlug::ISA = ('BasPlug');45 43 use gsprintf 'gsprintf'; 46 44 use util; 47 45 46 # SplitPlug is a sub-class of BasPlug. 47 sub BEGIN { 48 @SplitPlug::ISA = ('BasPlug'); 49 } 48 50 49 51 -
trunk/gsdl/perllib/plugins/UnknownPlug.pm
r8519 r8716 61 61 62 62 sub BEGIN { 63 @ ISA = ('BasPlug');63 @UnknownPlug::ISA = ('BasPlug'); 64 64 } 65 65 -
trunk/gsdl/perllib/plugins/XMLPlug.pm
r8121 r8716 30 30 31 31 sub BEGIN { 32 @ ISA = ('BasPlug');32 @XMLPlug::ISA = ('BasPlug'); 33 33 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan"); 34 34 } … … 232 232 sub close_document { 233 233 my $self = shift(@_); 234 234 my $doc_obj = $self->{'doc_obj'}; 235 235 # include any metadata passed in from previous plugins 236 236 # note that this metadata is associated with the top level section 237 $self->extra_metadata ($ self->{'doc_obj'},238 $ self->{'doc_obj'}->get_top_section(),237 $self->extra_metadata ($doc_obj, 238 $doc_obj->get_top_section(), 239 239 $self->{'metadata'}); 240 240 241 241 # do any automatic metadata extraction 242 $self->auto_extract_metadata ($ self->{'doc_obj'});242 $self->auto_extract_metadata ($doc_obj); 243 243 244 244 # add an OID 245 $ self->{'doc_obj'}->set_OID();245 $doc_obj->set_OID(); 246 246 247 247 $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}"); … … 249 249 250 250 # process the document 251 $self->{'processor'}->process($ self->{'doc_obj'});251 $self->{'processor'}->process($doc_obj); 252 252 253 253 $self->{'num_processed'} ++;
Note:
See TracChangeset
for help on using the changeset viewer.