Changeset 8512
- Timestamp:
- 2004-11-11T14:05:18+13:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/RecPlug.pm
r8090 r8512 157 157 $self->{'parser'} = $parser; 158 158 $self->{'in_filename'} = 0; 159 160 } 161 159 } 160 162 161 return bless $self, $class; 163 162 } … … 249 248 my %extrametadata; # maps from filespec to extra metadata keys 250 249 my @extrametakeys; # keys of %extrametadata in order read 251 250 252 251 if ($read_metadata_files) { 253 254 # read the directory "metadata.xml" file 252 #read the directory "metadata.xml" file 255 253 my $metadatafile = &util::filename_cat ($dirname, 'metadata.xml'); 256 254 if (-e $metadatafile) { … … 261 259 } 262 260 } 263 261 264 262 # import each of the files in the directory 265 263 my $out_metadata; 266 264 my $num_files = scalar(@dir); 265 for (my $i = 0; $i < scalar(@dir); $i++) { 266 my $subfile = $dir[$i]; 267 my $this_file_base_dir = $base_dir; 268 last if ($maxdocs != -1 && $count >= $maxdocs); 269 next if ($subfile =~ /^\.\.?$/); 270 #next if ($read_metadata_files && $subfile =~ /metadata\.xml$/); 271 272 # Recursively read each $subfile 273 print $outhandle "RecPlug metadata recurring: $subfile\n" if ($verbosity > 2); 274 275 $count += &plugin::metadata_read ($pluginfo, $this_file_base_dir, 276 &util::filename_cat($file, $subfile), 277 $out_metadata, \@extrametakeys, \%extrametadata, 278 $processor, $maxdocs, $gli); 279 $additionalmetadata = 1; 280 } 281 282 283 # import each of the files in the directory 284 $count=0; 267 285 for (my $i = 0; $i <= scalar(@dir); $i++) { 268 286 # When every file in the directory has been done, pause for a moment (figuratively!) … … 293 311 } 294 312 } 295 296 313 # When the new files have been processed, check again 297 314 $num_files = scalar(@dir); … … 343 360 # Next add metadata read in XML files (if it is supplied) 344 361 if ($additionalmetadata == 1) { 345 346 362 my ($filespec, $mdref); 347 363 foreach $filespec (@extrametakeys) { … … 357 373 # Recursively read each $subfile 358 374 print $outhandle "RecPlug recurring: $subfile\n" if ($verbosity > 2); 359 360 $count += &plugin::read ($pluginfo, $this_file_base_dir, 375 376 $count += &plugin::read ($pluginfo, $this_file_base_dir, 361 377 &util::filename_cat($file, $subfile), 362 378 $out_metadata, $processor, $maxdocs, $gli); 363 379 } 364 380 365 return $count; 381 return $count; 366 382 } 367 383 … … 383 399 $self->{'parser'}->parsefile($filename); 384 400 }; 401 385 402 if ($@) { 386 403 die "RecPlug: ERROR $filename is not a well formed metadata.xml file ($@)\n";
Note:
See TracChangeset
for help on using the changeset viewer.