Ignore:
Timestamp:
2020-07-23T13:41:08+12:00 (4 years ago)
Author:
ak19
Message:

Incorporating Kathy & Dr Bainbridge's improvements to the recently added export to meta CSV features: 1. Move meta to CSV now called Convert meta to CSV launch. 2. Launch Export Meta JChooser dialog in collection dir not import dir, but Convert Meta still launched in importDir as before. Also upload any metadata.csv created in collection dir to remote server if client-GLI, not just if meta.csv was created in importDir. 3. Labels of JChooser confirm button and dialog title corrected. 4. Updates to dictionary string names and values.

File:
1 edited

Legend:

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

    r34264 r34283  
    199199        eap = null;
    200200    }
    201     else if (esrc == menu_bar.file_exportmeta || esrc == menu_bar.file_movemeta) {
     201    else if (esrc == menu_bar.file_exportmeta || esrc == menu_bar.file_convertmeta) {
    202202        String currCollName = Gatherer.c_man.getCollection().getName();
    203203        String collection_directory_path = CollectionManager.getCollectionDirectoryPath(currCollName);
    204204       
    205205        String importDir = collection_directory_path + "import";
    206         File csvFile = MetadataToCSV.chooseMetaCSVFile(importDir, this);
     206
     207        boolean convertMode = false;
     208        String startDir = collection_directory_path;
     209        if(esrc == menu_bar.file_convertmeta) {
     210        startDir = importDir;
     211        convertMode = true;
     212        }
     213       
     214        File csvFile = MetadataToCSV.chooseMetaCSVFile(startDir, convertMode, this);
    207215        if(csvFile != null) {
    208216        MetadataToCSV toCSV = new MetadataToCSV(collection_directory_path, csvFile);
    209217       
    210218        boolean success = false;
    211         if(esrc == menu_bar.file_movemeta) {
    212             success = toCSV.moveMetaXMLToCSV(csvFile, this);
     219        if(esrc == menu_bar.file_convertmeta) {
     220            success = toCSV.convertMetaXMLToCSV(csvFile, this);
    213221        } else {
    214222            success = toCSV.exportMetaXMLToCSV(csvFile);
     
    216224
    217225        // refresh coll view if meta.csv was created somewhere inside this coll's import folder
    218         // And for remote case, also upload any new file that's inside import dir to server
    219         if(success && csvFile.exists() && csvFile.getAbsolutePath().startsWith(importDir)) {
     226        // And for remote case, also upload any new file that's inside collection dir
     227        // (especially import dir) to server
     228        if(success && csvFile.exists() && csvFile.getAbsolutePath().startsWith(collection_directory_path)) {
    220229            if(Gatherer.isGsdlRemote) {
    221230            Gatherer.remoteGreenstoneServer.uploadFilesIntoCollection(currCollName, new File[] {csvFile}, csvFile.getParentFile());
Note: See TracChangeset for help on using the changeset viewer.