Changeset 12157


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

no longer uses ExternalCollectionPrompt or NewCollectionMetadataPrompt. Just has a warning dialog about loading a legacy colleciton, then adds dublin core metadata set

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java

    r12150 r12157  
    5454import org.greenstone.gatherer.cdm.CollectionMetaManager;
    5555import org.greenstone.gatherer.cdm.CommandTokenizer;
    56 import org.greenstone.gatherer.gui.ExternalCollectionPrompt;
    5756import org.greenstone.gatherer.gui.LockFileDialog;
    5857import org.greenstone.gatherer.gui.ModalProgressPopup;
     
    849848    if (!collection_metadata_directory.exists()) {
    850849        DebugStream.println("Loading non-gatherer collection...");
     850        // Show a warning message in case user wants to quit now
    851851        non_gli_collection = true;
     852        WarningDialog legacy_dialog = new WarningDialog("warning.LegacyCollection", Dictionary.get("LegacyCollection.Title"), Dictionary.get("LegacyCollection.Message"), null, true);
     853        if (legacy_dialog.display()==JOptionPane.CANCEL_OPTION) {
     854        legacy_dialog.dispose();
     855        collection_directory = null;
     856        collection_config_file = null;
     857        return;
     858        }
     859        legacy_dialog.dispose();
     860
    852861    }
    853862
     
    903912        ProfileXMLFileManager.loadProfileXMLFile(collection_metadata_directory);
    904913 
    905         // If this is a non-GLI (legacy) collection, ask the user to choose some metadata sets
     914        // If this is a non-GLI (legacy) collection, load the
     915        // default metadata
    906916        if (non_gli_collection) {
    907         if (!addSomeMetadataSets(collection_directory)) {
    908             lock_file = null;
    909             collection_directory = null;
    910             closeCollection();
    911             return;
    912         }
    913 
     917        addDefaultMetadataSets(collection_directory);
     918       
    914919        // Recurse the import folder tree, backing up the metadata.xml files before they are edited
    915920        LegacyCollectionImporter.backupMetadataXMLFiles(collection_directory);
     
    11991204
    12001205    /** I started giving the user the choice of using an existing meta set or creating a new one. The second option being so that they didn't have to add/merge/ignore each element, they could all be added automatically. However, I am not sure where the merge prompt gets called from, and it is not essential, so I am leaving it for now - it should be added back in and finished. [kjdon] */
    1201     private boolean addSomeMetadataSets(File collection_dir) {
    1202 
    1203 
    1204     ExternalCollectionPrompt external_prompt = new ExternalCollectionPrompt();
    1205     int meta_choice = external_prompt.getMetadataChoice();
    1206     boolean cancelled = external_prompt.isCancelled();
    1207     if (cancelled) {
    1208         return false;
    1209     }
    1210 
    1211     // now we add dublin core which is the default metadata set. The user
     1206    private boolean addDefaultMetadataSets(File collection_dir) {
     1207
     1208
     1209    // Add dublin core which is the default metadata set. The user
    12121210    // can change this later
    12131211    File dc_file = new File(Gatherer.getGLIMetadataDirectoryPath()+"dublin.mds");
Note: See TracChangeset for help on using the changeset viewer.