Changeset 13586
- Timestamp:
- 2007-01-12T14:05:00+13:00 (17 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java
r13421 r13586 36 36 import org.greenstone.gatherer.Gatherer; 37 37 import org.greenstone.gatherer.LocalLibraryServer; 38 import org.greenstone.gatherer.collection.CollectionManager; 38 39 import org.greenstone.gatherer.gui.GLIButton; 39 40 import org.greenstone.gatherer.metadata.MetadataElement; … … 484 485 485 486 // If we're using the Local Library we must release the collection before writing to the collect.cfg file 486 String collection_name = Gatherer.c_man.getCollection().getName();487 String collection_name = CollectionManager.getLoadedCollectionName(); 487 488 boolean collection_released = false; 488 489 if (Gatherer.c_man.built() && LocalLibraryServer.isRunning() == true) { -
trunk/gli/src/org/greenstone/gatherer/cdm/GeneralManager.java
r13453 r13586 38 38 import org.greenstone.gatherer.Dictionary; 39 39 import org.greenstone.gatherer.Gatherer; 40 import org.greenstone.gatherer.collection.CollectionManager; 40 41 import org.greenstone.gatherer.gui.DesignPaneHeader; 41 42 import org.greenstone.gatherer.gui.EmailField; … … 152 153 153 154 JLabel short_name_label = new JLabel(Dictionary.get("NewCollectionPrompt.Collection_Name")); 154 JTextField short_name_textfield = new JTextField( Gatherer.c_man.getCollection().getName());155 JTextField short_name_textfield = new JTextField(CollectionManager.getLoadedCollectionName()); 155 156 short_name_textfield.setEditable(false); 156 157 short_name_textfield.setBackground(Configuration.getColor("coloring.collection_tree_background", false)); … … 317 318 318 319 public BrowseListener(String prefix_raw) { 319 this.prefix = prefix_raw.replaceAll(StaticStrings.COLNAME_PATTERN, Gatherer.c_man.getCollection().getName());320 this.prefix = prefix_raw.replaceAll(StaticStrings.COLNAME_PATTERN, CollectionManager.getLoadedCollectionName()); 320 321 } 321 322 … … 346 347 // If we're using a remote Greenstone server, upload the image 347 348 if (Gatherer.isGsdlRemote) { 348 RemoteGreenstoneServer.uploadCollectionFile( Gatherer.c_man.getCollection().getName(), collection_image_file);349 RemoteGreenstoneServer.uploadCollectionFile(CollectionManager.getLoadedCollectionName(), collection_image_file); 349 350 } 350 351 } … … 415 416 // Set the title 416 417 String collection_title = name_textfield.getText(); 417 String collection_name = Gatherer.c_man.getCollection().getName();418 String collection_name = CollectionManager.getLoadedCollectionName(); 418 419 Gatherer.g_man.setTitle(collection_title, collection_name); 419 420 collection_name_collectionmeta.setValue(name_textfield.getText()); -
trunk/gli/src/org/greenstone/gatherer/cdm/MacrosManager.java
r12652 r13586 41 41 import java.io.OutputStreamWriter; 42 42 43 import org.greenstone.gatherer.collection.CollectionManager;44 43 import org.greenstone.gatherer.Configuration; 45 44 import org.greenstone.gatherer.DebugStream; 46 45 import org.greenstone.gatherer.Dictionary; 47 46 import org.greenstone.gatherer.Gatherer; 47 import org.greenstone.gatherer.collection.CollectionManager; 48 48 import org.greenstone.gatherer.gui.DesignPaneHeader; 49 49 import org.greenstone.gatherer.gui.GLIButton; … … 217 217 // Users need to wait until the upload has finished before pressing Preview Collection! 218 218 if (Gatherer.isGsdlRemote) { 219 String collection_name = Gatherer.c_man.getCollection().getName(); 220 RemoteGreenstoneServer.uploadCollectionFile(collection_name, extra_dm_file); 219 RemoteGreenstoneServer.uploadCollectionFile(CollectionManager.getLoadedCollectionName(), extra_dm_file); 221 220 } 222 221 } -
trunk/gli/src/org/greenstone/gatherer/cdm/SuperCollectionManager.java
r12809 r13586 36 36 import org.greenstone.gatherer.Gatherer; 37 37 import org.greenstone.gatherer.collection.BasicCollectionConfiguration; 38 import org.greenstone.gatherer.collection.CollectionManager; 38 39 import org.greenstone.gatherer.util.CheckList; 39 40 import org.greenstone.gatherer.util.CheckListEntry; … … 207 208 { 208 209 collection_checklist_model = new ArrayList(); 209 current_coll_name = Gatherer.c_man.getCollection().getName();210 current_coll_name = CollectionManager.getLoadedCollectionName(); 210 211 211 212 File collect_directory = new File(Gatherer.getCollectDirectoryPath()); -
trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r13585 r13586 562 562 public Collection getCollection() { 563 563 return collection; 564 } 565 566 567 /** Returns the name of the loaded collection. 568 */ 569 static public String getLoadedCollectionName() 570 { 571 if (collection != null) { 572 return collection.getName(); 573 } 574 575 return null; 564 576 } 565 577 -
trunk/gli/src/org/greenstone/gatherer/file/FileManager.java
r13455 r13586 41 41 import org.greenstone.gatherer.Dictionary; 42 42 import org.greenstone.gatherer.Gatherer; 43 import org.greenstone.gatherer.collection.CollectionManager; 43 44 import org.greenstone.gatherer.collection.CollectionTree; 44 45 import org.greenstone.gatherer.collection.CollectionTreeNode; … … 169 170 file_queue.addJob(id, source, source_nodes, target, target_node, type); 170 171 if (Gatherer.isGsdlRemote) { 171 String collection_name = Gatherer.c_man.getCollection().getName();172 String collection_name = CollectionManager.getLoadedCollectionName(); 172 173 173 174 // Perform the appropriate action based on the job type (RemoteGreenstoneServer will queue) … … 248 249 // ... but only if it is inside the collection and we haven't already downloaded it 249 250 if (file.getAbsolutePath().startsWith(Gatherer.getCollectDirectoryPath()) && file.length() == 0) { 250 if (RemoteGreenstoneServer.downloadCollectionFile( Gatherer.c_man.getCollection().getName(), file).equals("")) {251 if (RemoteGreenstoneServer.downloadCollectionFile(CollectionManager.getLoadedCollectionName(), file).equals("")) { 251 252 // Something has gone wrong downloading the file 252 253 return; … … 323 324 folder_file.createNewFile(); 324 325 if (Gatherer.isGsdlRemote) { 325 RemoteGreenstoneServer.uploadCollectionFile( Gatherer.c_man.getCollection().getName(), folder_file);326 RemoteGreenstoneServer.uploadCollectionFile(CollectionManager.getLoadedCollectionName(), folder_file); 326 327 } 327 328 } … … 329 330 folder_file.mkdirs(); 330 331 if (Gatherer.isGsdlRemote) { 331 RemoteGreenstoneServer.newCollectionDirectory( Gatherer.c_man.getCollection().getName(), folder_file);332 RemoteGreenstoneServer.newCollectionDirectory(CollectionManager.getLoadedCollectionName(), folder_file); 332 333 } 333 334 } -
trunk/gli/src/org/greenstone/gatherer/gui/DeleteCollectionPrompt.java
r13584 r13586 48 48 import org.greenstone.gatherer.Gatherer; 49 49 import org.greenstone.gatherer.collection.BasicCollectionConfiguration; 50 import org.greenstone.gatherer.collection.CollectionManager; 50 51 import org.greenstone.gatherer.file.WorkspaceTree; // !!! Don't like this here 51 52 import org.greenstone.gatherer.util.ArrayTools; … … 293 294 Gatherer.g_man.refreshWorkspaceTree(WorkspaceTree.LIBRARY_CONTENTS_CHANGED); 294 295 295 if (Gatherer.c_man.getCollection() != null && collection.getShortName().equals( Gatherer.c_man.getCollection().getName())) {296 if (Gatherer.c_man.getCollection() != null && collection.getShortName().equals(CollectionManager.getLoadedCollectionName())) { 296 297 current_coll_deleted = true; 297 298 } -
trunk/gli/src/org/greenstone/gatherer/gui/ExplodeMetadataDatabasePrompt.java
r13579 r13586 271 271 else { 272 272 // Add in the filename, relative to the collection directory 273 String collection_name = Gatherer.c_man.getCollection().getName();273 String collection_name = CollectionManager.getLoadedCollectionName(); 274 274 String collection_directory_path = CollectionManager.getCollectionDirectoryPath(collection_name); 275 275 String metadata_file_relative_path = RemoteGreenstoneServer.getPathRelativeToDirectory(metadata_file, collection_directory_path); … … 344 344 if (Gatherer.isGsdlRemote) { 345 345 Utility.delete(metadata_file.getParentFile()); 346 RemoteGreenstoneServer.downloadCollectionFile( Gatherer.c_man.getCollection().getName(), metadata_file.getParentFile());346 RemoteGreenstoneServer.downloadCollectionFile(CollectionManager.getLoadedCollectionName(), metadata_file.getParentFile()); 347 347 } 348 348 -
trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFileManager.java
r12735 r13586 32 32 import org.greenstone.gatherer.DebugStream; 33 33 import org.greenstone.gatherer.Gatherer; 34 import org.greenstone.gatherer.collection.CollectionManager; 34 35 import org.greenstone.gatherer.collection.CollectionTreeNode; 35 36 import org.greenstone.gatherer.remote.RemoteGreenstoneServer; … … 377 378 378 379 // Upload the files modified since last time, then reset the list 379 RemoteGreenstoneServer.uploadCollectionFiles( Gatherer.c_man.getCollection().getName(), (File[]) modified_metadata_xml_files.toArray(new File[0]));380 RemoteGreenstoneServer.uploadCollectionFiles(CollectionManager.getLoadedCollectionName(), (File[]) modified_metadata_xml_files.toArray(new File[0])); 380 381 modified_metadata_xml_files.clear(); 381 382 }
Note:
See TracChangeset
for help on using the changeset viewer.