Changeset 24414 for main


Ignore:
Timestamp:
2011-08-16T21:17:46+12:00 (13 years ago)
Author:
ak19
Message:

To do with EmbeddedMetadataPlugin: 1.mkcol.pl and GLI changes puts the plugin in the bottom four plugins of the plugin pipeline. 2. EmbeddedMetadataPlugin and PDFPlugin are modified to work together again after the recent changes (introduction of overridable BasePlugin method can_process_file_for_metadata) which were needed to get the EmbeddedMetadataPlugin and OAIPlugin to work together.

Location:
main/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/cdm/PluginManager.java

    r24367 r24414  
    7171
    7272  /** The number of plugins that are fixed 'below the line' */
    73   private static int NUM_FIXED_PLUGINS = 3;
     73  private static int NUM_FIXED_PLUGINS = 4;
    7474    /** Constructor.
    7575     */
     
    194194     */
    195195    private void assignPlugin(Plugin plugin) {
    196       if(plugin.getName().equals(StaticStrings.RECPLUG_STR) || plugin.getName().equals(StaticStrings.ARCPLUG_STR) || plugin.getName().equals(StaticStrings.METADATAXMLPLUG_STR)) {
     196      if(plugin.getName().equals(StaticStrings.RECPLUG_STR) || plugin.getName().equals(StaticStrings.ARCPLUG_STR)
     197     || plugin.getName().equals(StaticStrings.METADATAXMLPLUG_STR) || plugin.getName().equals(StaticStrings.EMBEDMETAPLUG_STR)) {
    197198        addAfter(plugin, separator_plugin); // Adds after separator
    198199    } else {
     
    297298        return;
    298299    }
    299     if(plugin.getName().equals(StaticStrings.ARCPLUG_STR) || plugin.getName().equals(StaticStrings.RECPLUG_STR) || plugin.getName().equals(StaticStrings.METADATAXMLPLUG_STR)) {
     300    if(plugin.getName().equals(StaticStrings.ARCPLUG_STR) || plugin.getName().equals(StaticStrings.RECPLUG_STR)
     301       || plugin.getName().equals(StaticStrings.METADATAXMLPLUG_STR) || plugin.getName().equals(StaticStrings.EMBEDMETAPLUG_STR)) {
    300302        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.Move.Fixed"), Dictionary.get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE);
    301303        return;
     
    362364        Plugin plugin = (Plugin) getElementAt(index);
    363365        String name = plugin.getName();
    364         if(name.equals(StaticStrings.RECPLUG_STR) || name.equals(StaticStrings.ARCPLUG_STR) || name.equals(StaticStrings.METADATAXMLPLUG_STR)) {
     366        if(name.equals(StaticStrings.RECPLUG_STR) || name.equals(StaticStrings.ARCPLUG_STR)
     367           || name.equals(StaticStrings.METADATAXMLPLUG_STR) || name.equals(StaticStrings.EMBEDMETAPLUG_STR)) {
    365368            found_fixed = true;
    366369            index--;
     
    721724            String plugin_name = selected_plugin.getName();
    722725            // Some buttons are only available for plugins other than ArcPlug and RecPlug
    723             if(plugin_name.equals(StaticStrings.ARCPLUG_STR) || plugin_name.equals(StaticStrings.RECPLUG_STR) || plugin_name.equals(StaticStrings.METADATAXMLPLUG_STR)) {
     726            if(plugin_name.equals(StaticStrings.ARCPLUG_STR) || plugin_name.equals(StaticStrings.RECPLUG_STR)
     727           || plugin_name.equals(StaticStrings.METADATAXMLPLUG_STR) || plugin_name.equals(StaticStrings.EMBEDMETAPLUG_STR)) {
    724728              move_up_button.setEnabled(false);
    725729              move_down_button.setEnabled(false);
  • main/trunk/gli/src/org/greenstone/gatherer/util/StaticStrings.java

    r24367 r24414  
    157157    static final public String INT_STR = "int";
    158158    static final public String IMPORT_STR = "import";
    159     static final public String[] KEEP_PLUG = { "GreenstoneXMLPlugin", "GreenstoneMETSPlugin", "EmbeddedMetadataPlugin" };
     159    static final public String[] KEEP_PLUG = { "GreenstoneXMLPlugin", "GreenstoneMETSPlugin" };
    160160    static final public String LANGUAGE_ARGUMENT = "l=";
    161161    static final public String LANGUAGE_ATTRIBUTE = "language";
  • main/trunk/greenstone2/bin/script/mkcol.pl

    r24355 r24414  
    353353    # load default plugins if none were on command line
    354354    if (!scalar(@plugin)) {
    355     @plugin = (ZIPPlugin,GreenstoneXMLPlugin,EmbeddedMetadataPlugin,TextPlugin,HTMLPlugin,EmailPlugin,
    356            PDFPlugin,RTFPlugin,WordPlugin,PostScriptPlugin,PowerPointPlugin,ExcelPlugin,ImagePlugin,ISISPlugin,NulPlugin,MetadataXMLPlugin,ArchivesInfPlugin,DirectoryPlugin);
     355    @plugin = (ZIPPlugin,GreenstoneXMLPlugin,TextPlugin,HTMLPlugin,EmailPlugin,
     356           PDFPlugin,RTFPlugin,WordPlugin,PostScriptPlugin,PowerPointPlugin,ExcelPlugin,ImagePlugin,ISISPlugin,NulPlugin,EmbeddedMetadataPlugin,MetadataXMLPlugin,ArchivesInfPlugin,DirectoryPlugin);
    357357    }
    358358
  • main/trunk/greenstone2/perllib/plugins/EmbeddedMetadataPlugin.pm

    r24404 r24414  
    139139
    140140    # this plugin will look for metadata in any file through its
    141     # metadata_read() returning undef here means anything else further
     141    # metadata_read(). Returning undef here means anything else further
    142142    # down the pipeline can do the same
    143143
     
    297297   
    298298    # we don't want to process directories
    299     if (!-f $filename_full_path || !$self->can_process_this_file($filename_full_path)) {
     299    if (!-f $filename_full_path) {
    300300    return undef;
    301301    }
  • main/trunk/greenstone2/perllib/plugins/PDFPlugin.pm

    r24290 r24414  
    213213}
    214214
     215# Even if a plugin can extract metadata in its metadata_read pass,
     216# make the default return 'undef' so processing of the file continues
     217# down the pipeline, so other plugins can also have the opportunity to
     218# locate metadata and set it up in the extrametakeys variables that
     219# are passed around.
     220sub can_process_this_file_for_metadata {
     221    my $self = shift(@_);
     222
     223    # this plugin will look for metadata in any file through its
     224    # metadata_read(). Returning undef here means anything else further
     225    # down the pipeline can do the same
     226
     227    return 0;
     228}
     229
    215230sub init {
    216231    my $self = shift (@_);
Note: See TracChangeset for help on using the changeset viewer.