Ignore:
Timestamp:
2019-03-25T20:03:00+13:00 (5 years ago)
Author:
ak19
Message:

What seemed like the key change in the previous commit was unnecessary. The key change was actually just moving new Gatherer() outside of the invokeLater(). Moving the line only caused errors previously because the RemoteGSServer code would return immediately if it was run on the EDT thread, which it now was. But with RemoteGSServer no longer returning if it is run in the EDT thread, the line 'new Gatherer' in GathererProg can now be placed outside of the invokeLater() without also having to move the downloadCollectionConfigurations step from Gatherer.init() into Gatherer.openGLI(). Although the downloadCollectionConfigurations step ends up calling remoteGSServer.downloadFile() which then calls remoteGSServer.authenticateGLI() which displays a dialog, this didn't happen earlier during the dowloadWebXML step possibly due to my then having debugging turned on/unlinking turned off in gliserver.pl so the web zip file was already present and authenticating was shifted to downloadCollConfigurations. Whether that explains it or not, the situation now is that when all of the call to Gatherer.init() from Gatherer constructor is embedded in an invokeAndWait(), the program starts hanging during authenticateUser() of the downloadWebXML task (called from new ServletConfugration step in Gatherer). RemoteGSServer.downloadFile() calls authenticateUser which already runs in an invokeAndWait(), which is the most sensible place in the code to ensure authenticateUser popup happens on the EDT. For this reason, Gatherer.init() call need not be wrapped in entirety in invokeAndWait(). Rather, any individual dialogs called by Gatherer.init() should be made to happen on the EDT herefter. For a list of dialogs called by init() see the previous commit message.

File:
1 edited

Legend:

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

    r32923 r32924  
    671671            // if gsdlsite.cfg does not exist (if using server.exe for instance), the above method will just return
    672672        }
    673 
    674     }
    675 
    676    
    677     /** Returns the correct version of the (local or remote) Greenstone server if init() has already been called. */
    678     public static int serverVersionNumber() {
    679         return GS3 ? 3 : 2;
    680     }
    681 
    682     /** Returns "Server: version number" if init() has already been called. */
    683     public static String getServerVersionAsString() {
    684         return "Server: v" + serverVersionNumber();
    685     }
    686 
    687     public void openGUI()
    688     {
    689 
    690         // openGUI() is called on the EDT (graphical/swing thread)
    691         // remoteGS.downloadCollectionConfigurations() moved here as it calls remoteGS3.authenticateUser()
    692         // which displays a dialog to get user input and therefore belongs on the EDT.
     673       
    693674        // If using a remote Greenstone we need to download the collection configurations now
    694675        if (Gatherer.isGsdlRemote) {
     
    701682            }
    702683        }
    703        
     684    }
     685
     686   
     687    /** Returns the correct version of the (local or remote) Greenstone server if init() has already been called. */
     688    public static int serverVersionNumber() {
     689        return GS3 ? 3 : 2;
     690    }
     691
     692    /** Returns "Server: version number" if init() has already been called. */
     693    public static String getServerVersionAsString() {
     694        return "Server: v" + serverVersionNumber();
     695    }
     696
     697    public void openGUI()
     698    {
    704699        // Size and place the frame on the screen
    705700        Rectangle bounds = Configuration.getBounds("general.bounds", true);
Note: See TracChangeset for help on using the changeset viewer.