Ignore:
Timestamp:
2005-09-22T16:59:56+12:00 (19 years ago)
Author:
kjdon
Message:

made these look for BadArgument, BadArgumentValue, BadClassifier, BadPlugin tags from the import and build

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/shell/GBuildProgressMonitor.java

    r10530 r10618  
    7979    static final int CREATINGAUXILARY              = 50;
    8080    /** Now the language independant sentinel strings. */
     81    static final String BADARGUMENT_ELEMENT    = "BadArgument";
     82    static final String BADARGUMENTVALUE_ELEMENT = "BadArgumentValue";
     83    static final String BADCLASSIFIER_ELEMENT = "BadClassifier";
     84    static final String BADPLUGIN_ELEMENT = "BadPlugin";
    8185    static final String BUILD_ELEMENT          = "Build";
    8286    static final String COLLECTTEXTSTATS_VALUE = "CollectTextStats";
     
    106110    static final String WARNING_ELEMENT        = "Warning";   
    107111    static final String WORDLEVELINDEXES_VALUE = "WordLevelIndexes";
     112
     113    static final private String ARGUMENT_ATTRIBUTE = "a";
     114    static final private String CLASSIFIER_ATTRIBUTE = "c";
     115    static final private String PLUGIN_ATTRIBUTE = "p";
     116
    108117    /** Indicates if the GUI has asked the process this object monitors to stop. */
    109118    private boolean stop = false;
     
    226235        break;
    227236        case BUILD:
    228         // The only thing we would expect is a stage element
     237        // The only thing we would expect is a stage element or a
     238        // bad classifier arg name
    229239        name = element.getElementName();
     240
    230241        if(name.equals(STAGE_ELEMENT)) {
    231242            progress_bar.setIndeterminate(false);
     
    281292            }
    282293        }
     294        // We had a bad argument to a plugin/classifier
     295        else if (name.equals(BADARGUMENT_ELEMENT)) {
     296            if(Configuration.getMode() <= threshold) {
     297            String args[] = new String[1];
     298            args[0] = element.getAttribute(ARGUMENT_ATTRIBUTE);   
     299            queue.add(new GShellEvent(event.getSource(), 0, event.getType(), Dictionary.get("GShell.BadArgument", args), event.getStatus()));
     300            args = null;
     301            }
     302        }
     303        // We had a bad argument value to a plugin/clasifier
     304        else if (name.equals(BADARGUMENTVALUE_ELEMENT)) {
     305            if(Configuration.getMode() <= threshold) {
     306            String args[] = new String[1];
     307            args[0] = element.getAttribute(ARGUMENT_ATTRIBUTE);   
     308            queue.add(new GShellEvent(event.getSource(), 0, event.getType(), Dictionary.get("GShell.BadArgumentValue", args), event.getStatus()));
     309            args = null;
     310            }
     311        }
     312        // And this one tellsa us the plugin
     313        else if (name.equals(BADPLUGIN_ELEMENT)) {
     314            if(Configuration.getMode() <= threshold) {
     315            String args[] = new String[1];
     316            args[0] = element.getAttribute(PLUGIN_ATTRIBUTE);   
     317            queue.add(new GShellEvent(event.getSource(), 0, event.getType(), Dictionary.get("GShell.BadPluginOptions", args), event.getStatus()));
     318            args = null;
     319            }
     320        }
     321        // or the classifier
     322        else if (name.equals(BADCLASSIFIER_ELEMENT)) {
     323            if(Configuration.getMode() <= threshold) {
     324            String args[] = new String[1];
     325            args[0] = element.getAttribute(CLASSIFIER_ATTRIBUTE);   
     326            queue.add(new GShellEvent(event.getSource(), 0, event.getType(), Dictionary.get("GShell.BadClassifierOptions", args), event.getStatus()));
     327            args = null;
     328            }
     329        }
     330       
    283331        else {
    284332            // Unknown command, go indeterminate
Note: See TracChangeset for help on using the changeset viewer.