Ignore:
Timestamp:
2004-07-16T13:48:18+12:00 (20 years ago)
Author:
davidb
Message:

General restructuring to allow GLI to be run as an applet.
Main area of change: making code look in the JAR file first
for a file rather than assume on local file system.
Stores data locally on system in '.gli' or Greenstone/GLI
folder in users home space for subsequent uses of applet.

File:
1 edited

Legend:

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

    r7601 r7739  
    4444import org.greenstone.gatherer.cdm.TranslationView;
    4545import org.greenstone.gatherer.util.GSDLSiteConfig;
     46import org.greenstone.gatherer.util.Utility;
    4647
    4748/** 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.
     
    211212      ///ystem.err.println("Would have released collection if necessary.");
    212213      boolean collection_released = false;
    213       if(format_manager.formatsChanged() && Gatherer.c_man.built() && Gatherer.config.exec_file != null) {
     214      String col_name = Gatherer.c_man.getCollection().getName();
     215      boolean formats_changed = format_manager.formatsChanged();
     216
     217      if(formats_changed && Gatherer.c_man.built() && Gatherer.config.exec_file != null) {
    214218      // Release the collection
    215       Gatherer.self.configServer(GSDLSiteConfig.RELEASE_COMMAND + Gatherer.c_man.getCollection().getName());
     219      Gatherer.self.configServer(GSDLSiteConfig.RELEASE_COMMAND + col_name);
    216220      // This is very important -- it ensures that the above command has finished
    217221      Gatherer.self.configServer("");
     
    222226      collect_config.save();
    223227
     228      if (Gatherer.isGsdlRemote) {
     229      if(formats_changed && Gatherer.c_man.built()) {
     230          // upload etc/collect.cfg to server to reflect changes
     231          Utility.zipup(col_name,Utility.CONFIG_FILE);
     232          Utility.upload_url_zip(col_name,"etc");
     233      }
     234      }
     235
    224236      // Readd collection
    225237      ///ystem.err.println("Would have added collection if it had been released.");
    226238      if(collection_released) {
    227       // Then re-add it to force format commands to be processed
    228       Gatherer.self.configServer(GSDLSiteConfig.ADD_COMMAND + Gatherer.c_man.getCollection().getName());
     239      // Now re-add collection to server to force format commands to be processed
     240      Gatherer.self.configServer(GSDLSiteConfig.ADD_COMMAND + col_name);
    229241      // This is very important -- it ensures that the above command has finished
    230242      Gatherer.self.configServer("");
    231      // Unset formats changed
    232      format_manager.setFormatsChanged(false);
    233       }
    234     }
     243      }
     244
     245      if (formats_changed) {
     246      // Unset formats changed
     247      format_manager.setFormatsChanged(false);
     248      }
     249   }
    235250
    236251//     /** Ensures that the collection is now public. Useful for collections that are based on another, or that are about to be exported */
Note: See TracChangeset for help on using the changeset viewer.