Changeset 5996
- Timestamp:
- 2003-11-25T16:23:23+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r5893 r5996 544 544 return Utility.getCollectionDir(Gatherer.config.gsdl_path) + collection.getName() + File.separator + collection.getName() + ".col"; 545 545 } 546 /** Constructs the absolute filename of the collection images directory, which should resemble "$GSDLHOME/collect/<col_name>/images/" 547 * @return A <strong>String</strong> containing the filename. 548 * @see org.greenstone.gatherer.Configuration 549 * @see org.greenstone.gatherer.Gatherer 550 * @see org.greenstone.gatherer.collection.Collection 551 * @see org.greenstone.gatherer.util.Utility 552 */ 553 public String getCollectionImages() { 554 return Utility.getCollectionDir(Gatherer.config.gsdl_path) + collection.getName() + File.separator + StaticStrings.IMAGES_FOLDER; 555 } 546 556 /** Constructs the absolute filename of the collection import directory, which should resemble "$GSDLHOME/collect/<col_name>/import/" 547 557 * @return A <strong>String</strong> containing the filename. … … 717 727 return false; 718 728 } 729 // Check that there is the collection configuration file available 730 719 731 File collection_file = new File(location); 720 732 // Ensure that the directory exists. … … 761 773 // Open the collection file 762 774 collection = new Collection(collection_file); 775 if(collection.getTitle().equals(StaticStrings.ERROR_STR)) { 776 collection = null; 777 // Remove lock file 778 if(lock_file.exists()) { 779 lock_file.delete(); 780 } 781 throw(new Exception(Dictionary.get("CollectionManager.Missing_Config"))); 782 } 783 763 784 collection.msm = new MetadataSetManager(); 764 785 msm = collection.msm; // Legacy … … 807 828 // There is obviously no existing collection present. 808 829 Gatherer.printStackTrace(error); 809 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Cannot_Open", args2), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 830 if(error.getMessage() != null) { 831 String[] args = new String[2]; 832 args[0] = args2[0]; 833 args[1] = error.getMessage(); 834 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Cannot_Open_With_Reason", args), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 835 } 836 else { 837 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Cannot_Open", args2), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 838 } 810 839 } 811 840 … … 1023 1052 // If we were running an import, now run a build. 1024 1053 if(event.getType() == GShell.IMPORT && event.getStatus() != GShell.ERROR) { 1025 1054 // Finish import. 1026 1055 collection.setImported(true); 1027 1056 buildCollection(); … … 1029 1058 // If we were running a build, now is when we move files across. 1030 1059 else if(event.getType() == GShell.BUILD && event.getStatus() != GShell.ERROR) { 1031 ///ystem.err.println("Installing collection."); 1032 installCollection(); 1033 // If we have a local library running (that we know about) then we ask it to add our newly create collection 1034 ///ystem.err.println("Check if we should reset local server."); 1035 if(Gatherer.config.exec_file != null) { 1036 ///ystem.err.println("Local Library Found!"); 1037 //Gatherer.g_man.preview_pane.configServer(GSDLSiteConfig.ADD_COMMAND + collection.getName()); 1038 Gatherer.self.configServer(GSDLSiteConfig.ADD_COMMAND + collection.getName()); 1039 } 1040 //else { 1041 ///ystem.err.println("GLI can't recognize a local library."); 1042 //} 1043 // Signal collection changed. 1044 // workspace_model = null; 1045 Gatherer.g_man.collectionChanged(ready()); 1046 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Preview_Ready"), Dictionary.get("CollectionManager.Preview_Ready_Title"), JOptionPane.INFORMATION_MESSAGE); 1060 ///ystem.err.println("Installing collection."); 1061 if(installCollection()) { 1062 // If we have a local library running (that we know about) then we ask it to add our newly create collection 1063 ///ystem.err.println("Check if we should reset local server."); 1064 if(Gatherer.config.exec_file != null) { 1065 ///ystem.err.println("Local Library Found!"); 1066 //Gatherer.g_man.preview_pane.configServer(GSDLSiteConfig.ADD_COMMAND + collection.getName()); 1067 Gatherer.self.configServer(GSDLSiteConfig.ADD_COMMAND + collection.getName()); 1068 } 1069 //else { 1070 ///ystem.err.println("GLI can't recognize a local library."); 1071 //} 1072 // Signal collection changed. 1073 // workspace_model = null; 1074 Gatherer.g_man.collectionChanged(ready()); 1075 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Preview_Ready"), Dictionary.get("CollectionManager.Preview_Ready_Title"), JOptionPane.INFORMATION_MESSAGE); 1076 } 1077 else { 1078 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Preview_Ready_Failed"), Dictionary.get("CollectionManager.Preview_Ready_Title"), JOptionPane.ERROR_MESSAGE); 1079 Gatherer.g_man.collectionChanged(ready()); 1080 } 1047 1081 } 1048 1082 else if(event.getStatus() == GShell.ERROR) { … … 1197 1231 * @see org.greenstone.gatherer.util.Utility 1198 1232 */ 1199 private voidinstallCollection() {1233 private boolean installCollection() { 1200 1234 Gatherer.println("Build complete. Moving files."); 1201 1235 … … 1268 1302 catch (Exception exception) { 1269 1303 JOptionPane.showMessageDialog(Gatherer.g_man, "Exception detected during collection install.\nMost likely caused by Windows or Local Library holding locks on files:\n" + exception.getMessage(), "Error", JOptionPane.ERROR_MESSAGE); 1270 } 1304 return false; 1305 } 1306 return true; 1271 1307 } 1272 1308
Note:
See TracChangeset
for help on using the changeset viewer.