Ignore:
Timestamp:
2020-06-18T00:06:23+12:00 (4 years ago)
Author:
ak19
Message:

Collection ConfigFileEditor related changes, bugfixes and improvements: 1. In investigating why clientGLI > Edit > collectionConfig.xml > Save button didn't save and get reflected in the interface, found that regular GLI had the same problem. A simple all to c_man.saveCollection() fixed it for GLI, apparently should do so for client-GLI too but still to test. 2. A larger change is to make sure edits in GLI that affect collCfg.xml get saved to collCfg.xml before Edit > collCfg.xml loads the config file. This includes user values entered in controls being edited in the currently selected GLI pane. GLI code gave me a massive run-around to figure how its magic auto-save feature was working but I think I've figured it out now: It's that in GLI Panes which affect colCfg.xml (like Format pane), the loseFocus() on a GLI Pane triggers loseFocus() on GUI controls in that Pane (e.g. Format Pane's General field controls). These controls then save their current values to the collConfig in memory. Then an explicit call to c_man.saveCollection() happens. So just calling c_man.saveCollection before an Edit > collCfg.xml operation won't save the active edits in the current controls of the selected GLI Pane. Based on this understanding, I've forced a loseFocus() on the current pane, to force it to save the current state of its controls, before GLI loads the CollConfigEditor. It works. 3. ConfigFileEditor in GLI (and therefore hopefully in client-GLI too) no longer closes and reopens the collection on saving colcfg edits. This was a quick fix in the past to the problem of getting GLI to immediately reflect changes made to the currently open collection's colcfg.xml file. With the fixes in (1) and (2) this commit is able make a useful improvement to this behaviour, as the changes in this commit avoid having to close and reopen a collection after saving changes in CollConfigEditor, while aiming for the same effect of getting the interface to immediately reflect the edits. Great gains could especially be had with client-GLI, assuming this commit works for it too, as the close then reloading collection operation can take such a long time with client-GLI. Fingers crossed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java

    r24824 r34205  
    6767    // This method is initilised in CollectionDesignManager.java constructor
    6868    public CollectionConfiguration(File collect_config_file)
    69     {
     69    {       
     70        load(collect_config_file);
     71    }
     72
     73    private void load(File collect_config_file) {
    7074        this.collect_config_file = collect_config_file;
    7175        this.collect_config_filename = collect_config_file.getName();
     
    8488
    8589        //XMLTools.printXMLNode(document.getDocumentElement());
     90    }
     91
     92
     93    public void reload() {
     94        load(this.collect_config_file);
    8695    }
    8796
Note: See TracChangeset for help on using the changeset viewer.