Changeset 24548

Show
Ignore:
Timestamp:
02.09.2011 19:39:10 (8 years ago)
Author:
ak19
Message:

Part 2 of previous commit (r24547). Added new abstract plugin MetadataRead?? that defines can_process_this_file_for_metadata that MetadataPlugin?? subclasses can inherit (if MetadataRead?? is listed first in the ISA inheritance list) and which will then override the one defined in BasePlugin??. For now committing MARC, ISIS and OAIPlugins which now additionally inherit from MetadataRead??. Other metadataPlugins also need to be committed.

Location:
main/trunk/greenstone2/perllib/plugins
Files:
10 modified

Legend:

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

    r17026 r24548  
    4545 
    4646use SplitTextFile; 
     47use MetadataRead; 
    4748use strict; 
    4849no strict 'refs'; # allow filehandles to be variables and viceversa 
     
    5051# BibTexPlugin is a sub-class of SplitTextFile. 
    5152sub BEGIN { 
    52     @BibTexPlugin::ISA = ('SplitTextFile'); 
     53    @BibTexPlugin::ISA = ('MetadataRead', 'SplitTextFile'); 
    5354} 
    5455 
  • main/trunk/greenstone2/perllib/plugins/DatabasePlugin.pm

    r23352 r24548  
    4040 
    4141use AutoExtractMetadata; 
     42use MetadataRead; 
    4243use unicode; 
    4344 
    4445sub BEGIN { 
    45     @DatabasePlugin::ISA = ('AutoExtractMetadata'); 
     46    @DatabasePlugin::ISA = ('MetadataRead', 'AutoExtractMetadata'); 
    4647} 
    4748 
  • main/trunk/greenstone2/perllib/plugins/LOMPlugin.pm

    r23212 r24548  
    3434use ReadTextFile; 
    3535use MetadataPass; 
     36use MetadataRead; 
    3637use XMLParser; 
    3738use Cwd; 
    3839 
     40# methods with identical signatures take precedence in the order given in the ISA list. 
    3941sub BEGIN { 
    40     @ISA = ('ReadTextFile', 'MetadataPass'); 
     42    @ISA = ('MetadataRead', 'ReadTextFile', 'MetadataPass'); 
    4143} 
    4244 
     
    129131    # can we process this file?? 
    130132    my ($filename_full_path, $filename_no_path) = &util::get_full_filenames($base_dir, $file); 
    131     return undef unless $self->can_process_this_file($filename_full_path); 
     133    return undef unless $self->can_process_this_file_for_metadata($filename_full_path); 
    132134 
    133135    $file =~ s/^[\/\\]+//; # $file often begins with / so we'll tidy it up 
  • main/trunk/greenstone2/perllib/plugins/LaTeXPlugin.pm

    r16104 r24548  
    3434# greenstone packages 
    3535use ReadTextFile; 
     36use MetadataRead; 
    3637use unicode; 
    3738use util; 
     
    5152 
    5253sub BEGIN { 
    53     @LaTeXPlugin::ISA = ('ReadTextFile'); 
     54    @LaTeXPlugin::ISA = ('MetadataRead', 'ReadTextFile'); 
    5455} 
    5556 
  • main/trunk/greenstone2/perllib/plugins/NulPlugin.pm

    r15872 r24548  
    3838 
    3939use BasePlugin; 
     40use MetadataRead; 
    4041 
    4142use strict; 
     
    4344 
    4445sub BEGIN { 
    45     @NulPlugin::ISA = ('BasePlugin'); 
     46    @NulPlugin::ISA = ('MetadataRead', 'BasePlugin'); 
    4647} 
    4748 
  • main/trunk/greenstone2/perllib/plugins/PagedImagePlugin.pm

    r24148 r24548  
    138138use ReadTextFile; 
    139139use ImageConverter; 
     140use MetadataRead; 
    140141 
    141142use strict; 
     
    143144 
    144145sub BEGIN { 
    145     @PagedImagePlugin::ISA = ('ReadXMLFile', 'ReadTextFile', 'ImageConverter'); 
     146    @PagedImagePlugin::ISA = ('MetadataRead', 'ReadXMLFile', 'ReadTextFile', 'ImageConverter'); 
    146147} 
    147148 
  • main/trunk/greenstone2/perllib/plugins/ProCitePlugin.pm

    r17480 r24548  
    3030use multiread; 
    3131use SplitTextFile; 
     32use MetadataRead; 
    3233 
    3334use strict; 
     
    3637# ProCitePlugin is a sub-class of SplitTextFile 
    3738sub BEGIN { 
    38     @ProCitePlugin::ISA = ('SplitTextFile'); 
     39    @ProCitePlugin::ISA = ('MetadataRead', 'SplitTextFile'); 
    3940} 
    4041 
  • main/trunk/greenstone2/perllib/plugins/ReferPlugin.pm

    r16104 r24548  
    6464 
    6565use SplitTextFile; 
     66use MetadataRead; 
    6667use strict; 
    6768no strict 'refs'; # allow filehandles to be variables and viceversa 
     
    6970# ReferPlugin is a sub-class of BasePlugin. 
    7071sub BEGIN { 
    71     @ReferPlugin::ISA = ('SplitTextFile'); 
     72    @ReferPlugin::ISA = ('MetadataRead', 'SplitTextFile'); 
    7273} 
    7374 
  • main/trunk/greenstone2/perllib/plugins/RogPlugin.pm

    r18327 r24548  
    2929 
    3030use BasePlugin; 
     31use MetadataRead; 
    3132use sorttools; 
    3233use doc;  
     
    3637 
    3738sub BEGIN { 
    38     @RogPlugin::ISA = ('BasePlugin'); 
     39    @RogPlugin::ISA = ('MetadataRead', 'BasePlugin'); 
    3940} 
    4041 
  • main/trunk/greenstone2/perllib/plugins/SourceCodePlugin.pm

    r17739 r24548  
    3838 
    3939use ReadTextFile; 
     40use MetadataRead; 
    4041 
    4142use strict; 
     
    4344 
    4445sub BEGIN { 
    45     @SourceCodePlugin::ISA = ('ReadTextFile'); 
     46    @SourceCodePlugin::ISA = ('MetadataRead', 'ReadTextFile'); 
    4647} 
    4748