Changeset 16330
- Timestamp:
- 2008-07-10T12:53:51+12:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/Configuration.java
r15801 r16330 67 67 /** The name of the general Gatherer configuration file. */ 68 68 static public String CONFIG_XML = "config.xml"; 69 /** The name of the general Gatherer configuration file for running with GS3. */70 static public String GS3_CONFIG_XML = "config3.xml";71 69 static public String FEDORA_CONFIG_PREFIX = "fedora-"; 72 70 … … 130 128 static public URL gliserver_url = null; 131 129 static public URL library_url = null; 132 133 130 131 134 132 /** Constructor. 135 133 * @param gsdl_path The path to the Greenstone directory as a <strong>String</strong>. … … 137 135 * @param gsdl3_src_path The path to the Greenstone 3 src directory as a <strong>String</strong>. 138 136 * @param site_name The name of the Greenstone 3 site currently in use. 137 * @param fedora_info A FedoraInfo object containing the user-provided details for creating 138 * a connection to a Fedora repository. 139 139 */ 140 public Configuration(String gli_user_directory_path, String gsdl_path, String gsdl3_path, String gsdl3_src_path, String site_name,141 FedoraInfo fedora_info)140 public Configuration(String gli_user_directory_path, String gsdl_path, String gsdl3_path, String gsdl3_src_path, 141 String site_name, FedoraInfo fedora_info) 142 142 { 143 143 super(); 144 self = this; 144 self = this; // allows Configuration to statically refer to itself in the static methods 145 145 146 146 this.gli_user_directory_path = gli_user_directory_path; … … 154 154 // Try to load the configuration file from the user specific location 155 155 String config_xml_file_name = CONFIG_XML; 156 if (gsdl3_path != null || (Gatherer.isGsdlRemote && Gatherer.GS3)) {157 config_xml_file_name = GS3_CONFIG_XML;158 }159 156 160 157 if (fedora_info != null && fedora_info.isActive()) { … … 206 203 } 207 204 208 if (gsdl3_path != null || (Gatherer.GS3 && Gatherer.isGsdlRemote)) { 209 if (this.site_name == null || this.site_name.equals("")) { 210 this.site_name = getString("general.site_name", true); 211 this.servlet_path = getString("general.servlet_path", true); 212 if (this.site_name.equals("")) { 213 this.site_name = "localsite"; // can we assume these?? 214 this.servlet_path = "/library"; 215 setString("general.site_name", true, this.site_name); 216 setString("general.servlet_path", true, this.servlet_path); 217 } 218 219 } else { 220 // we set the current one in the config 221 setString("general.site_name", true, this.site_name); 222 if (this.servlet_path != null && !this.servlet_path.equals("")) { 223 setString("general.servlet_path", true, this.servlet_path); 224 } 225 } 226 } 227 } 228 205 if(gsdl3_path != null) { 206 prepareForGS3(); 207 } 208 209 } 210 211 // Called when (gsdl3_path != null) || (Gatherer.GS3 && Gatherer.isGsdlRemote) 212 static public void prepareForGS3() { 213 if (site_name == null || site_name.equals("")) { 214 site_name = getString("general.site_name", true); 215 servlet_path = getString("general.servlet_path", true); 216 if (site_name.equals("")) { 217 site_name = "localsite"; // can we assume these?? 218 servlet_path = "/library"; 219 setString("general.site_name", true, site_name); 220 setString("general.servlet_path", true, servlet_path); 221 } 222 223 } else { 224 // we set the current one in the config 225 setString("general.site_name", true, site_name); 226 if (servlet_path != null && !servlet_path.equals("")) { 227 setString("general.servlet_path", true, servlet_path); 228 } 229 } 230 } 229 231 230 232 static private boolean updateUserConfigXMLFileIfNecessary(File config_xml_file) … … 708 710 File user_config_xml = null; 709 711 String config_xml_name = CONFIG_XML; 710 711 if (gsdl3_path!=null) {712 config_xml_name = GS3_CONFIG_XML;713 }714 715 if (Gatherer.isGsdlRemote) {716 if (Gatherer.GS3){717 config_xml_name = GS3_CONFIG_XML;718 }else{719 config_xml_name = CONFIG_XML;720 }721 }722 712 723 713 if (fedora_info != null && fedora_info.isActive()) {
Note:
See TracChangeset
for help on using the changeset viewer.