Changeset 4571
- Timestamp:
- 2003-06-11T15:21:31+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/collection/SaveCollectionTask.java
r4366 r4571 110 110 Gatherer.g_man.wait(true); 111 111 // Create progress monitor box. It will display itself as necessary. 112 ProgressMonitor spd = new ProgressMonitor(Gatherer.g_man, Gatherer.dictionary.get("SaveProgressDialog.Title", collection.getName()), null, 0, 100); 113 spd.setMillisToDecideToPopup(100); 114 spd.setMillisToPopup(100); 112 // WARNING: ProgressMonitors seem to be extremely dodgy, and are not recommended! 113 // ProgressMonitor spd = new ProgressMonitor(Gatherer.g_man, Gatherer.dictionary.get("SaveProgressDialog.Title", collection.getName()), null, 0, 100); 114 // spd.setMillisToDecideToPopup(100); 115 // spd.setMillisToPopup(100); 115 116 // 0. Force all remaining metadata.xml files to load. 116 117 // 1. Perform a regular collection save on what we will later refer to as the origin collection. … … 120 121 args[0] = collection.getName() + ".col"; 121 122 try { 122 123 // Block until all of the metadata files have been read in. 123 124 collection.gdm.waitUntilComplete(); 124 125 // Write out the metadata xml files. The destroy below is meant to do this, but never does. 125 126 collection.gdm.save(); 126 127 spd.setProgress(getValue(METADATA_XML_SAVED)); 127 // spd.setProgress(getValue(METADATA_XML_SAVED)); 128 128 129 File file = new File(tmp_loc); 129 130 // Create backup 130 131 if(file.exists()) { 131 132 File backup = new File(tmp_loc + "~"); … … 135 136 } 136 137 } 137 // Carry on. 138 139 // Carry on. 138 140 collection.save(); 139 spd.setProgress(getValue(COLLECTION_SAVED)); 140 // Write out the collection configuration file. 141 // spd.setProgress(getValue(COLLECTION_SAVED)); 142 143 // Write out the collection configuration file. 141 144 Gatherer.g_man.config_pane.saveConfiguration(); 142 spd.setProgress(getValue(COLLECTION_CFG_SAVED)); 143 // Write out the metadata files. 145 // spd.setProgress(getValue(COLLECTION_CFG_SAVED)); 146 147 // Write out the metadata files. 144 148 Gatherer.c_man.msm.save(); 145 spd.setProgress(getValue(METADATA_SAVED)); 146 // Clean-up 147 spd.setProgress(100); 148 ///atherer.g_man.collectionChanged(Gatherer.c_man.ready()); 149 // spd.setProgress(getValue(METADATA_SAVED)); 150 149 151 collection.setSaved(true); 150 152 } … … 157 159 ///ystem.err.println("2. Make copy."); 158 160 Gatherer.c_man.createCollection(null, null, name, null, null, null); 159 spd.setProgress(getValue(MAKE_COLLECTION));161 // spd.setProgress(getValue(MAKE_COLLECTION)); 160 162 // 3. Copy files from the origin to the copied collections (except special collection files ending with ~). 161 163 // As part of this we must rename origin.col to copy.col … … 202 204 file = null; 203 205 } 204 spd.setProgress(getValue(COPY_COLLECTION));206 // spd.setProgress(getValue(COPY_COLLECTION)); 205 207 // 4. Restore origin collection by undoing file copy actions and removing the ~ from the end of collection files. 206 208 ///ystem.err.println("4. Restore origin."); … … 230 232 } 231 233 ///ystem.err.println(" - Restore *~ complete."); 232 spd.setProgress(getValue(RESTORE_COLLECTION));234 // spd.setProgress(getValue(RESTORE_COLLECTION)); 233 235 // 5. Close the origin collection. 234 236 ///ystem.err.println("5. Close origin."); 235 237 collection.setSaved(true); 236 238 Gatherer.c_man.closeCollection(); 237 spd.setProgress(getValue(CLOSE_COLLECTION));239 // spd.setProgress(getValue(CLOSE_COLLECTION)); 238 240 // 6. Open the copied collection. 239 241 ///ystem.err.println("6. Open copy."); 240 242 Gatherer.c_man.loadCollection(copied_dir.getAbsolutePath() + File.separator + name + ".col"); 241 spd.setProgress(getValue(OPEN_COLLECTION));243 // spd.setProgress(getValue(OPEN_COLLECTION)); 242 244 copied_dir = null; 243 245 } 244 spd.close();245 spd = null;246 // spd.close(); 247 // spd = null; 246 248 tmp_loc = null; 247 249 args = null;
Note:
See TracChangeset
for help on using the changeset viewer.