Changeset 12150
- Timestamp:
- 2006-07-11T16:03:11+12:00 (18 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r12070 r12150 57 57 import org.greenstone.gatherer.gui.LockFileDialog; 58 58 import org.greenstone.gatherer.gui.ModalProgressPopup; 59 import org.greenstone.gatherer.gui.NewCollectionMetadataPrompt;60 59 import org.greenstone.gatherer.gui.WarningDialog; 61 60 import org.greenstone.gatherer.metadata.DocXMLFileManager; … … 415 414 } 416 415 417 // If no sets were imported...418 if (MetadataSetManager.getMetadataSets().size() == 0) {419 // Prompt the user so that they can choose at least one initial metadata set. We're sneaky here and just create a ncm_prompt420 DebugStream.println("This collection has no metadata sets. Present the user with the metadata set selection prompt.");421 NewCollectionMetadataPrompt ncm_prompt = new NewCollectionMetadataPrompt();422 // If cancelled then they really do mean to start a collection with no metadata sets.423 if (!ncm_prompt.isCancelled()) {424 ArrayList initial_sets = ncm_prompt.getSets();425 for (int i = 0; initial_sets != null && i < initial_sets.size(); i++) {426 importMetadataSet((MetadataSet) initial_sets.get(i));427 }428 }429 ncm_prompt.dispose();430 ncm_prompt = null;431 }432 433 416 // Now we update our collect.cfg 434 417 DebugStream.println("Copy and update collect.cfg from base collection."); … … 1226 1209 } 1227 1210 1228 // now we reuse the newcoll metadata prompt for the user to select metadata sets 1229 NewCollectionMetadataPrompt ncm_prompt = new NewCollectionMetadataPrompt(true); 1230 if (ncm_prompt.isCancelled()) { 1231 return false; 1232 } 1233 ArrayList metadata_sets = ncm_prompt.getSets(); 1234 // Import default metadata sets if any. 1235 for(int i = 0; metadata_sets != null && i < metadata_sets.size(); i++) { 1236 importMetadataSet((MetadataSet) metadata_sets.get(i)); 1211 // now we add dublin core which is the default metadata set. The user 1212 // can change this later 1213 File dc_file = new File(Gatherer.getGLIMetadataDirectoryPath()+"dublin.mds"); 1214 if (dc_file.exists()) { 1215 importMetadataSet(new MetadataSet(dc_file)); 1237 1216 } 1238 1217 -
trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java
r12117 r12150 59 59 import org.greenstone.gatherer.gui.metaaudit.MetaAuditFrame; 60 60 import org.greenstone.gatherer.gui.tree.DragTree; 61 import org.greenstone.gatherer.metadata.MetadataSet; 61 62 import org.greenstone.gatherer.remote.RemoteGreenstoneServer; 62 63 import org.greenstone.gatherer.util.JarTools; … … 762 763 763 764 // Create the collection details prompt from new collection prompt 764 NewCollectionMetadataPrompt ncm_prompt = null;765 765 NewCollectionDetailsPrompt ncd_prompt = new NewCollectionDetailsPrompt(); 766 // If no previous collection was indicated as a model design, then show the metadata selection prompt from new collection prompt 767 if(!ncd_prompt.isCancelled() && (ncd_prompt.getBase() == null)) { 768 ncm_prompt = new NewCollectionMetadataPrompt(); 766 // dc metadata set is the default 767 ArrayList metadata_sets = new ArrayList(); 768 File dc_file = new File(Gatherer.getGLIMetadataDirectoryPath()+"dublin.mds"); 769 if (dc_file.exists()) { 770 metadata_sets.add(new MetadataSet(dc_file)); 769 771 } 770 772 // Create the new collection (if not cancelled) in a new thread. 771 if (!ncd_prompt.isCancelled() && (ncm_prompt == null || !ncm_prompt.isCancelled())) {773 if (!ncd_prompt.isCancelled()) { 772 774 // If there is already a collection open, save and close it. 773 775 if (Gatherer.c_man.ready()) { 774 776 saveThenCloseCurrentCollection(); 775 777 } 776 778 777 779 // Create new collection. 778 if (ncm_prompt == null) { 779 Gatherer.c_man.createCollection(ncd_prompt.getDescription(), Configuration.getEmail(), ncd_prompt.getName(), ncd_prompt.getTitle(), ncd_prompt.getBase(), null); 780 } 781 else { 782 Gatherer.c_man.createCollection(ncd_prompt.getDescription(), Configuration.getEmail(), ncd_prompt.getName(), ncd_prompt.getTitle(), null, ncm_prompt.getSets()); 783 ncm_prompt.dispose(); 784 } 785 780 Gatherer.c_man.createCollection(ncd_prompt.getDescription(), Configuration.getEmail(), ncd_prompt.getName(), ncd_prompt.getTitle(), ncd_prompt.getBase(), metadata_sets); 786 781 ncd_prompt.dispose(); 787 782 … … 798 793 // Done 799 794 ncd_prompt = null; 800 ncm_prompt = null;801 795 } 802 796 }
Note:
See TracChangeset
for help on using the changeset viewer.