Changeset 317 for trunk/gsdl/perllib/plugins/ArcPlug.pm
- Timestamp:
- 1999-06-30T15:36:35+12:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/ArcPlug.pm
r285 r317 1 # plugin which recurses through directories processing 2 # each file it finds 1 # plugin which recurses through an archives.inf file 2 # (i.e. the file generated in the archives directory 3 # when an import is done), processing each file it finds 3 4 4 5 package ArcPlug; … … 27 28 } 28 29 29 # return 1 if processed, 0 if not processed30 # return number of files processed, undef if can't process 30 31 # Note that $base_dir might be "" and that $file might 31 32 # include directories 32 33 sub read { 33 34 my $self = shift (@_); 34 ($pluginfo, $base_dir, $file, $metadata, $processor) = @_; 35 # my $count = 0; 35 ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs) = @_; 36 37 my $count = 0; 36 38 37 39 # see if this has a archives information file within it … … 39 41 40 42 if (-e $archive_info_filename) { 43 44 # found an archives.inf file 45 print STDERR "ArcPlug: processing $archive_info_filename\n"; 41 46 42 47 # read in the archives information file … … 48 53 # process each file 49 54 foreach $subfile (@$file_list) { 50 #### # note: metadata is not carried on to the next level - why ??? - I changed this 51 # so I could pass the classifytype from mgbuilder - Stefan. 55 last if (defined $maxdocs && $maxdocs =~ /\d/ && $count >= $maxdocs); 56 52 57 my $tmp = &util::filename_cat ($file, $subfile->[0]); 53 58 next if $tmp eq $file; 54 &plugin::read ($pluginfo, $base_dir, $tmp, $metadata, $processor); 55 # $count ++; 56 # last if $count > 200; 57 } 58 59 # all books have been processed so need to output classifications 60 # to infodb - note that at present you have to import before building 61 if (defined $processor->{'mode'} && $processor->{'mode'} eq 'infodb') { 62 print STDERR "ArcPlug: Adding classifications to infodb\n"; 63 $processor->process('classifications'); 59 # note: metadata is not carried on to the next level 60 $count += &plugin::read ($pluginfo, $base_dir, $tmp, {}, $processor, $maxdocs); 64 61 } 65 62 66 return 1;63 return $count; 67 64 } 68 65 69 66 # wasn't an archives directory, someone else will have to process it 70 return 0;67 return undef; 71 68 } 72 69
Note:
See TracChangeset
for help on using the changeset viewer.