Changeset 23561 for main/trunk/greenstone2
- Timestamp:
- 2011-01-13T11:49:38+13:00 (13 years ago)
- Location:
- main/trunk/greenstone2/perllib
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/ArchivesInfPlugin.pm
r23419 r23561 202 202 my ($filename_full_path, $filename_no_path) 203 203 = &util::get_full_filenames($base_dir, $file); 204 $self->block_filename($block_hash,$filename_full_path);204 &util::block_filename($block_hash,$filename_full_path); 205 205 return 1; 206 206 } -
main/trunk/greenstone2/perllib/plugins/BasePlugin.pm
r23544 r23561 382 382 } 383 383 384 sub block_filename385 {386 my $self = shift(@_);387 my ($block_hash,$filename) = @_;388 389 if ($ENV{'GSDLOS'} =~ m/^windows$/) {390 391 # lower case the entire thing, eg for cover.jpg when its actually cover.JPG392 my $lower_filename = lc($filename);393 $block_hash->{'file_blocks'}->{$lower_filename} = 1;394 # my $lower_drive = $filename;395 # $lower_drive =~ s/^([A-Z]):/\l$1:/i;396 397 # my $upper_drive = $filename;398 # $upper_drive =~ s/^([A-Z]):/\u$1:/i;399 #400 # $block_hash->{'file_blocks'}->{$lower_drive} = 1;401 # $block_hash->{'file_blocks'}->{$upper_drive} = 1;402 }403 else {404 $block_hash->{'file_blocks'}->{$filename} = 1;405 }406 }407 384 408 385 # rename imported files and assoc files using URL encoding by default … … 441 418 442 419 if ($self->{'block_exp'} ne "" && $filename_full_path =~ /$self->{'block_exp'}/) { 443 $self->block_filename($block_hash,$filename_full_path);420 &util::block_filename($block_hash,$filename_full_path); 444 421 } 445 422 … … 461 438 } 462 439 if (&util::fd_exists($coverfile)) { 463 $self->block_filename($block_hash,$coverfile);440 &util::block_filename($block_hash,$coverfile); 464 441 } 465 442 } -
main/trunk/greenstone2/perllib/plugins/DSpacePlugin.pm
r23419 r23561 149 149 150 150 if (&util::fd_exists($handle_filename)) { 151 $self->block_filename($block_hash,$handle_filename);151 &util::block_filename($block_hash,$handle_filename); 152 152 } 153 153 } -
main/trunk/greenstone2/perllib/plugins/DirectoryPlugin.pm
r23544 r23561 235 235 foreach my $e (keys %$exts) { 236 236 # block the file 237 $self->block_filename($block_hash,"$prefix$e");237 &util::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"; -
main/trunk/greenstone2/perllib/plugins/GreenstoneXMLPlugin.pm
r23419 r23561 123 123 } 124 124 125 $self->block_filename($block_hash,$full_gsdl_assoc_filename);125 &util::block_filename($block_hash,$full_gsdl_assoc_filename); 126 126 } 127 127 } -
main/trunk/greenstone2/perllib/plugins/HTMLPlugin.pm
r23463 r23561 180 180 181 181 my $html_fname = $filename_full_path; 182 my @file_blocks;183 182 184 183 my ($language, $content_encoding) = $self->textcat_get_language_encoding ($filename_full_path); … … 281 280 282 281 # Allow for possibility of raw byte version and Unicode versions of file 283 $self->block_filename($block_hash,$unicode_url_original_filename);282 &util::block_filename($block_hash,$unicode_url_original_filename); 284 283 } 285 284 286 285 # $url_original_filename = &util::upgrade_if_dos_filename($url_original_filename); 287 286 288 $self->block_filename($block_hash,$url_original_filename);287 &util::block_filename($block_hash,$url_original_filename); 289 288 290 289 } -
main/trunk/greenstone2/perllib/plugins/ISISPlugin.pm
r23419 r23561 136 136 print STDERR "$self->{'fdt_file_path'}\n"; 137 137 my $fdt_file = $self->{'fdt_file_path'}; 138 $self->block_filename($block_hash,$fdt_file);138 &util::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 $self->block_filename($block_hash,$xrf_file);143 &util::block_filename($block_hash,$xrf_file); 144 144 } 145 145 -
main/trunk/greenstone2/perllib/plugins/MetadataCSVPlugin.pm
r23419 r23561 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 $self->block_filename($block_hash,$filename);115 &util::block_filename($block_hash,$filename); 116 116 117 117 # Read the CSV file to get the metadata -
main/trunk/greenstone2/perllib/plugins/MetadataXMLPlugin.pm
r23419 r23561 254 254 print $outhandle "MetadataXMLPlugin: processing $file\n" if ($self->{'verbosity'})> 1; 255 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 256 $self->block_filename($block_hash,$filename);256 &util::block_filename($block_hash,$filename); 257 257 258 258 $self->{'metadataref'} = $extrametadata; -
main/trunk/greenstone2/perllib/plugins/PagedImagePlugin.pm
r23452 r23561 576 576 577 577 if ($line =~ /imgfile=\"([^\"]+)\"/) { 578 $self->block_filename($block_hash,$dir.$1);578 &util::block_filename($block_hash,$dir.$1); 579 579 } 580 580 if ($line =~ /txtfile=\"([^\"]+)\"/) { 581 $self->block_filename($block_hash,$dir.$1);581 &util::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 $self->block_filename($block_hash, &util::filename_cat( $dir,$imgname));607 &util::block_filename($block_hash, &util::filename_cat( $dir,$imgname)); 608 608 } 609 609 # find the text file if there is one 610 610 if (defined $txtname && $txtname ne "") { 611 $self->block_filename($block_hash, &util::filename_cat($dir,$txtname));611 &util::block_filename($block_hash, &util::filename_cat($dir,$txtname)); 612 612 } 613 613 } -
main/trunk/greenstone2/perllib/util.pm
r23484 r23561 1140 1140 } 1141 1141 1142 sub block_filename 1143 { 1144 my ($block_hash,$filename) = @_; 1145 1146 if ($ENV{'GSDLOS'} =~ m/^windows$/) { 1147 1148 # lower case the entire thing, eg for cover.jpg when its actually cover.JPG 1149 my $lower_filename = lc($filename); 1150 $block_hash->{'file_blocks'}->{$lower_filename} = 1; 1151 # my $lower_drive = $filename; 1152 # $lower_drive =~ s/^([A-Z]):/\l$1:/i; 1153 1154 # my $upper_drive = $filename; 1155 # $upper_drive =~ s/^([A-Z]):/\u$1:/i; 1156 # 1157 # $block_hash->{'file_blocks'}->{$lower_drive} = 1; 1158 # $block_hash->{'file_blocks'}->{$upper_drive} = 1; 1159 } 1160 else { 1161 $block_hash->{'file_blocks'}->{$filename} = 1; 1162 } 1163 } 1164 1142 1165 1143 1166 sub filename_is_absolute
Note:
See TracChangeset
for help on using the changeset viewer.