Changeset 8629


Ignore:
Timestamp:
2004-11-23T14:55:29+13:00 (19 years ago)
Author:
mdewsnip
Message:

More changes to the local library/web library configuration stuff.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
7 edited

Legend:

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

    r8627 r8629  
    621621    /** Loads the configuration file if one exists. Otherwise it creates a new one. Currently uses serialization.
    622622     * @param gsdl_path The path to the gsdl directory, gathered from the startup arguments, and presented as a <strong>String</strong>.
    623      * @param library_url The path to the library executable, gathered from the startup arguments, and presented as a <strong>String</strong>.
    624623     * @see org.greenstone.gatherer.Configuration
    625624     */
  • trunk/gli/src/org/greenstone/gatherer/GathererApplet.java

    r8626 r8629  
    172172
    173173    g_man = gatherer.init(size, go.gsdl_path, go.gsdl3_path, go.local_library_path,
    174                     go.library_url, go.debug, go.perl_path,
     174                    go.library_url_string, go.debug, go.perl_path,
    175175                    go.no_load, go.filename, go.site_name,
    176176                    go.servlet_path, go.wget_version_str, go.wget_path);
  • trunk/gli/src/org/greenstone/gatherer/GathererProg.java

    r8626 r8629  
    9191    GUIManager g_man
    9292        = gatherer.init(size, go.gsdl_path, go.gsdl3_path, go.local_library_path,
    93                  go.library_url, go.debug, go.perl_path,
     93                 go.library_url_string, go.debug, go.perl_path,
    9494                 go.no_load, go.filename, go.site_name,
    9595                 go.servlet_path, go.wget_version_str, go.wget_path);
  • trunk/gli/src/org/greenstone/gatherer/GetOpt.java

    r8626 r8629  
    4242    public String gsdl_path = null;
    4343    public String gsdl3_path = null;
    44     public String library_url = null;
     44    public String library_url_string = null;
    4545    public String local_library_path = null;
    4646    public String perl_path = null;
     
    185185            // Manually specify the Greenstone library URL
    186186            else if (argument_name.equals(StaticStrings.LIBRARY_URL_ARGUMENT)) {
    187             library_url = argument_value;
     187            library_url_string = argument_value;
    188188            }
    189189            // Parse the path to PERL. If not provided its assumes
  • trunk/gli/src/org/greenstone/gatherer/LocalLibraryServer.java

    r8627 r8629  
    5959    static private void config(String command)
    6060    {
     61    if (Configuration.library_url == null) {
     62        System.err.println("Error: Trying to configure local library with null Configuration.library_url!");
     63        return;
     64    }
     65
    6166    try {
    6267        URL url = new URL(Configuration.library_url.toString() + command);
  • trunk/gli/src/org/greenstone/gatherer/gui/CreatePane.java

    r8627 r8629  
    384384    tree.clearSelection();
    385385    tree.setSelectionPath(path);
     386
     387    // Validate the preview button
     388    if (Gatherer.c_man.built() && Configuration.library_url != null) {
     389        preview_button.setEnabled(true);
     390        simple_preview_button.setEnabled(true);
     391    }
     392    else {
     393        preview_button.setEnabled(false);
     394        simple_preview_button.setEnabled(false);
     395    }
    386396    }
    387397
     
    542552    }
    543553    tree.valueChanged(null);
    544    
    545     // now do the preview stuff
    546     if (!Gatherer.c_man.built() || Configuration.library_url == null) {
    547         preview_button.setEnabled(false);
    548         simple_preview_button.setEnabled(false);
    549     } else {
    550         preview_button.setEnabled(true);
    551         simple_preview_button.setEnabled(true);
    552     }
    553554    }
    554555
  • trunk/gli/src/org/greenstone/gatherer/gui/Preferences.java

    r8627 r8629  
    191191    library_path_label = new JLabel();
    192192    library_path_label.setPreferredSize(LABEL_SIZE);
    193     library_path_field = new JTextField(Configuration.library_url.toString());
     193    String library_url_string = "";
     194    if (Configuration.library_url != null) {
     195        library_url_string = Configuration.library_url.toString();
     196    }
     197    library_path_field = new JTextField(library_url_string);
    194198    library_path_field.setCaretPosition(0);
    195199    if (Gatherer.GS3) {
     
    613617        try {
    614618            Configuration.library_url = new URL(library_url_string);
    615             // Configuration.setString("general.library_url", true, library_url_string);
    616619        }
    617620        catch (MalformedURLException exception) {
     
    619622        }
    620623        }
     624        Configuration.setString("general.library_url", true, library_url_string);
     625
    621626        boolean site_changed = false;
    622627        if (Gatherer.GS3) {
Note: See TracChangeset for help on using the changeset viewer.