Changeset 16265 for gli

Show
Ignore:
Timestamp:
01.07.2008 18:51:07 (12 years ago)
Author:
ak19
Message:

Scheduling method requires that Greenstone be version 2 AND that the GLI that is running it is located inside the Greenstone 2 installation (since it requires the main.cfg inside GS2's etc folder). In other cases GLI crashes when trying to create a new collection. This will need to be fixed later so that it is no longer dependent on 1. where GLI is located; 2. Whether GS is v2 or v3; 3. Whether GS is a remote server or local.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gli/trunk/src/org/greenstone/gatherer/collection/CollectionManager.java

    r16251 r16265  
    558558 
    559559        // for remote case, scheduling causes an Exception on creating a new collection that  
    560         // can't be recovered from.  
    561         if (!Gatherer.isGsdlRemote) { 
     560        // can't be recovered from. For GS3, it doesn't work since it it trying to access etc/main.cfg 
     561        if (!Gatherer.isGsdlRemote && !Gatherer.GS3) { 
    562562        scheduling(); 
    563563        } 
     
    680680    //try to obtain email address of Greenstone installation webmaster for - used to indicate "sender".  
    681681    File mcfg = new File(LocalGreenstone.getDirectoryPath() + File.separator + "etc" + File.separator + "main.cfg"); 
     682    if(!mcfg.exists()) { 
     683        System.out.println("Cannot do scheduling, since there is no file: " + mcfg.getAbsolutePath()  
     684                   + ".\nScheduling presently depends on GLI running from inside a GS2."); 
     685        return; 
     686    } 
    682687    BufferedReader maincfg = new BufferedReader(new FileReader(mcfg));       
    683688        stmp = ""; 
     
    12141219        } 
    12151220         
    1216         if (!Gatherer.isGsdlRemote) { 
     1221        if (!Gatherer.isGsdlRemote && !Gatherer.GS3) { 
    12171222        //THIS LOOKS LIKE THE BEST PLACE TO TRY AND UPDATE .col FILES FOR EXISTING COLLECTIONS...Wendy 
    12181223  
     
    12851290        } 
    12861291         
    1287         if (!Gatherer.isGsdlRemote) { 
     1292        if (!Gatherer.isGsdlRemote && !Gatherer.GS3) { 
    12881293        scheduling(); 
    12891294        }