Changeset 12150


Ignore:
Timestamp:
2006-07-11T16:03:11+12:00 (18 years ago)
Author:
kjdon
Message:

removed ncm prompt stuff - now load dublin core as teh default set

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  
    5757import org.greenstone.gatherer.gui.LockFileDialog;
    5858import org.greenstone.gatherer.gui.ModalProgressPopup;
    59 import org.greenstone.gatherer.gui.NewCollectionMetadataPrompt;
    6059import org.greenstone.gatherer.gui.WarningDialog;
    6160import org.greenstone.gatherer.metadata.DocXMLFileManager;
     
    415414        }
    416415
    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_prompt
    420             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 
    433416        // Now we update our collect.cfg
    434417        DebugStream.println("Copy and update collect.cfg from base collection.");
     
    12261209    }
    12271210
    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));
    12371216    }
    12381217
  • trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r12117 r12150  
    5959import org.greenstone.gatherer.gui.metaaudit.MetaAuditFrame;
    6060import org.greenstone.gatherer.gui.tree.DragTree;
     61import org.greenstone.gatherer.metadata.MetadataSet;
    6162import org.greenstone.gatherer.remote.RemoteGreenstoneServer;
    6263import org.greenstone.gatherer.util.JarTools;
     
    762763
    763764        // Create the collection details prompt from new collection prompt
    764         NewCollectionMetadataPrompt ncm_prompt = null;
    765765        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));
    769771        }
    770772        // 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()) {
    772774        // If there is already a collection open, save and close it.
    773775        if (Gatherer.c_man.ready()) {
    774776            saveThenCloseCurrentCollection();
    775777        }
    776 
     778       
    777779        // 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);
    786781        ncd_prompt.dispose();
    787782
     
    798793        // Done
    799794        ncd_prompt = null;
    800         ncm_prompt = null;
    801795    }
    802796    }
Note: See TracChangeset for help on using the changeset viewer.