Changeset 8236


Ignore:
Timestamp:
2004-10-08T09:46:12+13:00 (20 years ago)
Author:
mdewsnip
Message:

Replaced all Gatherer.print* with DebugStream.print*.

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

Legend:

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

    r8231 r8236  
    152152
    153153    // The exec_path may contain an url address, in which case we blindly use that and leave it up to the user to worry about settings and resetting.
    154     Gatherer.println("EXEC_PATH = " + exec_path);
     154    DebugStream.println("EXEC_PATH = " + exec_path);
    155155    if(exec_path != null && exec_path.length() > 0) {
    156156        try {
     
    158158        }
    159159        catch (MalformedURLException error) {
    160         Gatherer.println("Not an address.");
    161         Gatherer.printStackTrace(error);
     160        DebugStream.println("Not an address.");
     161        DebugStream.printStackTrace(error);
    162162        }
    163163    }
     
    172172        }
    173173        else {
    174             Gatherer.println("No local library at given file path.");
     174            DebugStream.println("No local library at given file path.");
    175175        }
    176176        }
    177177        // All sorts of errors might be thrown by a bogus file path.
    178178        catch (Exception error) {
    179         Gatherer.println("Libary url does not indicate the server.exe file.");
     179        DebugStream.println("Libary url does not indicate the server.exe file.");
    180180        ///atherer.printStackTrace(error);
    181181        }
     
    187187        }
    188188        else {
    189             Gatherer.println("No local library.");
     189            DebugStream.println("No local library.");
    190190        }
    191191        }
     
    193193    }
    194194    else {
    195         Gatherer.println("exec_address != null -> " + exec_address);
     195        DebugStream.println("exec_address != null -> " + exec_address);
    196196    }
    197197
     
    248248    if(general_config == null) {
    249249        general_config = Utility.parse(TEMPLATE_CONFIG_XML, true);
    250         Gatherer.println("Loaded default Gatherer configuration template.");
     250        DebugStream.println("Loaded default Gatherer configuration template.");
    251251    }
    252252    else {
    253         Gatherer.println("Loaded current Gatherer configuration.");
     253        DebugStream.println("Loaded current Gatherer configuration.");
    254254    }
    255255
     
    292292        }
    293293    }
    294     Gatherer.println("EXEC_FILE = " + exec_file);
    295     Gatherer.println("EXEC_ADDRESS = " + exec_address);
     294    DebugStream.println("EXEC_FILE = " + exec_file);
     295    DebugStream.println("EXEC_ADDRESS = " + exec_address);
    296296    }
    297297
     
    322322    }
    323323    catch (Exception exception) {
    324         Gatherer.printStackTrace(exception);
     324        DebugStream.printStackTrace(exception);
    325325    }
    326326    return result;
     
    424424    }
    425425    catch(Exception error) {
    426         Gatherer.printStackTrace(error);
     426        DebugStream.printStackTrace(error);
    427427    }
    428428    return result;
     
    469469    }
    470470    catch(Exception exception) {
    471         Gatherer.printStackTrace(exception);
     471        DebugStream.printStackTrace(exception);
    472472    }
    473473    return special_directories;
     
    510510    }
    511511    catch(Exception error) {
    512         Gatherer.printStackTrace(error);
     512        DebugStream.printStackTrace(error);
    513513    }
    514514    return result;
     
    523523    }
    524524    catch(Exception error) {
    525         Gatherer.printStackTrace(error);
     525        DebugStream.printStackTrace(error);
    526526    }
    527527    return result;
     
    555555    }
    556556    catch(Exception error) {
    557         Gatherer.printStackTrace(error);
     557        DebugStream.printStackTrace(error);
    558558    }
    559559    return result;
     
    690690    }
    691691    catch(Exception error) {
    692         Gatherer.printStackTrace(error);
     692        DebugStream.printStackTrace(error);
    693693    }
    694694    return file;
     
    724724    static public void set(String property, boolean general, boolean value) {
    725725    if(property.startsWith("workflow")) {
    726         Gatherer.println("Set property: " + property + ", general=" + general + ", value=" + value);
     726        DebugStream.println("Set property: " + property + ", general=" + general + ", value=" + value);
    727727    }
    728728    setString(property, general, (value ? "true" : "false"));
     
    756756    }
    757757    catch (Exception error) {
    758         Gatherer.println("Error in Configuration.setArguments(): " + error);
    759         Gatherer.printStackTrace(error);
     758        DebugStream.println("Error in Configuration.setArguments(): " + error);
     759        DebugStream.printStackTrace(error);
    760760    }
    761761    }
     
    867867    /** Sets the value of the named property argument using the given string. */
    868868    static public void setString(String property, boolean general, String value) {
    869     Gatherer.println("Set configuration property: " + property + " = " + value + (general ? "" : " [Collection]"));
     869    DebugStream.println("Set configuration property: " + property + " = " + value + (general ? "" : " [Collection]"));
    870870    try {
    871871        Document document = general_config;
  • trunk/gli/src/org/greenstone/gatherer/Dictionary.java

    r6855 r8236  
    188188    catch (Exception e) {
    189189        System.err.println("Missing value for key: " + key);
    190         // Gatherer.printStackTrace(e);
     190        // DebugStream.printStackTrace(e);
    191191        return key;
    192192    }
  • trunk/gli/src/org/greenstone/gatherer/Gatherer.java

    r8235 r8236  
    220220        // Having loaded the configuration (necessary to determine if certain warnings have been disabled) and dictionary, we now check if the necessary path variables have been provided.
    221221        if (Configuration.exec_file == null && Configuration.exec_address == null) {
    222         Gatherer.println("config.exec_file is null");
    223         Gatherer.println("config.exec_address is null");
     222        DebugStream.println("config.exec_file is null");
     223        DebugStream.println("config.exec_address is null");
    224224        missingEXEC();
    225225        }
    226226
    227227        if (Gatherer.isGsdlRemote) {
    228         Gatherer.println("Not checking for perl path/exe");
     228        DebugStream.println("Not checking for perl path/exe");
    229229        }
    230230        else {
     
    326326
    327327    }
    328     catch (Exception error) {
    329         error.printStackTrace();
     328    catch (Exception exception) {
     329        DebugStream.printStackTrace(exception);
    330330    }
    331331
     
    472472        String raw_url = Configuration.exec_address.toString() + command;
    473473        URL url = new URL(raw_url);
    474         Gatherer.println("Action: " + raw_url);
     474        DebugStream.println("Action: " + raw_url);
    475475        HttpURLConnection library_connection = (HttpURLConnection) url.openConnection();
    476476        int response_code = library_connection.getResponseCode();
    477477        if(HttpURLConnection.HTTP_OK <= response_code && response_code < HttpURLConnection.HTTP_MULT_CHOICE) {
    478         Gatherer.println("200 - Complete.");
     478        DebugStream.println("200 - Complete.");
    479479        }
    480480        else {
    481         Gatherer.println("404 - Failed.");
     481        DebugStream.println("404 - Failed.");
    482482        }
    483483        url = null;
    484484    }
    485485    catch (Exception ex) {
    486         ex.printStackTrace();
    487         Gatherer.printStackTrace(ex);
     486        DebugStream.printStackTrace(ex);
    488487    }
    489488    }
     
    496495        String raw_url = Configuration.exec_address.toString() + Configuration.getServletPath() + command;
    497496        URL url = new URL(raw_url);
    498         Gatherer.println("Action: " + raw_url);
     497        DebugStream.println("Action: " + raw_url);
    499498        HttpURLConnection library_connection = (HttpURLConnection) url.openConnection();
    500499        int response_code = library_connection.getResponseCode();
    501500        if(HttpURLConnection.HTTP_OK <= response_code && response_code < HttpURLConnection.HTTP_MULT_CHOICE) {
    502         Gatherer.println("200 - Complete.");
     501        DebugStream.println("200 - Complete.");
    503502        }
    504503        else {
    505         Gatherer.println("404 - Failed.");
     504        DebugStream.println("404 - Failed.");
    506505        }
    507506        url = null;
    508507    }
    509508    catch(Exception exception) {
    510         Gatherer.printStackTrace(exception);
     509        DebugStream.printStackTrace(exception);
    511510        ///ystem.err.println("Bad URL.");
    512511    }
     
    613612    dialog = null;
    614613    }
    615     /** Print a message to the debug stream. */
    616     static synchronized public void print(String message) {
    617     DebugStream.print(message);
    618     }
    619     /** Print a message to the debug stream. */
    620     static synchronized public void println(String message) {
    621     DebugStream.println(message);
    622     }
    623 
    624     /** Print a stack trace to the debug stream. */
    625     static synchronized public void printStackTrace(Exception exception) {
    626     DebugStream.printStackTrace(exception);
    627     }
    628 
    629     /** Prints a usage message to screen.
    630      */
    631     static public void printUsage(Dictionary dictionary) {
    632     System.out.println(Dictionary.get("General.Usage"));
    633     }
     614
    634615
    635616    /** Sets up the proxy connection by setting JVM Environment flags and creating a new Authenticator.
     
    651632        }
    652633    } catch (Exception error) {
    653         Gatherer.println("Error in Gatherer.initProxy(): " + error);
    654         Gatherer.printStackTrace(error);
     634        DebugStream.println("Error in Gatherer.initProxy(): " + error);
     635        DebugStream.printStackTrace(error);
    655636    }
    656637    }
     
    695676    }
    696677    catch (Exception error) {
    697         Gatherer.println(Configuration.CONFIG_XML+" is not a well formed XML document.");
    698         Gatherer.printStackTrace(error);
     678        DebugStream.println(Configuration.CONFIG_XML+" is not a well formed XML document.");
     679        DebugStream.printStackTrace(error);
    699680    }
    700681    if (GS3) {
    701682        try {
    702683        servlet_config = new ServletConfiguration(gsdl3_path);
    703         } catch (Exception error) {
    704         error.printStackTrace();
     684        } catch (Exception exception) {
     685        DebugStream.printStackTrace(exception);
    705686        }
    706687    }
     
    711692    try {
    712693        Configuration.save();
    713     } catch (Exception error) {
    714         Gatherer.printStackTrace(error);
     694    } catch (Exception exception) {
     695        DebugStream.printStackTrace(exception);
    715696    }
    716697    }
     
    766747            // A quick test involves opening a connection to get the home page  for this collection. If this fails then we try changing the url to be localhost.
    767748            try {
    768                 Gatherer.println("Try connecting to server on config url: '" + Configuration.exec_address + "'");
     749                DebugStream.println("Try connecting to server on config url: '" + Configuration.exec_address + "'");
    769750                URLConnection connection = Configuration.exec_address.openConnection();
    770751                connection.getContent();
     
    772753            catch(IOException bad_url_connection) {
    773754                try {
    774                 Gatherer.println("Try connecting to server on local host: '" + gsdlsite_cfg.getLocalHostURL() + "'");
     755                DebugStream.println("Try connecting to server on local host: '" + gsdlsite_cfg.getLocalHostURL() + "'");
    775756                Configuration.exec_address = new URL(gsdlsite_cfg.getLocalHostURL   ());
    776757                URLConnection connection = Configuration.exec_address.openConnection();
     
    778759                }
    779760                catch(IOException worse_url_connection) {
    780                 Gatherer.println("Can't connect to server on either address.");
     761                DebugStream.println("Can't connect to server on either address.");
    781762                Configuration.exec_address = null;
    782763                Configuration.exec_file = null;
     
    789770            }
    790771        }
    791         catch (Exception error) {
    792             error.printStackTrace();
     772        catch (Exception exception) {
     773            DebugStream.printStackTrace(exception);
    793774        }
    794775        }
    795776        // Can't do a damb thing.
    796777    }
    797     Gatherer.println("Having started server.exe, exec_address is: " + Configuration.exec_address);
     778    DebugStream.println("Having started server.exe, exec_address is: " + Configuration.exec_address);
    798779    }
    799780
     
    827808            //}
    828809        }
    829         catch (Exception error) {
    830             error.printStackTrace();
     810        catch (Exception exception) {
     811            DebugStream.printStackTrace(exception);
    831812        }
    832813        }
     
    882863            whole_command.append(" ");
    883864            }
    884             println("Running " + whole_command.toString());
     865            DebugStream.println("Running " + whole_command.toString());
    885866            Runtime rt = Runtime.getRuntime();
    886867            process = rt.exec(commands);
     
    888869        }
    889870        else {
    890             println("Running " + command);
     871            DebugStream.println("Running " + command);
    891872            Runtime rt = Runtime.getRuntime();
    892873            process = rt.exec(command);
     
    894875        }
    895876        }
    896         catch (Exception error) {
    897         println("Error in ExternalApplication.run(): " + error);
    898         printStackTrace(error);
     877        catch (Exception exception) {
     878        DebugStream.printStackTrace(exception);
    899879        }
    900880        // Remove ourself from Gatherer list of threads.
     
    956936        String lower_name = prog_name.toLowerCase();
    957937        if (lower_name.indexOf("mozilla") != -1 || lower_name.indexOf("netscape") != -1) {
    958             Gatherer.println("found mozilla or netscape, trying remote it");
     938            DebugStream.println("found mozilla or netscape, trying remote it");
    959939            // mozilla and netscape, try using a remote command to get things in the same window
    960940            String [] new_commands = new String[] {prog_name, "-raise", "-remote", "openURL("+url+",new-tab)"};
     
    965945            int exitCode = process.waitFor();
    966946            if (exitCode != 0) { // if Netscape or mozilla was not open
    967             Gatherer.println("couldn't do remote, trying original command");
     947            DebugStream.println("couldn't do remote, trying original command");
    968948            printArray(commands);
    969949            process = rt.exec(commands); // try the original command
     
    976956            whole_command.append(" ");
    977957            }
    978             println("Running " + whole_command.toString());
     958            DebugStream.println("Running " + whole_command.toString());
    979959            Runtime rt = Runtime.getRuntime();
    980960            process = rt.exec(commands);
     
    983963        }
    984964       
    985         catch (Exception error) {
    986         println("Error in BrowserApplication.run(): " + error);
    987         printStackTrace(error);
     965        catch (Exception exception) {
     966        DebugStream.printStackTrace(exception);
    988967        }
    989968        // Remove ourself from Gatherer list of threads.
  • trunk/gli/src/org/greenstone/gatherer/GetOpt.java

    r8229 r8236  
    112112        //    value. We are ready to store the data in the
    113113        //    appropriate variables.
    114         Gatherer.println("Parsed Argument: name=" + argument_name + (argument_value != null ? (", value=" + argument_value) : ", no value"));
     114        DebugStream.println("Parsed Argument: name=" + argument_name + (argument_value != null ? (", value=" + argument_value) : ", no value"));
    115115        // 3a. First those arguments that have no associated value
    116116        if(argument_value == null) {
    117117            if(argument_name.equals(StaticStrings.HELP_ARGUMENT)) {
    118             Gatherer.printUsage(dictionary);
     118            System.out.println(Dictionary.get("General.Usage"));
    119119            System.exit(0);
    120120            }
  • trunk/gli/src/org/greenstone/gatherer/ServletConfiguration.java

    r8211 r8236  
    7070
    7171    if (!web_xml.exists()) {
    72         Gatherer.println("Error: no web.xml found at "+web_xml.toString());
     72        DebugStream.println("Error: no web.xml found at "+web_xml.toString());
    7373        return;
    7474    }
  • trunk/gli/src/org/greenstone/gatherer/WGet.java

    r8231 r8236  
    195195    }
    196196    else {
    197         Gatherer.println("Somehow we're trying to delete a job that is still running.");
     197        DebugStream.println("Somehow we're trying to delete a job that is still running.");
    198198    }
    199199    }
     
    259259    public void newDownloadJob(boolean no_parents, boolean other_hosts, boolean page_requisites, URL url, int depth, String destination) {
    260260    // Create the job and fill in the details from gatherer.config.
    261     Gatherer.println("About to create a new job");
     261    DebugStream.println("About to create a new job");
    262262
    263263    DownloadJob new_job = new DownloadJob(Configuration.get("mirroring.debug", false), no_parents, other_hosts, page_requisites, Configuration.get("mirroring.quiet", false), url, depth, destination, Configuration.proxy_pass, Configuration.proxy_user, this, simple);
     
    326326            job = (DownloadJob) job_queue.get(index);
    327327            if(job.getState() == DownloadJob.RUNNING) {
    328             Gatherer.println("DownloadJob " + job.toString() + " Begun.");
     328            DebugStream.println("DownloadJob " + job.toString() + " Begun.");
    329329            // A lock to prevent us deleting this job while its being
    330330            // run, unless you want things to go really wrong.
     
    337337            }
    338338            busy = false;
    339             Gatherer.println("DownloadJob " + job.toString() + " complete.");
     339            DebugStream.println("DownloadJob " + job.toString() + " complete.");
    340340            // And if the user has requested that complete jobs
    341341                // be removed, then remove it from the list.
     
    352352        try {
    353353            synchronized(this) {
    354             Gatherer.println("WGet thread is waiting for DownloadJobs.");
     354            DebugStream.println("WGet thread is waiting for DownloadJobs.");
    355355            wait();
    356356            }
  • trunk/gli/src/org/greenstone/gatherer/cdm/Argument.java

    r8015 r8236  
    3535import java.util.*;
    3636import org.greenstone.gatherer.Configuration;
     37import org.greenstone.gatherer.DebugStream;
    3738import org.greenstone.gatherer.Gatherer;
    3839import org.greenstone.gatherer.cdm.CollectionConfiguration;
     
    476477    }
    477478    else {
    478         Gatherer.println("Argument.setValue(" + value + ") called on a base Argument.");
     479        DebugStream.println("Argument.setValue(" + value + ") called on a base Argument.");
    479480    }
    480481    }
     
    496497    }
    497498    else {
    498         Gatherer.println("Argument.setValues([" + values.size() + " items]) called on a base Argument.");
     499        DebugStream.println("Argument.setValues([" + values.size() + " items]) called on a base Argument.");
    499500    }
    500501    }
  • trunk/gli/src/org/greenstone/gatherer/cdm/ArgumentConfiguration.java

    r8231 r8236  
    3232import javax.swing.*;
    3333import org.greenstone.gatherer.Configuration;
     34import org.greenstone.gatherer.DebugStream;
    3435import org.greenstone.gatherer.Dictionary;
    3536import org.greenstone.gatherer.Gatherer;
     
    375376            }
    376377            catch (Exception error) {
    377             Gatherer.println("ArgumentConfiguration Error: "+error);
     378            DebugStream.println("ArgumentConfiguration Error: "+error);
    378379            }
    379380        } else if (default_value != null && !default_value.equals("")) {
     
    383384            }
    384385            catch (Exception error) {
    385             Gatherer.println("ArgumentConfiguration Error: "+error);
     386            DebugStream.println("ArgumentConfiguration Error: "+error);
    386387            }
    387388        }
  • trunk/gli/src/org/greenstone/gatherer/cdm/ClassifierManager.java

    r8231 r8236  
    3737import org.apache.xerces.parsers.*;
    3838import org.greenstone.gatherer.Configuration;
     39import org.greenstone.gatherer.DebugStream;
    3940import org.greenstone.gatherer.Dictionary;
    4041import org.greenstone.gatherer.Gatherer;
     
    7677    super(CollectionDesignManager.collect_config.getDocumentElement(), CollectionConfiguration.CLASSIFY_ELEMENT, new Classifier());
    7778    this.model = this;
    78     Gatherer.println("ClassifierManager: " + getSize() + " classifiers parsed.");
     79    DebugStream.println("ClassifierManager: " + getSize() + " classifiers parsed.");
    7980    // Reload/Create the library
    8081    loadClassifiers();
     
    108109    public static boolean clearClassifierCache() {
    109110
    110     Gatherer.println("deleting classifiers.dat");
     111    DebugStream.println("deleting classifiers.dat");
    111112    File class_file = new File(Utility.BASE_DIR + "classifiers.dat");
    112113    if (class_file.exists()) {
     
    197198    private void moveClassifier(Classifier classifier, boolean direction, boolean all) {
    198199    if(getSize() < 2) {
    199         Gatherer.println("Not enough classifiers to allow moving.");
     200        DebugStream.println("Not enough classifiers to allow moving.");
    200201        return;
    201202    }
     
    379380    }
    380381    catch (Exception error) {
    381         Gatherer.println("Unable to open "+ Utility.BASE_DIR + "classifier.dat");
     382        DebugStream.println("Unable to open "+ Utility.BASE_DIR + "classifier.dat");
    382383    }
    383384
     
    813814            Classifier new_classifier = null;
    814815            if(base_classifier != null) {
    815             Gatherer.println("Creating Classifier based on existing Classifer.");
     816            DebugStream.println("Creating Classifier based on existing Classifer.");
    816817            element.setAttribute(CollectionConfiguration.TYPE_ATTRIBUTE, base_classifier.getName());
    817818            new_classifier = new Classifier(element, base_classifier);
    818819            }
    819820            else {
    820             Gatherer.println("Creating new custom Classifier.");
     821            DebugStream.println("Creating new custom Classifier.");
    821822            element.setAttribute(CollectionConfiguration.TYPE_ATTRIBUTE, selected_object.toString());
    822823            new_classifier = new Classifier(element, null);
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java

    r8231 r8236  
    3333import javax.swing.*;
    3434import org.greenstone.gatherer.Configuration;
     35import org.greenstone.gatherer.DebugStream;
    3536import org.greenstone.gatherer.Gatherer;
    3637import org.greenstone.gatherer.cdm.CommandTokenizer;
     
    463464        }
    464465        if(!original_file.renameTo(backup_file)) {
    465         Gatherer.println("Can't rename collect.cfg");
     466        DebugStream.println("Can't rename collect.cfg");
    466467        }
    467468    }
     
    514515        }
    515516        catch (Exception exception) {
    516         Gatherer.println("Error in CollectionConfiguration.save(boolean): " + exception);
    517         Gatherer.printStackTrace(exception);
     517        DebugStream.println("Error in CollectionConfiguration.save(boolean): " + exception);
     518        DebugStream.printStackTrace(exception);
    518519        }
    519520    }
     
    903904            // Why can't you switch on strings eh? We pass it to the various subparsers who each have a bash at parsing the command. If none can parse the command, an unknown element is created
    904905            if(command_element == null && command_type.equals(BUILDTYPE_STR)) {
    905             Gatherer.println("G2.39 Buildtype command detected. Ignoring.");
     906            DebugStream.println("G2.39 Buildtype command detected. Ignoring.");
    906907            command_element = document.createElement(UNKNOWN_ELEMENT);
    907908            append_element = false;
     
    916917            // If this was a G2.39 config file then we manipulate the command string a bit before we submit it to the parser. We start by adding allfields as the first index. We then space separate the remaining indexes, and remove duplicates when encountered. Of course before we do any of that we record the various space separated indexes so that we can remove the collection meta assigned to them.
    917918            if(is_twopointthreenine) {
    918                 Gatherer.println("G2.39 Index command detected. Modifying.");
    919                 Gatherer.println("Before: " + command_str);
     919                DebugStream.println("G2.39 Index command detected. Modifying.");
     920                DebugStream.println("Before: " + command_str);
    920921                StringBuffer new_command_str = new StringBuffer(command_type);
    921922                new_command_str.append(SPACE_CHARACTER);
     
    958959                command_str = new_command_str.toString();
    959960                new_command_str = null;
    960                 Gatherer.println("After: " + command_str);
     961                DebugStream.println("After: " + command_str);
    961962            }
    962963            command_element = parseIndex(command_str);
     
    967968            // If this was a G2.39 config file then we squelch the default index (no such thing in G2.4)
    968969            if(is_twopointthreenine) {
    969                 Gatherer.println("G2.39 Default Index command detected. Ignoring.");
     970                DebugStream.println("G2.39 Default Index command detected. Ignoring.");
    970971                append_element = false;
    971972            }
     
    980981            // Again if this is G2.39 we have to do a tiny bit of magic to the levels command. We need to add document level, and change the remainder to lower case.
    981982            if(is_twopointthreenine) {
    982                 Gatherer.println("G2.39 Levels command detected. Modifying.");
    983                 Gatherer.println("Before: " + command_str);
     983                DebugStream.println("G2.39 Levels command detected. Modifying.");
     984                DebugStream.println("Before: " + command_str);
    984985                StringBuffer new_command_str = new StringBuffer(command_type);
    985986                new_command_str.append(SPACE_CHARACTER);
     
    10001001                command_str = new_command_str.toString();
    10011002                new_command_str = null;
    1002                 Gatherer.println("After: " + command_str);
     1003                DebugStream.println("After: " + command_str);
    10031004            }
    10041005            command_element = parseLevels(command_str);
     
    10661067        Element document_element = document.getDocumentElement();
    10671068        NodeList collectionmeta_elements = document_element.getElementsByTagName(COLLECTIONMETADATA_ELEMENT);
    1068         Gatherer.println("There are " + obsolete_collectionmeta_names.size() + " collectionmeta to remove.");
    1069         Gatherer.println("There are " + changed_collectionmeta_names.size() + " collectionmeta to change.");
     1069        DebugStream.println("There are " + obsolete_collectionmeta_names.size() + " collectionmeta to remove.");
     1070        DebugStream.println("There are " + changed_collectionmeta_names.size() + " collectionmeta to change.");
    10701071        for(int z = collectionmeta_elements.getLength(); z > 0; z--) {
    10711072            Element collectionmeta_element = (Element) collectionmeta_elements.item(z - 1);
    10721073            String name = collectionmeta_element.getAttribute(NAME_ATTRIBUTE);
    1073             Gatherer.println("Checking " + name);
     1074            DebugStream.println("Checking " + name);
    10741075            // Remove any obsolete metadata
    10751076            if(obsolete_collectionmeta_names.contains(name)) {
    1076             Gatherer.println("G2.39 CollectMeta detected. Removing: " + name);
     1077            DebugStream.println("G2.39 CollectMeta detected. Removing: " + name);
    10771078            document_element.removeChild(collectionmeta_element);
    10781079            }
     
    10801081            else if(changed_collectionmeta_names.containsKey(name)) {
    10811082            String new_name = (String) changed_collectionmeta_names.get(name);
    1082             Gatherer.println("G2.39 CollectMeta detected. Changing: " + name + " -> " + new_name);
     1083            DebugStream.println("G2.39 CollectMeta detected. Changing: " + name + " -> " + new_name);
    10831084            collectionmeta_element.setAttribute(NAME_ATTRIBUTE, new_name);
    10841085            new_name = null;
     
    10881089
    10891090        // Finally add any newly acquired collectionmeta. This general defaults to the collectionmeta name less the full stop
    1090         Gatherer.println("There are " + acquired_collectionmeta_names.size() + " collectionmeta to add.");
     1091        DebugStream.println("There are " + acquired_collectionmeta_names.size() + " collectionmeta to add.");
    10911092        for(int y = 0; y < acquired_collectionmeta_names.size(); y++) {
    10921093            String name = (String) acquired_collectionmeta_names.get(y);
    10931094            String value = name.substring(1);
    1094             Gatherer.println("G2.39 CollectMeta missing. Adding: " + name + " [l=" + Configuration.getLanguage() + "] \"" + value + "\"");
     1095            DebugStream.println("G2.39 CollectMeta missing. Adding: " + name + " [l=" + Configuration.getLanguage() + "] \"" + value + "\"");
    10951096            Element element = document.createElement(COLLECTIONMETADATA_ELEMENT);
    10961097            element.setAttribute(NAME_ATTRIBUTE, name);
     
    11081109    }
    11091110    catch(Exception exception) {
    1110         Gatherer.println("Error in CollectionConfiguration.parse(java.io.File): " + exception);
    1111         Gatherer.printStackTrace(exception);
     1111        DebugStream.println("Error in CollectionConfiguration.parse(java.io.File): " + exception);
     1112        DebugStream.printStackTrace(exception);
    11121113    }
    11131114    }
     
    12011202    }
    12021203    catch (Exception exception) {
    1203         Gatherer.printStackTrace(exception);
     1204        DebugStream.printStackTrace(exception);
    12041205        command_element = null;
    12051206    }
     
    13941395    }
    13951396    catch (Exception exception) {
    1396         Gatherer.printStackTrace(exception);
     1397        DebugStream.printStackTrace(exception);
    13971398        command_element = null;
    13981399    }
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java

    r8231 r8236  
    3333import javax.swing.event.*;
    3434import org.greenstone.gatherer.Configuration;
     35import org.greenstone.gatherer.DebugStream;
    3536import org.greenstone.gatherer.Gatherer;
    3637import org.greenstone.gatherer.cdm.ClassifierManager;
     
    8687     */
    8788    public CollectionDesignManager(File collect_config_file) {
    88     Gatherer.println("Initializaing CollectionDesignModule.");
     89    DebugStream.println("Initializaing CollectionDesignModule.");
    8990    change_listener = new CDMChangeListener();
    9091    // Parse the collection configuration
    9192    collect_config = new CollectionConfiguration(collect_config_file);
    92     if(Gatherer.debug != null) {
     93    if (DebugStream.isDebuggingEnabled()) {
    9394        collect_config.display();
    9495    }
    9596    loadDesignDetails();
    96     Gatherer.println("CollectionDesignModule loaded.");
     97    DebugStream.println("CollectionDesignModule loaded.");
    9798    }
    9899
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionMetaManager.java

    r8231 r8236  
    3333import javax.swing.event.*;
    3434import org.greenstone.gatherer.Configuration;
     35import org.greenstone.gatherer.DebugStream;
    3536import org.greenstone.gatherer.Gatherer;
    3637import org.greenstone.gatherer.cdm.CollectionDesignManager;
     
    5253    public CollectionMetaManager() {
    5354    super(CollectionDesignManager.collect_config.getDocumentElement(), StaticStrings.COLLECTIONMETADATA_ELEMENT, new CollectionMeta(""));
    54     Gatherer.println("CollectionMetaManager: " + getSize() + " metadata parsed.");
     55    DebugStream.println("CollectionMetaManager: " + getSize() + " metadata parsed.");
    5556    }
    5657    /** Method to add a new piece of metadata.
     
    121122
    122123    public CollectionMeta getMetadatum(String name, boolean add_if_not_found) {
    123     //Gatherer.println("Get the metadata for " + name + " in the default language.");
     124    //DebugStream.println("Get the metadata for " + name + " in the default language.");
    124125    int size = getSize();
    125126    for(int i = 0; i < size; i++) {
    126127        CollectionMeta metadatum = (CollectionMeta) getElementAt(i);
    127128        if(metadatum.getName().equals(name) && metadatum.getLanguage().equals(Configuration.getLanguage())) {
    128         Gatherer.println("Found '" + metadatum + "'");
     129        DebugStream.println("Found '" + metadatum + "'");
    129130        return metadatum;
    130131        }
    131132        else {
    132         //Gatherer.println("No match with: " + metadatum.getName() + " [l=" + metadatum.getLanguage() + "] \"" + metadatum.getValue() + "\"");
     133        //DebugStream.println("No match with: " + metadatum.getName() + " [l=" + metadatum.getLanguage() + "] \"" + metadatum.getValue() + "\"");
    133134        }
    134135        metadatum = null;
     
    137138        CollectionMeta result = new CollectionMeta(name);
    138139        addMetadatum(result);
    139         Gatherer.println("Added new metadata: " + name);
     140        DebugStream.println("Added new metadata: " + name);
    140141        return result;
    141142    }
  • trunk/gli/src/org/greenstone/gatherer/cdm/CommandTokenizer.java

    r7206 r8236  
    4646import java.io.BufferedReader;
    4747import java.util.StringTokenizer;
     48import org.greenstone.gatherer.DebugStream;
    4849import org.greenstone.gatherer.Gatherer;
    4950import org.greenstone.gatherer.util.StaticStrings;
     
    205206        // Exception thrown when we attempted reading from the input stream, so throw the dummy, or at least return whatever we managed to parse sans its opening character
    206207        catch(Exception exception) {
    207         Gatherer.printStackTrace(exception);
     208        DebugStream.printStackTrace(exception);
    208209        if(strip_characters) {
    209210            return buffer.substring(1);
  • trunk/gli/src/org/greenstone/gatherer/cdm/FormatManager.java

    r8231 r8236  
    3838import javax.swing.event.*;
    3939import org.greenstone.gatherer.Configuration;
     40import org.greenstone.gatherer.DebugStream;
    4041import org.greenstone.gatherer.Dictionary;
    4142import org.greenstone.gatherer.Gatherer;
     
    8586    super(CollectionDesignManager.collect_config.getDocumentElement(), CollectionConfiguration.FORMAT_ELEMENT, new Format());
    8687    this.model = this;
    87     Gatherer.println("FormatManager: parsed " + getSize() + " format statements.");
     88    DebugStream.println("FormatManager: parsed " + getSize() + " format statements.");
    8889    // Establish all of the format objects, so that classifier indexes are initially correct (subsequent refreshes of the model will be sufficient to keep these up to date, as long as we start with a live reference to a classifier.
    8990    int size = getSize();
     
    181182
    182183    private HashMap buildDefaultMappings(ArrayList features_model, ArrayList parts_model) {
    183     Gatherer.println("buildDefaultMappings(): replace me with something that reads in a data xml file.");
     184    DebugStream.println("buildDefaultMappings(): replace me with something that reads in a data xml file.");
    184185    return new HashMap();
    185186    }
     
    201202
    202203    private ArrayList buildPartModel() {
    203     Gatherer.println("buildPartModel(): replace me with something that reads in a data xml file.");
     204    DebugStream.println("buildPartModel(): replace me with something that reads in a data xml file.");
    204205    ArrayList part_model = new ArrayList();
    205206    part_model.add(new Part("", ""));
     
    212213
    213214    private ArrayList buildVariableModel() {
    214     Gatherer.println("buildVariableModel(): replace me with something that reads in a data xml file.");
     215    DebugStream.println("buildVariableModel(): replace me with something that reads in a data xml file.");
    215216    ArrayList variable_model = new ArrayList();
    216217    variable_model.add("[Text]");
  • trunk/gli/src/org/greenstone/gatherer/cdm/GeneralManager.java

    r8231 r8236  
    3636import javax.swing.tree.*;
    3737import org.greenstone.gatherer.Configuration;
     38import org.greenstone.gatherer.DebugStream;
    3839import org.greenstone.gatherer.Dictionary;
    3940import org.greenstone.gatherer.Gatherer;
     
    6869    public GeneralManager() {
    6970    super();
    70     Gatherer.println("GeneralManager: Main GUI components created.");
     71    DebugStream.println("GeneralManager: Main GUI components created.");
    7172    // Assignments
    7273    this.controls = new GeneralControl();
     
    498499                }
    499500                catch(Exception exception) {
    500                 Gatherer.printStackTrace(exception);
     501                DebugStream.printStackTrace(exception);
    501502                // Show warning
    502503                JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.General.Image_Copy_Failed"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
  • trunk/gli/src/org/greenstone/gatherer/cdm/Index.java

    r8015 r8236  
    2828
    2929import java.util.*;
     30import org.greenstone.gatherer.DebugStream;
    3031import org.greenstone.gatherer.Gatherer;
    3132import org.greenstone.gatherer.cdm.CollectionConfiguration;
     
    7778        Object source_object = sources.get(i);
    7879        if(source_object instanceof ElementWrapper) {
    79         ///Gatherer.println("Found ElementWrapper as source: " + ((ElementWrapper)source_object).getName());
     80        ///DebugStream.println("Found ElementWrapper as source: " + ((ElementWrapper)source_object).getName());
    8081        content_element.setAttribute(CollectionConfiguration.NAME_ATTRIBUTE, ((ElementWrapper)source_object).getName());
    8182        }
    8283        else {
    83         ///Gatherer.println("Found String as source: " + source_object.toString());
     84        ///DebugStream.println("Found String as source: " + source_object.toString());
    8485        content_element.setAttribute(CollectionConfiguration.NAME_ATTRIBUTE, source_object.toString());
    8586        }
     
    254255    }
    255256    else {
    256         Gatherer.println("Error! Called setLevel() of index other than the default.");
     257        DebugStream.println("Error! Called setLevel() of index other than the default.");
    257258    }
    258259    }
     
    271272        Object source_object = sources.get(i);
    272273        if(source_object instanceof ElementWrapper) {
    273             //Gatherer.println("Found ElementWrapper as source: " + ((ElementWrapper)source_object).getName());
     274            //DebugStream.println("Found ElementWrapper as source: " + ((ElementWrapper)source_object).getName());
    274275            String name = ((ElementWrapper)source_object).getName();
    275276            content_element.setAttribute(CollectionConfiguration.NAME_ATTRIBUTE, name);
     
    277278        }
    278279        else {
    279             //Gatherer.println("Found String as source: " + source_object.toString());
     280            //DebugStream.println("Found String as source: " + source_object.toString());
    280281            content_element.setAttribute(CollectionConfiguration.NAME_ATTRIBUTE, source_object.toString());
    281282        }
     
    288289    }
    289290    else {
    290         Gatherer.println("Error! Called setSource() of index other than the default.");
     291        DebugStream.println("Error! Called setSource() of index other than the default.");
    291292    }
    292293    }
  • trunk/gli/src/org/greenstone/gatherer/cdm/IndexManager.java

    r8231 r8236  
    3333import javax.swing.event.*;
    3434import org.greenstone.gatherer.Configuration;
     35import org.greenstone.gatherer.DebugStream;
    3536import org.greenstone.gatherer.Dictionary;
    3637import org.greenstone.gatherer.Gatherer;
     
    7172    public IndexManager(Element indexes) {
    7273    super(indexes, CollectionConfiguration.INDEX_ELEMENT, new Index());
    73     Gatherer.println("IndexManager: " + getSize() + " indexes parsed.");
     74    DebugStream.println("IndexManager: " + getSize() + " indexes parsed.");
    7475    model = this;
    7576    // Parse and retrieve the default index
     
    8182    Element levels_element = CollectionDesignManager.collect_config.getLevels();
    8283    levels_model = new DOMProxyListModel(levels_element, CollectionConfiguration.CONTENT_ELEMENT, new Level());
    83     Gatherer.println(" + " + levels_model.getSize() + " levels parsed.");
     84    DebugStream.println(" + " + levels_model.getSize() + " levels parsed.");
    8485    }
    8586
  • trunk/gli/src/org/greenstone/gatherer/cdm/LanguageManager.java

    r8231 r8236  
    3939import javax.swing.event.*;
    4040import org.greenstone.gatherer.Configuration;
     41import org.greenstone.gatherer.DebugStream;
    4142import org.greenstone.gatherer.Dictionary;
    4243import org.greenstone.gatherer.Gatherer;
     
    7576    super(languages_element, CollectionConfiguration.LANGUAGE_ELEMENT, new Language());
    7677   
    77     Gatherer.println("LanguageManager: " + getSize() + " languages parsed.");
     78    DebugStream.println("LanguageManager: " + getSize() + " languages parsed.");
    7879
    7980    this.model = this;
  • trunk/gli/src/org/greenstone/gatherer/cdm/MetadataSetView.java

    r8231 r8236  
    3333import javax.swing.event.*;
    3434import org.greenstone.gatherer.Configuration;
     35import org.greenstone.gatherer.DebugStream;
    3536import org.greenstone.gatherer.Dictionary;
    3637import org.greenstone.gatherer.Gatherer;
     
    6061     */
    6162    public MetadataSetView() {
    62     Gatherer.println("MetadataSetView: Initialized.");
     63    DebugStream.println("MetadataSetView: Initialized.");
    6364    model = this;
    6465    Gatherer.c_man.getCollection().msm.addMSMListener(this);
  • trunk/gli/src/org/greenstone/gatherer/cdm/PlugIn.java

    r7111 r8236  
    5959    this.element = element;
    6060    this.name = element.getAttribute(StaticStrings.TYPE_ATTRIBUTE);
    61     //Gatherer.println("Establishing Plugin: " + name);
     61    //DebugStream.println("Establishing Plugin: " + name);
    6262    // Parse in any argument options for this plugin, keeping a list of the ones found
    6363    HashMap known_arguments = new HashMap();
     
    6767        Element option_element = (Element) option_elements.item(i);
    6868        Argument argument = new Argument(option_element);
    69         //Gatherer.println("Rebuilding existing argument: " + argument.getName());
     69        //DebugStream.println("Rebuilding existing argument: " + argument.getName());
    7070        known_arguments.put(argument.getName(), argument);
    7171        if (argument.isAssigned() || base_plugin == null) {
     
    7777    // If a base plugin was given
    7878    if(base_plugin != null) {
    79         //Gatherer.println("Based on previous plugin.");
     79        //DebugStream.println("Based on previous plugin.");
    8080        // Copy the details, and add a reference to whatever base_plugins super plugin is. ??
    8181        description = base_plugin.getDescription();
     
    8686        Argument base_argument = (Argument) all_arguments.get(j);
    8787        String base_argument_name = base_argument.getName();
    88         //Gatherer.println("Library indicates this plugin should have an argument: " + base_argument_name);
     88        //DebugStream.println("Library indicates this plugin should have an argument: " + base_argument_name);
    8989        Argument existing_argument = (Argument) known_arguments.get(base_argument_name);
    9090        // Found an existing argument. Complete its details
    9191        if(existing_argument != null) {
    92             //Gatherer.println("Found existing argument. Filling out details.");
     92            //DebugStream.println("Found existing argument. Filling out details.");
    9393            existing_argument.setCustomArgument(false);
    9494            existing_argument.setDefaultValue(base_argument.getDefaultValue());
     
    108108        // No existing argument. Copy base_argument and add it, but do not set its assigned flag. That should be set the first time its changed by the user.
    109109        else {
    110             //Gatherer.println("No such argument. Adding new, unassigned, argument.");
     110            //DebugStream.println("No such argument. Adding new, unassigned, argument.");
    111111            // The trick thing is that we have to create a new element in the DOM as well.
    112112            Argument new_argument = base_argument.copy();
  • trunk/gli/src/org/greenstone/gatherer/cdm/PlugInManager.java

    r8231 r8236  
    3838import org.apache.xerces.parsers.*;
    3939import org.greenstone.gatherer.Configuration;
     40import org.greenstone.gatherer.DebugStream;
    4041import org.greenstone.gatherer.Dictionary;
    4142import org.greenstone.gatherer.Gatherer;
     
    7071    public PlugInManager() {
    7172    super(CollectionDesignManager.collect_config.getDocumentElement(), CollectionConfiguration.PLUGIN_ELEMENT, new PlugIn());
    72     Gatherer.println("PlugInManager: " + super.getSize() + " plugins parsed.");
     73    DebugStream.println("PlugInManager: " + super.getSize() + " plugins parsed.");
    7374    model = this;
    7475    // Reload/Create the library
     
    102103    public static boolean clearPlugInCache() {
    103104
    104     Gatherer.println("deleting plugins.dat");
     105    DebugStream.println("deleting plugins.dat");
    105106    File plugin_file = new File(Utility.BASE_DIR + "plugins.dat");
    106107    if (plugin_file.exists()) {
     
    175176    // Can't ever move RecPlug or ArcPlug
    176177    if(super.getSize() < 4) {
    177         //Gatherer.println("Not enough plugins to allow moving.");
     178        //DebugStream.println("Not enough plugins to allow moving.");
    178179        return;
    179180    }
     
    290291    }
    291292    catch (Exception error) {
    292         Gatherer.printStackTrace(error);
     293        DebugStream.printStackTrace(error);
    293294    }
    294295    }
     
    335336    // Now go through the assigned plugins, and remove any that match.
    336337    available.removeAll(children());
    337     //Gatherer.println("There are a total of " + library.size() + " plugins in the library.");
    338     //Gatherer.println("However " + children().size() + " are in use,");
    339     //Gatherer.println("So only " + available.size() + " remain.");
     338    //DebugStream.println("There are a total of " + library.size() + " plugins in the library.");
     339    //DebugStream.println("However " + children().size() + " are in use,");
     340    //DebugStream.println("So only " + available.size() + " remain.");
    340341    Collections.sort(available);
    341342    return available.toArray();
     
    429430    }
    430431    catch (Exception error) {
    431         Gatherer.println("Unable to open "+ Utility.BASE_DIR + "plugins.dat");
     432        DebugStream.println("Unable to open "+ Utility.BASE_DIR + "plugins.dat");
    432433    }
    433434
     
    910911            PlugIn new_plugin = null;
    911912            if(base_plugin != null) {
    912             //Gatherer.println("New PlugIn based on existing PlugIn");
     913            //DebugStream.println("New PlugIn based on existing PlugIn");
    913914            element.setAttribute(CollectionConfiguration.TYPE_ATTRIBUTE, base_plugin.getName());
    914915            new_plugin = new PlugIn(element, base_plugin);
    915916            }
    916917            else {
    917             //Gatherer.println("New Custom PlugIn");
     918            //DebugStream.println("New Custom PlugIn");
    918919            element.setAttribute(CollectionConfiguration.TYPE_ATTRIBUTE, selected_object.toString());
    919920            new_plugin = new PlugIn(element, null);
  • trunk/gli/src/org/greenstone/gatherer/cdm/SearchTypeManager.java

    r8231 r8236  
    3737import javax.swing.event.*;
    3838import org.greenstone.gatherer.Configuration;
     39import org.greenstone.gatherer.DebugStream;
    3940import org.greenstone.gatherer.Dictionary;
    4041import org.greenstone.gatherer.Gatherer;
     
    6667    super(searchtypes_element, CollectionConfiguration.CONTENT_ELEMENT, new SearchType());
    6768    this.model = this;
    68     Gatherer.println("SearchTypeManager: parsed " + getSize() + " search types.");
     69    DebugStream.println("SearchTypeManager: parsed " + getSize() + " search types.");
    6970    }
    7071
  • trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionIndex.java

    r8015 r8236  
    2828
    2929import java.util.*;
     30import org.greenstone.gatherer.DebugStream;
    3031import org.greenstone.gatherer.Gatherer;
    3132import org.greenstone.gatherer.cdm.CollectionConfiguration;
     
    173174    }
    174175    else {
    175         Gatherer.println("Error! Called setSource() of index other than the default.");
     176        DebugStream.println("Error! Called setSource() of index other than the default.");
    176177    }
    177178    }
  • trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionIndexManager.java

    r8231 r8236  
    3333import javax.swing.event.*;
    3434import org.greenstone.gatherer.Configuration;
     35import org.greenstone.gatherer.DebugStream;
    3536import org.greenstone.gatherer.Dictionary;
    3637import org.greenstone.gatherer.Gatherer;
     
    6061    public SubcollectionIndexManager(Element subindexes) {
    6162    super(subindexes, CollectionConfiguration.INDEX_ELEMENT, new SubcollectionIndex());
    62     Gatherer.println("SubcollectionIndexManager: " + getSize() + " subcollection indexes parsed.");
     63    DebugStream.println("SubcollectionIndexManager: " + getSize() + " subcollection indexes parsed.");
    6364    model = this;
    6465    // Parse and retrieve the default index
  • trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionManager.java

    r8231 r8236  
    3737import javax.swing.event.*;
    3838import org.greenstone.gatherer.Configuration;
     39import org.greenstone.gatherer.DebugStream;
    3940import org.greenstone.gatherer.Dictionary;
    4041import org.greenstone.gatherer.Gatherer;
     
    7778    public SubcollectionManager() {
    7879    super(CollectionDesignManager.collect_config.getDocumentElement(), StaticStrings.SUBCOLLECTION_ELEMENT, new Subcollection());
    79     Gatherer.println("SubcollectionManager: " + getSize() + " subcollections parsed.");
     80    DebugStream.println("SubcollectionManager: " + getSize() + " subcollections parsed.");
    8081    this.model = this;
    8182    }
  • trunk/gli/src/org/greenstone/gatherer/cdm/SuperCollectionManager.java

    r8231 r8236  
    3333import javax.swing.event.*;
    3434import org.greenstone.gatherer.Configuration;
     35import org.greenstone.gatherer.DebugStream;
    3536import org.greenstone.gatherer.Dictionary;
    3637import org.greenstone.gatherer.Gatherer;
     
    5758    public SuperCollectionManager(Element supercollections_element) {
    5859    super(supercollections_element, StaticStrings.COLLECTION_ELEMENT, new SuperCollection());
    59     Gatherer.println("SuperCollectionManager: " + getSize() + " supercollection members parsed.");
     60    DebugStream.println("SuperCollectionManager: " + getSize() + " supercollection members parsed.");
    6061    this.model = this;
    6162    }
  • trunk/gli/src/org/greenstone/gatherer/cdm/TranslationView.java

    r8231 r8236  
    3434import javax.swing.table.*;
    3535import org.greenstone.gatherer.Configuration;
     36import org.greenstone.gatherer.DebugStream;
    3637import org.greenstone.gatherer.Dictionary;
    3738import org.greenstone.gatherer.Gatherer;
     
    6061
    6162    public TranslationView() {
    62     Gatherer.println("TranslationView: Initialized.");
     63    DebugStream.println("TranslationView: Initialized.");
    6364    }
    6465
  • trunk/gli/src/org/greenstone/gatherer/collection/BasicCollectionConfiguration.java

    r8147 r8236  
    3838
    3939import java.io.*;
     40import org.greenstone.gatherer.DebugStream;
    4041import org.greenstone.gatherer.Gatherer;
    4142import org.greenstone.gatherer.cdm.CommandTokenizer;
     
    147148    }
    148149    catch(Exception error) {
    149         Gatherer.println("Error in CollectionConfiguration.<init>(): " + error);
    150         Gatherer.printStackTrace(error);
     150        DebugStream.println("Error in CollectionConfiguration.<init>(): " + error);
     151        DebugStream.printStackTrace(error);
    151152    }
    152153    }
  • trunk/gli/src/org/greenstone/gatherer/collection/BuildOptions.java

    r8231 r8236  
    77import org.apache.xerces.parsers.DOMParser;
    88import org.greenstone.gatherer.Configuration;
     9import org.greenstone.gatherer.DebugStream;
    910import org.greenstone.gatherer.Gatherer;
    1011import org.greenstone.gatherer.cdm.Argument;
     
    8283    }
    8384    else {
    84         Gatherer.println("Loaded BO arguments from config.xml");
     85        DebugStream.println("Loaded BO arguments from config.xml");
    8586    }
    8687    // Now take a note of the values too.
     
    305306            }
    306307            catch(Exception exception) {
    307                 Gatherer.println("Exception in BuildOptions.getArgument() - Unexpected but non-fatal");
    308                 Gatherer.printStackTrace(exception);
     308                DebugStream.println("Exception in BuildOptions.getArgument() - Unexpected but non-fatal");
     309                DebugStream.printStackTrace(exception);
    309310            }
    310311            }
     
    313314    }
    314315    catch (Exception error) {
    315         Gatherer.println("Error in BuildOptions.getArgument(): " + error);
    316         Gatherer.printStackTrace(error);
     316        DebugStream.println("Error in BuildOptions.getArgument(): " + error);
     317        DebugStream.printStackTrace(error);
    317318    }
    318319    return argument;
     
    344345    }
    345346    catch (Exception error) {
    346         Gatherer.printStackTrace(error);
     347        DebugStream.printStackTrace(error);
    347348    }
    348349    return result;
     
    372373    }
    373374    catch (Exception error) {
    374         Gatherer.printStackTrace(error);
     375        DebugStream.printStackTrace(error);
    375376    }
    376377    return ArrayTools.arrayListToStringArray(values);
     
    428429    }
    429430    catch (Exception error) {
    430         Gatherer.println("Error in BuildOptions.loadArguments(): " + error);
    431         Gatherer.printStackTrace(error);
     431        DebugStream.println("Error in BuildOptions.loadArguments(): " + error);
     432        DebugStream.printStackTrace(error);
    432433    }
    433434    return arguments_element;
     
    482483    }
    483484    catch (Exception error) {
    484         Gatherer.printStackTrace(error);
     485        DebugStream.printStackTrace(error);
    485486    }
    486487    }
     
    503504    }
    504505    catch (Exception error) {
    505         Gatherer.printStackTrace(error);
     506        DebugStream.printStackTrace(error);
    506507    }
    507508    }
  • trunk/gli/src/org/greenstone/gatherer/collection/Collection.java

    r8231 r8236  
    4242import javax.swing.tree.*;
    4343import org.greenstone.gatherer.Configuration;
     44import org.greenstone.gatherer.DebugStream;
    4445import org.greenstone.gatherer.Gatherer;
    4546import org.greenstone.gatherer.cdm.CollectionDesignManager;
     
    261262    }
    262263    catch (Exception error) {
    263         Gatherer.printStackTrace(error);
     264        DebugStream.printStackTrace(error);
    264265    }
    265266    return result;
     
    287288    }
    288289    catch (Exception error) {
    289         Gatherer.printStackTrace(error);
     290        DebugStream.printStackTrace(error);
    290291    }
    291292    return result;
     
    303304    }
    304305    catch (Exception error) {
    305         Gatherer.printStackTrace(error);
     306        DebugStream.printStackTrace(error);
    306307    }
    307308    return build_values_element;
     
    335336    }
    336337    catch (Exception error) {
    337         Gatherer.printStackTrace(error);
     338        DebugStream.printStackTrace(error);
    338339    }
    339340    return import_values_element;
     
    377378    }
    378379    catch (Exception error) {
    379         Gatherer.printStackTrace(error);
     380        DebugStream.printStackTrace(error);
    380381    }
    381382    }
  • trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java

    r8231 r8236  
    4545import javax.swing.tree.*;
    4646import org.greenstone.gatherer.Configuration;
     47import org.greenstone.gatherer.DebugStream;
    4748import org.greenstone.gatherer.Dictionary;
    4849import org.greenstone.gatherer.Gatherer;
     
    149150     */
    150151    public void buildCollection() {
    151     Gatherer.println("CollectionManager.buildCollection()");
     152    DebugStream.println("CollectionManager.buildCollection()");
    152153    building = true;
    153154    String lang = Configuration.getLanguage();
     
    180181    shell.addGShellListener(Gatherer.g_man.create_pane);
    181182    shell.start();
    182     Gatherer.println("CollectionManager.buildCollection().return");
     183    DebugStream.println("CollectionManager.buildCollection().return");
    183184    }
    184185
     
    214215     */
    215216    public void closeCollection() {
    216     Gatherer.println("Close collection: " + collection.getName());
     217    DebugStream.println("Close collection: " + collection.getName());
    217218    // We set the closing thread, as it should be the only one who can actually see the collection is closed, at least until the closing thread expires.
    218219    closing_thread = Thread.currentThread();
     
    269270        command[3] = collection.getName();
    270271    }
    271     Gatherer.println("running command "+command);
     272    DebugStream.println("running command "+command);
    272273    GShell process = new GShell(command, GShell.CONVERT, COLLECT, this, null, GShell.GSHELL_CONVERT);
    273274    process.addGShellListener(this);
     
    283284        return false;
    284285    }
    285     Gatherer.println("Copying images and macros dirs from the base collection");
     286    DebugStream.println("Copying images and macros dirs from the base collection");
    286287    FileQueue fq = Gatherer.f_man.getQueue();
    287288    try {
     
    297298        }
    298299    } catch (Exception e) {
    299         Gatherer.println("Couldn't copy over the images dir from the base collection: "+e.toString());
     300        DebugStream.println("Couldn't copy over the images dir from the base collection: "+e.toString());
    300301    }
    301302    try {
     
    311312        }
    312313    } catch (Exception e) {
    313         Gatherer.println("Couldn't copy over the macros dir from the base collection: "+e.toString());
     314        DebugStream.println("Couldn't copy over the macros dir from the base collection: "+e.toString());
    314315    }
    315316    return true;
     
    349350        if (!config_file.exists()) {
    350351        // no point continuing
    351         Gatherer.println("The collection could not be created");
     352        DebugStream.println("The collection could not be created");
    352353        progress.close();
    353354        return;
     
    387388        // Before we create the CollectionDesignManager we have to check if we are basing it upon some other collection.
    388389        if(base_collection_directory != null) {
    389            Gatherer.println("Basing new collection on existing one: " + base_collection_directory);
     390           DebugStream.println("Basing new collection on existing one: " + base_collection_directory);
    390391           collection.setBaseCollection(base_collection_directory.getAbsolutePath());
    391392           // copy over other needed directories
     
    394395        File base_metadata = new File(base_collection_directory, Utility.META_DIR);
    395396        if(base_metadata.exists()) {
    396             Gatherer.println("Found the metadata directory.");
     397            DebugStream.println("Found the metadata directory.");
    397398            File[] possible_metadata_sets = base_metadata.listFiles();
    398399            for(int i = 0; possible_metadata_sets != null && i < possible_metadata_sets.length; i++) {
    399400            String filename = possible_metadata_sets[i].getName();
    400401            if(filename.endsWith(".mds")) {
    401                 Gatherer.println("+ Found a metadata set. Importing: " + possible_metadata_sets[i].getAbsolutePath());
     402                DebugStream.println("+ Found a metadata set. Importing: " + possible_metadata_sets[i].getAbsolutePath());
    402403                collection.msm.importMDS(possible_metadata_sets[i], false);
    403404                skip_import_phase = true;
     
    406407        }
    407408        else {
    408             Gatherer.println("This base collection has no metadata directory.");
     409            DebugStream.println("This base collection has no metadata directory.");
    409410        }
    410411        // If no sets were imported, then create a new metadata with this new collections name.
    411412        if(collection.msm.getSets().size() == 0) {
    412413            // Prompt the user so that they can choose at least one initial metadata set. We're sneaky here and just create a ncm_prompt
    413             Gatherer.println("This collection has no metadata sets. Present the user with the metadata set selection prompt.");
     414            DebugStream.println("This collection has no metadata sets. Present the user with the metadata set selection prompt.");
    414415            NewCollectionMetadataPrompt ncm_prompt = new NewCollectionMetadataPrompt();
    415416            // If cancelled then they really do mean to start a collection with no metadata sets.
     
    430431            File base_archive = new File(base_collection_directory, Utility.ARCHIVES_DIR);
    431432            if(base_archive.exists()) {
    432             Gatherer.println("+ Archive directory found. Inspecting archives for metadata information.");
     433            DebugStream.println("+ Archive directory found. Inspecting archives for metadata information.");
    433434            ArrayList metadata_elements = GreenstoneArchiveParser.extractMetadataElements(base_archive);
    434435            for(int i = 0; !cancelled && i < metadata_elements.size(); i++) {
     
    448449            }
    449450            else {
    450             Gatherer.println("+ Searching files for metadata.xml information.");
     451            DebugStream.println("+ Searching files for metadata.xml information.");
    451452            // Find the import directory
    452453            File base_import = new File(base_collection_directory, Utility.IMPORT_DIR);
     
    459460
    460461        // Now we update our collect.cfg
    461         Gatherer.println("Copy and update collect.cfg from base collection.");
     462        DebugStream.println("Copy and update collect.cfg from base collection.");
    462463        updateCollectionCFG(new File(base_collection_directory, Utility.CONFIG_FILE), new File(a_dir, Utility.CONFIG_FILE), description, email, title);
    463464        }
     
    529530    }
    530531    catch (Exception error) {
    531         Gatherer.printStackTrace(error);
     532        DebugStream.printStackTrace(error);
    532533    }
    533534
     
    565566    }
    566567    catch (Exception error) {
    567         Gatherer.printStackTrace(error);
     568        DebugStream.printStackTrace(error);
    568569    }
    569570    }
     
    809810    importing = true;
    810811    if(!saved()) {
    811         Gatherer.println("CollectionManager.importCollection().forcesave");
     812        DebugStream.println("CollectionManager.importCollection().forcesave");
    812813        import_monitor.saving();
    813814        // Force save.
     
    818819        }
    819820        catch(Exception error) {
    820         Gatherer.printStackTrace(error);
     821        DebugStream.printStackTrace(error);
    821822        }
    822823    }
    823824    else {
    824         Gatherer.println("CollectionManager.importCollection()");
     825        DebugStream.println("CollectionManager.importCollection()");
    825826        //check that we can remove the old index before starting import
    826827        File index_dir = new File(getCollectionIndex(), "temp.txt");
    827828        index_dir = index_dir.getParentFile();
    828829        if(index_dir.exists()) {
    829            Gatherer.println("Old Index = " + index_dir.getAbsolutePath()+", testing for deletability");
     830           DebugStream.println("Old Index = " + index_dir.getAbsolutePath()+", testing for deletability");
    830831           if (!canDelete(index_dir)) {
    831832           // tell the user
     
    874875        shell.addGShellListener(Gatherer.g_man.create_pane);
    875876        shell.start();
    876         Gatherer.println("CollectionManager.importCollection().return");
     877        DebugStream.println("CollectionManager.importCollection().return");
    877878    }
    878879    importing = false;
     
    896897     */
    897898    public boolean loadCollection(String location) {
    898     Gatherer.println("Load Collection '" + location + "'");
     899    DebugStream.println("Load Collection '" + location + "'");
    899900    String[] args2 = new String[1];
    900901    args2[0] = location;
     
    904905    if(!location.endsWith(".col")) {
    905906        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Not_Col_File", args2), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
    906         Gatherer.println("CollectionManager.loadCollection: Haven't been given a .col file.");
     907        DebugStream.println("CollectionManager.loadCollection: Haven't been given a .col file.");
    907908        return false;
    908909    }
     
    919920    File collection_config_file = new File(collection_directory, Utility.CONFIG_FILE);
    920921    if (!collection_config_file.exists()) {
    921         Gatherer.println("CollectionManager.loadCollection: No config file");
     922        DebugStream.println("CollectionManager.loadCollection: No config file");
    922923        collection_directory = null;
    923924        collection_config_file = null;
     
    929930    if(!metadata_directory.exists()) {
    930931
    931         Gatherer.println("CollectionManager.loadCollection: trying to load up a non-gatherer collection");
     932        DebugStream.println("CollectionManager.loadCollection: trying to load up a non-gatherer collection");
    932933        non_gatherer_collection = true;
    933934    }
     
    10101011        String[] args = new String[1];
    10111012        args[0] = name;
    1012         Gatherer.println(Dictionary.get("CollectionManager.Loading_Successful", args));
     1013        DebugStream.println(Dictionary.get("CollectionManager.Loading_Successful", args));
    10131014        // Now we need to hook up classes that depend on messages from the metadata set manager to keep their content fresh.
    10141015        collection.msm.addMSMListener(this);
     
    10211022    } catch (Exception error) {
    10221023        // There is obviously no existing collection present.
    1023         Gatherer.printStackTrace(error);
     1024        DebugStream.printStackTrace(error);
    10241025        if(error.getMessage() != null) {
    10251026        String[] args = new String[2];
     
    11621163     */
    11631164    public synchronized void processBegun(GShellEvent event) {
    1164     Gatherer.println("CollectionManager.processBegun(" + event.getType() + ")");
     1165    DebugStream.println("CollectionManager.processBegun(" + event.getType() + ")");
    11651166    ///ystem.err.println("ProcessBegun " + event.getType());
    11661167    // If this is one of the types where we wish to lock user control
     
    11741175     */
    11751176    public synchronized void processComplete(GShellEvent event) {
    1176     Gatherer.println("CollectionManager.processComplete(" + event.getType() + ")");
     1177    DebugStream.println("CollectionManager.processComplete(" + event.getType() + ")");
    11771178    Gatherer.g_man.lockCollection((event.getType() == GShell.IMPORT), false);
    11781179    ///ystem.err.println("Recieved process complete event - " + event);
     
    12131214    }
    12141215    else if(event.getStatus() == GShell.ERROR || event.getStatus() == GShell.CANCELLED) {
    1215         Gatherer.println("There was an error in the gshell:"+ event.getMessage());
     1216        DebugStream.println("There was an error in the gshell:"+ event.getMessage());
    12161217        if (event.getType() == GShell.NEW) {
    12171218        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Cannot_Create_Collection"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
     
    13011302     */
    13021303    public void saveCollection(boolean close_after, boolean exit_after) {
    1303     Gatherer.println("Save collection: " + collection.getName());
     1304    DebugStream.println("Save collection: " + collection.getName());
    13041305    try {
    13051306        SaveCollectionTask save_task = new SaveCollectionTask(collection, close_after, exit_after);
     
    13091310    }
    13101311    catch(Exception error) {
    1311         Gatherer.printStackTrace(error);
     1312        DebugStream.printStackTrace(error);
    13121313    }
    13131314    }
     
    14281429     */
    14291430    private boolean installCollection() {
    1430     Gatherer.println("Build complete. Moving files.");
     1431    DebugStream.println("Build complete. Moving files.");
    14311432
    14321433    try {
     
    14411442
    14421443        File index_dir = new File(getCollectionIndex());
    1443         Gatherer.println("Index = " + index_dir.getAbsolutePath());
     1444        DebugStream.println("Index = " + index_dir.getAbsolutePath());
    14441445
    14451446        File building_dir = new File(getCollectionBuild());
    1446         Gatherer.println("Building = " + building_dir.getAbsolutePath());
     1447        DebugStream.println("Building = " + building_dir.getAbsolutePath());
    14471448
    14481449        // Get the build mode from the build options
     
    15521553    HashMap mappings = collection.msm.profiler.getActions(collection_path);
    15531554    if(mappings == null) {
    1554         Gatherer.println("Mappings is null, which is odd. Leaving all configuration commands which use metadata as they are.");
     1555        DebugStream.println("Mappings is null, which is odd. Leaving all configuration commands which use metadata as they are.");
    15551556    }
    15561557   
     
    17171718    }
    17181719    catch(Exception error) {
    1719         Gatherer.printStackTrace(error);
     1720        DebugStream.printStackTrace(error);
    17201721    }
    17211722    // All done, I hope.
  • trunk/gli/src/org/greenstone/gatherer/collection/DeleteCollectionPrompt.java

    r8231 r8236  
    4444import javax.swing.event.*;
    4545import org.greenstone.gatherer.Configuration;
     46import org.greenstone.gatherer.DebugStream;
    4647import org.greenstone.gatherer.Dictionary;
    4748import org.greenstone.gatherer.Gatherer;
     
    350351        // Exception
    351352        catch (Exception exception) {
    352             Gatherer.println("Exception in GShell.runRemove() - unexpected");
    353             Gatherer.printStackTrace(exception);
     353            DebugStream.println("Exception in GShell.runRemove() - unexpected");
     354            DebugStream.printStackTrace(exception);
    354355        }
    355356        }
  • trunk/gli/src/org/greenstone/gatherer/collection/DownloadJob.java

    r8231 r8236  
    4343import javax.swing.tree.*;
    4444import org.greenstone.gatherer.Configuration;
     45import org.greenstone.gatherer.DebugStream;
    4546import org.greenstone.gatherer.Dictionary;
    4647import org.greenstone.gatherer.Gatherer;
     
    254255        }
    255256        else {
    256         Gatherer.println("Unknown user/pass");
     257        DebugStream.println("Unknown user/pass");
    257258        }
    258259    }
     
    284285    // Run it
    285286    try {
    286         //Gatherer.println("Cmd: " + command); // don't print it out cos it may have the password in it
     287        //DebugStream.println("Cmd: " + command); // don't print it out cos it may have the password in it
    287288        Runtime rt = Runtime.getRuntime();
    288289        String [] env = null;
     
    300301        while ((line = br.readLine()) != null && state != STOPPED) {
    301302       
    302         Gatherer.println(line);
     303        DebugStream.println(line);
    303304        download_log.appendLine(line);
    304305        // The first magic special test is to see if we've just
     
    306307        // the next add and then the next complete/error.
    307308        if(line.lastIndexOf("robots.txt;") != -1) {
    308             Gatherer.println("***** Requesting robot.txt");
     309            DebugStream.println("***** Requesting robot.txt");
    309310            ignore_for_robots = true;
    310311        }
     
    323324            String current_file_downloading = line.substring(line.indexOf("`") + 1, line.lastIndexOf("'"));
    324325            if(!ignore_for_robots) {
    325             Gatherer.println("Not ignore for robots");
     326            DebugStream.println("Not ignore for robots");
    326327            // Download complete
    327328            downloadComplete(current_file_downloading);
    328329            }
    329330            else {
    330             Gatherer.println("Ignore for robots");
     331            DebugStream.println("Ignore for robots");
    331332            ignore_for_robots = false;
    332333            }
     
    340341        else if(line.lastIndexOf(" `") != -1) {
    341342            // Not Overwriting
    342             Gatherer.println("Already there.");
     343            DebugStream.println("Already there.");
    343344            String new_url =
    344345            line.substring(line.indexOf("`") + 1, line.lastIndexOf("'"));
     
    350351            if(line.charAt(2) == ':' && line.charAt(5) == ':') {
    351352            if(!ignore_for_robots) {
    352                 Gatherer.println("Error.");
     353                DebugStream.println("Error.");
    353354                downloadFailed();
    354355            }
     
    370371    catch (Exception ioe) {
    371372        //message(Utility.ERROR, ioe.toString());
    372         Gatherer.printStackTrace(ioe);
     373        DebugStream.printStackTrace(ioe);
    373374    }
    374375    // If we've got to here and the state isn't STOPPED then the
     
    462463    args.add(initial.toString());
    463464
    464     Gatherer.println("Calling wget ");
     465    DebugStream.println("Calling wget ");
    465466    for(Enumeration e = args.elements(); e.hasMoreElements();) {
    466         Gatherer.println(e.nextElement() + " ");
    467     }
    468     Gatherer.println("");
     467        DebugStream.println(e.nextElement() + " ");
     468    }
     469    DebugStream.println("");
    469470
    470471    // Run home to mummy.
     
    490491    public void downloadComplete(String current_file_downloading) {
    491492    progress.downloadComplete();
    492     Gatherer.println("Current File: " + current_file_downloading);
     493    DebugStream.println("Current File: " + current_file_downloading);
    493494    // !! TEMPORARILY DISABLED !!
    494495    //WorkspaceTreeModel.refreshWebCacheMappings();
     
    518519//          // It suddenly occurs to me that by retrieving the destination path, we are causing the potential destination node to map its children which includes the file which I am about to add. Hence I was ending up with two copies.
    519520//          ///atherer.println("Ready to insert new FileNode.");
    520 //          Gatherer.println("Model:            " + tree_model);
    521 //          Gatherer.println("Destination path: " + destination_path);
     521//          DebugStream.println("Model:            " + tree_model);
     522//          DebugStream.println("Destination path: " + destination_path);
    522523//          destination_node.unmap();
    523524//          ///atherer.println("Destination node: " + destination_node);
  • trunk/gli/src/org/greenstone/gatherer/collection/ExportCollectionPrompt.java

    r8231 r8236  
    4343import javax.swing.*;
    4444import javax.swing.event.*;
     45import org.greenstone.gatherer.Configuration;
     46import org.greenstone.gatherer.DebugStream;
     47import org.greenstone.gatherer.Dictionary;
     48import org.greenstone.gatherer.Gatherer;
    4549import org.greenstone.gatherer.checklist.CheckList;
    4650import org.greenstone.gatherer.checklist.Entry;
    47 import org.greenstone.gatherer.Configuration;
    48 import org.greenstone.gatherer.Dictionary;
    49 import org.greenstone.gatherer.Gatherer;
    5051import org.greenstone.gatherer.collection.BasicCollectionConfiguration;
    5152import org.greenstone.gatherer.collection.Collection;
     
    252253     */
    253254    public void exportCollections() {
    254     Gatherer.println("ExportCollectionPrompt.exportCollection()");
     255    DebugStream.println("ExportCollectionPrompt.exportCollection()");
    255256
    256257    int num_collections = selected_collections.size();
     
    290291    }
    291292   
    292     Gatherer.print("export command = ");
     293    DebugStream.print("export command = ");
    293294    for (int i=0; i<args.length; i++) {
    294         Gatherer.print(args[i]+" ");
    295     }
    296     Gatherer.println("");
     295        DebugStream.print(args[i]+" ");
     296    }
     297    DebugStream.println("");
    297298    GShell process = new GShell(args, GShell.EXPORT, 3, this, null, GShell.GSHELL_EXPORT);
    298299    process.start();
    299300    //process.run();
    300     Gatherer.println("ExportCollectionPrompt.exportCollection().return");
     301    DebugStream.println("ExportCollectionPrompt.exportCollection().return");
    301302    }
    302303
     
    380381    if (message.startsWith("exportcol.pl>")) {
    381382        message = message.substring(13);
    382         //Gatherer.println("message = "+event.getMessage());
     383        //DebugStream.println("message = "+event.getMessage());
    383384        error_message.append(message);
    384385        error_message.append("\n");
  • trunk/gli/src/org/greenstone/gatherer/collection/SaveCollectionTask.java

    r8231 r8236  
    4141import javax.swing.*;
    4242import org.greenstone.gatherer.Configuration;
     43import org.greenstone.gatherer.DebugStream;
    4344import org.greenstone.gatherer.Gatherer;
    4445import org.greenstone.gatherer.collection.Collection;
     
    131132        backup.deleteOnExit();
    132133        if(!file.renameTo(backup)) {
    133             Gatherer.println("Error in CollectionManager.load(): FileRenamedException");
     134            DebugStream.println("Error in CollectionManager.load(): FileRenamedException");
    134135        }
    135136        }
     
    150151    }
    151152    catch (Exception error) {
    152         Gatherer.printStackTrace(error);
     153        DebugStream.printStackTrace(error);
    153154    }
    154155    // Now we check whether we've finished, or is this a Save As action, in which case we've got miles to go.
     
    230231            ///ystem.err.println("Renaming " + filename);
    231232            if(!file.renameTo(original_file)) {
    232             Gatherer.println("Error in SaveCollectionTask.run(): FileRenameException");
     233            DebugStream.println("Error in SaveCollectionTask.run(): FileRenameException");
    233234            }
    234235        }
     
    290291    }
    291292    catch (Exception exception) {
    292         Gatherer.printStackTrace(exception);
     293        DebugStream.printStackTrace(exception);
    293294    }
    294295    }
  • trunk/gli/src/org/greenstone/gatherer/file/FileAssociationManager.java

    r8231 r8236  
    3030import javax.swing.table.*;
    3131import org.greenstone.gatherer.Configuration;
     32import org.greenstone.gatherer.DebugStream;
    3233import org.greenstone.gatherer.Dictionary;
    3334import org.greenstone.gatherer.Gatherer;
     
    8081    }
    8182    else {
    82         Gatherer.println("Didn't parse anything. About to crash.");
     83        DebugStream.println("Didn't parse anything. About to crash.");
    8384    }
    8485    }
     
    9192
    9293    public String getBrowserCommand(String url) {
    93     Gatherer.println("Get browser command: " + url);
     94    DebugStream.println("Get browser command: " + url);
    9495    // First off we try to retrieve one from the configuration
    9596    String command = Configuration.getPreviewCommand();
     
    9798    if(command != null && command.length() > 0) {
    9899        command = command.replaceAll("%1", url);
    99         Gatherer.println("Result = " + command);
     100        DebugStream.println("Result = " + command);
    100101        return command;
    101102    }
     
    134135        Configuration.setPreviewCommand(command);
    135136        command = command.replaceAll(FILENAME_ARG, url);
    136         Gatherer.println("Result = " + command);
     137        DebugStream.println("Result = " + command);
    137138        return command;
    138139    }
    139140    // if we haven't got a command by now, we'll never get one
    140     Gatherer.println("Result = null");
     141    DebugStream.println("Result = null");
    141142    return null;
    142143   
     
    280281
    281282    public void setCommand(String extension, String command) {
    282     Gatherer.println("Set Launch: " + extension + " with " + command);
     283    DebugStream.println("Set Launch: " + extension + " with " + command);
    283284    // Retrieve any existing entry for this extension
    284285    Element entry = getCommand(extension);
  • trunk/gli/src/org/greenstone/gatherer/file/FileNode.java

    r8231 r8236  
    88import javax.swing.tree.*;
    99import org.greenstone.gatherer.Configuration;
     10import org.greenstone.gatherer.DebugStream;
    1011import org.greenstone.gatherer.Dictionary;
    1112import org.greenstone.gatherer.Gatherer;
     
    215216    /** Adds child to the receiver at index. */
    216217    public void insert(MutableTreeNode child, int index) {
    217     Gatherer.println("Insert " + child + " in " + this + " at index " + index + " [Model: " + model + "]");
     218    DebugStream.println("Insert " + child + " in " + this + " at index " + index + " [Model: " + model + "]");
    218219    if (child == null) {
    219220        return;
     
    339340        if(files != null && files.length > 0) {
    340341            // Sort the remaining files.
    341             Gatherer.println("Number of files to sort: " + files.length);
     342            DebugStream.println("Number of files to sort: " + files.length);
    342343            ArrayTools.sort(files);
    343             Gatherer.println("Files sorted.");
     344            DebugStream.println("Files sorted.");
    344345            // Now add them to children.
    345346            raw_children = new ArrayList();
  • trunk/gli/src/org/greenstone/gatherer/file/FileQueue.java

    r8231 r8236  
    3333import javax.swing.tree.*;
    3434import org.greenstone.gatherer.Configuration;
     35import org.greenstone.gatherer.DebugStream;
    3536import org.greenstone.gatherer.Dictionary;
    3637import org.greenstone.gatherer.Gatherer;
     
    123124    FileJob job = new FileJob(id, source, child, target, parent, type, undo, undoable);
    124125    job.folder_level = folder_level;
    125         Gatherer.println("Adding job: " + job);
     126        DebugStream.println("Adding job: " + job);
    126127    if(position != -1 && position <= queue.size() + 1) {
    127128        queue.add(position, job);
     
    320321                    // If we can't find the source file, then the most likely reason is that the file system has changed since the last time it was mapped. Warn the user that the requested file can't be found, then force a refresh of the source folder involved.
    321322                    catch(FileNotFoundException fnf_exception) {
    322                     Gatherer.printStackTrace(fnf_exception);
     323                    DebugStream.printStackTrace(fnf_exception);
    323324                    cancel_action = true;
    324325                    // Show warning.
     
    328329                    }
    329330                    catch(FileAlreadyExistsException fae_exception) {
    330                     Gatherer.printStackTrace(fae_exception);
     331                    DebugStream.printStackTrace(fae_exception);
    331332                    cancel_action = true;
    332333                    // Show warning.
     
    335336                    }
    336337                    catch(InsufficientSpaceException is_exception) {
    337                     Gatherer.printStackTrace(is_exception);
     338                    DebugStream.printStackTrace(is_exception);
    338339                    cancel_action = true;
    339340                    // Show warning. The message body of the expection explains how much more space is required for this file copy.
     
    342343                    }
    343344                    catch(UnknownFileErrorException ufe_exception) {
    344                     Gatherer.printStackTrace(ufe_exception);
     345                    DebugStream.printStackTrace(ufe_exception);
    345346                    cancel_action = true;
    346347                    // Show warning
     
    349350                    }
    350351                    catch(WriteNotPermittedException wnp_exception) {
    351                     Gatherer.printStackTrace(wnp_exception);
     352                    DebugStream.printStackTrace(wnp_exception);
    352353                    cancel_action = true;
    353354                    // Show warning
     
    357358                    catch(IOException exception) {
    358359                    // Can't really do much about this.
    359                     Gatherer.printStackTrace(exception);
     360                    DebugStream.printStackTrace(exception);
    360361                    }
    361362                 // If not cancelled
     
    543544                }
    544545                else {
    545                 Gatherer.println("I've already done this job twice. I refuse to requeue it again!!");
     546                DebugStream.println("I've already done this job twice. I refuse to requeue it again!!");
    546547                }
    547548            }
     
    595596        }
    596597        catch (Exception error) {
    597         Gatherer.printStackTrace(error);
     598        DebugStream.printStackTrace(error);
    598599        }
    599600    }
     
    675676        // Check if the origin file exists.
    676677        if(!source.exists()) {
    677         Gatherer.println("Couldn't find the source file.");
     678        DebugStream.println("Couldn't find the source file.");
    678679        throw(new FileNotFoundException());
    679680        }
  • trunk/gli/src/org/greenstone/gatherer/file/FileSystem.java

    r7633 r8236  
    33import java.io.File;
    44import javax.swing.filechooser.FileSystemView;
     5import org.greenstone.gatherer.DebugStream;
    56import org.greenstone.gatherer.Dictionary;
    6 import org.greenstone.gatherer.Gatherer;
    77import org.greenstone.gatherer.file.FileNode;
    88import org.greenstone.gatherer.util.ArrayTools;
     
    5555
    5656    // Make sure we're running on a multiuser OS where the idea of a "user home" is valid
    57     Gatherer.println("Property os.name: " + os_name);
     57    DebugStream.println("Property os.name: " + os_name);
    5858    String os_name_lc = os_name.toLowerCase();
    5959    if (os_name_lc.equals("windows 95") || os_name_lc.equals("windows 98") || os_name_lc.equals("windows me")) {
  • trunk/gli/src/org/greenstone/gatherer/file/FileSystemModel.java

    r7491 r8236  
    66import javax.swing.event.*;
    77import javax.swing.tree.*;
     8import org.greenstone.gatherer.DebugStream;
    89import org.greenstone.gatherer.Dictionary;
    910import org.greenstone.gatherer.Gatherer;
     
    5960    FileNode first_node = (FileNode)path.getPathComponent(0);
    6061    if(current.equals(first_node)) {
    61         Gatherer.println("First path component matches root node.");
     62        DebugStream.println("First path component matches root node.");
    6263        // For each path with this tree path
    6364        for(int i = 1; current != null && i < path.getPathCount(); i++) {
     
    6869            stale_node = (FileNode) stale_object;
    6970        }
    70         Gatherer.print("Searching for '" + stale_object + "': ");
     71        DebugStream.print("Searching for '" + stale_object + "': ");
    7172        // Locate the fresh node by searching current's children. Remember to ensure that current is mapped.
    7273        //current.unmap();
     
    7677        for(int j = 0; !found && j < current.getChildCount(); j++) {
    7778            FileNode child_node = (FileNode) current.getChildAt(j);
    78             Gatherer.print(child_node + " ");
     79            DebugStream.print(child_node + " ");
    7980            if((stale_node != null && stale_node.equals(child_node)) || stale_object.toString().equals(child_node.toString())) {
    8081            found = true;
    8182            current = child_node;
    82             Gatherer.println("Found!");
     83            DebugStream.println("Found!");
    8384            }
    8485            child_node = null;
     
    8788        for(int j = 0; !found && j < current.size(); j++) {
    8889            FileNode child_node = (FileNode) current.get(j);
    89             Gatherer.print(child_node + " ");
     90            DebugStream.print(child_node + " ");
    9091            if((stale_node != null && stale_node.equals(child_node)) || stale_object.toString().equals(child_node.toString())) {
    9192            found = true;
    9293            current = child_node;
    93             Gatherer.println("Found!");
     94            DebugStream.println("Found!");
    9495            }
    9596            child_node = null;
     
    9899        if(!found) {
    99100            current = null;
    100             Gatherer.println("Not Found!");
     101            DebugStream.println("Not Found!");
    101102        }
    102103        else {
    103             Gatherer.println("Returning node: " + new TreePath(current.getPath()));
     104            DebugStream.println("Returning node: " + new TreePath(current.getPath()));
    104105        }
    105106        // Repeat as necessary
  • trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTreeModel.java

    r7639 r8236  
    22
    33import javax.swing.tree.TreePath;
     4import org.greenstone.gatherer.DebugStream;
    45import org.greenstone.gatherer.Gatherer;
    56import org.greenstone.gatherer.collection.CollectionManager;
     
    7980        for (int i = 0; i < old_folder_shortcuts.length; i++) {
    8081        if (!doesArrayContain(folder_shortcuts, old_folder_shortcuts[i])) {
    81             Gatherer.println("Deleted shortcut: " + old_folder_shortcuts[i]);
     82            DebugStream.println("Deleted shortcut: " + old_folder_shortcuts[i]);
    8283            SynchronizedTreeModelTools.removeNodeFromParent(workspace_tree_model,
    8384                                    old_folder_shortcuts[i]);
     
    9091        for (int i = 0; i < folder_shortcuts.length; i++) {
    9192        if (!doesArrayContain(old_folder_shortcuts, folder_shortcuts[i])) {
    92             Gatherer.println("Added shortcut: " + folder_shortcuts[i]);
     93            DebugStream.println("Added shortcut: " + folder_shortcuts[i]);
    9394            SynchronizedTreeModelTools.insertNodeInto(workspace_tree_model, workspace_tree_root, folder_shortcuts[i], false);
    9495        }
  • trunk/gli/src/org/greenstone/gatherer/gui/EnrichPane.java

    r8231 r8236  
    4747import javax.swing.tree.*;
    4848import org.greenstone.gatherer.Configuration;
     49import org.greenstone.gatherer.DebugStream;
    4950import org.greenstone.gatherer.Dictionary;
    5051import org.greenstone.gatherer.Gatherer;
     
    282283        // You can only update if there is a selected_metadata and
    283284        // you have valid values in all fields.
    284         Gatherer.println("Replacing value:");
     285        DebugStream.println("Replacing value:");
    285286        if (selected_metadata != null && records != null && element != null && value != null) {
    286287        selected_metadata = Gatherer.c_man.getCollection().msm.updateMetadata(System.currentTimeMillis(), selected_metadata, records, value, MetaEditPrompt.CONFIRM, selected_metadata.isFileLevel());
     
    296297
    297298    public void run() {
    298         Gatherer.println("Removing value:");
     299        DebugStream.println("Removing value:");
    299300        if (selected_metadata != null && records != null) {
    300301        Gatherer.c_man.getCollection().msm.removeMetadata(System.currentTimeMillis(), selected_metadata, records);
     
    10141015        }
    10151016
    1016         Gatherer.println("Number of files/folders selected: " + selection_paths.length);
     1017        DebugStream.println("Number of files/folders selected: " + selection_paths.length);
    10171018
    10181019        // Always have meta-audit option
  • trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r8231 r8236  
    5050import javax.swing.text.*;
    5151import org.greenstone.gatherer.Configuration;
     52import org.greenstone.gatherer.DebugStream;
    5253import org.greenstone.gatherer.Dictionary;
    5354import org.greenstone.gatherer.Gatherer;
     
    229230        catch (Exception cce) {
    230231        // If the component is not a text component ignore the copy command
    231         Gatherer.println(cce.toString());
     232        DebugStream.println(cce.toString());
    232233        }
    233234    }
     
    242243        catch (ClassCastException cce) {
    243244        // If the component is not a text component ignore the cut command
    244         Gatherer.println(cce.toString());
     245        DebugStream.println(cce.toString());
    245246        }
    246247    }
     
    255256        catch (ClassCastException cce) {
    256257        // If the component is not a text component ignore the paste command
    257         Gatherer.println(cce.toString());
     258        DebugStream.println(cce.toString());
    258259        }
    259260    }
     
    475476    }
    476477    catch (Exception e) {
    477         Gatherer.printStackTrace(e);
     478        DebugStream.printStackTrace(e);
    478479        // The GUI failing to build is an app killer
    479480        e.printStackTrace();
     
    727728        }
    728729        catch(Exception error) {
    729                 Gatherer.println("Exception: " + error);
    730                 Gatherer.printStackTrace(error);
     730                DebugStream.println("Exception: " + error);
     731                DebugStream.printStackTrace(error);
    731732        }
    732733        }
     
    769770        }
    770771        catch(Exception error) {
    771             Gatherer.println("Exception: " + error);
    772             Gatherer.printStackTrace(error);
     772            DebugStream.println("Exception: " + error);
     773            DebugStream.printStackTrace(error);
    773774        }
    774775        }
     
    834835    }
    835836    catch(Exception error) {
    836         Gatherer.println("Exception: " + error);
    837         Gatherer.printStackTrace(error);
     837        DebugStream.println("Exception: " + error);
     838        DebugStream.printStackTrace(error);
    838839    }
    839840   
  • trunk/gli/src/org/greenstone/gatherer/gui/GatherPane.java

    r8231 r8236  
    4545import javax.swing.tree.*;
    4646import org.greenstone.gatherer.Configuration;
     47import org.greenstone.gatherer.DebugStream;
    4748import org.greenstone.gatherer.Dictionary;
    4849import org.greenstone.gatherer.Gatherer;
     
    578579        }
    579580
    580         Gatherer.println("Number of files/folders selected: " + selection_paths.length);
     581        DebugStream.println("Number of files/folders selected: " + selection_paths.length);
    581582
    582583        // Collection tree: display meta-audit option and delete options
  • trunk/gli/src/org/greenstone/gatherer/gui/ModalDialog.java

    r7314 r8236  
    1 /*
    2  * ModalDialog
    3  *
    4  * GLI 2.3c
    5  *
    6  * 30May2003
    7  *
    8  *#########################################################################
     1/*#########################################################################
    92 *
    103 * A component of the Gatherer application, part of the Greenstone digital
     
    3528import java.awt.*;
    3629import javax.swing.*;
     30import org.greenstone.gatherer.DebugStream;
    3731import org.greenstone.gatherer.Gatherer;
    3832/** An extension of the JDialog that overrides the JVM's typical modal behaviour. This typical behaviour is that when a modal dialog is opened, all other windows cease to respond to user events until the modal dialog is disposed. However this prevents us opening the help documents property whenever a modal dialog is open. Thus we override the modal behaviour so that only the owner frame or dialog is blocked.
     
    165159            }
    166160            catch(Exception exception) {
    167             Gatherer.printStackTrace(exception);
     161            DebugStream.printStackTrace(exception);
    168162            }
    169163        }
     
    175169        }
    176170        catch(Exception exception) {
    177         Gatherer.printStackTrace(exception);
     171        DebugStream.printStackTrace(exception);
    178172        }
    179173    }
  • trunk/gli/src/org/greenstone/gatherer/gui/OptionsPane.java

    r8231 r8236  
    4545import javax.swing.text.*;
    4646import org.greenstone.gatherer.Configuration;
     47import org.greenstone.gatherer.DebugStream;
    4748import org.greenstone.gatherer.Dictionary;
    4849import org.greenstone.gatherer.Gatherer;
     
    361362        }
    362363        catch(Exception exception) {
    363             Gatherer.println("Exception in OptionsPane.mouseExited() - unexpected");
    364             Gatherer.printStackTrace(exception);
     364            DebugStream.println("Exception in OptionsPane.mouseExited() - unexpected");
     365            DebugStream.printStackTrace(exception);
    365366        }
    366367        }
  • trunk/gli/src/org/greenstone/gatherer/gui/URLField.java

    r6659 r8236  
    66import javax.swing.event.*;
    77import javax.swing.text.*;
    8 import org.greenstone.gatherer.Gatherer;
     8import org.greenstone.gatherer.DebugStream;
     9
    910
    1011public class URLField
     
    8687    }
    8788    m = null;
    88     Gatherer.println("Validating: " + text + " -> " + (result ? "GOOD" : "BAD"));
     89    DebugStream.println("Validating: " + text + " -> " + (result ? "GOOD" : "BAD"));
    8990    text = null;
    9091    return result;
  • trunk/gli/src/org/greenstone/gatherer/gui/table/GTableModel.java

    r8231 r8236  
    3333import javax.swing.table.*;
    3434import org.greenstone.gatherer.Configuration;
     35import org.greenstone.gatherer.DebugStream;
    3536import org.greenstone.gatherer.Dictionary;
    3637import org.greenstone.gatherer.Gatherer;
     
    208209        ElementWrapper element = metadatum.getElement();
    209210        if (i < 0) {
    210         Gatherer.println("Could not find suitable row to select!");
     211        DebugStream.println("Could not find suitable row to select!");
    211212        i = 0; // select the first one
    212213        }
     
    217218            i--;
    218219            if (i < 0) {
    219             Gatherer.println("Could not find suitable row to select!");
     220            DebugStream.println("Could not find suitable row to select!");
    220221            i = 0;
    221222            }
     
    223224            newly_selected_metadatum = (Metadata) current_metadata.get(i);
    224225            if (!newly_selected_metadatum.getElement().equals(element)) {
    225                 Gatherer.println("Could not find suitable row to select!");
     226                DebugStream.println("Could not find suitable row to select!");
    226227                i = 0;
    227228            }
     
    341342    {
    342343        if (!Gatherer.c_man.ready()) {
    343         Gatherer.println("Not ready!");
     344        DebugStream.println("Not ready!");
    344345        return;
    345346        }
  • trunk/gli/src/org/greenstone/gatherer/gui/tree/WorkspaceTree.java

    r8231 r8236  
    55import javax.swing.tree.TreePath;
    66import org.greenstone.gatherer.Configuration;
     7import org.greenstone.gatherer.DebugStream;
    78import org.greenstone.gatherer.Gatherer;
    89import org.greenstone.gatherer.file.FileNode;
     
    2728    public void refresh(int refresh_reason)
    2829    {
    29     Gatherer.println("WorkspaceTree::refresh()... ");
     30    DebugStream.println("WorkspaceTree::refresh()... ");
    3031
    3132    // The method for displaying the tree has changed - redraw the tree
    3233    if (refresh_reason == DragTree.TREE_DISPLAY_CHANGED) {
    33         Gatherer.println("...Reason: tree display changed.");
     34        DebugStream.println("...Reason: tree display changed.");
    3435        updateUI();
    3536    }
     
    3738    // The loaded collection has changed - currently do nothing
    3839    if (refresh_reason == DragTree.LOADED_COLLECTION_CHANGED) {
    39         Gatherer.println("...Reason: loaded collection changed.");
     40        DebugStream.println("...Reason: loaded collection changed.");
    4041    }
    4142
    4243    // The collection's contents have changed - refresh collection's import folder
    4344    if (refresh_reason == DragTree.COLLECTION_CONTENTS_CHANGED) {
    44         Gatherer.println("...Reason: collection contents changed.");
     45        DebugStream.println("...Reason: collection contents changed.");
    4546        String import_directory_str = Gatherer.c_man.getCollectionImport();
    4647        refreshEveryNodeShowingFolder(import_directory_str);
     
    4950    // The collections in the library have changed - refresh the collect directory
    5051    if (refresh_reason == WorkspaceTree.LIBRARY_CONTENTS_CHANGED) {
    51         Gatherer.println("...Reason: library contents changed.");
     52        DebugStream.println("...Reason: library contents changed.");
    5253        String collect_directory_str = Configuration.gsdl_path + Utility.COL_DIR;
    5354        refreshEveryNodeShowingFolder(collect_directory_str);
     
    5758    // The downloaded files have changed - refresh that node
    5859    if (refresh_reason == WorkspaceTree.DOWNLOADED_FILES_CHANGED) {
    59         Gatherer.println("...Reason: downloaded files changed.");
     60        DebugStream.println("...Reason: downloaded files changed.");
    6061        WorkspaceTreeModel.refreshDownloadedFilesNode();
    6162    }
     
    6364    // The folder shortcuts have changed - refresh only them
    6465    if (refresh_reason == WorkspaceTree.FOLDER_SHORTCUTS_CHANGED) {
    65         Gatherer.println("...Reason: folder shortcuts changed.");
     66        DebugStream.println("...Reason: folder shortcuts changed.");
    6667        WorkspaceTreeModel.refreshFolderShortcuts();
    6768    }
  • trunk/gli/src/org/greenstone/gatherer/help/HelpFrame.java

    r8084 r8236  
    4545import javax.swing.tree.*;
    4646import org.apache.xerces.parsers.DOMParser;
     47import org.greenstone.gatherer.DebugStream;
    4748import org.greenstone.gatherer.Dictionary;
    48 import org.greenstone.gatherer.Gatherer;
    4949import org.greenstone.gatherer.util.StaticStrings;
    5050import org.greenstone.gatherer.util.Utility;
     
    119119        }
    120120        catch(Exception exception) {
    121             Gatherer.printStackTrace(exception);
     121            DebugStream.printStackTrace(exception);
    122122        }
    123123        }
     
    149149        }
    150150        catch (Exception exception) {
    151         Gatherer.printStackTrace(exception);
     151        DebugStream.printStackTrace(exception);
    152152        }
    153153    }
     
    263263        }
    264264        catch (Exception exception) {
    265             Gatherer.printStackTrace(exception);
     265            DebugStream.printStackTrace(exception);
    266266        }
    267267        }
  • trunk/gli/src/org/greenstone/gatherer/mem/MEMNode.java

    r8231 r8236  
    4141import javax.swing.tree.*;
    4242import org.greenstone.gatherer.Configuration;
     43import org.greenstone.gatherer.DebugStream;
    4344import org.greenstone.gatherer.Dictionary;
    4445import org.greenstone.gatherer.Gatherer;
     
    180181            }
    181182            catch(Exception exception) {
    182             Gatherer.println("Exception in MEMNode.toString() - exception is unexpected");
    183             Gatherer.printStackTrace(exception);
     183            DebugStream.println("Exception in MEMNode.toString() - exception is unexpected");
     184            DebugStream.printStackTrace(exception);
    184185            text = userObject.toString();
    185186            }
  • trunk/gli/src/org/greenstone/gatherer/metadata/DocXMLFile.java

    r8204 r8236  
    265265        if (metadata_element == null) {
    266266            // This element isn't defined in ex.mds, so create it for this session
    267             Gatherer.println("Extracted metadata element not defined: " + metadata_element_name);
     267            DebugStream.println("Extracted metadata element not defined: " + metadata_element_name);
    268268            extracted_metadata_set.addMetadataElementForThisSession(metadata_element_name);
    269269        }
  • trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFile.java

    r8165 r8236  
    231231        // If there is no metadata value tree node for this value, create it
    232232        if (metadata_value_tree_node == null) {
    233             Gatherer.println("Note: No value tree node for metadata value \"" + metadata_element_value + "\"");
     233            DebugStream.println("Note: No value tree node for metadata value \"" + metadata_element_value + "\"");
    234234            metadata_element.addMetadataValue(metadata_element_value);
    235235            metadata_value_tree_node = metadata_element.getMetadataValueTreeNode(metadata_element_value);
     
    338338
    339339    // Parse the metadata.xml file
    340     Gatherer.println("Skimming metadata.xml file " + this + "...");
     340    DebugStream.println("Skimming metadata.xml file " + this + "...");
    341341    Document document = XMLTools.parseXMLFile(this);
    342342    if (document == null) {
  • trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFileManager.java

    r8165 r8236  
    5555    for (int i = 0; i < file_nodes.length; i++) {
    5656        File current_file = file_nodes[i].getFile();
    57         Gatherer.println("Adding metadata to " + current_file.getAbsolutePath());
     57        DebugStream.println("Adding metadata to " + current_file.getAbsolutePath());
    5858
    5959        // Find which metadata.xml file needs editing
     
    9595    static public ArrayList getMetadataAssignedDirectlyToExternalFile(File file)
    9696    {
    97     Gatherer.println("Getting metadata assigned directly to external file " + file + "...");
     97    DebugStream.println("Getting metadata assigned directly to external file " + file + "...");
    9898
    9999    // Build up a list of applicable metadata.xml files
     
    175175    for (int i = 0; i < applicable_metadata_xml_files.size(); i++) {
    176176        MetadataXMLFile metadata_xml_file = (MetadataXMLFile) applicable_metadata_xml_files.get(i);
    177         Gatherer.println("Applicable metadata.xml file: " + metadata_xml_file);
     177        DebugStream.println("Applicable metadata.xml file: " + metadata_xml_file);
    178178
    179179        ArrayList metadata_values = metadata_xml_file.getMetadataAssignedToFile(file);
     
    241241    for (int i = 0; i < file_nodes.length; i++) {
    242242        File current_file = file_nodes[i].getFile();
    243         Gatherer.println("Removing metadata from " + current_file.getAbsolutePath());
     243        DebugStream.println("Removing metadata from " + current_file.getAbsolutePath());
    244244
    245245        // Find which metadata.xml file needs editing
     
    259259    static public void unloadMetadataXMLFile(File metadata_xml_file_file)
    260260    {
    261     Gatherer.println("Unloading metadata.xml file " + metadata_xml_file_file);
     261    DebugStream.println("Unloading metadata.xml file " + metadata_xml_file_file);
    262262
    263263    // Find the metadata.xml file in the list of loaded files, and remove it
  • trunk/gli/src/org/greenstone/gatherer/msm/ExistingMetadataLoader.java

    r8022 r8236  
    4040import java.util.*;
    4141import java.util.jar.*;
     42import org.greenstone.gatherer.DebugStream;
    4243import org.greenstone.gatherer.Gatherer;
    4344import org.greenstone.gatherer.file.FileNode;
     
    6667        name = name.substring(0, name.length() - 6);
    6768        load_these.add("org.greenstone.gatherer.msm.parsers." + name);
    68         Gatherer.println("Loaded metadata parser: " + name);
     69        DebugStream.println("Loaded metadata parser: " + name);
    6970        }
    7071        name = null;
     
    8586            if(!load_these.contains(name)) {
    8687                load_these.add(name);
    87                 Gatherer.println("Loaded metadata parser: " + name);
     88                DebugStream.println("Loaded metadata parser: " + name);
    8889            }
    8990            }                       
  • trunk/gli/src/org/greenstone/gatherer/msm/GreenstoneArchiveParser.java

    r8231 r8236  
    4141import java.util.*;
    4242import org.greenstone.gatherer.Configuration;
     43import org.greenstone.gatherer.DebugStream;
    4344import org.greenstone.gatherer.Dictionary;
    4445import org.greenstone.gatherer.Gatherer;
     
    208209    }
    209210    catch (UnsupportedEncodingException error) {
    210         Gatherer.printStackTrace(error);
     211        DebugStream.printStackTrace(error);
    211212    }
    212213
     
    269270            }
    270271            catch (Exception error) {
    271             Gatherer.printStackTrace(error);
     272            DebugStream.printStackTrace(error);
    272273            }
    273274        }
  • trunk/gli/src/org/greenstone/gatherer/msm/LegacyCollectionImporter.java

    r7338 r8236  
    3131import java.util.*;
    3232import org.w3c.dom.*;
     33import org.greenstone.gatherer.DebugStream;
    3334import org.greenstone.gatherer.Gatherer;
    3435import org.greenstone.gatherer.cdm.Argument;
     
    132133        }
    133134        catch (Exception e) {
    134         Gatherer.println("Exception: couldn't move the file " + meta_file.getPath() + e.getMessage());
     135        DebugStream.println("Exception: couldn't move the file " + meta_file.getPath() + e.getMessage());
    135136        }
    136137    }
  • trunk/gli/src/org/greenstone/gatherer/msm/MSMProfiler.java

    r6094 r8236  
    3939import java.io.*;
    4040import java.util.*;
     41import org.greenstone.gatherer.DebugStream;
    4142import org.greenstone.gatherer.Gatherer;
    4243import org.greenstone.gatherer.msm.MSMAdapter;
     
    112113     */
    113114    public void elementChanged(MSMEvent event) {
    114     Gatherer.println("Element changed: " + event);
     115    DebugStream.println("Element changed: " + event);
    115116    String new_name = null;
    116117    String old_name = event.getValue();
     
    207208        backup.deleteOnExit();
    208209        if(!profile_file.renameTo(backup)) {
    209             Gatherer.println("Error in MSMProfiler.save(): FileRenamedException");
     210            DebugStream.println("Error in MSMProfiler.save(): FileRenamedException");
    210211        }
    211212        backup = null;
     
    215216        Document document = Utility.parse(Utility.PROFILE_TEMPLATE, true);
    216217        if(document == null) {
    217         Gatherer.println("Error in MSMProfiler.save(): couldn't find and parse the profile template file!");
     218        DebugStream.println("Error in MSMProfiler.save(): couldn't find and parse the profile template file!");
    218219        return;
    219220        }
     
    249250    }
    250251    catch (Exception error) {
    251         Gatherer.printStackTrace(error);
     252        DebugStream.printStackTrace(error);
    252253    }
    253254    }
  • trunk/gli/src/org/greenstone/gatherer/msm/MetadataSet.java

    r8231 r8236  
    4242import org.apache.xerces.dom.*;
    4343import org.greenstone.gatherer.Configuration;
     44import org.greenstone.gatherer.DebugStream;
    4445import org.greenstone.gatherer.Dictionary;
    4546import org.greenstone.gatherer.Gatherer;
     
    345346
    346347    public Element getElement(Element parent_element, String name) {
    347     Gatherer.println("Get element named " + name + " from " + parent_element.getAttribute("name"));
     348    DebugStream.println("Get element named " + name + " from " + parent_element.getAttribute("name"));
    348349    NodeList elements = parent_element.getElementsByTagName("Element");
    349350    for(int i = 0; i < elements.getLength(); i++) {
     
    609610            }
    610611            else {
    611             Gatherer.println("Error! Missing mdv file: " + value_file.getAbsolutePath());
     612            DebugStream.println("Error! Missing mdv file: " + value_file.getAbsolutePath());
    612613            }
    613614        }
     
    615616    }
    616617    else {
    617         Gatherer.println("Error! Missing mds file: " + file.getAbsolutePath());
     618        DebugStream.println("Error! Missing mds file: " + file.getAbsolutePath());
    618619    }
    619620    }
  • trunk/gli/src/org/greenstone/gatherer/msm/MetadataSetManager.java

    r8231 r8236  
    4343import javax.swing.tree.TreePath;
    4444import org.greenstone.gatherer.Configuration;
     45import org.greenstone.gatherer.DebugStream;
    4546import org.greenstone.gatherer.Dictionary;
    4647import org.greenstone.gatherer.Gatherer;
     
    927928    File file = new File(Gatherer.self.getCollectionMetadata());
    928929    if (!file.exists()) {
    929         Gatherer.println("trying to save a collection and the metadata directory does not exist - creating it!");
     930        DebugStream.println("trying to save a collection and the metadata directory does not exist - creating it!");
    930931        file.mkdir();
    931932    }
     
    937938        backup.deleteOnExit();
    938939        if(!temp[i].renameTo(backup)) {
    939             Gatherer.println("Error in MetadataSetManager.save(): FileRenamedException");
     940            DebugStream.println("Error in MetadataSetManager.save(): FileRenamedException");
    940941        }
    941942        }
  • trunk/gli/src/org/greenstone/gatherer/msm/MetadataXMLFile.java

    r7624 r8236  
    2929import java.io.*;
    3030import java.util.*;
     31import org.greenstone.gatherer.DebugStream;
    3132import org.greenstone.gatherer.Gatherer;
    3233import org.greenstone.gatherer.msm.MetadataXMLFileManager;
     
    184185    }
    185186    catch (Exception error) {
    186         Gatherer.printStackTrace(error);
     187        DebugStream.printStackTrace(error);
    187188    }
    188189    }
     
    190191    /** this is used to 'purge' the metadata - I've taken the purge code out of getMetadata and put it in to here, cos its only called from one place and we dont want to retrieve the metadata, just update it */
    191192    public void cleanUpMetadataRefs() {
    192     //Gatherer.println("clean up metadata refs!");
     193    //DebugStream.println("clean up metadata refs!");
    193194
    194195    String file_relative_path = "";
     
    208209            // If this raw_value contains a '\' character, but no '\\', '[' or ']' characters, then replace the '\' with a '\\'
    209210            if(raw_value.indexOf(StaticStrings.ESCAPE_STR) != -1) {
    210             Gatherer.println("Detected Legacy Path: " + raw_value);
     211            DebugStream.println("Detected Legacy Path: " + raw_value);
    211212            raw_value = raw_value.replaceAll(StaticStrings.ESCAPE_PATTERN, StaticStrings.PIPE_STR);
    212213            MSMUtils.setValue(metadata_element, raw_value);
     
    231232        metadata_elements = null;
    232233        } // for each metadata type
    233     } catch (Exception error) {
    234         Gatherer.self.printStackTrace(error);
     234    } catch (Exception exception) {
     235        DebugStream.printStackTrace(exception);
    235236    }
    236237    }
     
    279280    // Kath has cleaned up this version a bit
    280281    public ArrayList getMetadata(String filename, boolean remove, ArrayList metadatum_so_far, File file, boolean append_folder_level) {
    281     Gatherer.println("Get metadata for " + filename);
    282     Gatherer.println("remove = " + remove + ", metadata_so_far = " + (metadatum_so_far != null ? String.valueOf(metadatum_so_far.size()) : "null") + ", file = " + file + ", append_folder_level = " + append_folder_level);
     282    DebugStream.println("Get metadata for " + filename);
     283    DebugStream.println("remove = " + remove + ", metadata_so_far = " + (metadatum_so_far != null ? String.valueOf(metadatum_so_far.size()) : "null") + ", file = " + file + ", append_folder_level = " + append_folder_level);
    283284
    284285    // Determine the file's path relative to the location of the metadata.xml file
     
    335336            // If this raw_value contains a '\' character, but no '\\', '[' or ']' characters, then replace the '\' with a '\\'
    336337            if(raw_value.indexOf(StaticStrings.ESCAPE_STR) != -1) {
    337                 Gatherer.println("Detected Legacy Path: " + raw_value);
     338                DebugStream.println("Detected Legacy Path: " + raw_value);
    338339                raw_value = raw_value.replaceAll(StaticStrings.ESCAPE_PATTERN, StaticStrings.PIPE_STR);
    339                 Gatherer.println("Updated Path To: " + raw_value);
     340                DebugStream.println("Updated Path To: " + raw_value);
    340341                MSMUtils.setValue(metadata_element, raw_value);
    341342            }
     
    454455        directorymetadata_element = null;
    455456    }
    456     catch (Exception error) {
    457         Gatherer.self.printStackTrace(error);
     457    catch (Exception exception) {
     458        DebugStream.printStackTrace(exception);
    458459    }
    459460    ///ystem.err.println("Found " + metadatum.size() + " pieces of metadata.");
     
    480481    }
    481482    catch (Exception error) {
    482         Gatherer.printStackTrace(error);
     483        DebugStream.printStackTrace(error);
    483484    }
    484485    return has_meta;
     
    523524    }
    524525    catch(Exception exception) {
    525         Gatherer.println("Exception in MetadataXMLFile.removeExtractedMetadata() - unexpected");
    526         Gatherer.printStackTrace(exception);
     526        DebugStream.println("Exception in MetadataXMLFile.removeExtractedMetadata() - unexpected");
     527        DebugStream.printStackTrace(exception);
    527528    }
    528529    }
     
    530531    /** Remove the given metadata from this document.If filename is null, then removes directory level metadata, otherwise just removes it from the specified file. All directory level metadata is available under the FileSet with filename '.*'. There is at least one nasty case to consider, where the first overwriting metadata entry, of several with the same element, is removed. In this case the next entry must become overwrite to ensure proper inheritance. */
    531532    public void removeMetadata(String filename, Metadata metadata) {
    532     Gatherer.println("Remove metadata: " + metadata + "\nFrom filename: " + filename);
     533    DebugStream.println("Remove metadata: " + metadata + "\nFrom filename: " + filename);
    533534    try {
    534535        boolean found = false;
     
    619620    }
    620621    catch (Exception error) {
    621         Gatherer.printStackTrace(error);
     622        DebugStream.printStackTrace(error);
    622623    }
    623624    }
  • trunk/gli/src/org/greenstone/gatherer/msm/MetadataXMLFileManager.java

    r8088 r8236  
    4444import javax.swing.event.*;
    4545import javax.swing.tree.*;
     46import org.greenstone.gatherer.DebugStream;
    4647import org.greenstone.gatherer.Gatherer;
    4748import org.greenstone.gatherer.file.FileNode;
     
    8384    Gatherer.c_man.getCollection().msm.addMSMListener(this);
    8485    // We also have a debug dialog
    85     if(Gatherer.debug != null) {
     86    if (DebugStream.isDebuggingEnabled()) {
    8687        display();
    8788    }
     
    213214        documents_in_cache_combobox.addItem(metadata_file);
    214215        }
    215         //Gatherer.println("[0ms]\tCached " + metadata_file);
     216        //DebugStream.println("[0ms]\tCached " + metadata_file);
    216217    }
    217218    return metadata_xml;
     
    388389    }
    389390    catch (Exception exception) {
    390         Gatherer.println("Exception in MetadataXMLFileManager.removeExtractedMetadata - unexpected");
    391         Gatherer.printStackTrace(exception);
     391        DebugStream.println("Exception in MetadataXMLFileManager.removeExtractedMetadata - unexpected");
     392        DebugStream.printStackTrace(exception);
    392393    }
    393394    }
     
    491492    private Metadata checkCache(Metadata metadata)
    492493    {
    493     Gatherer.println("Checking cache for " + metadata + "...");
     494    DebugStream.println("Checking cache for " + metadata + "...");
    494495
    495496    if (metadata == null) {
     
    501502    if (metadata_cache.contains(element_name, metadata.getValue())) {
    502503        // If so, return the cached metadata value
    503         Gatherer.println("In cache!");
     504        DebugStream.println("In cache!");
    504505        return (Metadata) metadata_cache.get(element_name, metadata.getValue());
    505506    }
  • trunk/gli/src/org/greenstone/gatherer/msm/parsers/GreenstoneMetadataParser.java

    r8022 r8236  
    3939import javax.swing.*;
    4040import javax.swing.tree.*;
     41import org.greenstone.gatherer.DebugStream;
    4142import org.greenstone.gatherer.Gatherer;
    4243import org.greenstone.gatherer.cdm.CommandTokenizer;
     
    9394    /** Locate and import any metadata parsed by this metadata parser given the file involved and its previous incarnation. */
    9495    public boolean process(FileNode destination, FileNode origin, boolean folder_level, boolean dummy_run) {
    95     Gatherer.println("GreenstoneMetadataParser: Process " + origin + ": ");
     96    DebugStream.println("GreenstoneMetadataParser: Process " + origin + ": ");
    9697    int counter = 0;
    9798    dialog_cancelled = false;
     
    114115        if(possible_cfg_file.exists() && (possible_gimport_directory.exists() || possible_import_directory.exists())) {
    115116        found = true;
    116         Gatherer.println("Found greenstone collection at " + collection_dir.getAbsolutePath());
     117        DebugStream.println("Found greenstone collection at " + collection_dir.getAbsolutePath());
    117118        }
    118119        else {
     
    131132
    132133    // 2. If a collection configuration file was found, attempt to merge in any mdses and make note of those that are successfully imported (by removing reference from collect.cfg).
    133     Gatherer.println("Merging in any metadata sets found.");
     134    DebugStream.println("Merging in any metadata sets found.");
    134135    if(collect_cfg != null) {
    135136        ArrayList mdses = collect_cfg.getMetadataSets();
     
    143144
    144145    // 3. Locate all of the metadata.xml files that may have an affect on the origin file. Make sure the metadata.xml closest to the origin files directory is last (to ensure property inheritance regarding accumulate/overwrite).
    145     Gatherer.println("Searching for metadata.xml files");
     146    DebugStream.println("Searching for metadata.xml files");
    146147    ArrayList search_files = new ArrayList();
    147148    File file = origin.getFile();
     
    176177    for(int i = 0; i < search_files.size(); i++) {
    177178        MetadataXMLFileSearch a_search = (MetadataXMLFileSearch) search_files.get(i);
    178         Gatherer.println("Search " + a_search.file.getAbsolutePath() + " for " + (a_search.filename != null ? a_search.filename : ".*"));
    179         Gatherer.println("Search at the " + (folder_level ? "Folder" : "Filename") + " level");
     179        DebugStream.println("Search " + a_search.file.getAbsolutePath() + " for " + (a_search.filename != null ? a_search.filename : ".*"));
     180        DebugStream.println("Search at the " + (folder_level ? "Folder" : "Filename") + " level");
    180181        // Retrieve the document
    181182        BasicGDMDocument document = getDocument(a_search.file);
     
    194195    search_files = null;
    195196    // Finally assign the metadata
    196     Gatherer.println("Found " + metadata.size() + " pieces of metadata for " + destination);
     197    DebugStream.println("Found " + metadata.size() + " pieces of metadata for " + destination);
    197198    if(metadata.size() > 0) {
    198199        addMetadata(origin, destination, metadata, collection_dir, collect_cfg, dummy_run);
     
    493494        directorymetadata_element = null;
    494495        }
    495         catch (Exception error) {
    496         Gatherer.self.printStackTrace(error);
     496        catch (Exception exception) {
     497        DebugStream.printStackTrace(exception);
    497498        }
    498499        return metadatum;
     
    583584            directorymetadata_element = null;
    584585        }
    585         catch (Exception error) {
    586             Gatherer.self.printStackTrace(error);
     586        catch (Exception exception) {
     587            DebugStream.printStackTrace(exception);
    587588        }
    588589        // Cache the result, given that these external metadata.xmls are taken to be static at the time of reading (if you happen to be sourcing information from a opened collection that someone is working on, too bad.
     
    703704        }
    704705        catch(Exception error) {
    705             Gatherer.printStackTrace(error);
     706            DebugStream.printStackTrace(error);
    706707            collect_cfg = null;
    707708        }
  • trunk/gli/src/org/greenstone/gatherer/shell/GBuildProgressMonitor.java

    r8231 r8236  
    4141import javax.swing.JProgressBar;
    4242import org.greenstone.gatherer.Configuration;
     43import org.greenstone.gatherer.DebugStream;
    4344import org.greenstone.gatherer.Dictionary;
    4445import org.greenstone.gatherer.Gatherer;
     
    223224        else {
    224225            // Unknown command, go indeterminate
    225             Gatherer.println("Unknown name: " + name);
     226            DebugStream.println("Unknown name: " + name);
    226227            progress_bar.setIndeterminate(true);
    227228        }
     
    270271            else {
    271272            // Unknown command, go indeterminate
    272             Gatherer.println("Unknown value: " + value);
     273            DebugStream.println("Unknown value: " + value);
    273274            progress_bar.setIndeterminate(true);
    274275            }
     
    286287        else {
    287288            // Unknown command, go indeterminate
    288             Gatherer.println("Unknown name: " + name);
     289            DebugStream.println("Unknown name: " + name);
    289290            progress_bar.setIndeterminate(true);
    290291        }
     
    312313            else {
    313314            // Unknown command, go indeterminate
    314             Gatherer.println("Unknown value: " + value);
     315            DebugStream.println("Unknown value: " + value);
    315316            progress_bar.setIndeterminate(true);
    316317            }
     
    331332        else {
    332333            // Unknown command, go indeterminate
    333             Gatherer.println("Unknown name: " + name);
     334            DebugStream.println("Unknown name: " + name);
    334335            progress_bar.setIndeterminate(true);
    335336        }
     
    366367            else {
    367368            // Unknown command, go indeterminate
    368             Gatherer.println("Unknown value: " + value);
     369            DebugStream.println("Unknown value: " + value);
    369370            progress_bar.setIndeterminate(true);
    370371            }
     
    388389        else {
    389390            // Unknown command, go indeterminate
    390             Gatherer.println("Unknown name: " + name);
     391            DebugStream.println("Unknown name: " + name);
    391392            progress_bar.setIndeterminate(true);
    392393        }
     
    427428            else {
    428429            // Unknown command, go indeterminate
    429             Gatherer.println("Unknown value: " + value);
     430            DebugStream.println("Unknown value: " + value);
    430431            progress_bar.setIndeterminate(true);
    431432            }
     
    441442        else {
    442443            // Unknown command, go indeterminate
    443             Gatherer.println("Unknown name: " + name);
     444            DebugStream.println("Unknown name: " + name);
    444445            progress_bar.setIndeterminate(true);
    445446        }
     
    458459        else {
    459460            // Unknown command, go indeterminate
    460             Gatherer.println("Unknown name: " + name);
     461            DebugStream.println("Unknown name: " + name);
    461462            progress_bar.setIndeterminate(true);
    462463        }
     
    465466        default:
    466467        // Unknown command, go indeterminate
    467         Gatherer.println("Unknown name: " + name);
     468        DebugStream.println("Unknown name: " + name);
    468469        progress_bar.setIndeterminate(true);
    469470        }
  • trunk/gli/src/org/greenstone/gatherer/shell/GImportProgressMonitor.java

    r8231 r8236  
    4242import javax.swing.JProgressBar;
    4343import org.greenstone.gatherer.Configuration;
     44import org.greenstone.gatherer.DebugStream;
    4445import org.greenstone.gatherer.Dictionary;
    4546import org.greenstone.gatherer.Gatherer;
     
    409410    shared_progress_bar.setValue(value);
    410411    if(value != 0 && value < previous_value) {
    411         Gatherer.println("Progress is decreasing! " + previous_value + " -> " + value);
     412        DebugStream.println("Progress is decreasing! " + previous_value + " -> " + value);
    412413    }
    413414    previous_value = value;
  • trunk/gli/src/org/greenstone/gatherer/shell/GShell.java

    r8231 r8236  
    4545import javax.swing.tree.*;
    4646import org.greenstone.gatherer.Configuration;
     47import org.greenstone.gatherer.DebugStream;
    4748import org.greenstone.gatherer.Dictionary;
    4849import org.greenstone.gatherer.Gatherer;
     
    119120    }
    120121    catch(Exception exception) {
    121         Gatherer.printStackTrace(exception);
     122        DebugStream.printStackTrace(exception);
    122123    }
    123124    return process_running;
     
    173174        if(line_buffer.length() > 0) {
    174175            String line = line_buffer.toString();
    175             Gatherer.println("* " + line + " *");
     176            DebugStream.println("* " + line + " *");
    176177            fireMessage(type, typeAsString(type) + "> " + line, status, bos);
    177178            line = null;
     
    196197        if(line_buffer.length() > 0) {
    197198        String line = line_buffer.toString();
    198         // Gatherer.println("* " + line + " *");
     199        // DebugStream.println("* " + line + " *");
    199200        fireMessage(type, typeAsString(type) + "> " + line, status, bos);
    200201        line_buffer = new StringBuffer();
     
    316317    catch (Exception exception) {
    317318        System.err.println("Exception in GShell.runRemote() - unexpected");
    318         Gatherer.printStackTrace(exception);
     319        DebugStream.printStackTrace(exception);
    319320        status = ERROR;
    320321    }
     
    330331        }
    331332       
    332         Gatherer.println("Command: "+command);
     333        DebugStream.println("Command: "+command);
    333334        ///ystem.err.println("Command: " + command);
    334335        fireMessage(type, Dictionary.get("GShell.Command") + ": " + command, status, null);
     
    377378        if(eline_buffer.length() > 0) {
    378379            String eline = eline_buffer.toString();
    379             //Gatherer.println("Last bit of eline: " + eline);
     380            //DebugStream.println("Last bit of eline: " + eline);
    380381            fireMessage(type, typeAsString(type) + "> " + eline, status, bos);
    381382            eline = null;
     
    384385        if(stdline_buffer.length() > 0) {
    385386            String stdline = stdline_buffer.toString();
    386             //Gatherer.println("Last bit of stdline: " + stdline);
     387            //DebugStream.println("Last bit of stdline: " + stdline);
    387388            fireMessage(type, typeAsString(type) + "> " + stdline, status, null);
    388389            stdline = null;
     
    425426    // Exception
    426427    catch (Exception exception) {
    427         Gatherer.println("Exception in GShell.runLocal() - unexpected");
    428         Gatherer.printStackTrace(exception);
     428        DebugStream.println("Exception in GShell.runLocal() - unexpected");
     429        DebugStream.printStackTrace(exception);
    429430        status = ERROR;
    430431    }
     
    453454        }
    454455        catch (Exception error) {
    455             Gatherer.printStackTrace(error);
     456            DebugStream.printStackTrace(error);
    456457        }
    457458        }
     
    581582        }
    582583        catch(Exception error) {
    583         Gatherer.printStackTrace(error);
     584        DebugStream.printStackTrace(error);
    584585        }
    585586    }
     
    617618        }
    618619        catch(Exception exception) {
    619         Gatherer.println("Exception in GShell.fireMessage() - unexpected");
    620         Gatherer.printStackTrace(exception);
     620        DebugStream.println("Exception in GShell.fireMessage() - unexpected");
     621        DebugStream.printStackTrace(exception);
    621622        }
    622623    }
  • trunk/gli/src/org/greenstone/gatherer/util/AppendLineOnlyFileDocument.java

    r7745 r8236  
    3838import javax.swing.event.*;
    3939import javax.swing.text.*;
     40import org.greenstone.gatherer.DebugStream;
    4041import org.greenstone.gatherer.Gatherer;
    4142import org.greenstone.gatherer.gui.GLIButton;
     
    8384     */
    8485    public AppendLineOnlyFileDocument(String filename, boolean build_log) {
    85     Gatherer.println("Creating log: " + filename);
     86    DebugStream.println("Creating log: " + filename);
    8687    // Initialization
    8788    this.build_log = build_log;
     
    116117    }
    117118    catch (Exception error) {
    118         Gatherer.printStackTrace(error);
     119        DebugStream.printStackTrace(error);
    119120    }
    120121    }
     
    163164    }
    164165    catch(Exception error) {
    165         Gatherer.printStackTrace(error);
     166        DebugStream.printStackTrace(error);
    166167    }
    167168    }
     
    187188    }
    188189    catch(Exception exception) {
    189         Gatherer.println("Exception in AppendLineOnlyFileDocument.destroy() - unexpected");
    190         Gatherer.printStackTrace(exception);
     190        DebugStream.println("Exception in AppendLineOnlyFileDocument.destroy() - unexpected");
     191        DebugStream.printStackTrace(exception);
    191192    }
    192193    }
     
    292293//          }
    293294//          catch (IOException error) {
    294 //          Gatherer.printStackTrace(error);
     295//          DebugStream.printStackTrace(error);
    295296//          }
    296297//          if(text == null) {
     
    366367        }
    367368        catch (Exception error) {
    368         Gatherer.printStackTrace(error);
     369        DebugStream.printStackTrace(error);
    369370        }
    370371    }
     
    795796            }
    796797            catch(Exception error) {
    797                 Gatherer.printStackTrace(error);
     798                DebugStream.printStackTrace(error);
    798799            }
    799800            element.clearContent();
     
    889890    static synchronized public void print(String message) {
    890891    if (message.endsWith("\n")) {
    891         Gatherer.print(message);
     892        DebugStream.print(message);
    892893    }
    893894    else {
    894         Gatherer.println(message);
     895        DebugStream.println(message);
    895896    }
    896897    }
  • trunk/gli/src/org/greenstone/gatherer/util/Codec.java

    r6899 r8236  
    222222        }
    223223        }
    224         //Gatherer.println("\n*** Transform: " + transform + " ***");
    225         //Gatherer.println("*** Raw      : '" + raw + "'");
    226         //Gatherer.println("*** Processed: '" + processed + "'");
     224        //DebugStream.println("\n*** Transform: " + transform + " ***");
     225        //DebugStream.println("*** Raw      : '" + raw + "'");
     226        //DebugStream.println("*** Processed: '" + processed + "'");
    227227        // If cache is at maximum size, empty it and start again
    228228        if(CACHE.size() == MAX_CACHE_SIZE) {
  • trunk/gli/src/org/greenstone/gatherer/util/DragTreeSelectionModel.java

    r5593 r8236  
    4040import java.awt.event.*;
    4141import javax.swing.tree.*;
     42import org.greenstone.gatherer.DebugStream;
    4243import org.greenstone.gatherer.Dictionary;
    43 import org.greenstone.gatherer.Gatherer;
    4444import org.greenstone.gatherer.gui.tree.DragTree;
    4545
     
    220220    }
    221221    catch (Exception error) {
    222         Gatherer.printStackTrace(error);
     222        DebugStream.printStackTrace(error);
    223223    }
    224224    }
  • trunk/gli/src/org/greenstone/gatherer/util/ExternalProgram.java

    r6785 r8236  
    11package org.greenstone.gatherer.util;
    22
    3 import org.greenstone.gatherer.Gatherer;
    43
    54import java.io.BufferedReader;
     
    87import java.io.IOException;
    98import java.io.OutputStreamWriter;
     9import org.greenstone.gatherer.DebugStream;
    1010
    1111
     
    7878    }
    7979    catch (IOException ex) {
    80         Gatherer.println("Error: Exception occurred while reading program output.");
    81         Gatherer.println("Exception: " + ex);
     80        DebugStream.println("Error: Exception occurred while reading program output.");
     81        DebugStream.println("Exception: " + ex);
    8282        return null;
    8383    }
     
    100100    }
    101101    catch (IOException ex) {
    102         Gatherer.println("Error: Exception occurred while reading program error.");
    103         Gatherer.println("Exception: " + ex);
     102        DebugStream.println("Error: Exception occurred while reading program error.");
     103        DebugStream.println("Exception: " + ex);
    104104        return null;
    105105    }
  • trunk/gli/src/org/greenstone/gatherer/util/SynchronizedTreeModelTools.java

    r6622 r8236  
    3131import javax.swing.SwingUtilities;
    3232import javax.swing.tree.*;
    33 import org.greenstone.gatherer.Gatherer;
     33import org.greenstone.gatherer.DebugStream;
     34
    3435/** Due to the TreeModel objects not having any synchronization, certain assumptions, such as the model state remaining constant during a repaint, don't always hold - especially given that I'm changing the tree model on a different thread. In order to get around this I will use the latest swing paradigm wherein you flag a section of code to be executed by the AWT GUI Event queue, as soon as other gui tasks have finished. This way I shouldn't have tree redraws throwing NPEs because the array size of the children of a certain node has changed -while- the repaint call was made, i.e. repaint() calls getChildCount() = 13, removeNodeFromParent() called, repaint calls getChildAt(12) = ArrayIndexOutOfBoundsException.
    3536 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    4647        public void run() {
    4748            ///ystem.err.print("Running task... ");
    48             Gatherer.println("insertNodeInto(" + model + ", " + parent + ", " + target_node + ", " + wait_allowed);
     49            DebugStream.println("insertNodeInto(" + model + ", " + parent + ", " + target_node + ", " + wait_allowed);
    4950            int index = -1;
    5051            int pos = 0;
     
    8990    }
    9091    catch (Exception exception) {
    91         Gatherer.printStackTrace(exception);
     92        DebugStream.printStackTrace(exception);
    9293    }
    9394    ///ystem.err.print("Added Task... ");
     
    110111    }
    111112    catch (Exception exception) {
    112         Gatherer.printStackTrace(exception);
     113        DebugStream.printStackTrace(exception);
    113114        ///ystem.err.println(e);
    114115    }
     
    142143    }
    143144    catch (Exception exception) {
    144         Gatherer.printStackTrace(exception);
     145        DebugStream.printStackTrace(exception);
    145146    }
    146147    }
  • trunk/gli/src/org/greenstone/gatherer/util/Utility.java

    r8231 r8236  
    4747import org.apache.xml.serialize.*;
    4848import org.greenstone.gatherer.Configuration;
     49import org.greenstone.gatherer.DebugStream;
    4950import org.greenstone.gatherer.Dictionary;
    5051import org.greenstone.gatherer.Gatherer;
     
    259260    catch (Exception exception) {
    260261        if(!file.getName().endsWith(METADATA_XML)) {
    261         Gatherer.printStackTrace(exception);
     262        DebugStream.printStackTrace(exception);
    262263        return false;
    263264        }
     
    740741        ZipEntry zipentry = (ZipEntry) e.nextElement();
    741742        String zentryname = dst_dir + zipentry.getName();
    742         Gatherer.println("    Unzipping: " + zentryname);
     743        DebugStream.println("    Unzipping: " + zentryname);
    743744
    744745        if (zipentry.isDirectory()) {
     
    774775    catch (ZipException error) {
    775776        System.err.println("Error: Unable to open '"+zip_file.getAbsolutePath()+"'");
    776         Gatherer.printStackTrace(error);
     777        DebugStream.printStackTrace(error);
    777778    }
    778779
     
    977978    }
    978979   
    979     Gatherer.println("    Zipping up: " + file_path);
     980    DebugStream.println("    Zipping up: " + file_path);
    980981    }
    981982
     
    10921093        ZipEntry zipentry = (ZipEntry) e.nextElement();
    10931094        String zentryname = col_dir + zipentry.getName();
    1094         Gatherer.println("    Unzipping: " + zentryname);
     1095        DebugStream.println("    Unzipping: " + zentryname);
    10951096
    10961097        if (zipentry.isDirectory()) {
     
    11261127    catch (ZipException error) {
    11271128        System.err.println("Error: Unable to open '"+zip_fname+"'");
    1128         Gatherer.printStackTrace(error);
     1129        DebugStream.printStackTrace(error);
    11291130    }
    11301131
     
    13131314    try {
    13141315        if (file.exists()) {
    1315         Gatherer.println("Parsing XML file: " + file);
     1316        DebugStream.println("Parsing XML file: " + file);
    13161317        FileInputStream fis = new FileInputStream(file);
    13171318        document = parse(fis, noisey);
     
    13211322        if(noisey) {
    13221323        error.printStackTrace();
    1323         Gatherer.println("Exception in Utility.parse() - Unexpected");
     1324        DebugStream.println("Exception in Utility.parse() - Unexpected");
    13241325        }
    13251326        else {
    1326         Gatherer.println("Exception in Utility.parse() - Expected");
    1327         Gatherer.printStackTrace(error);
     1327        DebugStream.println("Exception in Utility.parse() - Expected");
     1328        DebugStream.printStackTrace(error);
    13281329        }
    13291330    }
     
    13451346        if(noisey) {
    13461347        error.printStackTrace();
    1347         Gatherer.println("Exception in Utility.parse() - Unexpected");
     1348        DebugStream.println("Exception in Utility.parse() - Unexpected");
    13481349        }
    13491350        else {
    1350         Gatherer.println("Exception in Utility.parse() - Expected");
    1351         Gatherer.printStackTrace(error);
     1351        DebugStream.println("Exception in Utility.parse() - Expected");
     1352        DebugStream.printStackTrace(error);
    13521353        }
    13531354    }
     
    13821383        if(noisey) {
    13831384        error.printStackTrace();
    1384         Gatherer.println("Exception in Utility.parse() - Unexpected");
     1385        DebugStream.println("Exception in Utility.parse() - Unexpected");
    13851386        }
    13861387        else {
    1387         Gatherer.println("Exception in Utility.parse() - Expected");
    1388         }
    1389         Gatherer.printStackTrace(error);
     1388        DebugStream.println("Exception in Utility.parse() - Expected");
     1389        }
     1390        DebugStream.printStackTrace(error);
    13901391    }
    13911392    return document;
     
    14451446    }
    14461447    else {
    1447         //Gatherer.println("Zero length argument xml detected for: " + form);
     1448        //DebugStream.println("Zero length argument xml detected for: " + form);
    14481449        String[] margs = new String[1];
    14491450        margs[0] = form;
Note: See TracChangeset for help on using the changeset viewer.