Changeset 32357 for main/trunk/greenstone3/src
- Timestamp:
- 2018-08-22T22:08:05+12:00 (6 years ago)
- Location:
- main/trunk/greenstone3/src/java/org/greenstone
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/FedoraServiceProxy.java
r28966 r32357 39 39 import org.greenstone.gsdl3.util.OID; 40 40 import org.greenstone.gsdl3.util.XMLConverter; 41 import org.greenstone.util.ProtocolPortProperties; 41 42 import org.w3c.dom.Document; 42 43 import org.w3c.dom.Element; … … 142 143 globalProperties.load(Class.forName("org.greenstone.util.GlobalProperties").getClassLoader().getResourceAsStream("global.properties")); 143 144 String host = globalProperties.getProperty("tomcat.server", "localhost"); 144 String port = globalProperties.getProperty("tomcat.port", "8383"); 145 String protocol = "http"; 145 ProtocolPortProperties protocolPortProps = new ProtocolPortProperties(globalProperties); 146 if(protocolPortProps.hadError()) { 147 logger.error("Error with port/protocol in global.properties: " + protocolPortProps.getErrorMsg()); 148 return false; // configure has failed 149 } 150 String protocol = protocolPortProps.getProtocol(); 151 String port = protocolPortProps.getPort(); 152 146 153 String username = "fedoraIntCallUser"; //"fedoraAdmin" 147 154 String password = "changeme"; //"<user password>" -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/ServletRealmCheck.java
r28959 r32357 29 29 import java.net.URLConnection; 30 30 import java.util.Properties; 31 32 import org.greenstone.util.ProtocolPortProperties; 31 33 32 34 /** … … 86 88 // get the property value and print it out 87 89 String servername = buildProps.getProperty("tomcat.server"); 88 String port = buildProps.getProperty("tomcat.port"); 90 //String protocol = buildProps.getProperty("server.protocol", "http"); 91 //String port = buildProps.getProperty("tomcat.port"+protocol, "8383"); 92 93 ProtocolPortProperties protocolPortProps = new ProtocolPortProperties(buildProps); 94 if(protocolPortProps.hadError()) { 95 throw new Exception("**** ERROR with port and/or protocol in build.properties:\n" + protocolPortProps.getErrorMsg()); 96 } 97 String protocol = protocolPortProps.getProtocol(); 98 String port = protocolPortProps.getPort(); 89 99 int portNum = Integer.parseInt(port); 90 100 … … 94 104 urlSuffix = urlSuffix + "&col="+collection; 95 105 } 96 URL authenticationUrl = new URL( "http", servername, portNum, urlSuffix);106 URL authenticationUrl = new URL(protocol, servername, portNum, urlSuffix); 97 107 98 108 HttpURLConnection conn = (HttpURLConnection)authenticationUrl.openConnection(); … … 120 130 System.out.print(result); // don't add newline to end 121 131 122 } catch ( IOException ex) {132 } catch (Exception ex) { 123 133 ex.printStackTrace(); 124 134 } finally { -
main/trunk/greenstone3/src/java/org/greenstone/server/Server3.java
r32329 r32357 11 11 import org.greenstone.server.BaseProperty; 12 12 import org.greenstone.util.GlobalProperties; 13 import org.greenstone.util.ProtocolPortProperties; 13 14 import org.greenstone.util.RunAnt; 14 15 … … 16 17 { 17 18 String opt_ant_properties = null; 19 ProtocolPortProperties protocolPortProps = null; 18 20 19 21 public Server3(String gsdl3_src_home, String lang) … … 21 23 super(gsdl3_src_home, lang, gsdl3_src_home + File.separatorChar + "build.properties", "web"+File.separator+"logs"); 22 24 23 Property = new Server3Property(); 25 // config properties are loaded into the config_properties object 26 // now test the port and protocol values are sane or exit. 27 protocolPortProps = new ProtocolPortProperties(config_properties); 28 if(protocolPortProps.hadError()) { 29 String errorMsg = "Error with port/protocol in " + config_properties_file + ": " + protocolPortProps.getErrorMsg(); 30 31 // print it everywhere, because port/protocol misconfiguration is a fatal error and we're exiting 32 logger_.error(errorMsg); 33 System.err.println(errorMsg); 34 // If error, then quit this app as soon as possible 35 System.exit(-1); 36 } 37 38 Property = protocolPortProps.legacyMode ? new Server3Property() : new Server3Property(protocolPortProps.getProtocol()); 24 39 25 40 String frame_title = dictionary.get("ServerControl.Frame_Title"); -
main/trunk/greenstone3/src/java/org/greenstone/server/Server3Property.java
r29845 r32357 14 14 } 15 15 16 Server3Property(String protocol) 17 { 18 // Initialising customised final variables 19 // Version number, WEB_PORT, autoenter, startbrowser 20 // For GS3, the last two are controlled by the same property 21 super("3", "tomcat.port."+protocol, "server.auto.start", "server.auto.start", 22 "server.keep.port", "server.external.access"); 23 } 16 24 } -
main/trunk/greenstone3/src/java/org/greenstone/util/GlobalProperties.java
r32344 r32357 181 181 182 182 //port 183 portSpecifier = properties.getProperty("tomcat.port"); 183 portSpecifier = properties.getProperty("tomcat.port"); // support for legacy tomcat.port? 184 if(portSpecifier == null) { 185 portSpecifier = protocolSpecifier.startsWith("https") ? properties.getProperty("tomcat.port.https") : properties.getProperty("tomcat.port.http"); 186 } 184 187 if (portSpecifier == null || portSpecifier.equals("") 185 188 || (protocolSpecifier.equals("http://") && portSpecifier.equals("80"))
Note:
See TracChangeset
for help on using the changeset viewer.