Changeset 34247

Show
Ignore:
Timestamp:
04.07.2020 06:47:58 (5 weeks ago)
Author:
ak19
Message:

In the previous commit 1. Codec.java change was still related to commit 34241. 2. Fixed my own silly bug: it's windowClosed not windowClose. Because the real method was not overridden, it never got called when the configFileEditor was closed, as a result of which the GLI's GUI interface wasn't getting immediately repainted. 3. Fixed a bug in FileNode?.java (nullpointer exception case). 4. Accidentally committed experimental work to export metadata from GLI to csv. This commit undoes the experimental stuff, only some of which is promising and still needs work.

Location:
main/trunk/gli/src/org/greenstone/gatherer
Files:
3 modified

Legend:

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

    r34246 r34247  
    6868import org.greenstone.gatherer.metadata.MetadataSetManager; 
    6969import org.greenstone.gatherer.metadata.MetadataXMLFileManager; 
    70 import org.greenstone.gatherer.metadata.MetadataElement; 
    71 import org.greenstone.gatherer.metadata.MetadataValue; 
    7270import org.greenstone.gatherer.metadata.ProfileXMLFileManager; 
    7371import org.greenstone.gatherer.remote.RemoteGreenstoneServer; 
     
    156154    } 
    157155     
    158     /** helper methods to export metadata for collection files to csv */ 
    159     public TreeMap<File, ArrayList> getAllAssignedMetadataForAllFiles() { 
    160     TreeMap<File, ArrayList> files_with_meta = new TreeMap<File, ArrayList>(); 
    161      
    162     ArrayList<File> files = listFilesInCollection(); 
    163     Iterator<File> i = files.iterator(); 
    164      
    165     while(i.hasNext()) { 
    166         File f = i.next(); 
    167         ArrayList file_meta = MetadataXMLFileManager.getMetadataAssignedToFile(f); 
    168         files_with_meta.put(f, file_meta); 
    169          
    170         // debugging display 
    171         System.err.println("Meta for file: " + f.getAbsolutePath()); 
    172         Iterator it = file_meta.iterator(); 
    173         while(it.hasNext()) { 
    174         MetadataValue meta = (MetadataValue)it.next(); 
    175         String metaVal = meta.getValue(); 
    176         MetadataElement metaEl = meta.getMetadataElement(); 
    177         String metaName = metaEl.getFullName(); 
    178         System.err.println("   field: " + metaName); 
    179         System.err.println("   value: " + metaVal); 
    180         } 
    181  
    182     } 
    183  
    184     return files_with_meta; 
    185     } 
    186      
    187     public ArrayList<File> listFilesInCollection() { 
    188     ArrayList<File> files = new ArrayList<File>(); 
    189     if(collection_tree_model != null) { 
    190         collection_tree_model.getFileListing(files); 
    191     } 
    192     return files; 
    193     } 
    194156     
    195157    static public void addCollectionContentsChangedListener(CollectionContentsChangedListener listener) 
     
    13501312            Gatherer.remoteGreenstoneServer.uploadCollectionFile(collection.getGroupQualifiedName(false), metadata_set_file); 
    13511313        } 
    1352          
    1353         // It's not enough that the local collection's mds file in gli user location 
    1354         // (e.g. AppData/Roaming/Greenstone/GLI/collect/<collname>/metadata gets updated, 
    1355         // Need to also update local GS3's installation's gli/metadatacopy of the .mds file 
    1356         if (metadata_set_file.exists()) { 
    1357             System.err.println("@@@ Replacing: " + metadata_set_file); 
    1358             System.err.println("@@@ With: " + external_metadata_set_file); 
    1359              
    1360             // delete GLI's copy and replace 
    1361             //if(metadata_set_file.delete()) { // only if deletion was sucessful, try to replace 
    1362             //Gatherer.f_man.getQueue().copyFile(external_metadata_set_file, metadata_set_file, true);// true for overwrite 
    1363             //} 
    1364              
    1365         } 
    13661314    } catch (Exception exception) { 
    13671315        DebugStream.printStackTrace(exception); 
    1368     }    
     1316    } 
    13691317    } 
    13701318     
  • main/trunk/gli/src/org/greenstone/gatherer/file/FileSystemModel.java

    r34246 r34247  
    3535    getFileListing(root, files); 
    3636    return; 
    37     } 
    38      
    39     private void getFileListing(TreeNode node, ArrayList<File> files) { 
    40     if(node == null) return; 
    41      
    42     if(!(node instanceof FileNode)) { 
    43         return; 
    44     } else { 
    45         FileNode current = (FileNode)node; 
    46         files.add(current.getFile()); 
    47         if(current.isLeaf()) { 
    48         return; 
    49         } 
    50          
    51         Enumeration children = current.children();       
    52         while(children.hasMoreElements()) { 
    53         FileNode child = (FileNode)children.nextElement(); 
    54         getFileListing(child, files); 
    55         } 
    56     } 
    5737    } 
    5838     
  • main/trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r34246 r34247  
    305305        //Gatherer.c_man.saveCollection(); //shouldn't have to do this, in theory. See above comment 
    306306 
    307         Gatherer.c_man.getAllAssignedMetadataForAllFiles(); 
    308          
    309307        ConfigFileEditor configEditor = new ConfigFileEditor(); 
    310308        configEditor.setVisible(true);