Changeset 36104


Ignore:
Timestamp:
2022-03-11T10:34:49+13:00 (2 years ago)
Author:
kjdon
Message:

added some handling around getting the default servlet path from gliserver. no longer want to assume library

Location:
main/trunk/gli/src/org/greenstone/gatherer/remote
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/remote/RemoteGreenstoneServer.java

    r34285 r36104  
    136136    }
    137137
     138    // get the default servlet path from the server -- for a remote GLI of GS3
     139    public String getDefaultServletPath() {
     140    return performAction(new RemoteGreenstoneServerAction.GetDefaultServletPathAction());
     141    }
    138142    public String moveCollectionFile(String collection_name, File source_collection_file, File target_collection_file)
    139143    {
     
    604608    cgi_args += "&ts=" + System.currentTimeMillis();
    605609    if (Gatherer.GS3){
    606         cgi_args += "&site=" + Configuration.site_name;
     610        String site_name = Configuration.site_name;
     611        if (site_name != null && !site_name.equals("")) {
     612        cgi_args += "&site=" + Configuration.site_name;
     613        }
    607614        String library_servlet_name = Configuration.servlet_path;
    608         if (library_servlet_name.charAt(0) == '/') {
    609         library_servlet_name = library_servlet_name.substring(1);
    610         }
    611         cgi_args += "&servlet=" + library_servlet_name;
     615        if (library_servlet_name != null && !library_servlet_name.equals("")) {
     616        if (library_servlet_name.charAt(0) == '/') {
     617            library_servlet_name = library_servlet_name.substring(1);
     618        }
     619        cgi_args += "&servlet=" + library_servlet_name;
     620        }
    612621    }
    613622
  • main/trunk/gli/src/org/greenstone/gatherer/remote/RemoteGreenstoneServerAction.java

    r34161 r36104  
    494494    /**
    495495     * --------------------------------------------------------------------------------------------
     496     *    GET DEFAULT SERVLET PATH // for a remote GS3
     497     * --------------------------------------------------------------------------------------------
     498     */
     499    static class GetDefaultServletPathAction
     500    extends RemoteGreenstoneServerAction
     501    {
     502    public GetDefaultServletPathAction()
     503    {}
     504
     505    public void perform()
     506        throws Exception
     507    {
     508        progress_bar.setAction("Getting default servlet ...");
     509
     510        String get_script_options_command = "cmd=get-default-servlet-path";
     511        action_output = remote.sendCommandToServer(get_script_options_command, null);
     512    }
     513    }
     514
     515    /**
     516     * --------------------------------------------------------------------------------------------
    496517     *    MOVE COLLECTION FILE
    497518     * --------------------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.