Ignore:
Timestamp:
2020-07-23T18:33:28+12:00 (4 years ago)
Author:
ak19
Message:
  1. Dictionary string for the CSV filefilter extension description. 2. Gone back to attempting to upload any meta.csv created directly in the collection folder to server, and fixed an oversight in RemoteGreenstoneServer.getPathRelativeToDirectory() that prevented this because of an extra File separator char. However, even though the file now gets successfully uploaded, it won't get downloaded to the client again when the collection is reopened. (Also happens if the meta.csv file was exported into the collection's etc subfolder). This is because the remote server carefully selects which files get sent back to the client when a collection is opened, and csv files outside the import directory are not part of the existing selection. There's no compelling reason to incorporate csv files either, as the client's collect folder is stored in a hidden gli user folder anyway, and it's best the client-gli user choose an easily discoverable and accessible folder into which their exported meta csv is saved.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r34284 r34285  
    224224
    225225        // refresh coll view if meta.csv was created somewhere inside this coll's import folder
    226         // And for remote case, also upload any new file that's inside
    227         // the collection's import dir to the remote server
    228         if(success && csvFile.exists() && csvFile.getAbsolutePath().startsWith(importDir)) {
     226        // And for remote case, also upload any new meta csv file if created anywhere inside the collection dir
     227        // (incl especially its import dir) to the remote server
     228        if(success && csvFile.exists() && csvFile.getAbsolutePath().startsWith(collection_directory_path)) {
     229            // When the user *converts* metadata to CSV, it's set up to be easiest to create in the import folder
     230            // When the user *exports* meta to CSV, it's set up to create this easiest in the collection folder
     231           
     232            // Beware in export case: client-gli can create a metadata CSV file in the collection
     233            // folder and this will get successfully uploaded and store into the collect folder
     234            // on the remote server. However, when the collection is reopened in client-gli, the
     235            // collection that's downloaded will NOT contain such a metadata CSV file (even though it
     236            // still exists on the remote server in the collection folder) since the remote server
     237            // selectively sends files across when a collection is opened.
     238            // Not just anything and everything that exists in the collection folder (or its etc
     239            // subfolder) is sent back to the client. There must be a reason why the GS3 server sends
     240            // across some files and not others, so I'm not going to change that to incorporate any
     241            // *.csv files found anywhere in the server's collection folder.
     242            // When someone is using client-GLI it may not anyway make sense for them to save a file
     243            // into their collection folder: the coll folder is hidden away in the gli user directory
     244            // and even if client-GLI got it transferred back from the server and shows the user that
     245            // their metadata.csv file exists locally, they still can't locate it that easily on
     246            // their filesystem. It's best for the user to create the exported metadata in an easily
     247            // located location on the client file system.
    229248            if(Gatherer.isGsdlRemote) {
    230249            Gatherer.remoteGreenstoneServer.uploadFilesIntoCollection(currCollName, new File[] {csvFile}, csvFile.getParentFile());
    231250            }
    232             Gatherer.g_man.refreshCollectionTree(DragTree.COLLECTION_CONTENTS_CHANGED);
    233         }
     251            if(csvFile.getAbsolutePath().startsWith(importDir)) {
     252            Gatherer.g_man.refreshCollectionTree(DragTree.COLLECTION_CONTENTS_CHANGED);
     253            }
     254        }       
    234255        }
    235256       
Note: See TracChangeset for help on using the changeset viewer.