Changeset 24479 for main/trunk
- Timestamp:
- 2011-08-25T22:04:29+12:00 (13 years ago)
- Location:
- main/trunk/greenstone3/src/java/org/greenstone/server
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/server/BaseServer.java
r24455 r24479 250 250 } 251 251 252 public void reloadConfigProperties(boolean port_has_changed) { 252 // returns true on success 253 public boolean reloadConfigProperties(boolean port_has_changed) { 253 254 try { 254 255 FileInputStream in = new FileInputStream(config_properties_file); … … 265 266 } 266 267 268 return true; 267 269 } 268 270 -
main/trunk/greenstone3/src/java/org/greenstone/server/BaseServerControl.java
r24369 r24479 280 280 } 281 281 } 282 283 public void errorMessage(String message) { 284 JOptionPane.showMessageDialog(null,message,"Error", JOptionPane.ERROR_MESSAGE); 285 } 282 286 } -
main/trunk/greenstone3/src/java/org/greenstone/server/BaseServerSettings.java
r24455 r24479 290 290 291 291 String osName = System.getProperty("os.name"); 292 292 if (osName.startsWith("Windows")){ 293 293 browserPath = browserPath.replaceAll("\\\\","/"); 294 294 } … … 297 297 scriptReadWrite.writeOutFile(BaseServer.config_properties_file, newFileLines); 298 298 299 server.reloadConfigProperties(port_has_changed); 300 server.reload(); // work out the URL again in case it has changed 301 if (require_restart){ 302 JOptionPane.showMessageDialog(null,server.dictionary.get("ServerSettings.SettingChanged"),"Info", JOptionPane.INFORMATION_MESSAGE); 303 if(autoStart) { 304 server.autoStart(); 305 server.getServerControl().updateControl(); 306 } 299 if(server.reloadConfigProperties(port_has_changed)) { // successful/valid configuration changes 300 // if failure, it would have displayed an error message 301 server.reload(); // work out the URL again in case it has changed 302 if (require_restart){ 303 JOptionPane.showMessageDialog(null,server.dictionary.get("ServerSettings.SettingChanged"),"Info", JOptionPane.INFORMATION_MESSAGE); 304 if(autoStart) { 305 server.autoStart(); 306 server.getServerControl().updateControl(); 307 } 308 } 307 309 } 308 310 } -
main/trunk/greenstone3/src/java/org/greenstone/server/Server2.java
r24465 r24479 301 301 } 302 302 303 public voidreloadConfigProperties(boolean port_has_changed) {303 public boolean reloadConfigProperties(boolean port_has_changed) { 304 304 super.reloadConfigProperties(port_has_changed); 305 305 … … 318 318 if(!PortFinder.isPortAvailable(portNum, verbose)) { // first time, print any Port Unavailable messages 319 319 if(keepport.equals("1")) { 320 String errorMsg = "Unable to run the Greenstone server on port " + port + ". It may already be in use."; 320 server_control_.errorMessage(dictionary.get("ServerSettings.SettingsUnchangedPortOccupied", new String[]{port})); 321 String errorMsg = "Unable to run the Greenstone server on port " + port + ". It appears to already be in use."; 321 322 System.err.println("\n******************"); 322 323 logger_.error(errorMsg); 323 324 System.err.println("If you wish to try another port, go to File > Settings of the Greenstone Server interface and either change the port number or untick the \"Do Not Modify Port\" option there. Then press the \"Enter Library\" button."); 324 325 System.err.println("******************\n"); 326 327 return false; // property change is unsuccessful 328 325 329 } else { // can modify port, try to find a new port 326 330 … … 355 359 } 356 360 361 return true; 357 362 } 358 363
Note:
See TracChangeset
for help on using the changeset viewer.