Changeset 16392 for gsdl/trunk/perllib/plugins/ReadXMLFile.pm
- Timestamp:
- 2008-07-14T14:57:38+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/plugins/ReadXMLFile.pm
r15971 r16392 157 157 return $transformed_xml; 158 158 159 } 160 161 sub can_process_this_file { 162 my $self = shift(@_); 163 my ($filename) = @_; 164 165 if ($self->SUPER::can_process_this_file($filename) && $self->check_doctype($filename)) { 166 return 1; # its a file for us 167 } 168 return 0; 159 169 } 160 170 … … 188 198 } 189 199 190 # because we are not just using process_exp to determine whether to process or not, we need to implement this too, so that a file can be passed down if we are not actually processing it191 sub metadata_read {192 my $self = shift (@_);193 194 my ($pluginfo, $base_dir, $file, $metadata, $extrametakeys, $extrametadata, $processor, $maxdocs, $gli) = @_;195 196 my $result = $self->SUPER::metadata_read($pluginfo, $base_dir, $file, $metadata, $extrametakeys, $extrametadata, $processor, $maxdocs, $gli);197 198 if (defined $result) {199 # we think we are processing this, but check that we actually are200 my ($filename_full_path, $filename_no_path) = $self->get_full_filenames($base_dir, $file);201 202 if ($self->check_doctype($filename_full_path)) {203 return $result;204 }205 }206 return undef;207 }208 200 209 201 # we need to implement read cos we are not just using process_exp to determine … … 212 204 my $self = shift (@_); 213 205 214 my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $total_count, $gli) = @_; 215 216 # Make sure we're processing the correct file, do blocking etc 217 my ($block_status,$filename_full_path) = $self->read_block(@_); 218 return $block_status if ((!defined $block_status) || ($block_status==0)); 219 220 ## check the doctype to see whether we really want to process the file 221 if (!$self->check_doctype($filename_full_path)) { 222 # this file is not for us 223 return undef; 224 } 225 206 my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $processor, $maxdocs, $total_count, $gli) = @_; 207 208 # can we process this file?? 209 my ($filename_full_path, $filename_no_path) = &util::get_full_filenames($base_dir, $file); 210 return undef unless $self->can_process_this_file($filename_full_path); 211 226 212 $file =~ s/^[\/\\]+//; # $file often begins with / so we'll tidy it up 227 213 $self->{'base_dir'} = $base_dir;
Note:
See TracChangeset
for help on using the changeset viewer.