Ignore:
Timestamp:
2004-10-13T14:48:20+13:00 (20 years ago)
Author:
mdewsnip
Message:

Finally committing the (many) changes to the GLI to use the new metadata code... I hope this doesn't have too many bugs in it and committing it now doesn't stuff anyone up! (Katherine said I could commit it, so blame her if anything goes wrong).

File:
1 edited

Legend:

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

    r8243 r8313  
    4343import org.greenstone.gatherer.DebugStream;
    4444import org.greenstone.gatherer.Gatherer;
     45import org.greenstone.gatherer.metadata.MetadataSetManager;
    4546import org.greenstone.gatherer.util.Utility;
    4647
     
    6667    static final private int COPY_COLLECTION      = 4;
    6768    static final private int MAKE_COLLECTION      = 5;
    68     static final private int METADATA_SAVED       = 6;
    69     static final private int METADATA_XML_SAVED   = 7;
    7069    static final private int OPEN_COLLECTION      = 8;
    7170    static final private int RESTORE_COLLECTION   = 9;
     
    112111    // spd.setMillisToDecideToPopup(100);
    113112    // spd.setMillisToPopup(100);
    114     // 0. Force all remaining metadata.xml files to load.
     113
    115114    // 1. Perform a regular collection save on what we will later refer to as the origin collection.
    116115    ///ystem.err.println("1. Save origin.");
     
    119118    args[0] = collection.getName() + ".col";
    120119    try {
    121         // Block until all of the metadata files have been read in.
    122         collection.gdm.waitUntilComplete();
    123         // Write out the metadata xml files. The destroy below is meant to do this, but never does.
    124         collection.gdm.save();
    125         // spd.setProgress(getValue(METADATA_XML_SAVED));
    126 
    127120        File file = new File(tmp_loc);
    128121        // Create backup
     
    131124        backup.deleteOnExit();
    132125        if(!file.renameTo(backup)) {
    133             DebugStream.println("Error in CollectionManager.load(): FileRenamedException");
     126            DebugStream.println("Error in SaveCollectionTask.run(): FileRenamedException");
    134127        }
    135128        }
     
    143136        // spd.setProgress(getValue(COLLECTION_CFG_SAVED));
    144137
    145         // Write out the metadata files.
    146         Gatherer.c_man.msm.save();
    147         // spd.setProgress(getValue(METADATA_SAVED));
     138        // Write hfiles for the loaded metadata elements into the collection "etc" directory
     139        MetadataSetManager.writeHierarchyFiles(new File(Gatherer.c_man.getCollectionEtc()));
    148140
    149141        collection.setSaved(true);
     
    307299        return (int)((double)70 * multiplier);
    308300    case COLLECTION_CFG_SAVED:
    309     case METADATA_SAVED:
    310     case METADATA_XML_SAVED:
    311301        return (int)((double)10 * multiplier);
    312302        // Save As
     
    325315    }
    326316}
    327 
    328 
    329 
    330 
    331 
Note: See TracChangeset for help on using the changeset viewer.