Changeset 23419
- Timestamp:
- 2010-12-09T00:10:10+13:00 (13 years ago)
- Location:
- main/trunk/greenstone2/perllib/plugins
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/ArchivesInfPlugin.pm
r23212 r23419 202 202 my ($filename_full_path, $filename_no_path) 203 203 = &util::get_full_filenames($base_dir, $file); 204 $ block_hash->{'file_blocks'}->{$filename_full_path} = 1;204 $self->block_filename($block_hash,$filename_full_path); 205 205 return 1; 206 206 } -
main/trunk/greenstone2/perllib/plugins/BasePlugin.pm
r23418 r23419 382 382 } 383 383 384 sub block_filename 385 { 386 my $self = shift(@_); 387 my ($block_hash,$filename) = @_; 388 389 if ($ENV{'GSDLOS'} =~ m/^windows$/) { 390 391 my $lower_drive = $filename; 392 $lower_drive =~ s/^([A-Z]):/\l$1:/i; 393 394 my $upper_drive = $filename; 395 $upper_drive =~ s/^([A-Z]):/\u$1:/i; 396 397 $block_hash->{'file_blocks'}->{$lower_drive} = 1; 398 $block_hash->{'file_blocks'}->{$upper_drive} = 1; 399 } 400 else { 401 $block_hash->{'file_blocks'}->{$filename} = 1; 402 } 403 } 404 384 405 # rename imported files and assoc files using URL encoding by default 385 406 # as this will work for most plugins and give more legible filenames … … 417 438 418 439 if ($self->{'block_exp'} ne "" && $filename_full_path =~ /$self->{'block_exp'}/) { 419 $ block_hash->{'file_blocks'}->{$filename_full_path} = 1;440 $self->block_filename($block_hash,$filename_full_path); 420 441 } 421 442 … … 437 458 } 438 459 if (&util::fd_exists($coverfile)) { 439 $ block_hash->{'file_blocks'}->{$coverfile} = 1;460 $self->block_filename($block_hash,$coverfile); 440 461 } 441 462 } … … 1169 1190 my ($textref, $pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli) = @_; 1170 1191 1171 gsprintf(STDERR, "BasePlugin::process {common.must_be_implemented}\n") && die "\n"; 1192 gsprintf(STDERR, "BasePlugin::process {common.must_be_implemented}\n"); 1193 1194 my ($cpackage,$cfilename,$cline,$csubr,$chas_args,$cwantarray) = caller(1); 1195 print STDERR "Calling method: $cfilename:$cline $cpackage->$csubr\n"; 1196 1197 die "\n"; 1172 1198 1173 1199 return undef; # never gets here -
main/trunk/greenstone2/perllib/plugins/DSpacePlugin.pm
r23212 r23419 148 148 my $handle_filename = &util::filename_cat($contents_basedir,"handle"); 149 149 150 $block_hash->{'file_blocks'}->{$handle_filename} = 1 if (-e $handle_filename); 150 if (&util::fd_exists($handle_filename)) { 151 $self->block_filename($block_hash,$handle_filename); 152 } 151 153 } 152 154 -
main/trunk/greenstone2/perllib/plugins/DirectoryPlugin.pm
r23363 r23419 235 235 foreach my $e (keys %$exts) { 236 236 # block the file 237 $ block_hash->{'file_blocks'}->{"$prefix$e"} = 1;237 $self->block_filename($block_hash,"$prefix$e"); 238 238 # set up as an associatd file 239 239 print STDERR " $self->{'plugin_type'}: Associating $prefix$e with $tie_to version\n"; … … 333 333 $self->sort_out_associated_files($block_hash); 334 334 #return $count; 335 return 1; 335 336 336 337 } -
main/trunk/greenstone2/perllib/plugins/GreenstoneXMLPlugin.pm
r23212 r23419 123 123 } 124 124 125 $ block_hash->{'file_blocks'}->{$full_gsdl_assoc_filename} = 1;125 $self->block_filename($block_hash,$full_gsdl_assoc_filename); 126 126 } 127 127 } -
main/trunk/greenstone2/perllib/plugins/HTMLPlugin.pm
r23418 r23419 281 281 282 282 # Allow for possibility of raw byte version and Unicode versions of file 283 $block_hash->{'file_blocks'}->{$unicode_url_original_filename} = 1; 284 283 $self->block_filename($block_hash,$unicode_url_original_filename); 285 284 } 286 285 287 286 # $url_original_filename = &util::upgrade_if_dos_filename($url_original_filename); 288 287 289 290 $block_hash->{'file_blocks'}->{$url_original_filename} = 1; 291 if ($ENV{'GSDLOS'} =~ m/^windows$/) { 292 293 my $lower_drive = $url_original_filename; 294 $lower_drive =~ s/^([A-Z]):/\l$1:/i; 295 my $upper_drive = $url_original_filename; 296 297 $upper_drive =~ s/^([A-Z]):/\u$1:/i; 298 299 ## print STDERR "**** HTML plugin, blocking: \"$lower_drive\"\n"; 300 ## print STDERR "**** HTML plugin, blocking: \"$upper_drive\"\n"; 301 302 $block_hash->{'file_blocks'}->{$lower_drive} = 1; 303 $block_hash->{'file_blocks'}->{$upper_drive} = 1; 304 } 305 else { 306 ## print STDERR "**** HTML plugin, blocking: $url_original_filename\n"; 307 $block_hash->{'file_blocks'}->{$url_original_filename} = 1; 308 } 288 $self->block_filename($block_hash,$url_original_filename); 309 289 310 290 } -
main/trunk/greenstone2/perllib/plugins/ISISPlugin.pm
r20778 r23419 136 136 print STDERR "$self->{'fdt_file_path'}\n"; 137 137 my $fdt_file = $self->{'fdt_file_path'}; 138 $ block_hash->{'file_blocks'}->{$fdt_file} = 1;138 $self->block_filename($block_hash,$fdt_file); 139 139 } 140 140 if (-e $self->{'xrf_file_path'}) { 141 141 print STDERR "$self->{'xrf_file_path'}\n"; 142 142 my $xrf_file = $self->{'xrf_file_path'}; 143 $ block_hash->{'file_blocks'}->{$xrf_file} = 1;143 $self->block_filename($block_hash,$xrf_file); 144 144 } 145 145 -
main/trunk/greenstone2/perllib/plugins/MetadataCSVPlugin.pm
r23212 r23419 113 113 114 114 # add the file to the block list so that it won't be processed in read, as we will do all we can with it here 115 $ block_hash->{'file_blocks'}->{$filename} = 1;115 $self->block_filename($block_hash,$filename); 116 116 117 117 # Read the CSV file to get the metadata -
main/trunk/greenstone2/perllib/plugins/MetadataXMLPlugin.pm
r23212 r23419 214 214 my $self = shift (@_); 215 215 my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $gli) = @_; 216 216 217 217 my $filename_full_path = &util::filename_cat($base_dir, $file); 218 218 return undef unless $self->can_process_this_file($filename_full_path); 219 219 220 $block_hash->{'metadata_files'}->{$filename_full_path} = 1; 220 if ($ENV{'GSDLOS'} =~ m/^windows$/) { 221 222 my $lower_drive = $filename_full_path; 223 $lower_drive =~ s/^([A-Z]):/\l$1:/i; 224 225 my $upper_drive = $filename_full_path; 226 $upper_drive =~ s/^([A-Z]):/\u$1:/i; 227 228 $block_hash->{'metadata_files'}->{$lower_drive} = 1; 229 $block_hash->{'metadata_files'}->{$upper_drive} = 1; 230 } 231 else { 232 $block_hash->{'metadata_files'}->{$filename_full_path} = 1; 233 } 221 234 222 235 return 1; … … 235 248 $self->{'metadata-file'} = $file; 236 249 $self->{'metadata-filename'} = $filename; 237 250 238 251 my $outhandle = $self->{'outhandle'}; 239 252 … … 241 254 print $outhandle "MetadataXMLPlugin: processing $file\n" if ($self->{'verbosity'})> 1; 242 255 # add the file to the block list so that it won't be processed in read, as we will do all we can with it here 243 $ block_hash->{'file_blocks'}->{$filename} = 1;256 $self->block_filename($block_hash,$filename); 244 257 245 258 $self->{'metadataref'} = $extrametadata; -
main/trunk/greenstone2/perllib/plugins/PagedImagePlugin.pm
r23363 r23419 576 576 577 577 if ($line =~ /imgfile=\"([^\"]+)\"/) { 578 $ block_hash->{'file_blocks'}->{$dir.$1} = 1;578 $self->block_filename($block_hash,$dir.$1); 579 579 } 580 580 if ($line =~ /txtfile=\"([^\"]+)\"/) { 581 $ block_hash->{'file_blocks'}->{$dir.$1} = 1;581 $self->block_filename($block_hash,$dir.$1); 582 582 } 583 583 } … … 605 605 # find the image file if there is one 606 606 if (defined $imgname && $imgname ne "") { 607 $ block_hash->{'file_blocks'}->{$dir.$imgname}=1;607 $self->block_filename($block_hash,$dir.$imgname); 608 608 } 609 609 # find the text file if there is one 610 610 if (defined $txtname && $txtname ne "") { 611 $ block_hash->{'file_blocks'}->{$dir.$txtname} = 1;611 $self->block_filename($block_hash,$dir.$txtname); 612 612 } 613 613 }
Note:
See TracChangeset
for help on using the changeset viewer.