Changeset 24906

Show
Ignore:
Timestamp:
15.12.2011 22:00:44 (8 years ago)
Author:
ak19
Message:

The original GLI LocalLibraryServer? code called restore() when stopping the LLS. This would delete the configfile if it was not null. This code remained the same throughout the old changes from gsdlsite.cfg to glisite.cfg. However, the more recent change was to merge glisite.cfg with llssite.cfg, and we don't want to delete the file containing the property values. The file now retains the values that I think are important to remember, removes the URL that must be deleted when the server is stopped, additionally removes some values particular to server.exe and finally ensures that some basic defaults are retained if anything goes missing.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/greenstone/LocalLibraryServer.java

    r24508 r24906  
    411411                   + "\nto the LocalLibraryServer.\n" + e); 
    412412        } 
    413         if(success) {        
     413        if(success) { 
    414414        Gatherer.terminateApplication(ID); 
    415415        } else { 
     
    910910        if(configFile != null) { 
    911911        // Delete the file 
    912         configFile.delete(); 
     912        //configFile.delete(); 
     913         
     914        // Not restoring nor deleting here. Just removing the URL (which indicates a running server),  
     915        // so that the file's state indicates the server has stopped, and then saving the property file. 
     916        // Should all properties not defined in the llssite.cfg.in template be removed below? 
     917        String urlPropertyName = isIndependentGSI() ? GSI_URL : URL; 
     918        remove(urlPropertyName); 
     919         
     920        remove("gsdlhome"); 
     921        remove("collecthome"); 
     922        remove("gdbmhome"); 
     923        remove("logfilename"); 
     924         
     925        // For some reason launching GLI with server.exe clobbers autoenter and startbrowser  
     926        // values for independent GSI in llssite.cfg file, and gli.autoenter and gli.startbrowser. 
     927        // So set them here. 
     928        if(get(GSI_AUTOENTER) == null) { 
     929            put(GSI_AUTOENTER, "0"); 
     930        } 
     931        if(get(GSI_STARTBROWSER) == null) { 
     932            put(GSI_STARTBROWSER, "1"); 
     933        } 
     934        if(get(AUTOENTER) == null) { 
     935            put(AUTOENTER, "1"); 
     936        } 
     937        if(get(STARTBROWSER) == null) { 
     938            put(STARTBROWSER, "0"); 
     939        }        
     940        save(); 
    913941        } 
    914942        else {