Changeset 13177


Ignore:
Timestamp:
2006-10-27T15:36:27+13:00 (17 years ago)
Author:
mdewsnip
Message:

No longer tries to load the options for a plugin/classifier if it has already failed.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
4 edited

Legend:

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

    r12644 r13177  
    4444    static final public String CLASSIFIER_PREFIX = "CL";
    4545
     46    private boolean loading_options_failed = false;
     47
    4648
    4749    /** Constructor used only in DOMProxyListModel initializations.
     
    7476
    7577
     78    public boolean didLoadingOptionsFail()
     79    {
     80    return loading_options_failed;
     81    }
     82
     83
    7684    /** Generate the string showing this classifiers position. */
    7785    public String getPositionString() {
     
    8694    return position_string;
    8795    }
     96
     97
     98    public void setLoadingOptionsFailed()
     99    {
     100    this.loading_options_failed = true;
     101    }
    88102}
  • trunk/gli/src/org/greenstone/gatherer/cdm/Plugin.java

    r12642 r13177  
    4242    private String default_process_expression = "";
    4343    private boolean does_explode_metadata_databases = false;
     44    private boolean loading_options_failed = false;
    4445
    4546   
     
    8081    plugin_name = null;
    8182    return plugin;
     83    }
     84
     85
     86    public boolean didLoadingOptionsFail()
     87    {
     88    return loading_options_failed;
    8289    }
    8390
     
    203210    this.does_explode_metadata_databases = does_explode_metadata_databases;
    204211    }
     212
     213
     214    public void setLoadingOptionsFailed()
     215    {
     216    this.loading_options_failed = true;
     217    }
    205218}
  • trunk/gli/src/org/greenstone/gatherer/greenstone/Classifiers.java

    r13176 r13177  
    8383    // If we've found the classifier, load its arguments now, if required
    8484    if (classifier != null && arguments_required) {
    85         if (classifier.getArguments().size() == 0) {
     85        if (classifier.getArguments().size() == 0 && classifier.didLoadingOptionsFail() == false) {
    8686        loadClassifierInfo(classifier, collection_specific);
    8787        }
     
    165165        // Check the XML output was obtained successfully
    166166        if (classinfo_xml == null || classinfo_xml.length() == 0) {
     167        classifier.setLoadingOptionsFailed();
    167168        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.ClassifierManager.Classifier_XML_Parse_Failed", classifier.getName()), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
    168169        return;
     
    242243    Document document = XMLTools.parseXML(new StringReader(xml));
    243244    if (document == null) {
     245        classifier.setLoadingOptionsFailed();
    244246        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.ClassifierManager.Classifier_XML_Parse_Failed", classifier.getName()), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
    245247        return;
  • trunk/gli/src/org/greenstone/gatherer/greenstone/Plugins.java

    r13176 r13177  
    8484    // If we've found the plugin, load its arguments now, if required
    8585    if (plugin != null && arguments_required) {
    86         if (plugin.getArguments().size() == 0) {
     86        if (plugin.getArguments().size() == 0 && plugin.didLoadingOptionsFail() == false) {
    8787        loadPluginInfo(plugin, collection_specific);
    8888        }
     
    166166        // Check the XML output was obtained successfully
    167167        if (pluginfo_xml == null || pluginfo_xml.length() == 0) {
     168        plugin.setLoadingOptionsFailed();
    168169        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.PlugInManager.PlugIn_XML_Parse_Failed", plugin.getName()), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
    169170        return;
     
    243244    Document document = XMLTools.parseXML(new StringReader(xml));
    244245    if (document == null) {
     246        plugin.setLoadingOptionsFailed();
    245247        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.PlugInManager.PlugIn_XML_Parse_Failed", plugin.getName()), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
    246248        return;
Note: See TracChangeset for help on using the changeset viewer.