Changeset 6130


Ignore:
Timestamp:
2003-12-05T12:24:04+13:00 (20 years ago)
Author:
jmt12
Message:

CalPane no longer needed to communicate with local library server - preview pane can now be disabled on a more permanent basis

File:
1 edited

Legend:

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

    r5911 r6130  
    3434 **************************************************************************************/
    3535
    36 import calpa.html.*;
    3736import com.l2fprod.gui.*;
    3837import com.l2fprod.gui.plaf.skin.*;
     
    124123    private GSDLSiteConfig gsdlsite_cfg = null;
    125124    private ExternalApplication server = null;
    126     private CalHTMLPane view   = null;
    127125
    128126    /** The name of the Gatherers configuration file. */
     
    288286        g_man.display();
    289287
    290         // set up the calpane to use for config server
    291         CalHTMLPreferences prefs = new CalHTMLPreferences();
    292         DefaultCalHTMLObserver observer = new DefaultCalHTMLObserver();
    293         view = new CalHTMLPane(prefs, observer, "Default");
    294 
    295288        // Place the window in the desired location on the screen, if this is do-able (not under most linux window managers apparently. In fact you're lucky if they listen to any of your screen size requests).
    296289        g_man.setLocation(bounds.x, bounds.y);
     
    383376
    384377    try {
    385         String url = config.exec_address.toString() + command;
    386         ///ystem.err.println("Action: " + url);
    387         view.setLoadSynchronously(true);
    388         view.showHTMLDocument(new URL(url));
    389         view.setLoadSynchronously(false);
    390         ///ystem.err.println("Complete.");
     378        String raw_url = config.exec_address.toString() + command;
     379        URL url = new URL(raw_url);
     380        Gatherer.println("Action: " + raw_url);
     381        HttpURLConnection library_connection = (HttpURLConnection) url.openConnection();
     382        int response_code = library_connection.getResponseCode();
     383        if(HttpURLConnection.HTTP_OK <= response_code && response_code < HttpURLConnection.HTTP_MULT_CHOICE) {
     384        Gatherer.println("200 - Complete.");
     385        }
     386        else {
     387        Gatherer.println("404 - Failed.");
     388        }
    391389        url = null;
    392390    }
    393     catch(Exception error) {
     391    catch(Exception exception) {
     392        Gatherer.printStackTrace(exception);
    394393        ///ystem.err.println("Bad URL.");
    395394    }
     
    836835        if(gsdlsite_cfg.getURL() != null) {
    837836        // Send the command for it to exit.
    838         //Gatherer.g_man.preview_pane.configServer(GSDLSiteConfig.QUIT_COMMAND);
    839837        configServer(GSDLSiteConfig.QUIT_COMMAND);
    840838        // Wait until it exits.
Note: See TracChangeset for help on using the changeset viewer.