Changeset 10461
- Timestamp:
- 2005-08-10T14:56:20+12:00 (19 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Configuration.java
r10370 r10461 94 94 95 95 static public Configuration self = null; 96 static private String gli_user_directory_path = null; 96 97 97 98 static public boolean just_updated_config_xml_file = false; … … 137 138 * @param site_name The name of the Greenstone 3 site currently in use. 138 139 */ 139 public Configuration(String g sdl_path, String gsdl3_path, String gsdl3_src_path, String site_name)140 public Configuration(String gli_user_directory_path, String gsdl_path, String gsdl3_path, String gsdl3_src_path, String site_name) 140 141 { 141 142 super(); 142 143 self = this; 143 144 145 this.gli_user_directory_path = gli_user_directory_path; 144 146 this.gsdl_path = gsdl_path; 145 147 this.gsdl3_path = gsdl3_path; … … 154 156 155 157 // If the existing user config.xml file isn't recent enough, backup the old version and update it 156 File config_xml_file = new File( Gatherer.getGLIUserDirectoryPath()+ config_xml_file_name);158 File config_xml_file = new File(gli_user_directory_path + config_xml_file_name); 157 159 if (config_xml_file != null && config_xml_file.exists()) { 158 160 just_updated_config_xml_file = updateUserConfigXMLFileIfNecessary(config_xml_file); … … 392 394 } 393 395 } 394 catch(Exception error) { 396 catch (Exception exception) { 397 DebugStream.printStackTrace(exception); 395 398 } 396 399 return properties; … … 421 424 document_element = null; 422 425 } 423 catch(Exception error) { 426 catch (Exception exception) { 427 DebugStream.printStackTrace(exception); 424 428 } 425 429 return argument_element; … … 451 455 result = new Rectangle(x, y, width, height); 452 456 } 453 catch (Exception error) {454 DebugStream.printStackTrace(e rror);457 catch (Exception exception) { 458 DebugStream.printStackTrace(exception); 455 459 } 456 460 return result; … … 469 473 result = new Color(red, green, blue); 470 474 } 471 catch (Exception error) {472 error.printStackTrace();475 catch (Exception exception) { 476 DebugStream.printStackTrace(exception); 473 477 } 474 478 return result; … … 496 500 mappings = null; 497 501 } 498 catch (Exception exception) {502 catch (Exception exception) { 499 503 DebugStream.printStackTrace(exception); 500 504 } … … 537 541 result = new FontUIResource(face, style, size); 538 542 } 539 catch (Exception error) {540 DebugStream.printStackTrace(e rror);543 catch (Exception exception) { 544 DebugStream.printStackTrace(exception); 541 545 } 542 546 return result; … … 550 554 result = Integer.parseInt(raw); 551 555 } 552 catch (Exception error) {553 DebugStream.printStackTrace(e rror);556 catch (Exception exception) { 557 DebugStream.printStackTrace(exception); 554 558 } 555 559 return result; … … 582 586 } 583 587 } 584 catch (Exception error) {585 DebugStream.printStackTrace(e rror);588 catch (Exception exception) { 589 DebugStream.printStackTrace(exception); 586 590 } 587 591 return result; … … 664 668 } 665 669 } 666 catch (Exception e rror) {667 error.printStackTrace();670 catch (Exception exception) { 671 DebugStream.printStackTrace(exception); 668 672 } 669 673 // If we still have no result, and the search was made in the collection configuration, retrieve the general one instead. … … 707 711 mappings = null; 708 712 } 709 catch (Exception error) {710 DebugStream.printStackTrace(e rror);713 catch (Exception exception) { 714 DebugStream.printStackTrace(exception); 711 715 } 712 716 return file; … … 723 727 } 724 728 try { 725 user_config_xml = new File( Gatherer.getGLIUserDirectoryPath()+ config_xml_name);729 user_config_xml = new File(gli_user_directory_path + config_xml_name); 726 730 ///ystem.err.println("Trying to save to: " + user_config_xml.getAbsolutePath()); 727 731 ///ystem.err.println("Writing."); … … 729 733 XMLTools.writeXMLFile(new File(user_config_xml.getAbsolutePath()), general_config); 730 734 } 731 catch(Exception exception) { 735 catch (Exception exception) { 736 DebugStream.printStackTrace(exception); 732 737 user_config_xml = null; 733 738 } … … 768 773 document_element = null; 769 774 } 770 catch (Exception e rror) {771 DebugStream.println("Error in Configuration.setArguments(): " + e rror);772 DebugStream.printStackTrace(e rror);775 catch (Exception exception) { 776 DebugStream.println("Error in Configuration.setArguments(): " + exception); 777 DebugStream.printStackTrace(exception); 773 778 } 774 779 } … … 926 931 } 927 932 } 928 catch (Exception error) { 933 catch (Exception exception) { 934 DebugStream.printStackTrace(exception); 929 935 } 930 936 } -
trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r10396 r10461 209 209 try { 210 210 // Load GLI config file 211 new Configuration(g sdl_path, gsdl3_path, gsdl3_src_path, site_name);211 new Configuration(getGLIUserDirectoryPath(), gsdl_path, gsdl3_path, gsdl3_src_path, site_name); 212 212 if (Configuration.just_updated_config_xml_file) { 213 213 // Delete the plugins.dat and classifiers.dat files -
trunk/gli/src/org/greenstone/gatherer/gems/GEMS.java
r10447 r10461 66 66 import org.greenstone.gatherer.util.Codec; 67 67 import org.greenstone.gatherer.util.JarTools; 68 import org.greenstone.gatherer.util.Utility; 68 69 import org.greenstone.gatherer.util.XMLTools; 69 70 import org.w3c.dom.*; … … 172 173 public GEMS(String gsdl_path) 173 174 { 175 // Determine the GLI user directory path 176 String gli_user_directory_path = System.getProperty("user.home") + File.separator; 177 if (Utility.isWindows()) { 178 gli_user_directory_path += "Application Data" + File.separator + "Greenstone" + File.separator + "GLI" + File.separator; 179 } 180 else { 181 gli_user_directory_path += ".gli" + File.separator; 182 } 183 174 184 //Load configuration file 175 185 this.self = this; 176 186 JarTools.initialise(this); 177 config = new Configuration(g sdl_path, null, null, null);187 config = new Configuration(gli_user_directory_path, gsdl_path, null, null, null); 178 188 179 189 // Read Dictionary -
trunk/gli/src/org/greenstone/gatherer/gems/GEMSLanguageManager.java
r10345 r10461 48 48 import org.greenstone.gatherer.DebugStream; 49 49 import org.greenstone.gatherer.Dictionary; 50 import org.greenstone.gatherer.Gatherer;51 50 import org.greenstone.gatherer.gui.GLIButton; 52 51 import org.w3c.dom.*;
Note:
See TracChangeset
for help on using the changeset viewer.