Changeset 19758
- Timestamp:
- 2009-06-08T15:16:34+12:00 (15 years ago)
- Location:
- gli/trunk/src/org/greenstone/gatherer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/Gatherer.java
r19678 r19758 121 121 static public boolean isApplet = false; 122 122 static public boolean isGsdlRemote = false; 123 static public boolean isLocalLibrary = false; 123 124 124 125 /* TODO: If we're using local GLI, collections are built locally. If we're using client-GLI … … 349 350 } 350 351 else { // local greenstone: Start up the local library server, if that's what we want 351 if (local_library_path != null && !GS3) { 352 LocalLibraryServer.start(gsdl_path, local_library_path); 353 } 352 if (!GS3) { 353 isLocalLibrary = LocalLibraryServer.start(gsdl_path, local_library_path); 354 } 355 // else web library: GS server is local, but doesn't use the webserver included with GS2 354 356 } 355 357 … … 369 371 // It is not necessary if an independent GSI was launched and the user hasn't pressed Enter Library yet 370 372 DebugStream.println("Configuration.library_url = " + Configuration.library_url); 371 if (Configuration.library_url == null && ( LocalLibraryServer.isRunning()&& !LocalLibraryServer.isURLPending())) {373 if (Configuration.library_url == null && (isLocalLibrary && !LocalLibraryServer.isURLPending())) { 372 374 missingEXEC(); 373 375 } -
gli/trunk/src/org/greenstone/gatherer/greenstone/LocalLibraryServer.java
r19585 r19758 162 162 } 163 163 164 static public voidstart(String gsdl_path, String local_library_server_file_path)164 static public boolean start(String gsdl_path, String local_library_server_file_path) 165 165 { 166 // Check the local library server file (server.exe or gs2-server.sh) exists167 local_library_server_file = new File(local_library_server_file_path);168 169 if (!local_library_server_file.exists()) {170 DebugStream.println("No local library at given file path.");171 172 String defaultServerFilename = Utility.isWindows() ? "server.exe" : "gs2-server.sh";173 local_library_server_file = new File(gsdl_path + defaultServerFilename);174 if (!local_library_server_file.exists()) {175 DebugStream.println("No local library at all.");176 return;177 }178 }179 180 166 // In the case of the Local Library Server on Linux, we need to do an extra test: 181 167 // If GS2 was not configured with --enable-apache-httpd, then there is no apache webserver folder, … … 187 173 DebugStream.println("The web server does not exist at " 188 174 + localLinuxServerFolder.getAbsolutePath() + "\nNo local library at all. Trying web library"); 189 return; 190 } 191 } 175 return false; 176 } 177 } 178 179 // Check the local library server file (server.exe or gs2-server.sh) exists 180 if(local_library_server_file_path == null) { 181 return false; 182 } 183 local_library_server_file = new File(local_library_server_file_path); 184 if (!local_library_server_file.exists()) { 185 DebugStream.println("No local library at given file path."); 186 187 String defaultServerFilename = Utility.isWindows() ? "server.exe" : "gs2-server.sh"; 188 local_library_server_file = new File(gsdl_path + defaultServerFilename); 189 if (!local_library_server_file.exists()) { 190 DebugStream.println("No local library at all."); 191 return false; 192 } 193 } 192 194 193 195 llssite_cfg_file = new LLSSiteConfig(local_library_server_file); 194 196 if(!llssite_cfg_file.isConfigFileSet()) { 197 return false; 198 } 199 200 // from now on return true: we're in local_library_mode (even if the server is not running) 201 202 195 203 // If the user launched the GSI independent of GLI, but user has not pressed 196 204 // Enter Library yet, then we will obtain the previewURL later. 197 205 if(LocalLibraryServer.isURLPending()) { 198 206 // running is still false when the URL is pending because only GSI is running, not the server 199 return ;207 return true; 200 208 } else if(llssite_cfg_file.isIndependentGSI()) { 201 209 // there is a url, it's not pending, and it is llssite.cfg: meaning GSI has started up 202 210 running = true; 203 return ;211 return true; 204 212 } 205 213 … … 219 227 // Run the server interface 220 228 Gatherer.spawnApplication(local_library_server_command, ID); 221 return ;229 return true; 222 230 } 223 231 catch (MalformedURLException exception) { … … 250 258 } 251 259 } 260 261 return true; 252 262 } 253 263 … … 584 594 lastModified = configFile.lastModified(); 585 595 return true; 596 } 597 598 /** To test we've actually instantiated this object meaningfully. If so, then configFile is set */ 599 public boolean isConfigFileSet() { 600 return (configFile != null && configFile.exists()); 586 601 } 587 602 -
gli/trunk/src/org/greenstone/gatherer/gui/PreviewButton.java
r19752 r19758 88 88 } 89 89 90 if( !Gatherer.isGsdlRemote) {90 if(Gatherer.isLocalLibrary) { 91 91 // check that the local library server is still running - doesn't do anything if it's not supposed to be running 92 92 // !! Don't like this here 93 93 LocalLibraryServer.checkServerRunning(); 94 if(LocalLibraryServer.is Running() && LocalLibraryServer.isURLPending()) {94 if(LocalLibraryServer.isURLPending()) { 95 95 // Remind the user to press Enter Library, and return from this method 96 96 JOptionPane.showMessageDialog(Gatherer.g_man,
Note:
See TracChangeset
for help on using the changeset viewer.