Changeset 16272
- Timestamp:
- 2008-07-02T11:51:05+12:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/collection/CollectionManager.java
r16265 r16272 559 559 // for remote case, scheduling causes an Exception on creating a new collection that 560 560 // can't be recovered from. For GS3, it doesn't work since it it trying to access etc/main.cfg 561 if ( !Gatherer.isGsdlRemote && !Gatherer.GS3) {561 if (canDoScheduling()) { 562 562 scheduling(); 563 563 } … … 680 680 //try to obtain email address of Greenstone installation webmaster for - used to indicate "sender". 681 681 File mcfg = new File(LocalGreenstone.getDirectoryPath() + File.separator + "etc" + File.separator + "main.cfg"); 682 if(!mcfg.exists()) {683 System.out.println("Cannot do scheduling, since there is no file: " + mcfg.getAbsolutePath()684 + ".\nScheduling presently depends on GLI running from inside a GS2.");685 return;686 }687 682 BufferedReader maincfg = new BufferedReader(new FileReader(mcfg)); 688 683 stmp = ""; … … 1219 1214 } 1220 1215 1221 if ( !Gatherer.isGsdlRemote && !Gatherer.GS3) {1216 if (canDoScheduling()) { 1222 1217 //THIS LOOKS LIKE THE BEST PLACE TO TRY AND UPDATE .col FILES FOR EXISTING COLLECTIONS...Wendy 1223 1218 … … 1290 1285 } 1291 1286 1292 if ( !Gatherer.isGsdlRemote && !Gatherer.GS3) {1287 if (canDoScheduling()) { 1293 1288 scheduling(); 1294 1289 } … … 1354 1349 } 1355 1350 1351 /** At present, scheduling only works for GS2, only when GS2 is local and only when GLI runs from 1352 * within a GS2 installation. This method can be adjusted as scheduling becomes available for more 1353 * more situations. */ 1354 private boolean canDoScheduling() { 1355 if(Gatherer.isGsdlRemote) { 1356 return false; 1357 } 1358 if(Gatherer.GS3) { 1359 return false; 1360 } 1361 1362 // GS2's etc/main.cfg is necessary for scheduling, but scheduling looks for it locally: 1363 // it assumes GLI is inside a GS2 installation 1364 File mcfg = new File(LocalGreenstone.getDirectoryPath() + File.separator + "etc" + File.separator + "main.cfg"); 1365 if(!mcfg.exists()) { 1366 System.out.println("Cannot do scheduling, since there is no file: " + mcfg.getAbsolutePath() 1367 + ".\nScheduling presently depends on GLI running from inside a GS2."); 1368 return false; 1369 } 1370 1371 return true; 1372 } 1356 1373 1357 1374 private void makeCollection(String name, String email)
Note:
See TracChangeset
for help on using the changeset viewer.