Changeset 8236
- Timestamp:
- 2004-10-08T09:46:12+13:00 (20 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 72 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Configuration.java
r8231 r8236 152 152 153 153 // 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); 155 155 if(exec_path != null && exec_path.length() > 0) { 156 156 try { … … 158 158 } 159 159 catch (MalformedURLException error) { 160 Gatherer.println("Not an address.");161 Gatherer.printStackTrace(error);160 DebugStream.println("Not an address."); 161 DebugStream.printStackTrace(error); 162 162 } 163 163 } … … 172 172 } 173 173 else { 174 Gatherer.println("No local library at given file path.");174 DebugStream.println("No local library at given file path."); 175 175 } 176 176 } 177 177 // All sorts of errors might be thrown by a bogus file path. 178 178 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."); 180 180 ///atherer.printStackTrace(error); 181 181 } … … 187 187 } 188 188 else { 189 Gatherer.println("No local library.");189 DebugStream.println("No local library."); 190 190 } 191 191 } … … 193 193 } 194 194 else { 195 Gatherer.println("exec_address != null -> " + exec_address);195 DebugStream.println("exec_address != null -> " + exec_address); 196 196 } 197 197 … … 248 248 if(general_config == null) { 249 249 general_config = Utility.parse(TEMPLATE_CONFIG_XML, true); 250 Gatherer.println("Loaded default Gatherer configuration template.");250 DebugStream.println("Loaded default Gatherer configuration template."); 251 251 } 252 252 else { 253 Gatherer.println("Loaded current Gatherer configuration.");253 DebugStream.println("Loaded current Gatherer configuration."); 254 254 } 255 255 … … 292 292 } 293 293 } 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); 296 296 } 297 297 … … 322 322 } 323 323 catch (Exception exception) { 324 Gatherer.printStackTrace(exception);324 DebugStream.printStackTrace(exception); 325 325 } 326 326 return result; … … 424 424 } 425 425 catch(Exception error) { 426 Gatherer.printStackTrace(error);426 DebugStream.printStackTrace(error); 427 427 } 428 428 return result; … … 469 469 } 470 470 catch(Exception exception) { 471 Gatherer.printStackTrace(exception);471 DebugStream.printStackTrace(exception); 472 472 } 473 473 return special_directories; … … 510 510 } 511 511 catch(Exception error) { 512 Gatherer.printStackTrace(error);512 DebugStream.printStackTrace(error); 513 513 } 514 514 return result; … … 523 523 } 524 524 catch(Exception error) { 525 Gatherer.printStackTrace(error);525 DebugStream.printStackTrace(error); 526 526 } 527 527 return result; … … 555 555 } 556 556 catch(Exception error) { 557 Gatherer.printStackTrace(error);557 DebugStream.printStackTrace(error); 558 558 } 559 559 return result; … … 690 690 } 691 691 catch(Exception error) { 692 Gatherer.printStackTrace(error);692 DebugStream.printStackTrace(error); 693 693 } 694 694 return file; … … 724 724 static public void set(String property, boolean general, boolean value) { 725 725 if(property.startsWith("workflow")) { 726 Gatherer.println("Set property: " + property + ", general=" + general + ", value=" + value);726 DebugStream.println("Set property: " + property + ", general=" + general + ", value=" + value); 727 727 } 728 728 setString(property, general, (value ? "true" : "false")); … … 756 756 } 757 757 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); 760 760 } 761 761 } … … 867 867 /** Sets the value of the named property argument using the given string. */ 868 868 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]")); 870 870 try { 871 871 Document document = general_config; -
trunk/gli/src/org/greenstone/gatherer/Dictionary.java
r6855 r8236 188 188 catch (Exception e) { 189 189 System.err.println("Missing value for key: " + key); 190 // Gatherer.printStackTrace(e);190 // DebugStream.printStackTrace(e); 191 191 return key; 192 192 } -
trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r8235 r8236 220 220 // 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. 221 221 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"); 224 224 missingEXEC(); 225 225 } 226 226 227 227 if (Gatherer.isGsdlRemote) { 228 Gatherer.println("Not checking for perl path/exe");228 DebugStream.println("Not checking for perl path/exe"); 229 229 } 230 230 else { … … 326 326 327 327 } 328 catch (Exception e rror) {329 error.printStackTrace();328 catch (Exception exception) { 329 DebugStream.printStackTrace(exception); 330 330 } 331 331 … … 472 472 String raw_url = Configuration.exec_address.toString() + command; 473 473 URL url = new URL(raw_url); 474 Gatherer.println("Action: " + raw_url);474 DebugStream.println("Action: " + raw_url); 475 475 HttpURLConnection library_connection = (HttpURLConnection) url.openConnection(); 476 476 int response_code = library_connection.getResponseCode(); 477 477 if(HttpURLConnection.HTTP_OK <= response_code && response_code < HttpURLConnection.HTTP_MULT_CHOICE) { 478 Gatherer.println("200 - Complete.");478 DebugStream.println("200 - Complete."); 479 479 } 480 480 else { 481 Gatherer.println("404 - Failed.");481 DebugStream.println("404 - Failed."); 482 482 } 483 483 url = null; 484 484 } 485 485 catch (Exception ex) { 486 ex.printStackTrace(); 487 Gatherer.printStackTrace(ex); 486 DebugStream.printStackTrace(ex); 488 487 } 489 488 } … … 496 495 String raw_url = Configuration.exec_address.toString() + Configuration.getServletPath() + command; 497 496 URL url = new URL(raw_url); 498 Gatherer.println("Action: " + raw_url);497 DebugStream.println("Action: " + raw_url); 499 498 HttpURLConnection library_connection = (HttpURLConnection) url.openConnection(); 500 499 int response_code = library_connection.getResponseCode(); 501 500 if(HttpURLConnection.HTTP_OK <= response_code && response_code < HttpURLConnection.HTTP_MULT_CHOICE) { 502 Gatherer.println("200 - Complete.");501 DebugStream.println("200 - Complete."); 503 502 } 504 503 else { 505 Gatherer.println("404 - Failed.");504 DebugStream.println("404 - Failed."); 506 505 } 507 506 url = null; 508 507 } 509 508 catch(Exception exception) { 510 Gatherer.printStackTrace(exception);509 DebugStream.printStackTrace(exception); 511 510 ///ystem.err.println("Bad URL."); 512 511 } … … 613 612 dialog = null; 614 613 } 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 634 615 635 616 /** Sets up the proxy connection by setting JVM Environment flags and creating a new Authenticator. … … 651 632 } 652 633 } 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); 655 636 } 656 637 } … … 695 676 } 696 677 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); 699 680 } 700 681 if (GS3) { 701 682 try { 702 683 servlet_config = new ServletConfiguration(gsdl3_path); 703 } catch (Exception e rror) {704 error.printStackTrace();684 } catch (Exception exception) { 685 DebugStream.printStackTrace(exception); 705 686 } 706 687 } … … 711 692 try { 712 693 Configuration.save(); 713 } catch (Exception e rror) {714 Gatherer.printStackTrace(error);694 } catch (Exception exception) { 695 DebugStream.printStackTrace(exception); 715 696 } 716 697 } … … 766 747 // 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. 767 748 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 + "'"); 769 750 URLConnection connection = Configuration.exec_address.openConnection(); 770 751 connection.getContent(); … … 772 753 catch(IOException bad_url_connection) { 773 754 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() + "'"); 775 756 Configuration.exec_address = new URL(gsdlsite_cfg.getLocalHostURL ()); 776 757 URLConnection connection = Configuration.exec_address.openConnection(); … … 778 759 } 779 760 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."); 781 762 Configuration.exec_address = null; 782 763 Configuration.exec_file = null; … … 789 770 } 790 771 } 791 catch (Exception e rror) {792 error.printStackTrace();772 catch (Exception exception) { 773 DebugStream.printStackTrace(exception); 793 774 } 794 775 } 795 776 // Can't do a damb thing. 796 777 } 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); 798 779 } 799 780 … … 827 808 //} 828 809 } 829 catch (Exception e rror) {830 error.printStackTrace();810 catch (Exception exception) { 811 DebugStream.printStackTrace(exception); 831 812 } 832 813 } … … 882 863 whole_command.append(" "); 883 864 } 884 println("Running " + whole_command.toString());865 DebugStream.println("Running " + whole_command.toString()); 885 866 Runtime rt = Runtime.getRuntime(); 886 867 process = rt.exec(commands); … … 888 869 } 889 870 else { 890 println("Running " + command);871 DebugStream.println("Running " + command); 891 872 Runtime rt = Runtime.getRuntime(); 892 873 process = rt.exec(command); … … 894 875 } 895 876 } 896 catch (Exception error) { 897 println("Error in ExternalApplication.run(): " + error); 898 printStackTrace(error); 877 catch (Exception exception) { 878 DebugStream.printStackTrace(exception); 899 879 } 900 880 // Remove ourself from Gatherer list of threads. … … 956 936 String lower_name = prog_name.toLowerCase(); 957 937 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"); 959 939 // mozilla and netscape, try using a remote command to get things in the same window 960 940 String [] new_commands = new String[] {prog_name, "-raise", "-remote", "openURL("+url+",new-tab)"}; … … 965 945 int exitCode = process.waitFor(); 966 946 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"); 968 948 printArray(commands); 969 949 process = rt.exec(commands); // try the original command … … 976 956 whole_command.append(" "); 977 957 } 978 println("Running " + whole_command.toString());958 DebugStream.println("Running " + whole_command.toString()); 979 959 Runtime rt = Runtime.getRuntime(); 980 960 process = rt.exec(commands); … … 983 963 } 984 964 985 catch (Exception error) { 986 println("Error in BrowserApplication.run(): " + error); 987 printStackTrace(error); 965 catch (Exception exception) { 966 DebugStream.printStackTrace(exception); 988 967 } 989 968 // Remove ourself from Gatherer list of threads. -
trunk/gli/src/org/greenstone/gatherer/GetOpt.java
r8229 r8236 112 112 // value. We are ready to store the data in the 113 113 // 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")); 115 115 // 3a. First those arguments that have no associated value 116 116 if(argument_value == null) { 117 117 if(argument_name.equals(StaticStrings.HELP_ARGUMENT)) { 118 Gatherer.printUsage(dictionary);118 System.out.println(Dictionary.get("General.Usage")); 119 119 System.exit(0); 120 120 } -
trunk/gli/src/org/greenstone/gatherer/ServletConfiguration.java
r8211 r8236 70 70 71 71 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()); 73 73 return; 74 74 } -
trunk/gli/src/org/greenstone/gatherer/WGet.java
r8231 r8236 195 195 } 196 196 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."); 198 198 } 199 199 } … … 259 259 public void newDownloadJob(boolean no_parents, boolean other_hosts, boolean page_requisites, URL url, int depth, String destination) { 260 260 // 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"); 262 262 263 263 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); … … 326 326 job = (DownloadJob) job_queue.get(index); 327 327 if(job.getState() == DownloadJob.RUNNING) { 328 Gatherer.println("DownloadJob " + job.toString() + " Begun.");328 DebugStream.println("DownloadJob " + job.toString() + " Begun."); 329 329 // A lock to prevent us deleting this job while its being 330 330 // run, unless you want things to go really wrong. … … 337 337 } 338 338 busy = false; 339 Gatherer.println("DownloadJob " + job.toString() + " complete.");339 DebugStream.println("DownloadJob " + job.toString() + " complete."); 340 340 // And if the user has requested that complete jobs 341 341 // be removed, then remove it from the list. … … 352 352 try { 353 353 synchronized(this) { 354 Gatherer.println("WGet thread is waiting for DownloadJobs.");354 DebugStream.println("WGet thread is waiting for DownloadJobs."); 355 355 wait(); 356 356 } -
trunk/gli/src/org/greenstone/gatherer/cdm/Argument.java
r8015 r8236 35 35 import java.util.*; 36 36 import org.greenstone.gatherer.Configuration; 37 import org.greenstone.gatherer.DebugStream; 37 38 import org.greenstone.gatherer.Gatherer; 38 39 import org.greenstone.gatherer.cdm.CollectionConfiguration; … … 476 477 } 477 478 else { 478 Gatherer.println("Argument.setValue(" + value + ") called on a base Argument.");479 DebugStream.println("Argument.setValue(" + value + ") called on a base Argument."); 479 480 } 480 481 } … … 496 497 } 497 498 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."); 499 500 } 500 501 } -
trunk/gli/src/org/greenstone/gatherer/cdm/ArgumentConfiguration.java
r8231 r8236 32 32 import javax.swing.*; 33 33 import org.greenstone.gatherer.Configuration; 34 import org.greenstone.gatherer.DebugStream; 34 35 import org.greenstone.gatherer.Dictionary; 35 36 import org.greenstone.gatherer.Gatherer; … … 375 376 } 376 377 catch (Exception error) { 377 Gatherer.println("ArgumentConfiguration Error: "+error);378 DebugStream.println("ArgumentConfiguration Error: "+error); 378 379 } 379 380 } else if (default_value != null && !default_value.equals("")) { … … 383 384 } 384 385 catch (Exception error) { 385 Gatherer.println("ArgumentConfiguration Error: "+error);386 DebugStream.println("ArgumentConfiguration Error: "+error); 386 387 } 387 388 } -
trunk/gli/src/org/greenstone/gatherer/cdm/ClassifierManager.java
r8231 r8236 37 37 import org.apache.xerces.parsers.*; 38 38 import org.greenstone.gatherer.Configuration; 39 import org.greenstone.gatherer.DebugStream; 39 40 import org.greenstone.gatherer.Dictionary; 40 41 import org.greenstone.gatherer.Gatherer; … … 76 77 super(CollectionDesignManager.collect_config.getDocumentElement(), CollectionConfiguration.CLASSIFY_ELEMENT, new Classifier()); 77 78 this.model = this; 78 Gatherer.println("ClassifierManager: " + getSize() + " classifiers parsed.");79 DebugStream.println("ClassifierManager: " + getSize() + " classifiers parsed."); 79 80 // Reload/Create the library 80 81 loadClassifiers(); … … 108 109 public static boolean clearClassifierCache() { 109 110 110 Gatherer.println("deleting classifiers.dat");111 DebugStream.println("deleting classifiers.dat"); 111 112 File class_file = new File(Utility.BASE_DIR + "classifiers.dat"); 112 113 if (class_file.exists()) { … … 197 198 private void moveClassifier(Classifier classifier, boolean direction, boolean all) { 198 199 if(getSize() < 2) { 199 Gatherer.println("Not enough classifiers to allow moving.");200 DebugStream.println("Not enough classifiers to allow moving."); 200 201 return; 201 202 } … … 379 380 } 380 381 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"); 382 383 } 383 384 … … 813 814 Classifier new_classifier = null; 814 815 if(base_classifier != null) { 815 Gatherer.println("Creating Classifier based on existing Classifer.");816 DebugStream.println("Creating Classifier based on existing Classifer."); 816 817 element.setAttribute(CollectionConfiguration.TYPE_ATTRIBUTE, base_classifier.getName()); 817 818 new_classifier = new Classifier(element, base_classifier); 818 819 } 819 820 else { 820 Gatherer.println("Creating new custom Classifier.");821 DebugStream.println("Creating new custom Classifier."); 821 822 element.setAttribute(CollectionConfiguration.TYPE_ATTRIBUTE, selected_object.toString()); 822 823 new_classifier = new Classifier(element, null); -
trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java
r8231 r8236 33 33 import javax.swing.*; 34 34 import org.greenstone.gatherer.Configuration; 35 import org.greenstone.gatherer.DebugStream; 35 36 import org.greenstone.gatherer.Gatherer; 36 37 import org.greenstone.gatherer.cdm.CommandTokenizer; … … 463 464 } 464 465 if(!original_file.renameTo(backup_file)) { 465 Gatherer.println("Can't rename collect.cfg");466 DebugStream.println("Can't rename collect.cfg"); 466 467 } 467 468 } … … 514 515 } 515 516 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); 518 519 } 519 520 } … … 903 904 // 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 904 905 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."); 906 907 command_element = document.createElement(UNKNOWN_ELEMENT); 907 908 append_element = false; … … 916 917 // 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. 917 918 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); 920 921 StringBuffer new_command_str = new StringBuffer(command_type); 921 922 new_command_str.append(SPACE_CHARACTER); … … 958 959 command_str = new_command_str.toString(); 959 960 new_command_str = null; 960 Gatherer.println("After: " + command_str);961 DebugStream.println("After: " + command_str); 961 962 } 962 963 command_element = parseIndex(command_str); … … 967 968 // If this was a G2.39 config file then we squelch the default index (no such thing in G2.4) 968 969 if(is_twopointthreenine) { 969 Gatherer.println("G2.39 Default Index command detected. Ignoring.");970 DebugStream.println("G2.39 Default Index command detected. Ignoring."); 970 971 append_element = false; 971 972 } … … 980 981 // 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. 981 982 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); 984 985 StringBuffer new_command_str = new StringBuffer(command_type); 985 986 new_command_str.append(SPACE_CHARACTER); … … 1000 1001 command_str = new_command_str.toString(); 1001 1002 new_command_str = null; 1002 Gatherer.println("After: " + command_str);1003 DebugStream.println("After: " + command_str); 1003 1004 } 1004 1005 command_element = parseLevels(command_str); … … 1066 1067 Element document_element = document.getDocumentElement(); 1067 1068 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."); 1070 1071 for(int z = collectionmeta_elements.getLength(); z > 0; z--) { 1071 1072 Element collectionmeta_element = (Element) collectionmeta_elements.item(z - 1); 1072 1073 String name = collectionmeta_element.getAttribute(NAME_ATTRIBUTE); 1073 Gatherer.println("Checking " + name);1074 DebugStream.println("Checking " + name); 1074 1075 // Remove any obsolete metadata 1075 1076 if(obsolete_collectionmeta_names.contains(name)) { 1076 Gatherer.println("G2.39 CollectMeta detected. Removing: " + name);1077 DebugStream.println("G2.39 CollectMeta detected. Removing: " + name); 1077 1078 document_element.removeChild(collectionmeta_element); 1078 1079 } … … 1080 1081 else if(changed_collectionmeta_names.containsKey(name)) { 1081 1082 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); 1083 1084 collectionmeta_element.setAttribute(NAME_ATTRIBUTE, new_name); 1084 1085 new_name = null; … … 1088 1089 1089 1090 // 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."); 1091 1092 for(int y = 0; y < acquired_collectionmeta_names.size(); y++) { 1092 1093 String name = (String) acquired_collectionmeta_names.get(y); 1093 1094 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 + "\""); 1095 1096 Element element = document.createElement(COLLECTIONMETADATA_ELEMENT); 1096 1097 element.setAttribute(NAME_ATTRIBUTE, name); … … 1108 1109 } 1109 1110 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); 1112 1113 } 1113 1114 } … … 1201 1202 } 1202 1203 catch (Exception exception) { 1203 Gatherer.printStackTrace(exception);1204 DebugStream.printStackTrace(exception); 1204 1205 command_element = null; 1205 1206 } … … 1394 1395 } 1395 1396 catch (Exception exception) { 1396 Gatherer.printStackTrace(exception);1397 DebugStream.printStackTrace(exception); 1397 1398 command_element = null; 1398 1399 } -
trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java
r8231 r8236 33 33 import javax.swing.event.*; 34 34 import org.greenstone.gatherer.Configuration; 35 import org.greenstone.gatherer.DebugStream; 35 36 import org.greenstone.gatherer.Gatherer; 36 37 import org.greenstone.gatherer.cdm.ClassifierManager; … … 86 87 */ 87 88 public CollectionDesignManager(File collect_config_file) { 88 Gatherer.println("Initializaing CollectionDesignModule.");89 DebugStream.println("Initializaing CollectionDesignModule."); 89 90 change_listener = new CDMChangeListener(); 90 91 // Parse the collection configuration 91 92 collect_config = new CollectionConfiguration(collect_config_file); 92 if (Gatherer.debug != null) {93 if (DebugStream.isDebuggingEnabled()) { 93 94 collect_config.display(); 94 95 } 95 96 loadDesignDetails(); 96 Gatherer.println("CollectionDesignModule loaded.");97 DebugStream.println("CollectionDesignModule loaded."); 97 98 } 98 99 -
trunk/gli/src/org/greenstone/gatherer/cdm/CollectionMetaManager.java
r8231 r8236 33 33 import javax.swing.event.*; 34 34 import org.greenstone.gatherer.Configuration; 35 import org.greenstone.gatherer.DebugStream; 35 36 import org.greenstone.gatherer.Gatherer; 36 37 import org.greenstone.gatherer.cdm.CollectionDesignManager; … … 52 53 public CollectionMetaManager() { 53 54 super(CollectionDesignManager.collect_config.getDocumentElement(), StaticStrings.COLLECTIONMETADATA_ELEMENT, new CollectionMeta("")); 54 Gatherer.println("CollectionMetaManager: " + getSize() + " metadata parsed.");55 DebugStream.println("CollectionMetaManager: " + getSize() + " metadata parsed."); 55 56 } 56 57 /** Method to add a new piece of metadata. … … 121 122 122 123 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."); 124 125 int size = getSize(); 125 126 for(int i = 0; i < size; i++) { 126 127 CollectionMeta metadatum = (CollectionMeta) getElementAt(i); 127 128 if(metadatum.getName().equals(name) && metadatum.getLanguage().equals(Configuration.getLanguage())) { 128 Gatherer.println("Found '" + metadatum + "'");129 DebugStream.println("Found '" + metadatum + "'"); 129 130 return metadatum; 130 131 } 131 132 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() + "\""); 133 134 } 134 135 metadatum = null; … … 137 138 CollectionMeta result = new CollectionMeta(name); 138 139 addMetadatum(result); 139 Gatherer.println("Added new metadata: " + name);140 DebugStream.println("Added new metadata: " + name); 140 141 return result; 141 142 } -
trunk/gli/src/org/greenstone/gatherer/cdm/CommandTokenizer.java
r7206 r8236 46 46 import java.io.BufferedReader; 47 47 import java.util.StringTokenizer; 48 import org.greenstone.gatherer.DebugStream; 48 49 import org.greenstone.gatherer.Gatherer; 49 50 import org.greenstone.gatherer.util.StaticStrings; … … 205 206 // 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 206 207 catch(Exception exception) { 207 Gatherer.printStackTrace(exception);208 DebugStream.printStackTrace(exception); 208 209 if(strip_characters) { 209 210 return buffer.substring(1); -
trunk/gli/src/org/greenstone/gatherer/cdm/FormatManager.java
r8231 r8236 38 38 import javax.swing.event.*; 39 39 import org.greenstone.gatherer.Configuration; 40 import org.greenstone.gatherer.DebugStream; 40 41 import org.greenstone.gatherer.Dictionary; 41 42 import org.greenstone.gatherer.Gatherer; … … 85 86 super(CollectionDesignManager.collect_config.getDocumentElement(), CollectionConfiguration.FORMAT_ELEMENT, new Format()); 86 87 this.model = this; 87 Gatherer.println("FormatManager: parsed " + getSize() + " format statements.");88 DebugStream.println("FormatManager: parsed " + getSize() + " format statements."); 88 89 // 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. 89 90 int size = getSize(); … … 181 182 182 183 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."); 184 185 return new HashMap(); 185 186 } … … 201 202 202 203 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."); 204 205 ArrayList part_model = new ArrayList(); 205 206 part_model.add(new Part("", "")); … … 212 213 213 214 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."); 215 216 ArrayList variable_model = new ArrayList(); 216 217 variable_model.add("[Text]"); -
trunk/gli/src/org/greenstone/gatherer/cdm/GeneralManager.java
r8231 r8236 36 36 import javax.swing.tree.*; 37 37 import org.greenstone.gatherer.Configuration; 38 import org.greenstone.gatherer.DebugStream; 38 39 import org.greenstone.gatherer.Dictionary; 39 40 import org.greenstone.gatherer.Gatherer; … … 68 69 public GeneralManager() { 69 70 super(); 70 Gatherer.println("GeneralManager: Main GUI components created.");71 DebugStream.println("GeneralManager: Main GUI components created."); 71 72 // Assignments 72 73 this.controls = new GeneralControl(); … … 498 499 } 499 500 catch(Exception exception) { 500 Gatherer.printStackTrace(exception);501 DebugStream.printStackTrace(exception); 501 502 // Show warning 502 503 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 28 28 29 29 import java.util.*; 30 import org.greenstone.gatherer.DebugStream; 30 31 import org.greenstone.gatherer.Gatherer; 31 32 import org.greenstone.gatherer.cdm.CollectionConfiguration; … … 77 78 Object source_object = sources.get(i); 78 79 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()); 80 81 content_element.setAttribute(CollectionConfiguration.NAME_ATTRIBUTE, ((ElementWrapper)source_object).getName()); 81 82 } 82 83 else { 83 /// Gatherer.println("Found String as source: " + source_object.toString());84 ///DebugStream.println("Found String as source: " + source_object.toString()); 84 85 content_element.setAttribute(CollectionConfiguration.NAME_ATTRIBUTE, source_object.toString()); 85 86 } … … 254 255 } 255 256 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."); 257 258 } 258 259 } … … 271 272 Object source_object = sources.get(i); 272 273 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()); 274 275 String name = ((ElementWrapper)source_object).getName(); 275 276 content_element.setAttribute(CollectionConfiguration.NAME_ATTRIBUTE, name); … … 277 278 } 278 279 else { 279 // Gatherer.println("Found String as source: " + source_object.toString());280 //DebugStream.println("Found String as source: " + source_object.toString()); 280 281 content_element.setAttribute(CollectionConfiguration.NAME_ATTRIBUTE, source_object.toString()); 281 282 } … … 288 289 } 289 290 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."); 291 292 } 292 293 } -
trunk/gli/src/org/greenstone/gatherer/cdm/IndexManager.java
r8231 r8236 33 33 import javax.swing.event.*; 34 34 import org.greenstone.gatherer.Configuration; 35 import org.greenstone.gatherer.DebugStream; 35 36 import org.greenstone.gatherer.Dictionary; 36 37 import org.greenstone.gatherer.Gatherer; … … 71 72 public IndexManager(Element indexes) { 72 73 super(indexes, CollectionConfiguration.INDEX_ELEMENT, new Index()); 73 Gatherer.println("IndexManager: " + getSize() + " indexes parsed.");74 DebugStream.println("IndexManager: " + getSize() + " indexes parsed."); 74 75 model = this; 75 76 // Parse and retrieve the default index … … 81 82 Element levels_element = CollectionDesignManager.collect_config.getLevels(); 82 83 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."); 84 85 } 85 86 -
trunk/gli/src/org/greenstone/gatherer/cdm/LanguageManager.java
r8231 r8236 39 39 import javax.swing.event.*; 40 40 import org.greenstone.gatherer.Configuration; 41 import org.greenstone.gatherer.DebugStream; 41 42 import org.greenstone.gatherer.Dictionary; 42 43 import org.greenstone.gatherer.Gatherer; … … 75 76 super(languages_element, CollectionConfiguration.LANGUAGE_ELEMENT, new Language()); 76 77 77 Gatherer.println("LanguageManager: " + getSize() + " languages parsed.");78 DebugStream.println("LanguageManager: " + getSize() + " languages parsed."); 78 79 79 80 this.model = this; -
trunk/gli/src/org/greenstone/gatherer/cdm/MetadataSetView.java
r8231 r8236 33 33 import javax.swing.event.*; 34 34 import org.greenstone.gatherer.Configuration; 35 import org.greenstone.gatherer.DebugStream; 35 36 import org.greenstone.gatherer.Dictionary; 36 37 import org.greenstone.gatherer.Gatherer; … … 60 61 */ 61 62 public MetadataSetView() { 62 Gatherer.println("MetadataSetView: Initialized.");63 DebugStream.println("MetadataSetView: Initialized."); 63 64 model = this; 64 65 Gatherer.c_man.getCollection().msm.addMSMListener(this); -
trunk/gli/src/org/greenstone/gatherer/cdm/PlugIn.java
r7111 r8236 59 59 this.element = element; 60 60 this.name = element.getAttribute(StaticStrings.TYPE_ATTRIBUTE); 61 // Gatherer.println("Establishing Plugin: " + name);61 //DebugStream.println("Establishing Plugin: " + name); 62 62 // Parse in any argument options for this plugin, keeping a list of the ones found 63 63 HashMap known_arguments = new HashMap(); … … 67 67 Element option_element = (Element) option_elements.item(i); 68 68 Argument argument = new Argument(option_element); 69 // Gatherer.println("Rebuilding existing argument: " + argument.getName());69 //DebugStream.println("Rebuilding existing argument: " + argument.getName()); 70 70 known_arguments.put(argument.getName(), argument); 71 71 if (argument.isAssigned() || base_plugin == null) { … … 77 77 // If a base plugin was given 78 78 if(base_plugin != null) { 79 // Gatherer.println("Based on previous plugin.");79 //DebugStream.println("Based on previous plugin."); 80 80 // Copy the details, and add a reference to whatever base_plugins super plugin is. ?? 81 81 description = base_plugin.getDescription(); … … 86 86 Argument base_argument = (Argument) all_arguments.get(j); 87 87 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); 89 89 Argument existing_argument = (Argument) known_arguments.get(base_argument_name); 90 90 // Found an existing argument. Complete its details 91 91 if(existing_argument != null) { 92 // Gatherer.println("Found existing argument. Filling out details.");92 //DebugStream.println("Found existing argument. Filling out details."); 93 93 existing_argument.setCustomArgument(false); 94 94 existing_argument.setDefaultValue(base_argument.getDefaultValue()); … … 108 108 // 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. 109 109 else { 110 // Gatherer.println("No such argument. Adding new, unassigned, argument.");110 //DebugStream.println("No such argument. Adding new, unassigned, argument."); 111 111 // The trick thing is that we have to create a new element in the DOM as well. 112 112 Argument new_argument = base_argument.copy(); -
trunk/gli/src/org/greenstone/gatherer/cdm/PlugInManager.java
r8231 r8236 38 38 import org.apache.xerces.parsers.*; 39 39 import org.greenstone.gatherer.Configuration; 40 import org.greenstone.gatherer.DebugStream; 40 41 import org.greenstone.gatherer.Dictionary; 41 42 import org.greenstone.gatherer.Gatherer; … … 70 71 public PlugInManager() { 71 72 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."); 73 74 model = this; 74 75 // Reload/Create the library … … 102 103 public static boolean clearPlugInCache() { 103 104 104 Gatherer.println("deleting plugins.dat");105 DebugStream.println("deleting plugins.dat"); 105 106 File plugin_file = new File(Utility.BASE_DIR + "plugins.dat"); 106 107 if (plugin_file.exists()) { … … 175 176 // Can't ever move RecPlug or ArcPlug 176 177 if(super.getSize() < 4) { 177 // Gatherer.println("Not enough plugins to allow moving.");178 //DebugStream.println("Not enough plugins to allow moving."); 178 179 return; 179 180 } … … 290 291 } 291 292 catch (Exception error) { 292 Gatherer.printStackTrace(error);293 DebugStream.printStackTrace(error); 293 294 } 294 295 } … … 335 336 // Now go through the assigned plugins, and remove any that match. 336 337 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."); 340 341 Collections.sort(available); 341 342 return available.toArray(); … … 429 430 } 430 431 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"); 432 433 } 433 434 … … 910 911 PlugIn new_plugin = null; 911 912 if(base_plugin != null) { 912 // Gatherer.println("New PlugIn based on existing PlugIn");913 //DebugStream.println("New PlugIn based on existing PlugIn"); 913 914 element.setAttribute(CollectionConfiguration.TYPE_ATTRIBUTE, base_plugin.getName()); 914 915 new_plugin = new PlugIn(element, base_plugin); 915 916 } 916 917 else { 917 // Gatherer.println("New Custom PlugIn");918 //DebugStream.println("New Custom PlugIn"); 918 919 element.setAttribute(CollectionConfiguration.TYPE_ATTRIBUTE, selected_object.toString()); 919 920 new_plugin = new PlugIn(element, null); -
trunk/gli/src/org/greenstone/gatherer/cdm/SearchTypeManager.java
r8231 r8236 37 37 import javax.swing.event.*; 38 38 import org.greenstone.gatherer.Configuration; 39 import org.greenstone.gatherer.DebugStream; 39 40 import org.greenstone.gatherer.Dictionary; 40 41 import org.greenstone.gatherer.Gatherer; … … 66 67 super(searchtypes_element, CollectionConfiguration.CONTENT_ELEMENT, new SearchType()); 67 68 this.model = this; 68 Gatherer.println("SearchTypeManager: parsed " + getSize() + " search types.");69 DebugStream.println("SearchTypeManager: parsed " + getSize() + " search types."); 69 70 } 70 71 -
trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionIndex.java
r8015 r8236 28 28 29 29 import java.util.*; 30 import org.greenstone.gatherer.DebugStream; 30 31 import org.greenstone.gatherer.Gatherer; 31 32 import org.greenstone.gatherer.cdm.CollectionConfiguration; … … 173 174 } 174 175 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."); 176 177 } 177 178 } -
trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionIndexManager.java
r8231 r8236 33 33 import javax.swing.event.*; 34 34 import org.greenstone.gatherer.Configuration; 35 import org.greenstone.gatherer.DebugStream; 35 36 import org.greenstone.gatherer.Dictionary; 36 37 import org.greenstone.gatherer.Gatherer; … … 60 61 public SubcollectionIndexManager(Element subindexes) { 61 62 super(subindexes, CollectionConfiguration.INDEX_ELEMENT, new SubcollectionIndex()); 62 Gatherer.println("SubcollectionIndexManager: " + getSize() + " subcollection indexes parsed.");63 DebugStream.println("SubcollectionIndexManager: " + getSize() + " subcollection indexes parsed."); 63 64 model = this; 64 65 // Parse and retrieve the default index -
trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionManager.java
r8231 r8236 37 37 import javax.swing.event.*; 38 38 import org.greenstone.gatherer.Configuration; 39 import org.greenstone.gatherer.DebugStream; 39 40 import org.greenstone.gatherer.Dictionary; 40 41 import org.greenstone.gatherer.Gatherer; … … 77 78 public SubcollectionManager() { 78 79 super(CollectionDesignManager.collect_config.getDocumentElement(), StaticStrings.SUBCOLLECTION_ELEMENT, new Subcollection()); 79 Gatherer.println("SubcollectionManager: " + getSize() + " subcollections parsed.");80 DebugStream.println("SubcollectionManager: " + getSize() + " subcollections parsed."); 80 81 this.model = this; 81 82 } -
trunk/gli/src/org/greenstone/gatherer/cdm/SuperCollectionManager.java
r8231 r8236 33 33 import javax.swing.event.*; 34 34 import org.greenstone.gatherer.Configuration; 35 import org.greenstone.gatherer.DebugStream; 35 36 import org.greenstone.gatherer.Dictionary; 36 37 import org.greenstone.gatherer.Gatherer; … … 57 58 public SuperCollectionManager(Element supercollections_element) { 58 59 super(supercollections_element, StaticStrings.COLLECTION_ELEMENT, new SuperCollection()); 59 Gatherer.println("SuperCollectionManager: " + getSize() + " supercollection members parsed.");60 DebugStream.println("SuperCollectionManager: " + getSize() + " supercollection members parsed."); 60 61 this.model = this; 61 62 } -
trunk/gli/src/org/greenstone/gatherer/cdm/TranslationView.java
r8231 r8236 34 34 import javax.swing.table.*; 35 35 import org.greenstone.gatherer.Configuration; 36 import org.greenstone.gatherer.DebugStream; 36 37 import org.greenstone.gatherer.Dictionary; 37 38 import org.greenstone.gatherer.Gatherer; … … 60 61 61 62 public TranslationView() { 62 Gatherer.println("TranslationView: Initialized.");63 DebugStream.println("TranslationView: Initialized."); 63 64 } 64 65 -
trunk/gli/src/org/greenstone/gatherer/collection/BasicCollectionConfiguration.java
r8147 r8236 38 38 39 39 import java.io.*; 40 import org.greenstone.gatherer.DebugStream; 40 41 import org.greenstone.gatherer.Gatherer; 41 42 import org.greenstone.gatherer.cdm.CommandTokenizer; … … 147 148 } 148 149 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); 151 152 } 152 153 } -
trunk/gli/src/org/greenstone/gatherer/collection/BuildOptions.java
r8231 r8236 7 7 import org.apache.xerces.parsers.DOMParser; 8 8 import org.greenstone.gatherer.Configuration; 9 import org.greenstone.gatherer.DebugStream; 9 10 import org.greenstone.gatherer.Gatherer; 10 11 import org.greenstone.gatherer.cdm.Argument; … … 82 83 } 83 84 else { 84 Gatherer.println("Loaded BO arguments from config.xml");85 DebugStream.println("Loaded BO arguments from config.xml"); 85 86 } 86 87 // Now take a note of the values too. … … 305 306 } 306 307 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); 309 310 } 310 311 } … … 313 314 } 314 315 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); 317 318 } 318 319 return argument; … … 344 345 } 345 346 catch (Exception error) { 346 Gatherer.printStackTrace(error);347 DebugStream.printStackTrace(error); 347 348 } 348 349 return result; … … 372 373 } 373 374 catch (Exception error) { 374 Gatherer.printStackTrace(error);375 DebugStream.printStackTrace(error); 375 376 } 376 377 return ArrayTools.arrayListToStringArray(values); … … 428 429 } 429 430 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); 432 433 } 433 434 return arguments_element; … … 482 483 } 483 484 catch (Exception error) { 484 Gatherer.printStackTrace(error);485 DebugStream.printStackTrace(error); 485 486 } 486 487 } … … 503 504 } 504 505 catch (Exception error) { 505 Gatherer.printStackTrace(error);506 DebugStream.printStackTrace(error); 506 507 } 507 508 } -
trunk/gli/src/org/greenstone/gatherer/collection/Collection.java
r8231 r8236 42 42 import javax.swing.tree.*; 43 43 import org.greenstone.gatherer.Configuration; 44 import org.greenstone.gatherer.DebugStream; 44 45 import org.greenstone.gatherer.Gatherer; 45 46 import org.greenstone.gatherer.cdm.CollectionDesignManager; … … 261 262 } 262 263 catch (Exception error) { 263 Gatherer.printStackTrace(error);264 DebugStream.printStackTrace(error); 264 265 } 265 266 return result; … … 287 288 } 288 289 catch (Exception error) { 289 Gatherer.printStackTrace(error);290 DebugStream.printStackTrace(error); 290 291 } 291 292 return result; … … 303 304 } 304 305 catch (Exception error) { 305 Gatherer.printStackTrace(error);306 DebugStream.printStackTrace(error); 306 307 } 307 308 return build_values_element; … … 335 336 } 336 337 catch (Exception error) { 337 Gatherer.printStackTrace(error);338 DebugStream.printStackTrace(error); 338 339 } 339 340 return import_values_element; … … 377 378 } 378 379 catch (Exception error) { 379 Gatherer.printStackTrace(error);380 DebugStream.printStackTrace(error); 380 381 } 381 382 } -
trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r8231 r8236 45 45 import javax.swing.tree.*; 46 46 import org.greenstone.gatherer.Configuration; 47 import org.greenstone.gatherer.DebugStream; 47 48 import org.greenstone.gatherer.Dictionary; 48 49 import org.greenstone.gatherer.Gatherer; … … 149 150 */ 150 151 public void buildCollection() { 151 Gatherer.println("CollectionManager.buildCollection()");152 DebugStream.println("CollectionManager.buildCollection()"); 152 153 building = true; 153 154 String lang = Configuration.getLanguage(); … … 180 181 shell.addGShellListener(Gatherer.g_man.create_pane); 181 182 shell.start(); 182 Gatherer.println("CollectionManager.buildCollection().return");183 DebugStream.println("CollectionManager.buildCollection().return"); 183 184 } 184 185 … … 214 215 */ 215 216 public void closeCollection() { 216 Gatherer.println("Close collection: " + collection.getName());217 DebugStream.println("Close collection: " + collection.getName()); 217 218 // 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. 218 219 closing_thread = Thread.currentThread(); … … 269 270 command[3] = collection.getName(); 270 271 } 271 Gatherer.println("running command "+command);272 DebugStream.println("running command "+command); 272 273 GShell process = new GShell(command, GShell.CONVERT, COLLECT, this, null, GShell.GSHELL_CONVERT); 273 274 process.addGShellListener(this); … … 283 284 return false; 284 285 } 285 Gatherer.println("Copying images and macros dirs from the base collection");286 DebugStream.println("Copying images and macros dirs from the base collection"); 286 287 FileQueue fq = Gatherer.f_man.getQueue(); 287 288 try { … … 297 298 } 298 299 } 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()); 300 301 } 301 302 try { … … 311 312 } 312 313 } 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()); 314 315 } 315 316 return true; … … 349 350 if (!config_file.exists()) { 350 351 // no point continuing 351 Gatherer.println("The collection could not be created");352 DebugStream.println("The collection could not be created"); 352 353 progress.close(); 353 354 return; … … 387 388 // Before we create the CollectionDesignManager we have to check if we are basing it upon some other collection. 388 389 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); 390 391 collection.setBaseCollection(base_collection_directory.getAbsolutePath()); 391 392 // copy over other needed directories … … 394 395 File base_metadata = new File(base_collection_directory, Utility.META_DIR); 395 396 if(base_metadata.exists()) { 396 Gatherer.println("Found the metadata directory.");397 DebugStream.println("Found the metadata directory."); 397 398 File[] possible_metadata_sets = base_metadata.listFiles(); 398 399 for(int i = 0; possible_metadata_sets != null && i < possible_metadata_sets.length; i++) { 399 400 String filename = possible_metadata_sets[i].getName(); 400 401 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()); 402 403 collection.msm.importMDS(possible_metadata_sets[i], false); 403 404 skip_import_phase = true; … … 406 407 } 407 408 else { 408 Gatherer.println("This base collection has no metadata directory.");409 DebugStream.println("This base collection has no metadata directory."); 409 410 } 410 411 // If no sets were imported, then create a new metadata with this new collections name. 411 412 if(collection.msm.getSets().size() == 0) { 412 413 // 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."); 414 415 NewCollectionMetadataPrompt ncm_prompt = new NewCollectionMetadataPrompt(); 415 416 // If cancelled then they really do mean to start a collection with no metadata sets. … … 430 431 File base_archive = new File(base_collection_directory, Utility.ARCHIVES_DIR); 431 432 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."); 433 434 ArrayList metadata_elements = GreenstoneArchiveParser.extractMetadataElements(base_archive); 434 435 for(int i = 0; !cancelled && i < metadata_elements.size(); i++) { … … 448 449 } 449 450 else { 450 Gatherer.println("+ Searching files for metadata.xml information.");451 DebugStream.println("+ Searching files for metadata.xml information."); 451 452 // Find the import directory 452 453 File base_import = new File(base_collection_directory, Utility.IMPORT_DIR); … … 459 460 460 461 // 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."); 462 463 updateCollectionCFG(new File(base_collection_directory, Utility.CONFIG_FILE), new File(a_dir, Utility.CONFIG_FILE), description, email, title); 463 464 } … … 529 530 } 530 531 catch (Exception error) { 531 Gatherer.printStackTrace(error);532 DebugStream.printStackTrace(error); 532 533 } 533 534 … … 565 566 } 566 567 catch (Exception error) { 567 Gatherer.printStackTrace(error);568 DebugStream.printStackTrace(error); 568 569 } 569 570 } … … 809 810 importing = true; 810 811 if(!saved()) { 811 Gatherer.println("CollectionManager.importCollection().forcesave");812 DebugStream.println("CollectionManager.importCollection().forcesave"); 812 813 import_monitor.saving(); 813 814 // Force save. … … 818 819 } 819 820 catch(Exception error) { 820 Gatherer.printStackTrace(error);821 DebugStream.printStackTrace(error); 821 822 } 822 823 } 823 824 else { 824 Gatherer.println("CollectionManager.importCollection()");825 DebugStream.println("CollectionManager.importCollection()"); 825 826 //check that we can remove the old index before starting import 826 827 File index_dir = new File(getCollectionIndex(), "temp.txt"); 827 828 index_dir = index_dir.getParentFile(); 828 829 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"); 830 831 if (!canDelete(index_dir)) { 831 832 // tell the user … … 874 875 shell.addGShellListener(Gatherer.g_man.create_pane); 875 876 shell.start(); 876 Gatherer.println("CollectionManager.importCollection().return");877 DebugStream.println("CollectionManager.importCollection().return"); 877 878 } 878 879 importing = false; … … 896 897 */ 897 898 public boolean loadCollection(String location) { 898 Gatherer.println("Load Collection '" + location + "'");899 DebugStream.println("Load Collection '" + location + "'"); 899 900 String[] args2 = new String[1]; 900 901 args2[0] = location; … … 904 905 if(!location.endsWith(".col")) { 905 906 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."); 907 908 return false; 908 909 } … … 919 920 File collection_config_file = new File(collection_directory, Utility.CONFIG_FILE); 920 921 if (!collection_config_file.exists()) { 921 Gatherer.println("CollectionManager.loadCollection: No config file");922 DebugStream.println("CollectionManager.loadCollection: No config file"); 922 923 collection_directory = null; 923 924 collection_config_file = null; … … 929 930 if(!metadata_directory.exists()) { 930 931 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"); 932 933 non_gatherer_collection = true; 933 934 } … … 1010 1011 String[] args = new String[1]; 1011 1012 args[0] = name; 1012 Gatherer.println(Dictionary.get("CollectionManager.Loading_Successful", args));1013 DebugStream.println(Dictionary.get("CollectionManager.Loading_Successful", args)); 1013 1014 // Now we need to hook up classes that depend on messages from the metadata set manager to keep their content fresh. 1014 1015 collection.msm.addMSMListener(this); … … 1021 1022 } catch (Exception error) { 1022 1023 // There is obviously no existing collection present. 1023 Gatherer.printStackTrace(error);1024 DebugStream.printStackTrace(error); 1024 1025 if(error.getMessage() != null) { 1025 1026 String[] args = new String[2]; … … 1162 1163 */ 1163 1164 public synchronized void processBegun(GShellEvent event) { 1164 Gatherer.println("CollectionManager.processBegun(" + event.getType() + ")");1165 DebugStream.println("CollectionManager.processBegun(" + event.getType() + ")"); 1165 1166 ///ystem.err.println("ProcessBegun " + event.getType()); 1166 1167 // If this is one of the types where we wish to lock user control … … 1174 1175 */ 1175 1176 public synchronized void processComplete(GShellEvent event) { 1176 Gatherer.println("CollectionManager.processComplete(" + event.getType() + ")");1177 DebugStream.println("CollectionManager.processComplete(" + event.getType() + ")"); 1177 1178 Gatherer.g_man.lockCollection((event.getType() == GShell.IMPORT), false); 1178 1179 ///ystem.err.println("Recieved process complete event - " + event); … … 1213 1214 } 1214 1215 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()); 1216 1217 if (event.getType() == GShell.NEW) { 1217 1218 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Cannot_Create_Collection"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); … … 1301 1302 */ 1302 1303 public void saveCollection(boolean close_after, boolean exit_after) { 1303 Gatherer.println("Save collection: " + collection.getName());1304 DebugStream.println("Save collection: " + collection.getName()); 1304 1305 try { 1305 1306 SaveCollectionTask save_task = new SaveCollectionTask(collection, close_after, exit_after); … … 1309 1310 } 1310 1311 catch(Exception error) { 1311 Gatherer.printStackTrace(error);1312 DebugStream.printStackTrace(error); 1312 1313 } 1313 1314 } … … 1428 1429 */ 1429 1430 private boolean installCollection() { 1430 Gatherer.println("Build complete. Moving files.");1431 DebugStream.println("Build complete. Moving files."); 1431 1432 1432 1433 try { … … 1441 1442 1442 1443 File index_dir = new File(getCollectionIndex()); 1443 Gatherer.println("Index = " + index_dir.getAbsolutePath());1444 DebugStream.println("Index = " + index_dir.getAbsolutePath()); 1444 1445 1445 1446 File building_dir = new File(getCollectionBuild()); 1446 Gatherer.println("Building = " + building_dir.getAbsolutePath());1447 DebugStream.println("Building = " + building_dir.getAbsolutePath()); 1447 1448 1448 1449 // Get the build mode from the build options … … 1552 1553 HashMap mappings = collection.msm.profiler.getActions(collection_path); 1553 1554 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."); 1555 1556 } 1556 1557 … … 1717 1718 } 1718 1719 catch(Exception error) { 1719 Gatherer.printStackTrace(error);1720 DebugStream.printStackTrace(error); 1720 1721 } 1721 1722 // All done, I hope. -
trunk/gli/src/org/greenstone/gatherer/collection/DeleteCollectionPrompt.java
r8231 r8236 44 44 import javax.swing.event.*; 45 45 import org.greenstone.gatherer.Configuration; 46 import org.greenstone.gatherer.DebugStream; 46 47 import org.greenstone.gatherer.Dictionary; 47 48 import org.greenstone.gatherer.Gatherer; … … 350 351 // Exception 351 352 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); 354 355 } 355 356 } -
trunk/gli/src/org/greenstone/gatherer/collection/DownloadJob.java
r8231 r8236 43 43 import javax.swing.tree.*; 44 44 import org.greenstone.gatherer.Configuration; 45 import org.greenstone.gatherer.DebugStream; 45 46 import org.greenstone.gatherer.Dictionary; 46 47 import org.greenstone.gatherer.Gatherer; … … 254 255 } 255 256 else { 256 Gatherer.println("Unknown user/pass");257 DebugStream.println("Unknown user/pass"); 257 258 } 258 259 } … … 284 285 // Run it 285 286 try { 286 // Gatherer.println("Cmd: " + command); // don't print it out cos it may have the password in it287 //DebugStream.println("Cmd: " + command); // don't print it out cos it may have the password in it 287 288 Runtime rt = Runtime.getRuntime(); 288 289 String [] env = null; … … 300 301 while ((line = br.readLine()) != null && state != STOPPED) { 301 302 302 Gatherer.println(line);303 DebugStream.println(line); 303 304 download_log.appendLine(line); 304 305 // The first magic special test is to see if we've just … … 306 307 // the next add and then the next complete/error. 307 308 if(line.lastIndexOf("robots.txt;") != -1) { 308 Gatherer.println("***** Requesting robot.txt");309 DebugStream.println("***** Requesting robot.txt"); 309 310 ignore_for_robots = true; 310 311 } … … 323 324 String current_file_downloading = line.substring(line.indexOf("`") + 1, line.lastIndexOf("'")); 324 325 if(!ignore_for_robots) { 325 Gatherer.println("Not ignore for robots");326 DebugStream.println("Not ignore for robots"); 326 327 // Download complete 327 328 downloadComplete(current_file_downloading); 328 329 } 329 330 else { 330 Gatherer.println("Ignore for robots");331 DebugStream.println("Ignore for robots"); 331 332 ignore_for_robots = false; 332 333 } … … 340 341 else if(line.lastIndexOf(" `") != -1) { 341 342 // Not Overwriting 342 Gatherer.println("Already there.");343 DebugStream.println("Already there."); 343 344 String new_url = 344 345 line.substring(line.indexOf("`") + 1, line.lastIndexOf("'")); … … 350 351 if(line.charAt(2) == ':' && line.charAt(5) == ':') { 351 352 if(!ignore_for_robots) { 352 Gatherer.println("Error.");353 DebugStream.println("Error."); 353 354 downloadFailed(); 354 355 } … … 370 371 catch (Exception ioe) { 371 372 //message(Utility.ERROR, ioe.toString()); 372 Gatherer.printStackTrace(ioe);373 DebugStream.printStackTrace(ioe); 373 374 } 374 375 // If we've got to here and the state isn't STOPPED then the … … 462 463 args.add(initial.toString()); 463 464 464 Gatherer.println("Calling wget ");465 DebugStream.println("Calling wget "); 465 466 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(""); 469 470 470 471 // Run home to mummy. … … 490 491 public void downloadComplete(String current_file_downloading) { 491 492 progress.downloadComplete(); 492 Gatherer.println("Current File: " + current_file_downloading);493 DebugStream.println("Current File: " + current_file_downloading); 493 494 // !! TEMPORARILY DISABLED !! 494 495 //WorkspaceTreeModel.refreshWebCacheMappings(); … … 518 519 // // 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. 519 520 // ///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); 522 523 // destination_node.unmap(); 523 524 // ///atherer.println("Destination node: " + destination_node); -
trunk/gli/src/org/greenstone/gatherer/collection/ExportCollectionPrompt.java
r8231 r8236 43 43 import javax.swing.*; 44 44 import javax.swing.event.*; 45 import org.greenstone.gatherer.Configuration; 46 import org.greenstone.gatherer.DebugStream; 47 import org.greenstone.gatherer.Dictionary; 48 import org.greenstone.gatherer.Gatherer; 45 49 import org.greenstone.gatherer.checklist.CheckList; 46 50 import org.greenstone.gatherer.checklist.Entry; 47 import org.greenstone.gatherer.Configuration;48 import org.greenstone.gatherer.Dictionary;49 import org.greenstone.gatherer.Gatherer;50 51 import org.greenstone.gatherer.collection.BasicCollectionConfiguration; 51 52 import org.greenstone.gatherer.collection.Collection; … … 252 253 */ 253 254 public void exportCollections() { 254 Gatherer.println("ExportCollectionPrompt.exportCollection()");255 DebugStream.println("ExportCollectionPrompt.exportCollection()"); 255 256 256 257 int num_collections = selected_collections.size(); … … 290 291 } 291 292 292 Gatherer.print("export command = ");293 DebugStream.print("export command = "); 293 294 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(""); 297 298 GShell process = new GShell(args, GShell.EXPORT, 3, this, null, GShell.GSHELL_EXPORT); 298 299 process.start(); 299 300 //process.run(); 300 Gatherer.println("ExportCollectionPrompt.exportCollection().return");301 DebugStream.println("ExportCollectionPrompt.exportCollection().return"); 301 302 } 302 303 … … 380 381 if (message.startsWith("exportcol.pl>")) { 381 382 message = message.substring(13); 382 // Gatherer.println("message = "+event.getMessage());383 //DebugStream.println("message = "+event.getMessage()); 383 384 error_message.append(message); 384 385 error_message.append("\n"); -
trunk/gli/src/org/greenstone/gatherer/collection/SaveCollectionTask.java
r8231 r8236 41 41 import javax.swing.*; 42 42 import org.greenstone.gatherer.Configuration; 43 import org.greenstone.gatherer.DebugStream; 43 44 import org.greenstone.gatherer.Gatherer; 44 45 import org.greenstone.gatherer.collection.Collection; … … 131 132 backup.deleteOnExit(); 132 133 if(!file.renameTo(backup)) { 133 Gatherer.println("Error in CollectionManager.load(): FileRenamedException");134 DebugStream.println("Error in CollectionManager.load(): FileRenamedException"); 134 135 } 135 136 } … … 150 151 } 151 152 catch (Exception error) { 152 Gatherer.printStackTrace(error);153 DebugStream.printStackTrace(error); 153 154 } 154 155 // Now we check whether we've finished, or is this a Save As action, in which case we've got miles to go. … … 230 231 ///ystem.err.println("Renaming " + filename); 231 232 if(!file.renameTo(original_file)) { 232 Gatherer.println("Error in SaveCollectionTask.run(): FileRenameException");233 DebugStream.println("Error in SaveCollectionTask.run(): FileRenameException"); 233 234 } 234 235 } … … 290 291 } 291 292 catch (Exception exception) { 292 Gatherer.printStackTrace(exception);293 DebugStream.printStackTrace(exception); 293 294 } 294 295 } -
trunk/gli/src/org/greenstone/gatherer/file/FileAssociationManager.java
r8231 r8236 30 30 import javax.swing.table.*; 31 31 import org.greenstone.gatherer.Configuration; 32 import org.greenstone.gatherer.DebugStream; 32 33 import org.greenstone.gatherer.Dictionary; 33 34 import org.greenstone.gatherer.Gatherer; … … 80 81 } 81 82 else { 82 Gatherer.println("Didn't parse anything. About to crash.");83 DebugStream.println("Didn't parse anything. About to crash."); 83 84 } 84 85 } … … 91 92 92 93 public String getBrowserCommand(String url) { 93 Gatherer.println("Get browser command: " + url);94 DebugStream.println("Get browser command: " + url); 94 95 // First off we try to retrieve one from the configuration 95 96 String command = Configuration.getPreviewCommand(); … … 97 98 if(command != null && command.length() > 0) { 98 99 command = command.replaceAll("%1", url); 99 Gatherer.println("Result = " + command);100 DebugStream.println("Result = " + command); 100 101 return command; 101 102 } … … 134 135 Configuration.setPreviewCommand(command); 135 136 command = command.replaceAll(FILENAME_ARG, url); 136 Gatherer.println("Result = " + command);137 DebugStream.println("Result = " + command); 137 138 return command; 138 139 } 139 140 // if we haven't got a command by now, we'll never get one 140 Gatherer.println("Result = null");141 DebugStream.println("Result = null"); 141 142 return null; 142 143 … … 280 281 281 282 public void setCommand(String extension, String command) { 282 Gatherer.println("Set Launch: " + extension + " with " + command);283 DebugStream.println("Set Launch: " + extension + " with " + command); 283 284 // Retrieve any existing entry for this extension 284 285 Element entry = getCommand(extension); -
trunk/gli/src/org/greenstone/gatherer/file/FileNode.java
r8231 r8236 8 8 import javax.swing.tree.*; 9 9 import org.greenstone.gatherer.Configuration; 10 import org.greenstone.gatherer.DebugStream; 10 11 import org.greenstone.gatherer.Dictionary; 11 12 import org.greenstone.gatherer.Gatherer; … … 215 216 /** Adds child to the receiver at index. */ 216 217 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 + "]"); 218 219 if (child == null) { 219 220 return; … … 339 340 if(files != null && files.length > 0) { 340 341 // Sort the remaining files. 341 Gatherer.println("Number of files to sort: " + files.length);342 DebugStream.println("Number of files to sort: " + files.length); 342 343 ArrayTools.sort(files); 343 Gatherer.println("Files sorted.");344 DebugStream.println("Files sorted."); 344 345 // Now add them to children. 345 346 raw_children = new ArrayList(); -
trunk/gli/src/org/greenstone/gatherer/file/FileQueue.java
r8231 r8236 33 33 import javax.swing.tree.*; 34 34 import org.greenstone.gatherer.Configuration; 35 import org.greenstone.gatherer.DebugStream; 35 36 import org.greenstone.gatherer.Dictionary; 36 37 import org.greenstone.gatherer.Gatherer; … … 123 124 FileJob job = new FileJob(id, source, child, target, parent, type, undo, undoable); 124 125 job.folder_level = folder_level; 125 Gatherer.println("Adding job: " + job);126 DebugStream.println("Adding job: " + job); 126 127 if(position != -1 && position <= queue.size() + 1) { 127 128 queue.add(position, job); … … 320 321 // 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. 321 322 catch(FileNotFoundException fnf_exception) { 322 Gatherer.printStackTrace(fnf_exception);323 DebugStream.printStackTrace(fnf_exception); 323 324 cancel_action = true; 324 325 // Show warning. … … 328 329 } 329 330 catch(FileAlreadyExistsException fae_exception) { 330 Gatherer.printStackTrace(fae_exception);331 DebugStream.printStackTrace(fae_exception); 331 332 cancel_action = true; 332 333 // Show warning. … … 335 336 } 336 337 catch(InsufficientSpaceException is_exception) { 337 Gatherer.printStackTrace(is_exception);338 DebugStream.printStackTrace(is_exception); 338 339 cancel_action = true; 339 340 // Show warning. The message body of the expection explains how much more space is required for this file copy. … … 342 343 } 343 344 catch(UnknownFileErrorException ufe_exception) { 344 Gatherer.printStackTrace(ufe_exception);345 DebugStream.printStackTrace(ufe_exception); 345 346 cancel_action = true; 346 347 // Show warning … … 349 350 } 350 351 catch(WriteNotPermittedException wnp_exception) { 351 Gatherer.printStackTrace(wnp_exception);352 DebugStream.printStackTrace(wnp_exception); 352 353 cancel_action = true; 353 354 // Show warning … … 357 358 catch(IOException exception) { 358 359 // Can't really do much about this. 359 Gatherer.printStackTrace(exception);360 DebugStream.printStackTrace(exception); 360 361 } 361 362 // If not cancelled … … 543 544 } 544 545 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!!"); 546 547 } 547 548 } … … 595 596 } 596 597 catch (Exception error) { 597 Gatherer.printStackTrace(error);598 DebugStream.printStackTrace(error); 598 599 } 599 600 } … … 675 676 // Check if the origin file exists. 676 677 if(!source.exists()) { 677 Gatherer.println("Couldn't find the source file.");678 DebugStream.println("Couldn't find the source file."); 678 679 throw(new FileNotFoundException()); 679 680 } -
trunk/gli/src/org/greenstone/gatherer/file/FileSystem.java
r7633 r8236 3 3 import java.io.File; 4 4 import javax.swing.filechooser.FileSystemView; 5 import org.greenstone.gatherer.DebugStream; 5 6 import org.greenstone.gatherer.Dictionary; 6 import org.greenstone.gatherer.Gatherer;7 7 import org.greenstone.gatherer.file.FileNode; 8 8 import org.greenstone.gatherer.util.ArrayTools; … … 55 55 56 56 // 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); 58 58 String os_name_lc = os_name.toLowerCase(); 59 59 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 6 6 import javax.swing.event.*; 7 7 import javax.swing.tree.*; 8 import org.greenstone.gatherer.DebugStream; 8 9 import org.greenstone.gatherer.Dictionary; 9 10 import org.greenstone.gatherer.Gatherer; … … 59 60 FileNode first_node = (FileNode)path.getPathComponent(0); 60 61 if(current.equals(first_node)) { 61 Gatherer.println("First path component matches root node.");62 DebugStream.println("First path component matches root node."); 62 63 // For each path with this tree path 63 64 for(int i = 1; current != null && i < path.getPathCount(); i++) { … … 68 69 stale_node = (FileNode) stale_object; 69 70 } 70 Gatherer.print("Searching for '" + stale_object + "': ");71 DebugStream.print("Searching for '" + stale_object + "': "); 71 72 // Locate the fresh node by searching current's children. Remember to ensure that current is mapped. 72 73 //current.unmap(); … … 76 77 for(int j = 0; !found && j < current.getChildCount(); j++) { 77 78 FileNode child_node = (FileNode) current.getChildAt(j); 78 Gatherer.print(child_node + " ");79 DebugStream.print(child_node + " "); 79 80 if((stale_node != null && stale_node.equals(child_node)) || stale_object.toString().equals(child_node.toString())) { 80 81 found = true; 81 82 current = child_node; 82 Gatherer.println("Found!");83 DebugStream.println("Found!"); 83 84 } 84 85 child_node = null; … … 87 88 for(int j = 0; !found && j < current.size(); j++) { 88 89 FileNode child_node = (FileNode) current.get(j); 89 Gatherer.print(child_node + " ");90 DebugStream.print(child_node + " "); 90 91 if((stale_node != null && stale_node.equals(child_node)) || stale_object.toString().equals(child_node.toString())) { 91 92 found = true; 92 93 current = child_node; 93 Gatherer.println("Found!");94 DebugStream.println("Found!"); 94 95 } 95 96 child_node = null; … … 98 99 if(!found) { 99 100 current = null; 100 Gatherer.println("Not Found!");101 DebugStream.println("Not Found!"); 101 102 } 102 103 else { 103 Gatherer.println("Returning node: " + new TreePath(current.getPath()));104 DebugStream.println("Returning node: " + new TreePath(current.getPath())); 104 105 } 105 106 // Repeat as necessary -
trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTreeModel.java
r7639 r8236 2 2 3 3 import javax.swing.tree.TreePath; 4 import org.greenstone.gatherer.DebugStream; 4 5 import org.greenstone.gatherer.Gatherer; 5 6 import org.greenstone.gatherer.collection.CollectionManager; … … 79 80 for (int i = 0; i < old_folder_shortcuts.length; i++) { 80 81 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]); 82 83 SynchronizedTreeModelTools.removeNodeFromParent(workspace_tree_model, 83 84 old_folder_shortcuts[i]); … … 90 91 for (int i = 0; i < folder_shortcuts.length; i++) { 91 92 if (!doesArrayContain(old_folder_shortcuts, folder_shortcuts[i])) { 92 Gatherer.println("Added shortcut: " + folder_shortcuts[i]);93 DebugStream.println("Added shortcut: " + folder_shortcuts[i]); 93 94 SynchronizedTreeModelTools.insertNodeInto(workspace_tree_model, workspace_tree_root, folder_shortcuts[i], false); 94 95 } -
trunk/gli/src/org/greenstone/gatherer/gui/EnrichPane.java
r8231 r8236 47 47 import javax.swing.tree.*; 48 48 import org.greenstone.gatherer.Configuration; 49 import org.greenstone.gatherer.DebugStream; 49 50 import org.greenstone.gatherer.Dictionary; 50 51 import org.greenstone.gatherer.Gatherer; … … 282 283 // You can only update if there is a selected_metadata and 283 284 // you have valid values in all fields. 284 Gatherer.println("Replacing value:");285 DebugStream.println("Replacing value:"); 285 286 if (selected_metadata != null && records != null && element != null && value != null) { 286 287 selected_metadata = Gatherer.c_man.getCollection().msm.updateMetadata(System.currentTimeMillis(), selected_metadata, records, value, MetaEditPrompt.CONFIRM, selected_metadata.isFileLevel()); … … 296 297 297 298 public void run() { 298 Gatherer.println("Removing value:");299 DebugStream.println("Removing value:"); 299 300 if (selected_metadata != null && records != null) { 300 301 Gatherer.c_man.getCollection().msm.removeMetadata(System.currentTimeMillis(), selected_metadata, records); … … 1014 1015 } 1015 1016 1016 Gatherer.println("Number of files/folders selected: " + selection_paths.length);1017 DebugStream.println("Number of files/folders selected: " + selection_paths.length); 1017 1018 1018 1019 // Always have meta-audit option -
trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java
r8231 r8236 50 50 import javax.swing.text.*; 51 51 import org.greenstone.gatherer.Configuration; 52 import org.greenstone.gatherer.DebugStream; 52 53 import org.greenstone.gatherer.Dictionary; 53 54 import org.greenstone.gatherer.Gatherer; … … 229 230 catch (Exception cce) { 230 231 // If the component is not a text component ignore the copy command 231 Gatherer.println(cce.toString());232 DebugStream.println(cce.toString()); 232 233 } 233 234 } … … 242 243 catch (ClassCastException cce) { 243 244 // If the component is not a text component ignore the cut command 244 Gatherer.println(cce.toString());245 DebugStream.println(cce.toString()); 245 246 } 246 247 } … … 255 256 catch (ClassCastException cce) { 256 257 // If the component is not a text component ignore the paste command 257 Gatherer.println(cce.toString());258 DebugStream.println(cce.toString()); 258 259 } 259 260 } … … 475 476 } 476 477 catch (Exception e) { 477 Gatherer.printStackTrace(e);478 DebugStream.printStackTrace(e); 478 479 // The GUI failing to build is an app killer 479 480 e.printStackTrace(); … … 727 728 } 728 729 catch(Exception error) { 729 Gatherer.println("Exception: " + error);730 Gatherer.printStackTrace(error);730 DebugStream.println("Exception: " + error); 731 DebugStream.printStackTrace(error); 731 732 } 732 733 } … … 769 770 } 770 771 catch(Exception error) { 771 Gatherer.println("Exception: " + error);772 Gatherer.printStackTrace(error);772 DebugStream.println("Exception: " + error); 773 DebugStream.printStackTrace(error); 773 774 } 774 775 } … … 834 835 } 835 836 catch(Exception error) { 836 Gatherer.println("Exception: " + error);837 Gatherer.printStackTrace(error);837 DebugStream.println("Exception: " + error); 838 DebugStream.printStackTrace(error); 838 839 } 839 840 -
trunk/gli/src/org/greenstone/gatherer/gui/GatherPane.java
r8231 r8236 45 45 import javax.swing.tree.*; 46 46 import org.greenstone.gatherer.Configuration; 47 import org.greenstone.gatherer.DebugStream; 47 48 import org.greenstone.gatherer.Dictionary; 48 49 import org.greenstone.gatherer.Gatherer; … … 578 579 } 579 580 580 Gatherer.println("Number of files/folders selected: " + selection_paths.length);581 DebugStream.println("Number of files/folders selected: " + selection_paths.length); 581 582 582 583 // 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 /*######################################################################### 9 2 * 10 3 * A component of the Gatherer application, part of the Greenstone digital … … 35 28 import java.awt.*; 36 29 import javax.swing.*; 30 import org.greenstone.gatherer.DebugStream; 37 31 import org.greenstone.gatherer.Gatherer; 38 32 /** 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. … … 165 159 } 166 160 catch(Exception exception) { 167 Gatherer.printStackTrace(exception);161 DebugStream.printStackTrace(exception); 168 162 } 169 163 } … … 175 169 } 176 170 catch(Exception exception) { 177 Gatherer.printStackTrace(exception);171 DebugStream.printStackTrace(exception); 178 172 } 179 173 } -
trunk/gli/src/org/greenstone/gatherer/gui/OptionsPane.java
r8231 r8236 45 45 import javax.swing.text.*; 46 46 import org.greenstone.gatherer.Configuration; 47 import org.greenstone.gatherer.DebugStream; 47 48 import org.greenstone.gatherer.Dictionary; 48 49 import org.greenstone.gatherer.Gatherer; … … 361 362 } 362 363 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); 365 366 } 366 367 } -
trunk/gli/src/org/greenstone/gatherer/gui/URLField.java
r6659 r8236 6 6 import javax.swing.event.*; 7 7 import javax.swing.text.*; 8 import org.greenstone.gatherer.Gatherer; 8 import org.greenstone.gatherer.DebugStream; 9 9 10 10 11 public class URLField … … 86 87 } 87 88 m = null; 88 Gatherer.println("Validating: " + text + " -> " + (result ? "GOOD" : "BAD"));89 DebugStream.println("Validating: " + text + " -> " + (result ? "GOOD" : "BAD")); 89 90 text = null; 90 91 return result; -
trunk/gli/src/org/greenstone/gatherer/gui/table/GTableModel.java
r8231 r8236 33 33 import javax.swing.table.*; 34 34 import org.greenstone.gatherer.Configuration; 35 import org.greenstone.gatherer.DebugStream; 35 36 import org.greenstone.gatherer.Dictionary; 36 37 import org.greenstone.gatherer.Gatherer; … … 208 209 ElementWrapper element = metadatum.getElement(); 209 210 if (i < 0) { 210 Gatherer.println("Could not find suitable row to select!");211 DebugStream.println("Could not find suitable row to select!"); 211 212 i = 0; // select the first one 212 213 } … … 217 218 i--; 218 219 if (i < 0) { 219 Gatherer.println("Could not find suitable row to select!");220 DebugStream.println("Could not find suitable row to select!"); 220 221 i = 0; 221 222 } … … 223 224 newly_selected_metadatum = (Metadata) current_metadata.get(i); 224 225 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!"); 226 227 i = 0; 227 228 } … … 341 342 { 342 343 if (!Gatherer.c_man.ready()) { 343 Gatherer.println("Not ready!");344 DebugStream.println("Not ready!"); 344 345 return; 345 346 } -
trunk/gli/src/org/greenstone/gatherer/gui/tree/WorkspaceTree.java
r8231 r8236 5 5 import javax.swing.tree.TreePath; 6 6 import org.greenstone.gatherer.Configuration; 7 import org.greenstone.gatherer.DebugStream; 7 8 import org.greenstone.gatherer.Gatherer; 8 9 import org.greenstone.gatherer.file.FileNode; … … 27 28 public void refresh(int refresh_reason) 28 29 { 29 Gatherer.println("WorkspaceTree::refresh()... ");30 DebugStream.println("WorkspaceTree::refresh()... "); 30 31 31 32 // The method for displaying the tree has changed - redraw the tree 32 33 if (refresh_reason == DragTree.TREE_DISPLAY_CHANGED) { 33 Gatherer.println("...Reason: tree display changed.");34 DebugStream.println("...Reason: tree display changed."); 34 35 updateUI(); 35 36 } … … 37 38 // The loaded collection has changed - currently do nothing 38 39 if (refresh_reason == DragTree.LOADED_COLLECTION_CHANGED) { 39 Gatherer.println("...Reason: loaded collection changed.");40 DebugStream.println("...Reason: loaded collection changed."); 40 41 } 41 42 42 43 // The collection's contents have changed - refresh collection's import folder 43 44 if (refresh_reason == DragTree.COLLECTION_CONTENTS_CHANGED) { 44 Gatherer.println("...Reason: collection contents changed.");45 DebugStream.println("...Reason: collection contents changed."); 45 46 String import_directory_str = Gatherer.c_man.getCollectionImport(); 46 47 refreshEveryNodeShowingFolder(import_directory_str); … … 49 50 // The collections in the library have changed - refresh the collect directory 50 51 if (refresh_reason == WorkspaceTree.LIBRARY_CONTENTS_CHANGED) { 51 Gatherer.println("...Reason: library contents changed.");52 DebugStream.println("...Reason: library contents changed."); 52 53 String collect_directory_str = Configuration.gsdl_path + Utility.COL_DIR; 53 54 refreshEveryNodeShowingFolder(collect_directory_str); … … 57 58 // The downloaded files have changed - refresh that node 58 59 if (refresh_reason == WorkspaceTree.DOWNLOADED_FILES_CHANGED) { 59 Gatherer.println("...Reason: downloaded files changed.");60 DebugStream.println("...Reason: downloaded files changed."); 60 61 WorkspaceTreeModel.refreshDownloadedFilesNode(); 61 62 } … … 63 64 // The folder shortcuts have changed - refresh only them 64 65 if (refresh_reason == WorkspaceTree.FOLDER_SHORTCUTS_CHANGED) { 65 Gatherer.println("...Reason: folder shortcuts changed.");66 DebugStream.println("...Reason: folder shortcuts changed."); 66 67 WorkspaceTreeModel.refreshFolderShortcuts(); 67 68 } -
trunk/gli/src/org/greenstone/gatherer/help/HelpFrame.java
r8084 r8236 45 45 import javax.swing.tree.*; 46 46 import org.apache.xerces.parsers.DOMParser; 47 import org.greenstone.gatherer.DebugStream; 47 48 import org.greenstone.gatherer.Dictionary; 48 import org.greenstone.gatherer.Gatherer;49 49 import org.greenstone.gatherer.util.StaticStrings; 50 50 import org.greenstone.gatherer.util.Utility; … … 119 119 } 120 120 catch(Exception exception) { 121 Gatherer.printStackTrace(exception);121 DebugStream.printStackTrace(exception); 122 122 } 123 123 } … … 149 149 } 150 150 catch (Exception exception) { 151 Gatherer.printStackTrace(exception);151 DebugStream.printStackTrace(exception); 152 152 } 153 153 } … … 263 263 } 264 264 catch (Exception exception) { 265 Gatherer.printStackTrace(exception);265 DebugStream.printStackTrace(exception); 266 266 } 267 267 } -
trunk/gli/src/org/greenstone/gatherer/mem/MEMNode.java
r8231 r8236 41 41 import javax.swing.tree.*; 42 42 import org.greenstone.gatherer.Configuration; 43 import org.greenstone.gatherer.DebugStream; 43 44 import org.greenstone.gatherer.Dictionary; 44 45 import org.greenstone.gatherer.Gatherer; … … 180 181 } 181 182 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); 184 185 text = userObject.toString(); 185 186 } -
trunk/gli/src/org/greenstone/gatherer/metadata/DocXMLFile.java
r8204 r8236 265 265 if (metadata_element == null) { 266 266 // 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); 268 268 extracted_metadata_set.addMetadataElementForThisSession(metadata_element_name); 269 269 } -
trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFile.java
r8165 r8236 231 231 // If there is no metadata value tree node for this value, create it 232 232 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 + "\""); 234 234 metadata_element.addMetadataValue(metadata_element_value); 235 235 metadata_value_tree_node = metadata_element.getMetadataValueTreeNode(metadata_element_value); … … 338 338 339 339 // Parse the metadata.xml file 340 Gatherer.println("Skimming metadata.xml file " + this + "...");340 DebugStream.println("Skimming metadata.xml file " + this + "..."); 341 341 Document document = XMLTools.parseXMLFile(this); 342 342 if (document == null) { -
trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFileManager.java
r8165 r8236 55 55 for (int i = 0; i < file_nodes.length; i++) { 56 56 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()); 58 58 59 59 // Find which metadata.xml file needs editing … … 95 95 static public ArrayList getMetadataAssignedDirectlyToExternalFile(File file) 96 96 { 97 Gatherer.println("Getting metadata assigned directly to external file " + file + "...");97 DebugStream.println("Getting metadata assigned directly to external file " + file + "..."); 98 98 99 99 // Build up a list of applicable metadata.xml files … … 175 175 for (int i = 0; i < applicable_metadata_xml_files.size(); i++) { 176 176 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); 178 178 179 179 ArrayList metadata_values = metadata_xml_file.getMetadataAssignedToFile(file); … … 241 241 for (int i = 0; i < file_nodes.length; i++) { 242 242 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()); 244 244 245 245 // Find which metadata.xml file needs editing … … 259 259 static public void unloadMetadataXMLFile(File metadata_xml_file_file) 260 260 { 261 Gatherer.println("Unloading metadata.xml file " + metadata_xml_file_file);261 DebugStream.println("Unloading metadata.xml file " + metadata_xml_file_file); 262 262 263 263 // 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 40 40 import java.util.*; 41 41 import java.util.jar.*; 42 import org.greenstone.gatherer.DebugStream; 42 43 import org.greenstone.gatherer.Gatherer; 43 44 import org.greenstone.gatherer.file.FileNode; … … 66 67 name = name.substring(0, name.length() - 6); 67 68 load_these.add("org.greenstone.gatherer.msm.parsers." + name); 68 Gatherer.println("Loaded metadata parser: " + name);69 DebugStream.println("Loaded metadata parser: " + name); 69 70 } 70 71 name = null; … … 85 86 if(!load_these.contains(name)) { 86 87 load_these.add(name); 87 Gatherer.println("Loaded metadata parser: " + name);88 DebugStream.println("Loaded metadata parser: " + name); 88 89 } 89 90 } -
trunk/gli/src/org/greenstone/gatherer/msm/GreenstoneArchiveParser.java
r8231 r8236 41 41 import java.util.*; 42 42 import org.greenstone.gatherer.Configuration; 43 import org.greenstone.gatherer.DebugStream; 43 44 import org.greenstone.gatherer.Dictionary; 44 45 import org.greenstone.gatherer.Gatherer; … … 208 209 } 209 210 catch (UnsupportedEncodingException error) { 210 Gatherer.printStackTrace(error);211 DebugStream.printStackTrace(error); 211 212 } 212 213 … … 269 270 } 270 271 catch (Exception error) { 271 Gatherer.printStackTrace(error);272 DebugStream.printStackTrace(error); 272 273 } 273 274 } -
trunk/gli/src/org/greenstone/gatherer/msm/LegacyCollectionImporter.java
r7338 r8236 31 31 import java.util.*; 32 32 import org.w3c.dom.*; 33 import org.greenstone.gatherer.DebugStream; 33 34 import org.greenstone.gatherer.Gatherer; 34 35 import org.greenstone.gatherer.cdm.Argument; … … 132 133 } 133 134 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()); 135 136 } 136 137 } -
trunk/gli/src/org/greenstone/gatherer/msm/MSMProfiler.java
r6094 r8236 39 39 import java.io.*; 40 40 import java.util.*; 41 import org.greenstone.gatherer.DebugStream; 41 42 import org.greenstone.gatherer.Gatherer; 42 43 import org.greenstone.gatherer.msm.MSMAdapter; … … 112 113 */ 113 114 public void elementChanged(MSMEvent event) { 114 Gatherer.println("Element changed: " + event);115 DebugStream.println("Element changed: " + event); 115 116 String new_name = null; 116 117 String old_name = event.getValue(); … … 207 208 backup.deleteOnExit(); 208 209 if(!profile_file.renameTo(backup)) { 209 Gatherer.println("Error in MSMProfiler.save(): FileRenamedException");210 DebugStream.println("Error in MSMProfiler.save(): FileRenamedException"); 210 211 } 211 212 backup = null; … … 215 216 Document document = Utility.parse(Utility.PROFILE_TEMPLATE, true); 216 217 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!"); 218 219 return; 219 220 } … … 249 250 } 250 251 catch (Exception error) { 251 Gatherer.printStackTrace(error);252 DebugStream.printStackTrace(error); 252 253 } 253 254 } -
trunk/gli/src/org/greenstone/gatherer/msm/MetadataSet.java
r8231 r8236 42 42 import org.apache.xerces.dom.*; 43 43 import org.greenstone.gatherer.Configuration; 44 import org.greenstone.gatherer.DebugStream; 44 45 import org.greenstone.gatherer.Dictionary; 45 46 import org.greenstone.gatherer.Gatherer; … … 345 346 346 347 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")); 348 349 NodeList elements = parent_element.getElementsByTagName("Element"); 349 350 for(int i = 0; i < elements.getLength(); i++) { … … 609 610 } 610 611 else { 611 Gatherer.println("Error! Missing mdv file: " + value_file.getAbsolutePath());612 DebugStream.println("Error! Missing mdv file: " + value_file.getAbsolutePath()); 612 613 } 613 614 } … … 615 616 } 616 617 else { 617 Gatherer.println("Error! Missing mds file: " + file.getAbsolutePath());618 DebugStream.println("Error! Missing mds file: " + file.getAbsolutePath()); 618 619 } 619 620 } -
trunk/gli/src/org/greenstone/gatherer/msm/MetadataSetManager.java
r8231 r8236 43 43 import javax.swing.tree.TreePath; 44 44 import org.greenstone.gatherer.Configuration; 45 import org.greenstone.gatherer.DebugStream; 45 46 import org.greenstone.gatherer.Dictionary; 46 47 import org.greenstone.gatherer.Gatherer; … … 927 928 File file = new File(Gatherer.self.getCollectionMetadata()); 928 929 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!"); 930 931 file.mkdir(); 931 932 } … … 937 938 backup.deleteOnExit(); 938 939 if(!temp[i].renameTo(backup)) { 939 Gatherer.println("Error in MetadataSetManager.save(): FileRenamedException");940 DebugStream.println("Error in MetadataSetManager.save(): FileRenamedException"); 940 941 } 941 942 } -
trunk/gli/src/org/greenstone/gatherer/msm/MetadataXMLFile.java
r7624 r8236 29 29 import java.io.*; 30 30 import java.util.*; 31 import org.greenstone.gatherer.DebugStream; 31 32 import org.greenstone.gatherer.Gatherer; 32 33 import org.greenstone.gatherer.msm.MetadataXMLFileManager; … … 184 185 } 185 186 catch (Exception error) { 186 Gatherer.printStackTrace(error);187 DebugStream.printStackTrace(error); 187 188 } 188 189 } … … 190 191 /** 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 */ 191 192 public void cleanUpMetadataRefs() { 192 // Gatherer.println("clean up metadata refs!");193 //DebugStream.println("clean up metadata refs!"); 193 194 194 195 String file_relative_path = ""; … … 208 209 // If this raw_value contains a '\' character, but no '\\', '[' or ']' characters, then replace the '\' with a '\\' 209 210 if(raw_value.indexOf(StaticStrings.ESCAPE_STR) != -1) { 210 Gatherer.println("Detected Legacy Path: " + raw_value);211 DebugStream.println("Detected Legacy Path: " + raw_value); 211 212 raw_value = raw_value.replaceAll(StaticStrings.ESCAPE_PATTERN, StaticStrings.PIPE_STR); 212 213 MSMUtils.setValue(metadata_element, raw_value); … … 231 232 metadata_elements = null; 232 233 } // for each metadata type 233 } catch (Exception e rror) {234 Gatherer.self.printStackTrace(error);234 } catch (Exception exception) { 235 DebugStream.printStackTrace(exception); 235 236 } 236 237 } … … 279 280 // Kath has cleaned up this version a bit 280 281 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); 283 284 284 285 // Determine the file's path relative to the location of the metadata.xml file … … 335 336 // If this raw_value contains a '\' character, but no '\\', '[' or ']' characters, then replace the '\' with a '\\' 336 337 if(raw_value.indexOf(StaticStrings.ESCAPE_STR) != -1) { 337 Gatherer.println("Detected Legacy Path: " + raw_value);338 DebugStream.println("Detected Legacy Path: " + raw_value); 338 339 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); 340 341 MSMUtils.setValue(metadata_element, raw_value); 341 342 } … … 454 455 directorymetadata_element = null; 455 456 } 456 catch (Exception e rror) {457 Gatherer.self.printStackTrace(error);457 catch (Exception exception) { 458 DebugStream.printStackTrace(exception); 458 459 } 459 460 ///ystem.err.println("Found " + metadatum.size() + " pieces of metadata."); … … 480 481 } 481 482 catch (Exception error) { 482 Gatherer.printStackTrace(error);483 DebugStream.printStackTrace(error); 483 484 } 484 485 return has_meta; … … 523 524 } 524 525 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); 527 528 } 528 529 } … … 530 531 /** 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. */ 531 532 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); 533 534 try { 534 535 boolean found = false; … … 619 620 } 620 621 catch (Exception error) { 621 Gatherer.printStackTrace(error);622 DebugStream.printStackTrace(error); 622 623 } 623 624 } -
trunk/gli/src/org/greenstone/gatherer/msm/MetadataXMLFileManager.java
r8088 r8236 44 44 import javax.swing.event.*; 45 45 import javax.swing.tree.*; 46 import org.greenstone.gatherer.DebugStream; 46 47 import org.greenstone.gatherer.Gatherer; 47 48 import org.greenstone.gatherer.file.FileNode; … … 83 84 Gatherer.c_man.getCollection().msm.addMSMListener(this); 84 85 // We also have a debug dialog 85 if (Gatherer.debug != null) {86 if (DebugStream.isDebuggingEnabled()) { 86 87 display(); 87 88 } … … 213 214 documents_in_cache_combobox.addItem(metadata_file); 214 215 } 215 // Gatherer.println("[0ms]\tCached " + metadata_file);216 //DebugStream.println("[0ms]\tCached " + metadata_file); 216 217 } 217 218 return metadata_xml; … … 388 389 } 389 390 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); 392 393 } 393 394 } … … 491 492 private Metadata checkCache(Metadata metadata) 492 493 { 493 Gatherer.println("Checking cache for " + metadata + "...");494 DebugStream.println("Checking cache for " + metadata + "..."); 494 495 495 496 if (metadata == null) { … … 501 502 if (metadata_cache.contains(element_name, metadata.getValue())) { 502 503 // If so, return the cached metadata value 503 Gatherer.println("In cache!");504 DebugStream.println("In cache!"); 504 505 return (Metadata) metadata_cache.get(element_name, metadata.getValue()); 505 506 } -
trunk/gli/src/org/greenstone/gatherer/msm/parsers/GreenstoneMetadataParser.java
r8022 r8236 39 39 import javax.swing.*; 40 40 import javax.swing.tree.*; 41 import org.greenstone.gatherer.DebugStream; 41 42 import org.greenstone.gatherer.Gatherer; 42 43 import org.greenstone.gatherer.cdm.CommandTokenizer; … … 93 94 /** Locate and import any metadata parsed by this metadata parser given the file involved and its previous incarnation. */ 94 95 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 + ": "); 96 97 int counter = 0; 97 98 dialog_cancelled = false; … … 114 115 if(possible_cfg_file.exists() && (possible_gimport_directory.exists() || possible_import_directory.exists())) { 115 116 found = true; 116 Gatherer.println("Found greenstone collection at " + collection_dir.getAbsolutePath());117 DebugStream.println("Found greenstone collection at " + collection_dir.getAbsolutePath()); 117 118 } 118 119 else { … … 131 132 132 133 // 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."); 134 135 if(collect_cfg != null) { 135 136 ArrayList mdses = collect_cfg.getMetadataSets(); … … 143 144 144 145 // 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"); 146 147 ArrayList search_files = new ArrayList(); 147 148 File file = origin.getFile(); … … 176 177 for(int i = 0; i < search_files.size(); i++) { 177 178 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"); 180 181 // Retrieve the document 181 182 BasicGDMDocument document = getDocument(a_search.file); … … 194 195 search_files = null; 195 196 // 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); 197 198 if(metadata.size() > 0) { 198 199 addMetadata(origin, destination, metadata, collection_dir, collect_cfg, dummy_run); … … 493 494 directorymetadata_element = null; 494 495 } 495 catch (Exception e rror) {496 Gatherer.self.printStackTrace(error);496 catch (Exception exception) { 497 DebugStream.printStackTrace(exception); 497 498 } 498 499 return metadatum; … … 583 584 directorymetadata_element = null; 584 585 } 585 catch (Exception e rror) {586 Gatherer.self.printStackTrace(error);586 catch (Exception exception) { 587 DebugStream.printStackTrace(exception); 587 588 } 588 589 // 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. … … 703 704 } 704 705 catch(Exception error) { 705 Gatherer.printStackTrace(error);706 DebugStream.printStackTrace(error); 706 707 collect_cfg = null; 707 708 } -
trunk/gli/src/org/greenstone/gatherer/shell/GBuildProgressMonitor.java
r8231 r8236 41 41 import javax.swing.JProgressBar; 42 42 import org.greenstone.gatherer.Configuration; 43 import org.greenstone.gatherer.DebugStream; 43 44 import org.greenstone.gatherer.Dictionary; 44 45 import org.greenstone.gatherer.Gatherer; … … 223 224 else { 224 225 // Unknown command, go indeterminate 225 Gatherer.println("Unknown name: " + name);226 DebugStream.println("Unknown name: " + name); 226 227 progress_bar.setIndeterminate(true); 227 228 } … … 270 271 else { 271 272 // Unknown command, go indeterminate 272 Gatherer.println("Unknown value: " + value);273 DebugStream.println("Unknown value: " + value); 273 274 progress_bar.setIndeterminate(true); 274 275 } … … 286 287 else { 287 288 // Unknown command, go indeterminate 288 Gatherer.println("Unknown name: " + name);289 DebugStream.println("Unknown name: " + name); 289 290 progress_bar.setIndeterminate(true); 290 291 } … … 312 313 else { 313 314 // Unknown command, go indeterminate 314 Gatherer.println("Unknown value: " + value);315 DebugStream.println("Unknown value: " + value); 315 316 progress_bar.setIndeterminate(true); 316 317 } … … 331 332 else { 332 333 // Unknown command, go indeterminate 333 Gatherer.println("Unknown name: " + name);334 DebugStream.println("Unknown name: " + name); 334 335 progress_bar.setIndeterminate(true); 335 336 } … … 366 367 else { 367 368 // Unknown command, go indeterminate 368 Gatherer.println("Unknown value: " + value);369 DebugStream.println("Unknown value: " + value); 369 370 progress_bar.setIndeterminate(true); 370 371 } … … 388 389 else { 389 390 // Unknown command, go indeterminate 390 Gatherer.println("Unknown name: " + name);391 DebugStream.println("Unknown name: " + name); 391 392 progress_bar.setIndeterminate(true); 392 393 } … … 427 428 else { 428 429 // Unknown command, go indeterminate 429 Gatherer.println("Unknown value: " + value);430 DebugStream.println("Unknown value: " + value); 430 431 progress_bar.setIndeterminate(true); 431 432 } … … 441 442 else { 442 443 // Unknown command, go indeterminate 443 Gatherer.println("Unknown name: " + name);444 DebugStream.println("Unknown name: " + name); 444 445 progress_bar.setIndeterminate(true); 445 446 } … … 458 459 else { 459 460 // Unknown command, go indeterminate 460 Gatherer.println("Unknown name: " + name);461 DebugStream.println("Unknown name: " + name); 461 462 progress_bar.setIndeterminate(true); 462 463 } … … 465 466 default: 466 467 // Unknown command, go indeterminate 467 Gatherer.println("Unknown name: " + name);468 DebugStream.println("Unknown name: " + name); 468 469 progress_bar.setIndeterminate(true); 469 470 } -
trunk/gli/src/org/greenstone/gatherer/shell/GImportProgressMonitor.java
r8231 r8236 42 42 import javax.swing.JProgressBar; 43 43 import org.greenstone.gatherer.Configuration; 44 import org.greenstone.gatherer.DebugStream; 44 45 import org.greenstone.gatherer.Dictionary; 45 46 import org.greenstone.gatherer.Gatherer; … … 409 410 shared_progress_bar.setValue(value); 410 411 if(value != 0 && value < previous_value) { 411 Gatherer.println("Progress is decreasing! " + previous_value + " -> " + value);412 DebugStream.println("Progress is decreasing! " + previous_value + " -> " + value); 412 413 } 413 414 previous_value = value; -
trunk/gli/src/org/greenstone/gatherer/shell/GShell.java
r8231 r8236 45 45 import javax.swing.tree.*; 46 46 import org.greenstone.gatherer.Configuration; 47 import org.greenstone.gatherer.DebugStream; 47 48 import org.greenstone.gatherer.Dictionary; 48 49 import org.greenstone.gatherer.Gatherer; … … 119 120 } 120 121 catch(Exception exception) { 121 Gatherer.printStackTrace(exception);122 DebugStream.printStackTrace(exception); 122 123 } 123 124 return process_running; … … 173 174 if(line_buffer.length() > 0) { 174 175 String line = line_buffer.toString(); 175 Gatherer.println("* " + line + " *");176 DebugStream.println("* " + line + " *"); 176 177 fireMessage(type, typeAsString(type) + "> " + line, status, bos); 177 178 line = null; … … 196 197 if(line_buffer.length() > 0) { 197 198 String line = line_buffer.toString(); 198 // Gatherer.println("* " + line + " *");199 // DebugStream.println("* " + line + " *"); 199 200 fireMessage(type, typeAsString(type) + "> " + line, status, bos); 200 201 line_buffer = new StringBuffer(); … … 316 317 catch (Exception exception) { 317 318 System.err.println("Exception in GShell.runRemote() - unexpected"); 318 Gatherer.printStackTrace(exception);319 DebugStream.printStackTrace(exception); 319 320 status = ERROR; 320 321 } … … 330 331 } 331 332 332 Gatherer.println("Command: "+command);333 DebugStream.println("Command: "+command); 333 334 ///ystem.err.println("Command: " + command); 334 335 fireMessage(type, Dictionary.get("GShell.Command") + ": " + command, status, null); … … 377 378 if(eline_buffer.length() > 0) { 378 379 String eline = eline_buffer.toString(); 379 // Gatherer.println("Last bit of eline: " + eline);380 //DebugStream.println("Last bit of eline: " + eline); 380 381 fireMessage(type, typeAsString(type) + "> " + eline, status, bos); 381 382 eline = null; … … 384 385 if(stdline_buffer.length() > 0) { 385 386 String stdline = stdline_buffer.toString(); 386 // Gatherer.println("Last bit of stdline: " + stdline);387 //DebugStream.println("Last bit of stdline: " + stdline); 387 388 fireMessage(type, typeAsString(type) + "> " + stdline, status, null); 388 389 stdline = null; … … 425 426 // Exception 426 427 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); 429 430 status = ERROR; 430 431 } … … 453 454 } 454 455 catch (Exception error) { 455 Gatherer.printStackTrace(error);456 DebugStream.printStackTrace(error); 456 457 } 457 458 } … … 581 582 } 582 583 catch(Exception error) { 583 Gatherer.printStackTrace(error);584 DebugStream.printStackTrace(error); 584 585 } 585 586 } … … 617 618 } 618 619 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); 621 622 } 622 623 } -
trunk/gli/src/org/greenstone/gatherer/util/AppendLineOnlyFileDocument.java
r7745 r8236 38 38 import javax.swing.event.*; 39 39 import javax.swing.text.*; 40 import org.greenstone.gatherer.DebugStream; 40 41 import org.greenstone.gatherer.Gatherer; 41 42 import org.greenstone.gatherer.gui.GLIButton; … … 83 84 */ 84 85 public AppendLineOnlyFileDocument(String filename, boolean build_log) { 85 Gatherer.println("Creating log: " + filename);86 DebugStream.println("Creating log: " + filename); 86 87 // Initialization 87 88 this.build_log = build_log; … … 116 117 } 117 118 catch (Exception error) { 118 Gatherer.printStackTrace(error);119 DebugStream.printStackTrace(error); 119 120 } 120 121 } … … 163 164 } 164 165 catch(Exception error) { 165 Gatherer.printStackTrace(error);166 DebugStream.printStackTrace(error); 166 167 } 167 168 } … … 187 188 } 188 189 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); 191 192 } 192 193 } … … 292 293 // } 293 294 // catch (IOException error) { 294 // Gatherer.printStackTrace(error);295 // DebugStream.printStackTrace(error); 295 296 // } 296 297 // if(text == null) { … … 366 367 } 367 368 catch (Exception error) { 368 Gatherer.printStackTrace(error);369 DebugStream.printStackTrace(error); 369 370 } 370 371 } … … 795 796 } 796 797 catch(Exception error) { 797 Gatherer.printStackTrace(error);798 DebugStream.printStackTrace(error); 798 799 } 799 800 element.clearContent(); … … 889 890 static synchronized public void print(String message) { 890 891 if (message.endsWith("\n")) { 891 Gatherer.print(message);892 DebugStream.print(message); 892 893 } 893 894 else { 894 Gatherer.println(message);895 DebugStream.println(message); 895 896 } 896 897 } -
trunk/gli/src/org/greenstone/gatherer/util/Codec.java
r6899 r8236 222 222 } 223 223 } 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 + "'"); 227 227 // If cache is at maximum size, empty it and start again 228 228 if(CACHE.size() == MAX_CACHE_SIZE) { -
trunk/gli/src/org/greenstone/gatherer/util/DragTreeSelectionModel.java
r5593 r8236 40 40 import java.awt.event.*; 41 41 import javax.swing.tree.*; 42 import org.greenstone.gatherer.DebugStream; 42 43 import org.greenstone.gatherer.Dictionary; 43 import org.greenstone.gatherer.Gatherer;44 44 import org.greenstone.gatherer.gui.tree.DragTree; 45 45 … … 220 220 } 221 221 catch (Exception error) { 222 Gatherer.printStackTrace(error);222 DebugStream.printStackTrace(error); 223 223 } 224 224 } -
trunk/gli/src/org/greenstone/gatherer/util/ExternalProgram.java
r6785 r8236 1 1 package org.greenstone.gatherer.util; 2 2 3 import org.greenstone.gatherer.Gatherer;4 3 5 4 import java.io.BufferedReader; … … 8 7 import java.io.IOException; 9 8 import java.io.OutputStreamWriter; 9 import org.greenstone.gatherer.DebugStream; 10 10 11 11 … … 78 78 } 79 79 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); 82 82 return null; 83 83 } … … 100 100 } 101 101 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); 104 104 return null; 105 105 } -
trunk/gli/src/org/greenstone/gatherer/util/SynchronizedTreeModelTools.java
r6622 r8236 31 31 import javax.swing.SwingUtilities; 32 32 import javax.swing.tree.*; 33 import org.greenstone.gatherer.Gatherer; 33 import org.greenstone.gatherer.DebugStream; 34 34 35 /** 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. 35 36 * @author John Thompson, Greenstone Digital Library, University of Waikato … … 46 47 public void run() { 47 48 ///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); 49 50 int index = -1; 50 51 int pos = 0; … … 89 90 } 90 91 catch (Exception exception) { 91 Gatherer.printStackTrace(exception);92 DebugStream.printStackTrace(exception); 92 93 } 93 94 ///ystem.err.print("Added Task... "); … … 110 111 } 111 112 catch (Exception exception) { 112 Gatherer.printStackTrace(exception);113 DebugStream.printStackTrace(exception); 113 114 ///ystem.err.println(e); 114 115 } … … 142 143 } 143 144 catch (Exception exception) { 144 Gatherer.printStackTrace(exception);145 DebugStream.printStackTrace(exception); 145 146 } 146 147 } -
trunk/gli/src/org/greenstone/gatherer/util/Utility.java
r8231 r8236 47 47 import org.apache.xml.serialize.*; 48 48 import org.greenstone.gatherer.Configuration; 49 import org.greenstone.gatherer.DebugStream; 49 50 import org.greenstone.gatherer.Dictionary; 50 51 import org.greenstone.gatherer.Gatherer; … … 259 260 catch (Exception exception) { 260 261 if(!file.getName().endsWith(METADATA_XML)) { 261 Gatherer.printStackTrace(exception);262 DebugStream.printStackTrace(exception); 262 263 return false; 263 264 } … … 740 741 ZipEntry zipentry = (ZipEntry) e.nextElement(); 741 742 String zentryname = dst_dir + zipentry.getName(); 742 Gatherer.println(" Unzipping: " + zentryname);743 DebugStream.println(" Unzipping: " + zentryname); 743 744 744 745 if (zipentry.isDirectory()) { … … 774 775 catch (ZipException error) { 775 776 System.err.println("Error: Unable to open '"+zip_file.getAbsolutePath()+"'"); 776 Gatherer.printStackTrace(error);777 DebugStream.printStackTrace(error); 777 778 } 778 779 … … 977 978 } 978 979 979 Gatherer.println(" Zipping up: " + file_path);980 DebugStream.println(" Zipping up: " + file_path); 980 981 } 981 982 … … 1092 1093 ZipEntry zipentry = (ZipEntry) e.nextElement(); 1093 1094 String zentryname = col_dir + zipentry.getName(); 1094 Gatherer.println(" Unzipping: " + zentryname);1095 DebugStream.println(" Unzipping: " + zentryname); 1095 1096 1096 1097 if (zipentry.isDirectory()) { … … 1126 1127 catch (ZipException error) { 1127 1128 System.err.println("Error: Unable to open '"+zip_fname+"'"); 1128 Gatherer.printStackTrace(error);1129 DebugStream.printStackTrace(error); 1129 1130 } 1130 1131 … … 1313 1314 try { 1314 1315 if (file.exists()) { 1315 Gatherer.println("Parsing XML file: " + file);1316 DebugStream.println("Parsing XML file: " + file); 1316 1317 FileInputStream fis = new FileInputStream(file); 1317 1318 document = parse(fis, noisey); … … 1321 1322 if(noisey) { 1322 1323 error.printStackTrace(); 1323 Gatherer.println("Exception in Utility.parse() - Unexpected");1324 DebugStream.println("Exception in Utility.parse() - Unexpected"); 1324 1325 } 1325 1326 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); 1328 1329 } 1329 1330 } … … 1345 1346 if(noisey) { 1346 1347 error.printStackTrace(); 1347 Gatherer.println("Exception in Utility.parse() - Unexpected");1348 DebugStream.println("Exception in Utility.parse() - Unexpected"); 1348 1349 } 1349 1350 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); 1352 1353 } 1353 1354 } … … 1382 1383 if(noisey) { 1383 1384 error.printStackTrace(); 1384 Gatherer.println("Exception in Utility.parse() - Unexpected");1385 DebugStream.println("Exception in Utility.parse() - Unexpected"); 1385 1386 } 1386 1387 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); 1390 1391 } 1391 1392 return document; … … 1445 1446 } 1446 1447 else { 1447 // Gatherer.println("Zero length argument xml detected for: " + form);1448 //DebugStream.println("Zero length argument xml detected for: " + form); 1448 1449 String[] margs = new String[1]; 1449 1450 margs[0] = form;
Note:
See TracChangeset
for help on using the changeset viewer.