Changeset 14567


Ignore:
Timestamp:
2007-09-25T10:13:24+12:00 (15 years ago)
Author:
qq6
Message:

if Configuration.library_url is given, assume a default Configuration.gliserver_urlGatherer.java

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

Legend:

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

    r12115 r14567  
    6464    private JPasswordField password = null;
    6565    /** The default size of this dialog. */
    66     static final private Dimension SIZE = new Dimension(410,140);
     66    static final private Dimension SIZE = new Dimension(470,160);
    6767
    6868    /** Constructor. */
  • gli/trunk/src/org/greenstone/gatherer/Gatherer.java

    r14372 r14567  
    132132    }
    133133
     134    static private URL default_gliserver_url=null;
    134135
    135136    public Gatherer(String[] args)
     
    291292        if (Configuration.library_url == null) {
    292293        missingEXEC();
    293         if ((Configuration.library_url!=null) && isGsdlRemote && GS3 && (gliserver_url_string==null)){
    294             Configuration.gliserver_url = new URL(Configuration.library_url.toString() + "/cgi-bin/gliserver4gs3.pl");
    295             gliserver_url_string = Configuration.gliserver_url.toString();
    296             Configuration.setString("general.gliserver_url", true, gliserver_url_string);
     294        if ((Configuration.library_url!=null) && isGsdlRemote && (gliserver_url_string==null)){
     295            if (GS3){
     296            default_gliserver_url = new URL(Configuration.library_url.toString() + "/cgi-bin/gliserver4gs3.pl");
     297            }else{
     298            default_gliserver_url = new URL(Configuration.library_url.toString().substring(0,Configuration.library_url.toString().lastIndexOf("/library")) + "/gliserver.pl");
     299            }
     300            missingGLIServer();
    297301        }
    298302        }
     
    313317        if (isGsdlRemote) {
    314318        if (Configuration.gliserver_url == null) {
     319            if (Configuration.library_url != null) {
     320            if (GS3){
     321                default_gliserver_url = new URL(Configuration.library_url.toString() + "/cgi-bin/gliserver4gs3.pl");
     322            }else{
     323                default_gliserver_url = new URL(Configuration.library_url.toString().substring(0,Configuration.library_url.toString().lastIndexOf("/library")) + "/gliserver.pl");
     324            }
     325            }
    315326            missingGLIServer();
    316327        }
     
    781792    }
    782793    dialog.setValueField(new URLField(Configuration.getColor("coloring.editable_foreground", false), Configuration.getColor("coloring.editable_background", false)));
     794   
     795    if (Gatherer.default_gliserver_url!=null){
     796        dialog.setValueField(Gatherer.default_gliserver_url.toString());
     797    }
     798   
    783799    dialog.display();
    784800    dialog.dispose();
    785801    dialog = null;
    786 
     802   
    787803    String gliserver_url_string = Configuration.getString("general.gliserver_url", true);
    788804    if (!gliserver_url_string.equals("")) {
  • gli/trunk/src/org/greenstone/gatherer/gui/WarningDialog.java

    r13397 r14567  
    154154        if(affected_property != null && Configuration.self != null) {
    155155        String value = value_field.getText();
     156        System.out.println("-------- warningdialog value: "+value);
    156157        if(value.length() > 0) {
    157158           if(value_field instanceof URLField) {
    158159              bad_value = !((URLField)value_field).validateURL();
     160              System.out.println("-------- warningdialog bad_value: "+bad_value);
    159161           }
    160162           if(!bad_value) {
    161163              // Store the value of the property
    162164              Configuration.setString(affected_property, true, value_field.getText());
     165              System.out.println("-------- warningdialog affected_property: "+affected_property);
     166              System.out.println("-------- warningdialog value_field.getText(): "+value_field.getText());
     167              System.out.println("-------- warningdialog Configuration.getString(general.gliserver_url, true): "+Configuration.getString("general.gliserver_url", true));     
    163168           }
    164169        }
     
    166171        if(!bad_value) {
    167172        result = JOptionPane.OK_OPTION;
     173        System.out.println("-------- warningdialog result: "+result);
    168174        }
    169175    }
     
    251257    }
    252258    }
     259
     260    public void setValueField(String field_value){
     261    this.value_field.setText(field_value);
     262    }
     263
    253264}
Note: See TracChangeset for help on using the changeset viewer.