Ignore:
Timestamp:
2010-10-15T20:33:43+13:00 (14 years ago)
Author:
ak19
Message:

More changes to making collectdir movable: 1. When not working with a remote GS or server.exe: if the collecthome set in GLI is not the same as the one in gsdlsite.cfg used by the apache web server, then a dialog pops up on exiting GLI allowing the user to set the collecthome value for both GLI (in the user's GLI config.xml) and the server (in gsdlsite.cfg). 2. Collecthome line in gsdlsite.cfg is removed if it is the default GS collect folder. (Just as a recent commit stores an empty string for the open_collection element in the GLI config.xml file if no collection is left open on exiting GLI and the collect folder is the default GS collect directory.) 3. Some bug fixes.

File:
1 edited

Legend:

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

    r23015 r23143  
    7070    static private boolean isPersistentServer = false;
    7171
     72    static public boolean isPersistentServer() {
     73        return isPersistentServer;
     74    }
     75   
    7276    static public void addCollection(String collection_name)
    7377    {
     
    395399    if (isPersistentServer) {
    396400        config(QUIT_COMMAND);
    397     } else {
     401    } else {       
    398402        boolean success = sendMessageToServer("QUIT\n");
    399403        try {
     
    697701        // Set the correct collectdir (from last time) before the server is started up
    698702       
    699         //String collectDir = Configuration.getString("general.open_collection_gs2", true);
    700703        String orig_collection_path = Configuration.getString("general.open_collection_gs2", true);
    701         String collectDir = Gatherer.getCollectDirectoryPath();
     704        String collectDir = Gatherer.getCollectDirectoryPath();                 // Gatherer would've set this up
    702705        String defaultColDir = Gatherer.getDefaultGSCollectDirectoryPath(true); // with file separator at end
    703        
    704         // If opening a collection outside the standard GS collect folder, need
    705         // to open the non-standard collect folder that the collection resides in.
    706         // Also, would have been forced to change the loaded collection--and hence collectDir--
    707         // to the default coldir if orig_col_path was "" or led to a collectdir that didn't exist
    708         // (in the last case, gsdlsite.cfg already corrected in Gatherer if coldir was changed).   
    709        
     706               
    710707        if(orig_collection_path.equals("")) { // default GS collect dir path
    711708            return;
    712709        }
    713710       
    714         if (Gatherer.open_collection_file_path != null // may be null if no_load was specified on GLI startup           
    715             && (!orig_collection_path.startsWith(collectDir) // if coldir would've been changed on startup OR if coldir is non-standard collect folder
    716                 || !collectDir.equals(defaultColDir)))
     711        if (!orig_collection_path.startsWith(collectDir) // if coldir would've been changed on startup OR if coldir is non-standard collect folder
     712                || !collectDir.equals(defaultColDir))
    717713        {           
    718714            // if we're running *server.exe* and if the current collect dir at Local Lib's startup is
     
    720716            // dir because the non-standard collectDir didn't exist/wasn't specified in the GLI config
    721717            // file, then write out the new collectDir (minus file separator at end) to the lls site conf in use
     718            // Regardless of what collecthome value was in the llssite/glisite file, we end up resetting it here
    722719            if (isPersistentServer) { // server.exe, so we're dealing with a local GS2         
    723720                put(COLLECTHOME, collectDir);
Note: See TracChangeset for help on using the changeset viewer.