Changeset 8768


Ignore:
Timestamp:
2004-12-09T15:37:34+13:00 (19 years ago)
Author:
mdewsnip
Message:

A bit of work in preparation for exploding metadata databases.

Location:
trunk/gli/src/org/greenstone/gatherer/cdm
Files:
2 edited

Legend:

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

    r8607 r8768  
    3636    extends ArrayList
    3737    implements ArgumentContainer, Comparable, DOMProxyListEntry, Serializable {
    38     private boolean is_abstract = false; // Only for Base
    3938    /** The DOM Element this assigned Plugin is modelled on. */
    4039    private Element element;
     40    private boolean does_explode_metadata_databases = false; // Only for Base
     41    private boolean is_abstract = false; // Only for Base
    4142    /** The parent Plugin this one inherits from, if any. */
    4243    private Plugin super_plugin; // Only for Base
     
    156157
    157158
     159    /** Checks whether the plugin this instance is based on processes metadata databases that can be exploded. */
     160    public boolean doesExplodeMetadataDatabases()
     161    {
     162    Plugin base_plugin = CollectionDesignManager.plugin_manager.getBasePlugin(getName());
     163    return base_plugin.does_explode_metadata_databases;
     164    }
     165
     166
     167    /** Checks whether this plugin instance will process the specified file (given its process_exp and block_exp). */
    158168    public boolean doesProcessFile(File file)
    159169    {
     
    189199    }
    190200
    191     // This plugin (probably) will not deal with the specified file
     201    // This plugin will (probably) not deal with the specified file
    192202    return false;
    193203    }
     
    368378    }
    369379
     380    public void setDoesExplodeMetadataDatabases(boolean does_explode_metadata_databases) {
     381    this.does_explode_metadata_databases = does_explode_metadata_databases;
     382    }
     383
    370384    public void setElement(Element element) {
    371385    this.element = element;
  • trunk/gli/src/org/greenstone/gatherer/cdm/PluginManager.java

    r8765 r8768  
    124124
    125125
     126    /** This function listens for new files being added to the collection and hints about suitable plugins. */
    126127    public void fileAddedToCollection(File file)
    127128    {
     
    134135        // This file will be processed by an assigned plugin, so no suggestion is necessary
    135136        System.err.println("Processed by assigned plugin: " + assigned_plugin);
     137        System.err.println("Explodes metadata databases: " + assigned_plugin.doesExplodeMetadataDatabases());
    136138        return;
    137139        }
     
    606608    Plugin plugin = new Plugin();
    607609    String node_name = null;
    608     for(Node node = root.getFirstChild(); node != null;
    609         node = node.getNextSibling()) {
     610    for (Node node = root.getFirstChild(); node != null; node = node.getNextSibling()) {
    610611        node_name = node.getNodeName();
    611612        if(node_name.equalsIgnoreCase("Name")) {
     
    618619        plugin.setName(name);
    619620        }
    620         else if(node_name.equalsIgnoreCase("Desc")) {
     621        else if (node_name.equalsIgnoreCase("Desc")) {
    621622        plugin.setDescription(XMLTools.getValue(node));
    622623        }
    623         else if(node_name.equalsIgnoreCase("Abstract")) {
    624         plugin.setIsAbstract(XMLTools.getValue(node).equalsIgnoreCase(CollectionConfiguration.YES_STR));
    625         }
    626         // Parse the multitude of arguments.
     624        else if (node_name.equalsIgnoreCase("Abstract")) {
     625        plugin.setIsAbstract(XMLTools.getValue(node).equalsIgnoreCase(StaticStrings.YES_STR));
     626        }
     627        else if (node_name.equalsIgnoreCase("Explodes")) {
     628        plugin.setDoesExplodeMetadataDatabases(XMLTools.getValue(node).equalsIgnoreCase(StaticStrings.YES_STR));
     629        System.err.println("Plugin " + plugin.getName() + " explodes metadata databases: " + plugin.doesExplodeMetadataDatabases());
     630        }
     631        // Parse the multitude of arguments
    627632        else if(node_name.equalsIgnoreCase("Arguments")) {
    628633        for(Node arg = node.getFirstChild(); arg != null; arg = arg.getNextSibling()) {
Note: See TracChangeset for help on using the changeset viewer.