Ignore:
Timestamp:
2011-08-12T18:10:11+12:00 (11 years ago)
Author:
ak19
Message:

Dr Bainbridge has fixed the conflict between OAIPlugin and EmbeddedMetadataPlugin which resulted in the oai tutorial (with the JCDL pictures) going wrong: meta was not attached to the images. Dr Bainbridge solved the problem by introducing a new method in BasePlugin: can_process_this_file_for_metadata, which by default returns undef so that things should work by default mostly. This method has been overridden in OAIPlugin and EmbeddedMetadataPlugin now to do the right thing there.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/EmbeddedMetadataPlugin.pm

    r24349 r24403  
    121121#}
    122122
     123# plugins that rely on more than process_exp (eg XML plugins) can override this method
     124sub 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
     137sub 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
    123147
    124148sub extractEmbeddedMetadata()
     
    285309}
    286310
     311sub read
     312{
     313    return undef;
     314}
    287315
    288316sub process()
Note: See TracChangeset for help on using the changeset viewer.