Changeset 10540


Ignore:
Timestamp:
2005-08-19T13:40:25+12:00 (19 years ago)
Author:
mdewsnip
Message:

Added a "-use_remote_greenstone" argument, and added the "gliserver_url" argument to the configRemote.xml file.

Location:
trunk/gli
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/classes/dictionary.properties

    r10388 r10540  
    770770MissingEXEC_GS3.Message:Warning! You will not be able to view your new collections within the Librarian Interface unless you specify the path to the Greenstone context in the locally running Tomcat Webserver. You can enter this now in the text field below, or later by going to Preferences and choosing the Connection tab. Remember that a valid url must start with the protocol "http://". The default address is http://localhost:8080/gsdl3.
    771771MissingEXEC_GS3.Title:Missing Greenstone Library Address
     772#***** Missing GLIServer *****
     773MissingGLIServer.Message:Warning! You will not be able to work with collections within the Librarian Interface unless you specify the address of the remote Greenstone "gliserver" script. You can enter this now in the text field below, or later by going to Preferences and choosing the Connection tab. Remember that a valid URL must start with the protocol "http://" and end with "gliserver".
     774MissingGLIServer.Title:Missing GLIServer Address
    772775#***** Missing GSDL *****
    773776MissingGSDL.Message:Warning! You will not be able to access all of the Librarian Interface's features without a local copy of Greenstone Digital Library also installed. If you believe you are receiving this message in error please check your installation, and the paths specified in Librarian Interface batch or script file.
  • trunk/gli/classes/xml/configRemote.xml

    r10390 r10540  
    2828]>
    2929
    30 <Configuration version="2.61">
     30<Configuration version="2.61a">
    3131  <GathererConfig>
    3232    <!-- ***** General Options: apply globally to the GLI execution. ***** -->
     
    3737    <!-- The standard font used in the Gatherer. [Verdana, BOLD, 12] -->
    3838    <Argument name="general.font">Verdana, BOLD, 12</Argument>
     39    <Argument name="general.gliserver_url"/>
    3940    <Argument name="general.library_url"/>
    4041    <Argument name="general.locale">en_NZ</Argument>
     
    9899    <Argument name="warning.MissingEXEC">true</Argument>
    99100    <Argument name="warning.MissingGSDL">true</Argument>
     101    <Argument name="warning.MissingGLIServer">true</Argument>
    100102    <Argument name="warning.MissingImageMagick">true</Argument>
    101103    <Argument name="warning.MissingPERL">true</Argument>
  • trunk/gli/src/org/greenstone/gatherer/Configuration.java

    r10461 r10540  
    129129    static private String wget_version_str = StaticStrings.NO_WGET_STR;
    130130
     131    static public URL gliserver_url = null;
    131132    static public URL library_url = null;
    132133
     
    182183        catch (MalformedURLException exception) {
    183184        DebugStream.printStackTrace(exception);
     185        }
     186    }
     187
     188    // Read the Greenstone gliserver URL from the config file, if using a remote Greenstone
     189    if (Gatherer.isGsdlRemote) {
     190        String gliserver_url_string = getString("general.gliserver_url", true);
     191        if (!gliserver_url_string.equals("")) {
     192        try {
     193            gliserver_url = new URL(gliserver_url_string);
     194        }
     195        catch (MalformedURLException exception) {
     196            DebugStream.printStackTrace(exception);
     197        }
    184198        }
    185199    }
  • trunk/gli/src/org/greenstone/gatherer/Gatherer.java

    r10518 r10540  
    9393    static public boolean isApplet = false;
    9494    static public boolean isGsdlRemote = false;
    95     static public String cgiBase = "";
     95    static public String cgiBase = null;
    9696
    9797    // feedback stuff
     
    129129    }
    130130
    131     // If a gliserver URL has been specified, we're using remote building
    132     if (go.gliserver_url_string != null) {
     131    // Are we using a remote Greenstone?
     132    if (go.use_remote_greenstone) {
    133133        isGsdlRemote = true;
    134         cgiBase = go.gliserver_url_string.substring(0, go.gliserver_url_string.lastIndexOf('/') + 1);
    135 
    136         // With remote building we use our own collect directory, since we can't use the Greenstone one
    137         setCollectDirectoryPath(getGLIUserDirectoryPath() + "collect" + File.separator);
    138134
    139135        // We don't have a local Greenstone!
    140136        go.gsdl_path = null;
    141     }
    142 
    143     // We have a local Greenstone
    144     if (!isGsdlRemote) {
     137
     138        // We have to use our own collect directory since we can't use the Greenstone one
     139        setCollectDirectoryPath(getGLIUserDirectoryPath() + "collect" + File.separator);
     140
     141        // If a gliserver URL has been specified...
     142        if (go.gliserver_url_string != null) {
     143        cgiBase = go.gliserver_url_string.substring(0, go.gliserver_url_string.lastIndexOf('/') + 1);
     144        }
     145    }
     146    // No, we have a local Greenstone
     147    else {
    145148        LocalGreenstone.setDirectoryPath(go.gsdl_path);
    146149    }
     
    151154    }
    152155
    153     // Special code for running with a remote Greenstone
     156    // More special code for running with a remote Greenstone
    154157    if (isGsdlRemote) {
    155158        Configuration.TEMPLATE_CONFIG_XML = "xml/configRemote.xml";
     
    173176    }
    174177
    175     init(go.gsdl_path, go.gsdl3_path, go.gsdl3_src_path, go.local_library_path, go.library_url_string, go.debug,
    176          go.perl_path, go.no_load, go.filename, go.site_name, go.servlet_path, go.wget_path);
     178    init(go.gsdl_path, go.gsdl3_path, go.gsdl3_src_path, go.local_library_path, go.library_url_string,
     179         go.gliserver_url_string, go.debug, go.perl_path, go.no_load, go.filename, go.site_name,
     180         go.servlet_path, go.wget_path);
    177181    }
    178182
    179183
    180184    public void init(String gsdl_path, String gsdl3_path, String gsdl3_src_path, String local_library_path,
    181              String library_url_string, boolean debug_enabled, String perl_path,
    182              boolean no_load, String open_collection,
     185             String library_url_string, String gliserver_url_string, boolean debug_enabled,
     186             String perl_path, boolean no_load, String open_collection,
    183187             String site_name, String servlet_path, String wget_path)
    184188    {
     
    273277        if (Configuration.library_url == null) {
    274278        missingEXEC();
     279        }
     280
     281        // The "-gliserver_url" option overwrites anything in the config files
     282        if (gliserver_url_string != null && gliserver_url_string.length() > 0) {
     283        try {
     284            System.err.println("Setting gliserver_url to " + gliserver_url_string + "...");
     285            Configuration.gliserver_url = new URL(gliserver_url_string);
     286        }
     287        catch (MalformedURLException error) {
     288            DebugStream.printStackTrace(error);
     289        }
     290        }
     291
     292        // If we're using a remote Greenstone we need to know where the gliserver script is
     293        System.err.println("Configuration.gliserver_url = " + Configuration.gliserver_url);
     294        if (isGsdlRemote && Configuration.gliserver_url == null) {
     295        missingGLIServer();
    275296        }
    276297
     
    683704        try {
    684705        Configuration.library_url = new URL(library_url_string);
     706        }
     707        catch (MalformedURLException exception) {
     708        DebugStream.printStackTrace(exception);
     709        }
     710    }
     711    }
     712
     713
     714    static private void missingGLIServer()
     715    {
     716    WarningDialog dialog = new WarningDialog("warning.MissingGLIServer", "MissingGLIServer.Title", Dictionary.get("MissingGLIServer.Message"), "general.gliserver_url", false);
     717    dialog.setValueField(new URLField(Configuration.getColor("coloring.editable_foreground", false), Configuration.getColor("coloring.editable_background", false), Configuration.getColor("coloring.error_foreground", false), Configuration.getColor("coloring.error_background", false)));
     718    dialog.display();
     719    dialog.dispose();
     720    dialog = null;
     721
     722    String gliserver_url_string = Configuration.getString("general.gliserver_url", true);
     723    if (!gliserver_url_string.equals("")) {
     724        try {
     725        Configuration.gliserver_url = new URL(gliserver_url_string);
    685726        }
    686727        catch (MalformedURLException exception) {
  • trunk/gli/src/org/greenstone/gatherer/GathererApplet.java

    r10396 r10540  
    120120        // }
    121121
    122     String[] args = { "-gliserver_url", gliserver_url_string,
     122    String[] args = { "-use_remote_greenstone",
     123              "-gliserver_url", gliserver_url_string,
    123124              "-library_url", library_url_string,
    124125                    };
  • trunk/gli/src/org/greenstone/gatherer/GetOpt.java

    r10367 r10540  
    3737    public boolean feedback_enabled = false;
    3838    public boolean no_load = false;
     39    public boolean use_remote_greenstone = false;
    3940
    4041    public String collect_directory_path = null;
     
    135136            filename = null;
    136137            }
     138            // Use a remote Greenstone rather than a local one
     139            else if (argument_name.equals(StaticStrings.USE_REMOTE_GREENSTONE_ARGUMENT)) {
     140            use_remote_greenstone = true;
     141            }
    137142        }
    138143        // 3b. Now for those that do
  • trunk/gli/src/org/greenstone/gatherer/util/StaticStrings.java

    r10527 r10540  
    233233    static final public String UNKNOWNPLUG_STR                             = "UnknownPlug";
    234234    static final public String USE_METADATA_FILES_ARGUMENT                = "use_metadata_files";
     235    static final public String USE_REMOTE_GREENSTONE_ARGUMENT             = "-use_remote_greenstone";
    235236    static final public String URL_SEPARATOR_CHARACTER                    = "/";
    236237    static final public String VALUE_ATTRIBUTE                            = "value";
Note: See TracChangeset for help on using the changeset viewer.