Changeset 36229
- Timestamp:
- 2022-05-31T10:15:53+12:00 (2 years ago)
- Location:
- main/trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/Configuration.java
r36102 r36229 63 63 static final public int EXPERT_MODE = 3; 64 64 65 // Gs2 and 3 use the same config file format - same template - but will save in user folder as config2/3 so you can 66 // save settings for version 2 and 3. 67 static final public String CONFIG_XML_TEMPLATE = "config.xml"; 68 static final public String CONFIG_XML_2 = "config2.xml"; 69 static final public String CONFIG_XML_3 = "config3.xml"; 70 static final public String CONFIG_REMOTE_XML = "configRemote.xml"; 71 72 static final public String TEMPLATE_CONFIG_PREFIX = "xml/"; 73 static final public String FEDORA_CONFIG_PREFIX = "fedora-"; 74 65 75 /** The string identifying an argument's name attribute. */ 66 76 static final private String ARGUMENT_NAME = "name"; 67 /** The name of the general Gatherer configuration file.68 Gatherer will change this to configRemote if isGsdlRemote */69 static public String CONFIG_XML = "config.xml";70 static public String FEDORA_CONFIG_PREFIX = "fedora-";71 77 72 78 /** The name of the root element of the subtree containing gatherer configuration options. This is required as the document itself may contain several other subtrees of settings (such as in the case of a '.col' file). */ … … 82 88 /** The name of the other arguments element. */ 83 89 static final private String OTHER = "Other"; 84 /** The name of the general Gatherer configuration template.85 Gatherer will change this to xml/configRemote.xml if isGSDLRemote */86 static public String TEMPLATE_CONFIG_XML = "xml/config.xml";87 90 /** The first of three patterns used during tokenization, this pattern handles a comma separated list. */ 88 91 static final private String TOKENIZER_PATTERN1 = " ,\n\t"; … … 94 97 static public Configuration self = null; 95 98 static public String gli_user_directory_path = null; 99 /** The name of the general Gatherer configuration file. 100 Gatherer will set this to configRemote/2/3 as necessary */ 101 static public String config_xml = CONFIG_XML_2; 102 /** The name of the general Gatherer configuration template. 103 Gatherer will change this to xml/configRemote.xml if isGSDLRemote */ 104 static public String template_config_xml = TEMPLATE_CONFIG_PREFIX + CONFIG_XML_TEMPLATE; 96 105 97 106 static public boolean just_updated_config_xml_file = false; … … 156 165 157 166 // Try to load the configuration file from the user specific location 158 String config_xml_file_name = CONFIG_XML; 159 160 if (fedora_info != null && fedora_info.isActive()) { 161 config_xml_file_name = FEDORA_CONFIG_PREFIX + config_xml_file_name; 162 } 167 String config_xml_file_name = this.config_xml; 168 169 // I think this has already been set by Gatherer 170 // if (fedora_info != null && fedora_info.isActive()) { 171 // config_xml_file_name = FEDORA_CONFIG_PREFIX + config_xml_file_name; 172 // } 163 173 164 174 // If the existing user config.xml file isn't recent enough, backup the old version and update it … … 172 182 // Create a new config from the default configuration file from our xml library 173 183 if (general_config == null) { 174 general_config = XMLTools.parseXMLFile( TEMPLATE_CONFIG_XML, true);184 general_config = XMLTools.parseXMLFile(this.template_config_xml, true); 175 185 just_updated_config_xml_file = true; 176 186 } … … 248 258 { 249 259 // Check if the configuration file actually needs updating by looking at the version numbers 250 Document new_document = XMLTools.parseXMLFile( TEMPLATE_CONFIG_XML, true);260 Document new_document = XMLTools.parseXMLFile(template_config_xml, true); 251 261 Document old_document = XMLTools.parseXMLFile(config_xml_file); 252 262 if (new_document == null || old_document == null) { … … 736 746 // We first try exporting to a user specific place 737 747 File user_config_xml = null; 738 String config_xml_name = CONFIG_XML; 739 740 if (fedora_info != null && fedora_info.isActive()) { 741 config_xml_name = FEDORA_CONFIG_PREFIX + config_xml_name; 742 } 748 String config_xml_name = config_xml; 749 750 // this should have been set already 751 // if (fedora_info != null && fedora_info.isActive()) { 752 // config_xml_name = FEDORA_CONFIG_PREFIX + config_xml_name; 753 // } 743 754 744 755 try { -
main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r36110 r36229 186 186 } 187 187 188 // Are we greenstone 2 or 3? 189 if (go.gsdl3_path != null && !go.gsdl3_path.equals("")) { 190 this.GS3 = true; 191 Configuration.config_xml = Configuration.CONFIG_XML_3; 192 } else { 193 go.gsdl3_path = null; 194 go.gsdl3_src_path = null; 195 } 196 188 197 // Are we using a remote Greenstone? 189 198 if (go.use_remote_greenstone) { … … 217 226 if (isGsdlRemote) { 218 227 if (go.fedora_info.isActive()) { 219 Configuration.TEMPLATE_CONFIG_XML = "xml/" + Configuration.FEDORA_CONFIG_PREFIX + "configRemote.xml"; 228 Configuration.template_config_xml = Configuration.TEMPLATE_CONFIG_PREFIX + Configuration.FEDORA_CONFIG_PREFIX + Configuration.CONFIG_REMOTE_XML; 220 229 } 221 230 else { 222 Configuration.TEMPLATE_CONFIG_XML = "xml/configRemote.xml"; 223 } 224 225 Configuration. CONFIG_XML = "configRemote.xml";231 Configuration.template_config_xml = Configuration.TEMPLATE_CONFIG_PREFIX + Configuration.CONFIG_REMOTE_XML; 232 } 233 234 Configuration.config_xml = Configuration.CONFIG_REMOTE_XML; 226 235 227 236 File collect_directory = new File(Gatherer.getCollectDirectoryPath()); … … 232 241 else { 233 242 if (go.fedora_info.isActive()) { 234 Configuration. TEMPLATE_CONFIG_XML = "xml/" + Configuration.FEDORA_CONFIG_PREFIX + Configuration.CONFIG_XML;243 Configuration.template_config_xml = Configuration.TEMPLATE_CONFIG_PREFIX + Configuration.FEDORA_CONFIG_PREFIX + Configuration.config_xml; 235 244 } 236 245 // else, the CONFIG_XML uses the default config file, which is for the local GS server … … 256 265 String site_name, String servlet_path, String collect_directory_path) 257 266 { 258 if (gsdl3_path != null && !gsdl3_path.equals("")) { 259 this.GS3 = true; 260 } else { 261 gsdl3_path = null; 262 gsdl3_src_path = null; 263 } 267 264 268 265 269 // Create the debug stream if required
Note:
See TracChangeset
for help on using the changeset viewer.