Changeset 10156
- Timestamp:
- 2005-06-23T11:19:53+12:00 (19 years ago)
- Location:
- trunk/gsdl/perllib/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/ArcPlug.pm
r9853 r10156 63 63 } 64 64 65 sub deinit { 66 my ($self) = @_; 67 68 my $archive_info = $self->{'archive_info'}; 69 70 if (defined $archive_info) { 71 my $archive_info_filename = $self->{'archive_info_filename'}; 72 73 my $file_list = $archive_info->get_file_list(); 74 75 # change each file to "Been Indexed" 76 77 foreach my $subfile (@$file_list) { 78 my $doc_oid = $subfile->[1]; 79 $index_status = $archive_info->get_status_info($doc_oid); 80 $archive_info->set_status_info($doc_oid,"B"); 81 } 82 83 $archive_info->save_info($archive_info_filename); 84 } 85 } 86 65 87 # return 1 if this class might recurse using $pluginfo 66 88 sub is_recursive { … … 69 91 return 1; 70 92 } 93 94 95 71 96 72 97 # return number of files processed, undef if can't process … … 82 107 # see if this has a archives information file within it 83 108 my $archive_info_filename = &util::filename_cat($base_dir,$file,"archives.inf"); 109 $self->{'archive_info_filename'} = $archive_info_filename; 84 110 85 111 if (-e $archive_info_filename) { … … 90 116 # read in the archives information file 91 117 my $archive_info = new arcinfo (); 118 $self->{'archive_info'} = $archive_info; 119 92 120 $archive_info->load_info ($archive_info_filename); 93 121 … … 100 128 my $tmp = &util::filename_cat ($file, $subfile->[0]); 101 129 next if $tmp eq $file; 102 # note: metadata is not carried on to the next level 103 $count += &plugin::read ($pluginfo, $base_dir, $tmp, {}, $processor, $maxdocs, ($total_count+$count), $gli); 130 131 my $doc_oid = $subfile->[1]; 132 133 $index_status = $archive_info->get_status_info($doc_oid); 134 135 my $processor_mode = $processor->get_mode(); 136 137 if (($processor_mode eq "infodb") || ($index_status eq "I")) { 138 139 # note: metadata is not carried on to the next level 140 $count += &plugin::read ($pluginfo, $base_dir, $tmp, {}, $processor, $maxdocs, ($total_count+$count), $gli); 141 } 142 104 143 } 105 144 -
trunk/gsdl/perllib/plugins/RecPlug.pm
r9853 r10156 166 166 } 167 167 168 sub begin { 169 my $self = shift (@_); 170 my ($pluginfo, $base_dir, $processor, $maxdocs) = @_; 171 172 my $proc_package_name = ref $processor; 173 174 if ($proc_package_name !~ /buildproc$/) { 175 176 # Only lookup timestamp info for import.pl 177 178 my $output_dir = $processor->getoutputdir(); 179 my $archives_inf = &util::filename_cat($output_dir,"archives.inf"); 180 181 if ( -e $archives_inf ) { 182 $self->{'inf_timestamp'} = -M $archives_inf; 183 } 184 } 185 186 $self->SUPER::begin($pluginfo, $base_dir, $processor, $maxdocs); 187 } 188 189 168 190 # return 1 if this class might recurse using $pluginfo 169 191 sub is_recursive { … … 413 435 } 414 436 } 415 437 438 439 my $file_subfile = &util::filename_cat($file, $subfile); 440 my $filename_subfile 441 = &util::filename_cat($this_file_base_dir,$file_subfile); 442 if (defined $self->{'inf_timestamp'}) { 443 my $inf_timestamp = $self->{'inf_timestamp'}; 444 445 if (! -d $filename_subfile) { 446 my $filename_timestamp = -M $filename_subfile; 447 if ($filename_timestamp > $inf_timestamp) { 448 # filename has been around for longer than inf 449 ##### print $outhandle "**** Skipping $subfile\n"; 450 next; 451 } 452 } 453 } 454 416 455 # Recursively read each $subfile 417 456 print $outhandle "RecPlug recurring: $subfile\n" if ($verbosity > 2); 418 457 419 458 $count += &plugin::read ($pluginfo, $this_file_base_dir, 420 &util::filename_cat($file, $subfile),459 $file_subfile, 421 460 $out_metadata, $processor, $maxdocs, ($total_count + $count), $gli); 422 461 }
Note:
See TracChangeset
for help on using the changeset viewer.