Changeset 23031

Show
Ignore:
Timestamp:
04.10.2010 15:49:27 (9 years ago)
Author:
ak19
Message:

More changes to 2. Gatherer.java to allow empty string into config.xml for when the current collect dir is the default collect dir and 2. swapping between user names in applet (no longer loads open collections, because all collections are closed on exiting the applet).

Location:
main/trunk/gli/src/org/greenstone/gatherer
Files:
2 modified

Legend:

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

    r23015 r23031  
    315315        if (fedora_info.isActive()) { 
    316316        popupFedoraInfo(); 
    317         } 
     317        }    
     318 
    318319         
    319320        open_collection_file_path = open_collection; 
     
    322323                "general.open_collection"+Configuration.gliPropertyNameSuffix(), true); 
    323324        } 
    324         if (no_load) { 
     325        if (no_load || (isGsdlRemote && open_collection_file_path.equals(""))) { 
    325326        open_collection_file_path = null; 
    326327        //      collectDirectoryHasChanged(); // make sure gsdlsite.cfg's collecthome defaults to GS' collect 
     
    329330        // If opening a collection outside the standard GS collect folder, need 
    330331        // to open the non-standard collect folder that the collection resides in 
    331         if (open_collection_file_path != null && 
    332         !open_collection_file_path.startsWith(getDefaultGSCollectDirectoryPath(true))) { 
     332        if (!isGsdlRemote 
     333            && open_collection_file_path != null 
     334            && !open_collection_file_path.startsWith(getDefaultGSCollectDirectoryPath(true))) 
     335        { 
    333336            File collectFolder = null; 
    334337             
     
    349352                    collectFolder = collectFolder.getParentFile();           
    350353                } 
    351             }        
     354            } 
    352355             
    353             if(!isGsdlRemote && (collectFolder == null || !collectFolder.exists())) { 
     356            if(collectFolder == null || !collectFolder.exists()) { 
    354357                // if GLI config file specified no collectDir  (open_collection_file_path is "") 
    355358                // OR if dealing with a local server but the collectdir no longer exists,  
     
    366369                if(Gatherer.GS3) {  // GS2's gsdlsite.cfg was taken care of when LocalLibraryServer was started up 
    367370                                    // (LocalLibraryServer would also already have set glisite.cfg to the correct collecthome) 
    368                     String gsdlsitecfg = Configuration.gsdl3_path + File.separator  
     371                    String gsdlsitecfg = Configuration.gsdl3_path + File.separator  
    369372                        + "WEB-INF" + File.separator + "cgi" + File.separator + "gsdl3site.cfg"; 
    370373                    Utility.updatePropertyConfigFile(gsdlsitecfg, "collecthome", defaultColDir); // no file separator 
     
    376379                } else { 
    377380                    setCollectDirectoryPath(collectFolder.getAbsolutePath()); // now set this as the current collect folder 
    378                 } 
    379                      
    380             } 
    381         } 
    382  
     381                }                    
     382            }            
     383        } 
     384         
    383385        // Finally, we're ready to find out the version of the remote Greenstone server  
    384386        if(isGsdlRemote) { 
     
    557559        } 
    558560         
     561         
    559562    } catch (Exception exception) { 
    560563        DebugStream.printStackTrace(exception); 
  • main/trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r23016 r23031  
    507507        // in applets when other users on a machine want to use an applet and GLI wants to load 
    508508        // a collection left open from a previous session and *requires* the old user to authenticate 
    509         if(!Gatherer.isGsdlRemote) { 
     509        if(Gatherer.isGsdlRemote) { 
     510            Configuration.setString("general.open_collection"+Configuration.gliPropertyNameSuffix(),  
     511                    true, "");           
     512        } else { 
    510513            Configuration.setString("general.open_collection"+Configuration.gliPropertyNameSuffix(),  
    511514                    true, CollectionManager.getLoadedCollectionColFilePath()); 
     
    515518    else { 
    516519        // if there was no open collection, then write out the collect dir path for next time 
    517         // IF this is not the default collect directory 
    518         if(Gatherer.getCollectDirectoryPath().equals( 
     520        // IF this is not the default collect directory and not a remote GLI/applet 
     521        if(Gatherer.isGsdlRemote || Gatherer.getCollectDirectoryPath().equals( 
    519522                Gatherer.getDefaultGSCollectDirectoryPath(true))) {  
    520523            Configuration.setString("general.open_collection"+Configuration.gliPropertyNameSuffix(),