Changeset 34113


Ignore:
Timestamp:
2020-05-19T11:34:40+12:00 (4 years ago)
Author:
ak19
Message:
  1. tomcat.port no longer exists in build.properties after https also supported. GLI now goes through ProtocolPortProperties.java (which supports legacy tomcat.port) to work out the port number and the protocol, just like GS3 runtime code has been doing for a while now. The greenstone3 context is also not to be hardcoded to greenstone3, but to be read in from the build.properties file. 2. Have to add a copy of GS3 runtime src's ProtocolPortProperties.java into GLI. Anything better than such code duplication? GLI also has what is largely a copy of SafeProcess.java, although there may be minor diffs there with the GS3 runtime code version. 3. Removed unused imports from FedoraLogin.java.
Location:
main/trunk/gli/src/org/greenstone/gatherer
Files:
1 added
2 edited

Legend:

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

    r32926 r34113  
    5151import org.greenstone.gatherer.greenstone.LocalLibraryServer;
    5252import org.greenstone.gatherer.greenstone.Plugins;
     53import org.greenstone.gatherer.greenstone3.ProtocolPortProperties;
    5354import org.greenstone.gatherer.greenstone3.ServletConfiguration;
    5455import org.greenstone.gatherer.gui.GUIManager;
     
    12521253        // specified in the build.properties located in the gsdl3_src_path
    12531254        if (GS3) {
     1255            // defaults
    12541256            String host = "localhost";
    12551257            String port = "8383";
     1258            String context = "greenstone3";
     1259            String protocol = "http";
    12561260           
    12571261            File buildPropsFile = new File(Configuration.gsdl3_src_path + File.separator + "build.properties");
     
    12601264                try{
    12611265                    props.load(new FileInputStream(buildPropsFile));
    1262                     host = props.getProperty("tomcat.server", host);
    1263                     port = props.getProperty("tomcat.port", port);
     1266                    host = props.getProperty("tomcat.server", host);
     1267                    context = props.getProperty("greenstone.context", context);
     1268                    ProtocolPortProperties protocolPortProps = new ProtocolPortProperties(props); // can throw Exception
     1269                    // Use ProtocolPortProperties to get the tomcat port and protocol used
     1270                    protocol = protocolPortProps.getProtocol();
     1271                    port = protocolPortProps.getPort();
    12641272                }catch(Exception e){
    12651273                    DebugStream.println("Could not load build.properties file");
     
    12681276                props = null;
    12691277            }
    1270             String defaultURL = "http://"+host+":"+port+"/"+"greenstone3";
     1278            String defaultURL = protocol+"://"+host+":"+port+"/"+context;
    12711279            field.setText(defaultURL);
    12721280            field.selectAll();
  • main/trunk/gli/src/org/greenstone/gatherer/gui/FedoraLogin.java

    r18412 r34113  
    3737
    3838import java.io.File;
    39 import java.io.FileInputStream;
    40 import java.io.FileOutputStream;
    4139import java.io.IOException;
    4240
Note: See TracChangeset for help on using the changeset viewer.