Changeset 6879
- Timestamp:
- 2004-02-24T13:09:55+13:00 (20 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/collection/Collection.java
r6387 r6879 50 50 import org.greenstone.gatherer.file.FileNode; 51 51 import org.greenstone.gatherer.msm.ElementWrapper; 52 import org.greenstone.gatherer.msm. GDMManager;52 import org.greenstone.gatherer.msm.MetadataXMLFileManager; 53 53 import org.greenstone.gatherer.msm.MetadataSetManager; 54 54 import org.greenstone.gatherer.msm.MSMUtils; … … 67 67 public CollectionDesignManager cdm; 68 68 /** A reference to the Greenstone Directory Metadata Manager. */ 69 public GDMManager gdm;69 public MetadataXMLFileManager gdm; 70 70 /** A reference to the Metadata Set Manager. */ 71 71 public MetadataSetManager msm; … … 109 109 * @see org.greenstone.gatherer.Gatherer 110 110 * @see org.greenstone.gatherer.cdm.CollectionDesignManager 111 * @see org.greenstone.gatherer.msm. GDMManager111 * @see org.greenstone.gatherer.msm.MetadataXMLFileManager 112 112 * @see org.greenstone.gatherer.msm.MetadataSetManager 113 113 */ … … 162 162 } 163 163 164 public GDMManager getGDM() {164 public MetadataXMLFileManager getGDM() { 165 165 return gdm; 166 166 } -
trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r6842 r6879 61 61 import org.greenstone.gatherer.gui.tree.WorkspaceTree; 62 62 import org.greenstone.gatherer.msm.ElementWrapper; 63 import org.greenstone.gatherer.msm. GDMManager;63 import org.greenstone.gatherer.msm.MetadataXMLFileManager; 64 64 import org.greenstone.gatherer.msm.GreenstoneArchiveParser; 65 65 import org.greenstone.gatherer.msm.LegacyCollectionImporter; … … 426 426 } 427 427 428 collection.gdm = new GDMManager();428 collection.gdm = new MetadataXMLFileManager(); 429 429 430 430 progress.setProgress(3); … … 872 872 } 873 873 874 // Whether the collection is legacy or not, we should now be able to prepare d the GDMManager875 collection.gdm = new GDMManager();874 // Whether the collection is legacy or not, we should now be able to prepare the MetadataXMLFileManager 875 collection.gdm = new MetadataXMLFileManager(); 876 876 877 877 // Tell everyone that it worked. -
trunk/gli/src/org/greenstone/gatherer/file/FileQueue.java
r6770 r6879 39 39 import org.greenstone.gatherer.gui.LongProgressBar; 40 40 import org.greenstone.gatherer.gui.tree.DragTree; 41 import org.greenstone.gatherer.msm. GDMManager;41 import org.greenstone.gatherer.msm.MetadataXMLFileManager; 42 42 import org.greenstone.gatherer.undo.UndoManager; 43 43 import org.greenstone.gatherer.util.ArrayTools; … … 442 442 if (job.source.toString().equals("Collection")) { 443 443 ///ystem.err.println("Move within collection..."); 444 GDMManager gdm = Gatherer.c_man.getCollection().gdm;444 MetadataXMLFileManager gdm = Gatherer.c_man.getCollection().gdm; 445 445 // we just retrieve the metadata attached to the origin node... 446 446 ArrayList existing_metadata = gdm.getMetadataOnly(source_file); … … 454 454 // If it came from the recycle bin retrieve the metadata from there, once again remembering to account for inherited metadata 455 455 else if (job.source.toString().equals("Undo")) { 456 GDMManager gdm = Gatherer.c_man.getCollection().gdm;456 MetadataXMLFileManager gdm = Gatherer.c_man.getCollection().gdm; 457 457 // Retrieve metadata from the recycle bin 458 458 ArrayList existing_metadata = Gatherer.c_man.undo.getMetadata(source_file); -
trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java
r6842 r6879 122 122 /** The main tab pane containing the different views, available here to trap view change events. */ 123 123 private JTabbedPane tab_pane = null; 124 /** A reference to any existing search and replace module/dialog. */125 // private SearchAndReplace sar = null;126 124 /** A threaded tab changer to try and avoid NPE on exit. */ 127 125 private TabUpdater tab_updater = null; … … 135 133 private TreeSynchronizer workspace_tree_sync = null; 136 134 /**Constructor. Enable window events and arranges all other components. 137 138 135 * @param size The intial <strong>Dimension</strong> of the screen. 136 */ 139 137 public GUIManager(Dimension size) { 140 138 super(); … … 173 171 174 172 /** Any implementation of <i>ActionListener</i> must include this method so that we can be informed when an action has occured. In this case we are listening to actions from the menu-bar, and should react appropriately. 175 176 173 * @param event An <strong>ActionEvent</strong> containing information about the action that has occured. 174 */ 177 175 public void actionPerformed(ActionEvent event) { 178 176 boolean cont = true; … … 220 218 } 221 219 else if(esrc == menu_bar.file_options) { 222 223 224 220 // Just incase the user has edited the GeneralSettings of a collection without losing focus afterwards. Well I'm forever losing foc... ooh shiney. 221 design_pane.loseFocus(); 222 // And spawn a new preferences. 225 223 new Preferences(); 226 224 } … … 366 364 // browser_pane.afterDisplay(); 367 365 // } 368 if (mirror_pane != null) {366 if (mirror_pane != null) { 369 367 mirror_pane.afterDisplay(); 370 368 } -
trunk/gli/src/org/greenstone/gatherer/msm/LegacyCollectionImporter.java
r6770 r6879 182 182 element_ew = null; 183 183 } 184 // If the raw name is null now, we have been instructed to ignore this metadata, so we can delete it from the metadata.xml ( GDMDocumentwould do this anyway when it tried to save)184 // If the raw name is null now, we have been instructed to ignore this metadata, so we can delete it from the metadata.xml (MetadataXMLFile would do this anyway when it tried to save) 185 185 else { 186 186 // Retrieve the parent node … … 257 257 changed = true; 258 258 } 259 // Cancel only skips the current metadata.xml file - actually I'll ignore the file on a cancel, as otherwise it will bugger up GDMManager when it starts up259 // Cancel only skips the current metadata.xml file - actually I'll ignore the file on a cancel, as otherwise it will bugger up MetadataXMLFileManager when it starts up 260 260 else { 261 261 // Confirm the cancel, informing the user that the metadata.xml will be completely ignored if they continue -
trunk/gli/src/org/greenstone/gatherer/msm/MetadataSetManager.java
r6770 r6879 86 86 private ExistingMetadataLoader loader = null; 87 87 /** Specialized parser for parsing GreenstoneDirectoryMetadata files, which not only caches entries, but also breaks up massive metadata.xml files into reasonable sizes. */ 88 private GDMParser gdm_parser = null;88 private MetadataXMLFileParser gdm_parser = null; 89 89 /** A list of classes who are interested in changes to the loaded metadata sets. */ 90 90 private Vector listeners = null; … … 92 92 /** Constructor. */ 93 93 public MetadataSetManager() { 94 this.gdm_parser = new GDMParser();94 this.gdm_parser = new MetadataXMLFileParser(); 95 95 this.listeners = new Vector(); 96 96 this.loader = new ExistingMetadataLoader(); … … 1088 1088 1089 1089 /** Add a reference to a piece of metadata to the given FileNode. The whole method gets a wee bit messy as we have to allow for several different commands from users such as accumulate / overwrite, skip just this file or cancel the whole batch. Cancelling is especially problematic as we need to rollback any changes (within reason). 1090 * It is also worth mentioning that despite its name, no actual metadata is added directly by this method. Instead a call to fireMetadataChanged() is issued, which is in turn processed by the GDMManager (which, given this method may have been called from GDMManager as well, means the cycle is complete. Um, that doesn't mean theres an infinite loop... I hope).1090 * It is also worth mentioning that despite its name, no actual metadata is added directly by this method. Instead a call to fireMetadataChanged() is issued, which is in turn processed by the MetadataXMLFileManager (which, given this method may have been called from MetadataXMLFileManager as well, means the cycle is complete. Um, that doesn't mean theres an infinite loop... I hope). 1091 1091 * @param id a long unique identifier shared by all actions caused by the same gesture. 1092 1092 * @param record the FileNode we are adding the metadata to. -
trunk/gli/src/org/greenstone/gatherer/undo/UndoManager.java
r6008 r6879 51 51 import org.greenstone.gatherer.file.FileQueue; 52 52 import org.greenstone.gatherer.file.FileSystemModel; 53 import org.greenstone.gatherer.msm. GDMDocument;53 import org.greenstone.gatherer.msm.MetadataXMLFile; 54 54 import org.greenstone.gatherer.msm.Metadata; 55 55 import org.greenstone.gatherer.msm.MSMEvent; … … 75 75 private FileQueue file_queue; 76 76 private FileSystemModel model; 77 private GDMDocumentobsolete_metadata;77 private MetadataXMLFile obsolete_metadata; 78 78 /** What sort of action should a drag resemble. Not really used as we override with custom drag icon. */ 79 79 private int drag_action = DnDConstants.ACTION_MOVE; … … 104 104 } 105 105 this.model = new FileSystemModel(new FileNode(recycle_directory, "Undo")); 106 obsolete_metadata = new GDMDocument(); // This GDM is never saved.106 obsolete_metadata = new MetadataXMLFile(); // This GDM is never saved. 107 107 redo = new UndoStack(false); 108 108 redo_sources = new ArrayList(); -
trunk/gli/src/org/greenstone/gatherer/util/Utility.java
r6770 r6879 254 254 return true; 255 255 } 256 // A file not found exception is most likely thrown because the directory the metadata.xml file is attempting to be written to no longer has any files in it. I'll add a test in GDMDocumentto test for this, but if it still happens ignore it (a non-existant directory can't really have metadata added to it any way.256 // A file not found exception is most likely thrown because the directory the metadata.xml file is attempting to be written to no longer has any files in it. I'll add a test in MetadataXMLFile to test for this, but if it still happens ignore it (a non-existant directory can't really have metadata added to it any way. 257 257 catch (Exception exception) { 258 258 if(!file.getName().endsWith(METADATA_XML)) {
Note:
See TracChangeset
for help on using the changeset viewer.