Changeset 9093
- Timestamp:
- 2005-02-18T11:23:49+13:00 (19 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Configuration.java
r9036 r9093 97 97 static public Configuration self = null; 98 98 99 static public boolean just_created_new_config_file = false; 99 100 /** The path to the Greenstone Suite installation directory. */ 100 101 static public String gsdl_path = ""; … … 154 155 } 155 156 156 // Check the version of the config we have loaded, and if it isn't recent enough, backup the old version, and then create a new config. 157 // If the version of the config we've loaded isn't recent enough, backup the old version and create a new one 158 just_created_new_config_file = false; 157 159 if (general_config != null) { 158 160 Element configuration_element = general_config.getDocumentElement(); … … 166 168 } 167 169 168 // And if that fails retrievethe default configuration file from our xml library170 // Create a new config from the default configuration file from our xml library 169 171 if (general_config == null) { 170 172 general_config = Utility.parse(TEMPLATE_CONFIG_XML, true); 173 just_created_new_config_file = true; 171 174 } 172 175 -
trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r9061 r9093 41 41 import org.greenstone.gatherer.Configuration; 42 42 import org.greenstone.gatherer.GAuthenticator; 43 import org.greenstone.gatherer.cdm.ClassifierManager; 44 import org.greenstone.gatherer.cdm.PluginManager; 43 45 import org.greenstone.gatherer.collection.CollectionManager; 44 46 import org.greenstone.gatherer.feedback.ActionRecorderDialog; … … 146 148 147 149 try { 148 // Load Config 149 loadConfig(gsdl_path, gsdl3_path, site_name); 150 // Load GLI config file 151 new Configuration(gsdl_path, gsdl3_path, site_name); 152 if (Configuration.just_created_new_config_file) { 153 // Delete the plugins.dat and classifiers.dat files 154 PluginManager.clearPluginCache(); 155 ClassifierManager.clearClassifierCache(); 156 } 157 158 if (GS3) { 159 // Load Greenstone 3 servelt configuration 160 servlet_config = new ServletConfiguration(gsdl3_path); 161 } 150 162 151 163 // Check we know where Perl is … … 629 641 630 642 631 /** Loads the configuration file if one exists. Otherwise it creates a new one. Currently uses serialization.632 * @param gsdl_path The path to the gsdl directory, gathered from the startup arguments, and presented as a <strong>String</strong>.633 * @see org.greenstone.gatherer.Configuration634 */635 private void loadConfig(String gsdl_path, String gsdl3_path, String site_name) {636 try {637 new Configuration(gsdl_path, gsdl3_path, site_name);638 }639 catch (Exception error) {640 DebugStream.println(Configuration.CONFIG_XML+" is not a well formed XML document.");641 DebugStream.printStackTrace(error);642 }643 if (GS3) {644 try {645 servlet_config = new ServletConfiguration(gsdl3_path);646 } catch (Exception exception) {647 DebugStream.printStackTrace(exception);648 }649 }650 }651 652 643 /** Causes the general configuration file to export itself to xml. Doesn't effect any remaining collection configuration, as its up to the collection manager to handle them (especially since we have no idea where they are going). */ 653 644 private void saveConfig() {
Note:
See TracChangeset
for help on using the changeset viewer.