Changeset 5649 for trunk


Ignore:
Timestamp:
2003-10-16T11:20:11+13:00 (21 years ago)
Author:
jmt12
Message:

203B301: Changing view away from design now causes collection to release as necessary, configuration to be written, and collection to be readd if released

Location:
trunk/gli/src/org/greenstone/gatherer/cdm
Files:
2 edited

Legend:

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

    r5590 r5649  
    4343import org.greenstone.gatherer.cdm.SubcollectionManager;
    4444import org.greenstone.gatherer.cdm.TranslationView;
     45import org.greenstone.gatherer.util.GSDLSiteConfig;
    4546
    4647/** This manager provides access to submanagers, which in turn provide tools for the designing of Greenstone collections via the information stored in etc/collect.cfg. This class acts as a hub for the managers that handle specific parts of the configuration such as classifiers, format strings and language settings.
     
    155156    general_manager.gainFocus();
    156157    }
     158   
    157159    /** Retrieve the name of the collection configuration file which is being used as the source of the information in this object.
    158160     * @return The files absolute path as a <strong>String</strong>.
     
    173175     * @see org.greenstone.gatherer.util.EmailAddress
    174176     */
    175     public void save() {
    176     general_manager.loseFocus();
    177     collect_config.save();
    178     }
     177   public void save() {
     178      // Release collection as necessary
     179      ///ystem.err.println("Would have released collection if necessary.");
     180      boolean collection_released = false;
     181      if(format_manager.formatsChanged() && Gatherer.c_man.built() && Gatherer.config.exec_file != null) {
     182     // Release the collection
     183     Gatherer.g_man.preview_pane.configServer(GSDLSiteConfig.RELEASE_COMMAND + Gatherer.c_man.getCollection().getName());
     184     collection_released = true;
     185      }
     186     
     187      general_manager.loseFocus();
     188      collect_config.save();
     189     
     190      // Readd collection
     191      ///ystem.err.println("Would have added collection if it had been released.");
     192      if(collection_released) {
     193     // Then re-add it to force format commands to be processed
     194     Gatherer.g_man.preview_pane.configServer(GSDLSiteConfig.ADD_COMMAND + Gatherer.c_man.getCollection().getName());
     195     // Unset formats changed
     196     format_manager.setFormatsChanged(false);
     197      }
     198    }
     199   
    179200    /** Method used during a global search and replace to highlight the appropriate record within the Collection Design Managers version of the Metadata Set Manager (view only).
    180201     * @param element The name of the desired element as a <strong>String</strong>.
  • trunk/gli/src/org/greenstone/gatherer/cdm/GeneralManager.java

    r5595 r5649  
    5858    private Control controls;
    5959    /** The panel apon which is rendered the currently selected section screen. */
    60     private Control view = null;
     60   private Control view = null;
    6161    /** A tree to serve as a 'table of contents' for this design tool. We decided on a tree rather than a list, as it allows us to break sections into subsections if they become to complicated. */
    6262    private DesignTree tree;
     
    113113
    114114    /** Saves the state of the controls in the current view. */
    115     public void loseFocus() {
    116     if (view != null) {
    117         view.loseFocus();
    118     }
     115   public void loseFocus() {
     116      if (view != null) {
     117     view.loseFocus();
     118      }
    119119    }
    120120
Note: See TracChangeset for help on using the changeset viewer.