Changeset 14309 for gli/trunk


Ignore:
Timestamp:
2007-08-06T11:24:46+12:00 (17 years ago)
Author:
qq6
Message:

added the site info for a remote GS3

File:
1 edited

Legend:

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

    r13195 r14309  
    3535import javax.swing.event.*;
    3636import javax.swing.plaf.*;
     37import org.greenstone.gatherer.remote.RemoteGreenstoneServer;
    3738import org.greenstone.gatherer.Configuration;
     39import org.greenstone.gatherer.GAuthenticator;
    3840import org.greenstone.gatherer.DebugStream;
    3941import org.greenstone.gatherer.Dictionary;
     
    201203    JPanel gliserver_url_pane = null;
    202204    JLabel gliserver_url_label = null;
    203     if (Gatherer.isGsdlRemote) {
     205    if (Gatherer.isGsdlRemote && !Gatherer.GS3) {
    204206        gliserver_url_pane = new JPanel();
    205207        gliserver_url_pane.setPreferredSize(ROW_SIZE);
     
    322324    library_path_pane.add(library_path_field, BorderLayout.CENTER);
    323325
    324     if (Gatherer.isGsdlRemote) {
     326    if (Gatherer.isGsdlRemote && !Gatherer.GS3) {
    325327        gliserver_url_pane.setLayout(new BorderLayout());
    326328        gliserver_url_pane.add(gliserver_url_label, BorderLayout.WEST);
     
    350352    connection_pane.add(program_pane);
    351353    connection_pane.add(library_path_pane);
    352     if (Gatherer.isGsdlRemote) {
     354    if (Gatherer.isGsdlRemote && !Gatherer.GS3) {
    353355        connection_pane.add(gliserver_url_pane);
    354356    }
     
    669671        Configuration.setString("general.library_url", true, library_url_string);
    670672
    671         if (Gatherer.isGsdlRemote) {
     673        if (Gatherer.isGsdlRemote && !Gatherer.GS3) {
    672674        String gliserver_url_string = gliserver_url_field.getText();
    673675        if (gliserver_url_string.equals("")) {
     
    760762        }
    761763
    762         if (Gatherer.GS3 && site_changed && Gatherer.c_man.getCollection() != null) {
     764        if (Gatherer.GS3 && site_changed && Gatherer.c_man.getCollection() != null && !Gatherer.isGsdlRemote) {
    763765        // shut down the collection
    764766        System.err.println("shutting down teh collection");
     
    783785        // Always save configuration changes immediately (in case the GLI crashes)
    784786        Configuration.save();
    785 
     787        if (Gatherer.isGsdlRemote && Gatherer.GS3 && site_changed ){
     788        RemoteGreenstoneServer.downloadCollectionConfigurations();
     789        }
    786790        // Refresh the GLI to account for the configuration changes
    787791        Gatherer.refresh(Gatherer.PREFERENCES_CHANGED);
     
    894898        current_site_selection = site;
    895899        System.err.println("changed the current selection");
     900       
    896901        ArrayList servlet_options = Gatherer.servlet_config.getServletsForSite(current_site_selection);
    897902        if (servlet_options == null) {
     
    906911            servlet_combobox.setToolTipText(Dictionary.get("Preferences.Connection.Servlet_Tooltip"));
    907912            servlet_combobox.setEnabled(true);
     913        }
     914        if (Gatherer.isGsdlRemote){
     915            // Close the current collection, remove the lock on this file, ask to login to the new site, then download collection configurations of the site.
     916            if (Gatherer.c_man.getCollection()!=null){
     917            Gatherer.g_man.closeCurrentCollection();
     918            }
     919            File lock_file = new File(Gatherer.c_man.getLoadedCollectionDirectoryPath() + "gli.lck");
     920            RemoteGreenstoneServer.deleteCollectionFile(Gatherer.c_man.getLoadedCollectionName(),lock_file);
     921            Configuration.site_name=site;
     922            RemoteGreenstoneServer.set_remote_greenstone_server_authentication_to_null();
     923            RemoteGreenstoneServer.downloadCollectionConfigurations();
    908924        }
    909925        }
Note: See TracChangeset for help on using the changeset viewer.