Changeset 34263

11.07.2020 23:32:49 (3 weeks ago)

Option in GLI file menu to Export collection meta to CSV (new CSV file or add to existing). Uses apache commons CSV, so had to include the csv subfolder of commons into apache.jar, where all other apache jars used by GLI are bundled into. Updated the gli/lib/README about this.

1 added
5 modified


  • main/trunk/gli/classes/

    r32515 r34263  
    532532ExportAsPrompt.MappingXML_Tooltip:Use a mapping file for converting the exported files. 
     534#***** Export Metadata to CSV ***** 
     535ExportMeta.ChooseMetaCSVFile: Export metadata from GLI to a new CSV file or add to existing 
    534537#***** Inherited Metadata ***** 
    535538ExtractedMetadata.Message:The selected file or folder contains extracted metadata, but it is currently hidden. To view extracted metadata go to the "File" menu and select "Preferences". In the "General" properties sheet select "View Extracted Metadata", then click "Ok". 
     786Menu.File_ExportMeta:Export metadata... 
  • main/trunk/gli/lib/README.txt

    r31649 r34263  
    3737            - logging: appears to be from commons-logging. 
    3838            - not sure where the 4 other subfolders of commons (beanutils, collections, digester, httpclient) are from. See commit message of for ideas. 
     39            - csv: ADDED 11/07/2020 from commons-csv-1.8.jar 
    4141Essentially, in commit 29729, the entire contents of GS3 web-lib's xml-apis.jar and xercesImpl.jar have been added to apache.jar after unzipping it, replacing earlier versions already present. The "javax" and "licence" toplevel folders of apache.jar are proper additions, deriving from xml-apis.jar. All other contents of apache.jar have been left as they were. 
    4545UPDATING apache.jar 
     47Create a folder in gli/lib called apache. 
     48Copy apache.jar from gli/lib into gli/lib/apache. 
     49Then go into the new apache folder and unjar (unzip) the apache.jar there: 
     50> cd apache 
     51> jar -xvf apache.jar 
    48 After unzipping apache.jar, its contents were updated to use the later xerces and xml-apis as described above. 
     54After unzipping apache.jar, its contents were updated to use the later xerces and xml-apis as described in the sections above. 
    5056How to recreate the apache.jar: 
    5157> cd gli/lib/apache 
    5258> jar -cvf apache.jar * 
     59> jar -tvf apache.jar 
     60  (to check the contents of the jar file just created) 
    54 The apache.jar file gets generated inside gli/lib/apache, move it into gli/lib. Then commit it. 
     62The apache.jar file gets generated inside gli/lib/apache, move it into gli/lib replacing any older versions. Then commit it. 
    5664Further changes to, to mention the new javax subfolder, since it may also need to be unzipped from apache.jar along with the other contained libraries, so that xml-apis' javax too can be included in GLI.jar when this is generated, in case there is any dependence on javax in the rest of xml-apis' classes. 
  • main/trunk/gli/src/org/greenstone/gatherer/gui/

    r34247 r34263  
    6767import org.greenstone.gatherer.util.Utility; 
     69import org.greenstone.gatherer.metadata.MetadataToCSV; 
    7071/** The GUIManager is in charge of creating the Gatherer window frame then filling it with the goodness of the view panes. GUIManager not only creates these panes, but allows some messaging between them. Furthermore GUIManager includes functionality from menu driven choices, simply as it was easier to put it here once and have it accessible from all pane children. */ 
    197198        eap.destroy(); 
    198199        eap = null; 
     200    } 
     201    else if (esrc == menu_bar.file_exportmeta) { 
     202        String currCollName = Gatherer.c_man.getCollection().getName(); 
     203        String collection_directory_path = CollectionManager.getCollectionDirectoryPath(currCollName); 
     205        String importDir = collection_directory_path + File.separator + "import"; 
     206        File selectedFile = MetadataToCSV.chooseMetaCSVFile(importDir, this); 
     207        if(selectedFile != null) { 
     208        MetadataToCSV toCSV = new MetadataToCSV(collection_directory_path, selectedFile); 
     209        //toCSV.printOrderedCollectionMeta();        
     210        toCSV.exportGLIMetaToCSV(new File(importDir, "metadata.csv")); 
     211        } 
    199212    } 
    200213    else if (esrc == menu_bar.file_exit) { 
  • main/trunk/gli/src/org/greenstone/gatherer/gui/

    r30701 r34263  
    6969    public JMenuItem file_exit       = null; 
    7070    public JMenuItem file_exportas   = null; 
     71    public JMenuItem file_exportmeta = null; 
    7172    public JMenuItem file_new        = null; 
    7273    public JMenuItem file_open       = null; 
    122123    file_exportas.setEnabled(!Gatherer.isGsdlRemote); 
    123124    file_exportas.setComponentOrientation(Dictionary.getOrientation()); 
     126    file_exportmeta = new JMenuItem(Dictionary.get("Menu.File_ExportMeta")); 
     127    file_exportmeta.addActionListener(Gatherer.g_man); 
     128    file_exportmeta.setEnabled(!Gatherer.isGsdlRemote); 
     129    file_exportmeta.setComponentOrientation(Dictionary.getOrientation()); 
    125131    file_new = new JMenuItem(Dictionary.get("Menu.File_New")); 
    148154    file.add(file_delete); 
    149155    file.add(file_exportas); 
     156    file.add(file_exportmeta); 
    150157    // these currently don't work. better to just disable them? 
    151158    if (!Gatherer.GS3) {