greenstone.org greenstone wiki greenstone trac planet greenstone

Changeset 16295

Show
Ignore:
Timestamp:
2008-07-03 16:51:13 (2 months ago)
Author:
ak19
Message:

ArchivesInfPlugin? has 0 options which caused GLI to try and load it twice. This problem is now resolved by turning the loading_options_failed member variable into has_loaded_options since the latter now indicates 2 things: whether a plugin has already been loaded before and whether it has successfully been loaded (or failed during loading attempt).

Files:

Legend:

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

    r15108 r16295  
    4343    private boolean does_explode_metadata_databases = false;  
    4444    private boolean does_replace_srcdocs_with_html = false; // to work with replace_srcdoc_with_html.pl 
    45     private boolean loading_options_failed = false; 
     45    /** Plugins are loaded as needed. This variable indicates 1. whether a plugin has been loaded already; 2. whether a  
     46     * plugin has been successfully loaded. When both are true, has_loaded_options will be true. */ 
     47    private boolean has_loaded_options = false; 
    4648 
    4749    /** Constructor used in DOMProxyListModel initializations, and Library Level. Used for Base plugins (those in the list of available plugins, not ones that are in the DOMProxyList) 
     
    8486 
    8587 
    86     public boolean didLoadingOptionsFail() 
    87     { 
    88         return loading_options_failed
     88    public boolean hasLoadedOptions() 
     89    { 
     90        return has_loaded_options
    8991    } 
    9092 
     
    228230    } 
    229231 
    230     public void setLoadingOptionsFailed(
    231     { 
    232         this.loading_options_failed = true
     232    public void setHasLoadedOptions(boolean hasLoadedOptions
     233    { 
     234        this.has_loaded_options = hasLoadedOptions
    233235    } 
    234236} 
  • gli/trunk/src/org/greenstone/gatherer/greenstone/Plugins.java

    r15111 r16295  
    8383        // If we've found the plugin, load its arguments now, if required 
    8484        if (plugin != null && arguments_required) { 
    85             if (plugin.getArguments().size() == 0 && plugin.didLoadingOptionsFail() == false) { 
     85            if (!plugin.hasLoadedOptions()) { 
    8686                loadPluginInfo(plugin, collection_specific); 
    8787            } 
     
    165165            // Check the XML output was obtained successfully 
    166166            if (pluginfo_xml == null || pluginfo_xml.length() == 0) { 
    167                 plugin.setLoadingOptionsFailed(); 
     167                plugin.setHasLoadedOptions(false); // failure to load options 
    168168                JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.PlugInManager.PlugIn_XML_Parse_Failed", plugin.getName()), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 
    169169                return; 
     170            } else { 
     171                plugin.setHasLoadedOptions(true); 
    170172            } 
    171173 
     
    243245        Document document = XMLTools.parseXML(new StringReader(xml)); 
    244246        if (document == null) { 
    245             plugin.setLoadingOptionsFailed(); 
     247            plugin.setHasLoadedOptions(false); // failure to load the options/failed plugin 
    246248            JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.PlugInManager.PlugIn_XML_Parse_Failed", plugin.getName()), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 
    247249            return; 
     250        } else { 
     251            plugin.setHasLoadedOptions(true); 
    248252        } 
    249253