Changeset 8625


Ignore:
Timestamp:
2004-11-23T13:07:15+13:00 (19 years ago)
Author:
mdewsnip
Message:

Changed the old exec_path variable and option to library_url.

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

Legend:

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

    r8620 r8625  
    9797    static public Configuration self = null;
    9898
    99     /** The path (or url) to the webserver which is serving the Greenstone collection. */
    100     static public String exec_path = null;
    10199    /** The path to the Greenstone Suite installation directory. */
    102100    static public String gsdl_path = "";
     
    135133    /** Constructor.
    136134     * @param gsdl_path The path to the Greenstone directory as a <strong>String</strong>.
    137      * @param exec_path A <strong>String</strong> containing the path or url to the webserver serving the greenstone collections.
     135     * @param library_url A <strong>String</strong> containing the url of the Greenstone webserver.
    138136     * @param perl_path The path to the PERL executable, as a <strong>String</strong>.
    139137     * @param mirroring_enabled If true will override the config.xml fiel setting for mirroring.
    140138     * @param site_name The name of the Greenstone 3 site currently in use.
    141139     */
    142     public Configuration(String gsdl_path, String gsdl3_path, String exec_path, String perl_path, boolean mirroring_enabled, String site_name) {
     140    public Configuration(String gsdl_path, String gsdl3_path, String library_url, String perl_path, boolean mirroring_enabled, String site_name) {
    143141    super();
    144142    self = this;
     
    146144    this.gsdl_path = gsdl_path;
    147145    this.gsdl3_path = gsdl3_path;
    148     this.exec_path = exec_path;
    149146    this.mirroring_enabled = mirroring_enabled;
    150147    this.site_name = site_name;
    151148
    152     // The exec_path may contain an url address, in which case we blindly use that and leave it up to the user to worry about settings and resetting.
    153     DebugStream.println("EXEC_PATH = " + exec_path);
    154     if(exec_path != null && exec_path.length() > 0) {
     149    DebugStream.println("Library URL = " + library_url);
     150    if (library_url != null && library_url.length() > 0) {
    155151        try {
    156         exec_address = new URL(exec_path);
     152        exec_address = new URL(library_url);
    157153        }
    158154        catch (MalformedURLException error) {
    159         DebugStream.println("Not an address.");
    160         // !!! When the Local Library is used on Windows this exception is thrown -- needs to be fixed
    161         // DebugStream.printStackTrace(error);
     155        DebugStream.printStackTrace(error);
    162156        }
    163157    }
  • trunk/gli/src/org/greenstone/gatherer/Gatherer.java

    r8624 r8625  
    118118
    119119    public GUIManager init(Dimension size, String gsdl_path, String gsdl3_path, String local_library_path,
    120                String exec_path, boolean debug_enabled, String perl_path,
     120               String library_url, boolean debug_enabled, String perl_path,
    121121               boolean no_load, String open_collection,
    122122               String site_name, String servlet_path,
     
    153153    try {
    154154        // Load Config
    155         loadConfig(gsdl_path, gsdl3_path, exec_path, perl_path, mirroring_enabled, site_name);
     155        loadConfig(gsdl_path, gsdl3_path, library_url, perl_path, mirroring_enabled, site_name);
    156156
    157157        // I don't really know what this is for but I've moved it here from Configuration
     
    609609    /** Loads the configuration file if one exists. Otherwise it creates a new one. Currently uses serialization.
    610610     * @param gsdl_path The path to the gsdl directory, gathered from the startup arguments, and presented as a <strong>String</strong>.
    611      * @param exec_path The path to the library executable, gathered from the startup arguments, and presented as a <strong>String</strong>.
     611     * @param library_url The path to the library executable, gathered from the startup arguments, and presented as a <strong>String</strong>.
    612612     * @param perl_path The path to the PERL compiler as a <strong>String</strong>. Necessary for windows platform versions.
    613613     * @param mirroring_enabled
     
    619619     * @see org.greenstone.gatherer.Configuration
    620620     */
    621     private void loadConfig(String gsdl_path, String gsdl3_path, String exec_path, String perl_path, boolean mirroring_enabled, String site_name) {
     621    private void loadConfig(String gsdl_path, String gsdl3_path, String library_url, String perl_path, boolean mirroring_enabled, String site_name) {
    622622    try {
    623         new Configuration(gsdl_path, gsdl3_path, exec_path, perl_path, mirroring_enabled, site_name);
     623        new Configuration(gsdl_path, gsdl3_path, library_url, perl_path, mirroring_enabled, site_name);
    624624    }
    625625    catch (Exception error) {
  • trunk/gli/src/org/greenstone/gatherer/GathererApplet.java

    r8620 r8625  
    172172
    173173    g_man = gatherer.init(size, go.gsdl_path, go.gsdl3_path, go.local_library_path,
    174                     go.exec_path, go.debug, go.perl_path,
     174                    go.library_url, go.debug, go.perl_path,
    175175                    go.no_load, go.filename, go.site_name,
    176176                    go.servlet_path, go.mirroring_enabled,
  • trunk/gli/src/org/greenstone/gatherer/GathererProg.java

    r8621 r8625  
    9191    GUIManager g_man
    9292        = gatherer.init(size, go.gsdl_path, go.gsdl3_path, go.local_library_path,
    93                  go.exec_path, go.debug, go.perl_path,
     93                 go.library_url, go.debug, go.perl_path,
    9494                 go.no_load, go.filename, go.site_name,
    9595                 go.servlet_path, go.mirroring_enabled,
  • trunk/gli/src/org/greenstone/gatherer/GetOpt.java

    r8620 r8625  
    3939    public boolean no_load = false;
    4040
    41     public String exec_path = null;
    4241    public String extra = null;
    4342    public String filename = null;
    4443    public String gsdl_path = null;
    4544    public String gsdl3_path = null;
     45    public String library_url = null;
    4646    public String local_library_path = null;
    4747    public String perl_path = null;
     
    187187            else if (argument_name.equals(StaticStrings.LOCAL_LIBRARY_ARGUMENT)) {
    188188            local_library_path = argument_value;
    189 
    190 //          exec_path = argument_value;
    191 //          // If there is no colon in first five characters of
    192 //          // the exec_path (which would either be an existing
    193 //          // protocol, or a windows file path to say a local
    194 //          // library), we can append the protocol http://.
    195 //          if(argument_value.lastIndexOf(StaticStrings.COLON_CHARACTER, 5) == -1) {
    196 //              exec_path = StaticStrings.HTTP_PROTOCOL_STR + argument_value;
    197 //          }
    198 //          else {
    199 //              exec_path = argument_value;
    200 //          }
    201 //          // If the user has given us an address, but it ends
    202 //          // with a '/' we assume we're using the greenstone
    203 //          // library.cgi
    204 //          if(exec_path.startsWith(StaticStrings.HTTP_PROTOCOL_STR) && exec_path.endsWith(StaticStrings.URL_SEPARATOR_CHARACTER)) {
    205 //              exec_path = exec_path + StaticStrings.LIBRARY_STR;
    206 //          }
     189            }
     190            // Manually specify the Greenstone library URL
     191            else if (argument_name.equals(StaticStrings.LIBRARY_URL_ARGUMENT)) {
     192            library_url = argument_value;
    207193            }
    208194            // Parse the path to PERL. If not provided its assumes
  • trunk/gli/src/org/greenstone/gatherer/gems/GEMS.java

    r8593 r8625  
    190190    try {
    191191           
    192         config = new Configuration(go.gsdl_path, null, go.exec_path, go.perl_path, false, null);
     192        config = new Configuration(go.gsdl_path, null, null, go.perl_path, false, null);
    193193    }
    194194    catch (Exception exception) {
  • trunk/gli/src/org/greenstone/gatherer/util/StaticStrings.java

    r8618 r8625  
    155155    static final public String LEVELS_ELEMENT                             = "Levels";
    156156    static final public String LEVELS_STR                                 = "levels";
     157    static final public String LIBRARY_URL_ARGUMENT                       = "-library_url";
    157158    static final public String LOCAL_LIBRARY_ARGUMENT                     = "-local_library";
    158     static final public String LIBRARY_STR                                = "library";
    159159    static final public String LOAD_ARGUMENT                              = "-load";
    160160    static final public String MAC_OPEN_COMMAND                           = "open %1";
Note: See TracChangeset for help on using the changeset viewer.