Changeset 16381
- Timestamp:
- 2008-07-14T14:37:01+12:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/plugin.pm
r15873 r16381 195 195 } 196 196 197 sub file_block_read { 198 my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $gli) = @_; 199 200 201 $gli = 0 unless defined $gli; 202 203 my $rv = 0; 204 my $glifile = $file; 205 206 $glifile =~ s/^[\/\\]+//; # file sometimes starts with a / so get rid of it 207 208 # Announce to GLI that we are handling a file 209 print STDERR "<File n='$glifile'>\n" if $gli; 210 211 # the .kill file is a handy (if not very elegant) way of aborting 212 # an import.pl or buildcol.pl process 213 if (-e &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, ".kill")) { 214 gsprintf($outhandle, "{plugin.kill_file}\n"); 215 die "\n"; 216 } 217 218 foreach my $plugobj (@$pluginfo) { 219 220 $rv = $plugobj->file_block_read($pluginfo, $base_dir, $file, $block_hash, $metadata, $gli); 221 #last if (defined $rv && $rv==1); # stop this file once we have found something to 'process' it 222 } 223 224 } 225 197 226 198 227 sub metadata_read { 199 my ($pluginfo, $base_dir, $file, $ metadata, $extrametakeys, $extrametadata, $processor, $maxdocs, $gli, $aux) = @_;228 my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $extrametakeys, $extrametadata, $processor, $maxdocs, $gli, $aux) = @_; 200 229 201 230 $maxdocs = -1 unless defined $maxdocs && $maxdocs =~ /\d/; … … 228 257 foreach my $plugobj (@$pluginfo) { 229 258 230 $rv = $plugobj->metadata_read($pluginfo, $base_dir, $file, 259 $rv = $plugobj->metadata_read($pluginfo, $base_dir, $file, $block_hash, 231 260 $metadata, $extrametakeys, $extrametadata, $processor, $maxdocs, $gli, $aux); 232 261 … … 246 275 247 276 sub read { 248 my ($pluginfo, $base_dir, $file, $ metadata, $processor, $maxdocs, $total_count, $gli, $aux) = @_;277 my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $processor, $maxdocs, $total_count, $gli, $aux) = @_; 249 278 250 279 $maxdocs = -1 unless defined $maxdocs && $maxdocs =~ /\d/; … … 266 295 die "\n"; 267 296 } 268 297 269 298 my $had_error = 0; 270 299 # pass this file by each of the plugins in turn until one … … 279 308 280 309 $rv = $plugobj->read($pluginfo, $base_dir, $file, 281 $metadata, $processor, $maxdocs, $total_count, $gli, $aux); 310 $block_hash, $metadata, $processor, $maxdocs, 311 $total_count, $gli, $aux); 282 312 283 313 if (defined $rv) {
Note:
See TracChangeset
for help on using the changeset viewer.