Changeset 24403
- Timestamp:
- 2011-08-12T18:10:11+12:00 (13 years ago)
- Location:
- main/trunk/greenstone2/perllib/plugins
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/BasePlugin.pm
r24290 r24403 528 528 } 529 529 530 # Even if a plugin can extract metadata in its metadata_read pass, 531 # make the default return 'undef' so processing of the file continues 532 # down the pipeline, so other plugins can also have the opportunity to 533 # locate metadata and set it up in the extrametakeys variables that 534 # are passed around. 535 536 sub can_process_this_file_for_metadata { 537 my $self = shift(@_); 538 539 return undef; 540 } 541 542 530 543 # just converts path as is to utf8. 531 544 sub filepath_to_utf8 { … … 1131 1144 # can we process this file?? 1132 1145 my ($filename_full_path, $filename_no_path) = &util::get_full_filenames($base_dir, $file); 1133 return undef unless $self->can_process_this_file ($filename_full_path);1146 return undef unless $self->can_process_this_file_for_metadata($filename_full_path); 1134 1147 1135 1148 return 1; # we recognise the file, but don't actually do anything with it -
main/trunk/greenstone2/perllib/plugins/EmbeddedMetadataPlugin.pm
r24349 r24403 121 121 #} 122 122 123 # plugins that rely on more than process_exp (eg XML plugins) can override this method 124 sub can_process_this_file { 125 my $self = shift(@_); 126 127 # we process metadata, not the file 128 return 0; 129 } 130 131 # Even if a plugin can extract metadata in its metadata_read pass, 132 # make the default return 'undef' so processing of the file continues 133 # down the pipeline, so other plugins can also have the opportunity to 134 # locate metadata and set it up in the extrametakeys variables that 135 # are passed around. 136 137 sub can_process_this_file_for_metadata { 138 my $self = shift(@_); 139 140 # this plugin will look for metadata in any file through its 141 # metadata_read() returning undef here means anything else further 142 # down the pipeline can do the same 143 144 return undef; 145 } 146 123 147 124 148 sub extractEmbeddedMetadata() … … 285 309 } 286 310 311 sub read 312 { 313 return undef; 314 } 287 315 288 316 sub process() -
main/trunk/greenstone2/perllib/plugins/OAIPlugin.pm
r23352 r24403 185 185 } 186 186 187 sub can_process_this_file_for_metadata { 188 my $self = shift(@_); 189 190 return $self->can_process_this_file(@_); 191 } 192 187 193 188 194 sub metadata_read { … … 195 201 # can we process this file?? 196 202 my ($filename_full_path, $filename_no_path) = &util::get_full_filenames($base_dir, $file); 197 return undef unless $self->can_process_this_file ($filename_full_path);203 return undef unless $self->can_process_this_file_for_metadata($filename_full_path); 198 204 199 205 if (!$self->parse_file($filename_full_path, $file, $gli)) {
Note:
See TracChangeset
for help on using the changeset viewer.