- Timestamp:
- 2007-08-06T11:36:26+12:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/greenstone3/ServletConfiguration.java
r13596 r14310 44 44 import javax.swing.*; 45 45 import javax.swing.plaf.*; 46 import org.greenstone.gatherer.Gatherer; 46 47 import org.greenstone.gatherer.DebugStream; 47 48 import org.greenstone.gatherer.util.ArrayTools; … … 49 50 import org.greenstone.gatherer.util.Utility; 50 51 import org.greenstone.gatherer.util.XMLTools; 52 import org.greenstone.gatherer.remote.RemoteGreenstoneServer; 51 53 import org.w3c.dom.*; 52 54 … … 68 70 69 71 //String web_xml_path = gsdl3_path + File.separator + "web" + File.separator + "WEB-INF"+ File.separator + "web.xml"; 70 File web_xml = new File(gsdl3_path + "WEB-INF"+ File.separator + "web.xml"); 71 72 File web_xml; 73 if (Gatherer.isGsdlRemote){ 74 web_xml = new File(gsdl3_path + "web.xml"); 75 }else{ 76 web_xml = new File(gsdl3_path + "WEB-INF"+ File.separator + "web.xml"); 77 } 72 78 if (!web_xml.exists()) { 73 79 DebugStream.println("Error: no web.xml found at "+web_xml.toString()); … … 76 82 77 83 this.sites = new ArrayList(); 84 if (Gatherer.isGsdlRemote){ 85 if (RemoteGreenstoneServer.downloadWebXMLFile().equals("")) { 86 System.err.println("Error: Could not download web.xml."); 87 System.exit(0); 88 } 89 String sites_on_server = RemoteGreenstoneServer.getSiteNames(); 90 if (sites_on_server.equals("")) { 91 // !! Something went wrong : could not get names of the sites 92 System.err.println("Error: Could not get names of the sites."); 93 System.exit(0); 94 } 95 96 String[] sites_arr=sites_on_server.split("-----"); 97 for (int i=0; i<sites_arr.length; i++){ 98 if (!(sites_arr[i].trim().equals(""))){ 99 this.sites.add(sites_arr[i].trim()); 100 } 101 } 102 }else{ 78 103 // find the sites 79 104 File start = new File(Utility.getSitesDir(gsdl3_path)); … … 86 111 } 87 112 } 88 113 } 89 114 this.mappings = new HashMap(); 90 115 Document web_config = XMLTools.parseXMLFile(web_xml.getAbsolutePath(), false);
Note:
See TracChangeset
for help on using the changeset viewer.