Changeset 13584


Ignore:
Timestamp:
2007-01-12T13:21:37+13:00 (15 years ago)
Author:
mdewsnip
Message:

Moved the code to deal with the local library when deleting a collection out of DeleteCollectionPrompt and into CollectionManager.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
2 edited

Legend:

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

    r13529 r13584  
    533533    public boolean deleteCollection(String collection_name)
    534534    {
     535    // First we must release the collection from the local library, if it's running
     536    if (LocalLibraryServer.isRunning() == true) {
     537        LocalLibraryServer.releaseCollection(collection_name);
     538    }
     539
     540    // Delete the collection on the server if we're using a remote Greenstone
     541    if (Gatherer.isGsdlRemote) {
     542        RemoteGreenstoneServer.deleteCollection(collection_name);
     543    }
     544
     545    // Now delete the collection directory
    535546    return Utility.delete(new File(getCollectionDirectoryPath(collection_name)));
    536547    }
  • trunk/gli/src/org/greenstone/gatherer/gui/DeleteCollectionPrompt.java

    r12730 r13584  
    4747import org.greenstone.gatherer.Dictionary;
    4848import org.greenstone.gatherer.Gatherer;
    49 import org.greenstone.gatherer.LocalLibraryServer;
    5049import org.greenstone.gatherer.collection.BasicCollectionConfiguration;
    5150import org.greenstone.gatherer.file.WorkspaceTree;  // !!! Don't like this here
    52 import org.greenstone.gatherer.remote.RemoteGreenstoneServer;
    5351import org.greenstone.gatherer.util.ArrayTools;
    5452import org.greenstone.gatherer.util.StaticStrings;
     
    288286     * @see org.greenstone.gatherer.util.Utility
    289287     */
    290     public void actionPerformed(ActionEvent event) {
     288    public void actionPerformed(ActionEvent event)
     289    {
    291290        // Delete the selected collection.
    292         // !! This should all go into CollectionManager !!
    293 
    294         // First we must release it from the local library
    295         if (LocalLibraryServer.isRunning() == true) {
    296         LocalLibraryServer.releaseCollection(collection.getShortName());
    297         }
    298 
    299         if (Gatherer.isGsdlRemote) {
    300         RemoteGreenstoneServer.deleteCollection(collection.getShortName());
    301         }
    302 
    303291        if (Gatherer.c_man.deleteCollection(collection.getShortName())) {
    304292        // Refresh the collections shown in the workspace tree
Note: See TracChangeset for help on using the changeset viewer.