Changeset 8214
- Timestamp:
- 2004-10-04T15:38:50+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r8044 r8214 327 327 328 328 try { 329 // first make sure that the collect directory exists 330 File collect_dir = new File(getCollectDirectory()); 331 if (!collect_dir.exists()) { 332 collect_dir.mkdirs(); 333 } 329 334 // Create a progress monitor. 330 335 ProgressMonitor progress = new ProgressMonitor(Gatherer.g_man, Dictionary.get("CollectionManager.Creating_New"), "mkcol.pl", 0, 7); 331 336 // Create the new collection. 332 337 makeCollection(description, email, name, title); 333 progress.setProgress(1);338 334 339 // ******************* 340 //check that this creation has worked - simply by checking for the existence of the collect.cfg file 335 341 String a_dir; 336 342 if (Gatherer.GS3) { … … 339 345 a_dir = Utility.getCollectionDir(Gatherer.config.gsdl_path, name); 340 346 } 347 File config_file = new File(Utility.getConfigFile(a_dir)); 348 if (!config_file.exists()) { 349 // no point continuing 350 Gatherer.println("The collection could not be created"); 351 progress.close(); 352 return; 353 } 354 progress.setProgress(1); 355 341 356 // ACTIVE_DIR/log/ 342 357 File log_dir_temp = new File(Utility.getLogDir(a_dir)+"temp.dat"); … … 1123 1138 } 1124 1139 GShell process = new GShell(command, GShell.NEW, COLLECT, this, null, GShell.GSHELL_NEW); 1125 process.addGShellListener(this);1126 1140 process.run(); // Don't bother threading this... yet 1127 1128 1141 } 1129 1142 … … 1200 1213 else if(event.getStatus() == GShell.ERROR || event.getStatus() == GShell.CANCELLED) { 1201 1214 Gatherer.println("There was an error in the gshell:"+ event.getMessage()); 1202 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Preview_Ready_Failed"), Dictionary.get("CollectionManager.Preview_Ready_Title"), JOptionPane.ERROR_MESSAGE); 1203 Gatherer.g_man.collectionChanged(ready()); 1215 if (event.getType() == GShell.NEW) { 1216 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Cannot_Create_Collection"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 1217 } else { 1218 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Preview_Ready_Failed"), Dictionary.get("CollectionManager.Preview_Ready_Title"), JOptionPane.ERROR_MESSAGE); 1219 Gatherer.g_man.collectionChanged(ready()); 1220 } 1221 1204 1222 Gatherer.g_man.repaint(); // It appears Java's own dialogs have the same not always painting correct area bug that I suffer from. Well I don't suffer from it personally, but my ModalDialog components do. 1205 1223 }
Note:
See TracChangeset
for help on using the changeset viewer.