Changeset 8597


Ignore:
Timestamp:
2004-11-18T14:31:40+13:00 (19 years ago)
Author:
mdewsnip
Message:

Made Gatherer.configServer static.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
4 edited

Legend:

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

    r8480 r8597  
    459459    // The response code is returned immediately -- but this does not mean the local
    460460    //   library action has finished!
    461     public void configServer(String command)
     461    static public void configServer(String command)
    462462    {
    463463    try {
     
    481481
    482482    // used to send reload coll messages to the tomcat server
    483     public void configGS3Server(String site, String command) {
     483    static public void configGS3Server(String site, String command) {
    484484
    485485    try {
     
    498498        url = null;
    499499    }
    500     catch(Exception exception) {
     500    catch (Exception exception) {
    501501        DebugStream.printStackTrace(exception);
    502         ///ystem.err.println("Bad URL.");
    503502    }
    504503    }
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java

    r8250 r8597  
    195195    }
    196196
     197
    197198    /** Cause the current collection configuration to be written out to disk.
    198      * @see org.greenstone.gatherer.cdm.ClassifierManager
    199      * @see org.greenstone.gatherer.cdm.CollectionMetaManager
    200      * @see org.greenstone.gatherer.cdm.FormatManager
    201      * @see org.greenstone.gatherer.cdm.IndexManager
    202      * @see org.greenstone.gatherer.cdm.LanguageManager
    203      * @see org.greenstone.gatherer.cdm.MetadataSetView
    204      * @see org.greenstone.gatherer.cdm.PlugInManager
    205      * @see org.greenstone.gatherer.cdm.SubcollectionManager
    206      */
    207    public void save() {
    208       // Release collection as necessary
    209       ///ystem.err.println("Would have released collection if necessary.");
    210       boolean collection_released = false;
    211       String col_name = Gatherer.c_man.getCollection().getName();
    212       boolean formats_changed = format_manager.formatsChanged();
    213 
    214       if(formats_changed && Gatherer.c_man.built() && Configuration.exec_file != null) {
    215       // Release the collection
    216       Gatherer.self.configServer(GSDLSiteConfig.RELEASE_COMMAND + col_name);
    217       // This is very important -- it ensures that the above command has finished
    218       Gatherer.self.configServer("");
    219       collection_released = true;
    220       }
    221 
    222       general_manager.loseFocus();
    223       collect_config.save();
    224 
    225       if (Gatherer.isGsdlRemote) {
    226       if(formats_changed && Gatherer.c_man.built()) {
    227           // upload etc/collect.cfg to server to reflect changes
    228           Utility.zipup(col_name,Utility.CONFIG_FILE);
    229           GathererApplet.upload_url_zip(col_name,"etc");
    230       }
    231       }
    232 
    233       // Readd collection
    234       ///ystem.err.println("Would have added collection if it had been released.");
    235       if(collection_released) {
    236       // Now re-add collection to server to force format commands to be processed
    237       Gatherer.self.configServer(GSDLSiteConfig.ADD_COMMAND + col_name);
    238       // This is very important -- it ensures that the above command has finished
    239       Gatherer.self.configServer("");
    240       }
    241 
    242       if (formats_changed) {
    243       // Unset formats changed
    244       format_manager.setFormatsChanged(false);
    245       }
    246    }
     199     */
     200    public void save() {
     201    // Release collection as necessary
     202    boolean collection_released = false;
     203    String col_name = Gatherer.c_man.getCollection().getName();
     204    boolean formats_changed = format_manager.formatsChanged();
     205
     206    if (formats_changed && Gatherer.c_man.built() && Configuration.exec_file != null) {
     207        // Release the collection
     208        Gatherer.configServer(GSDLSiteConfig.RELEASE_COMMAND + col_name);
     209        // This is very important -- it ensures that the above command has finished
     210        Gatherer.configServer("");
     211        collection_released = true;
     212    }
     213
     214    general_manager.loseFocus();
     215    collect_config.save();
     216
     217    if (Gatherer.isGsdlRemote) {
     218        if (formats_changed && Gatherer.c_man.built()) {
     219        // upload etc/collect.cfg to server to reflect changes
     220        Utility.zipup(col_name,Utility.CONFIG_FILE);
     221        GathererApplet.upload_url_zip(col_name,"etc");
     222        }
     223    }
     224
     225    // Readd collection
     226    if (collection_released) {
     227        // Now re-add collection to server to force format commands to be processed
     228        Gatherer.configServer(GSDLSiteConfig.ADD_COMMAND + col_name);
     229        // This is very important -- it ensures that the above command has finished
     230        Gatherer.configServer("");
     231    }
     232
     233    if (formats_changed) {
     234        // Unset formats changed
     235        format_manager.setFormatsChanged(false);
     236    }
     237    }
    247238
    248239
  • trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java

    r8594 r8597  
    11371137        // If we have a local library running (that we know about) then we ask it to add our newly create collection
    11381138        if (Configuration.exec_file != null) {
    1139             Gatherer.self.configServer(GSDLSiteConfig.ADD_COMMAND + collection.getName());
     1139            Gatherer.configServer(GSDLSiteConfig.ADD_COMMAND + collection.getName());
    11401140            // This is very important -- it ensures that the above command has finished
    1141             Gatherer.self.configServer("");
     1141            Gatherer.configServer("");
    11421142        }
    11431143        else if (Gatherer.GS3) {
    11441144            convertToGS3Collection();
    1145             Gatherer.self.configGS3Server(Configuration.site_name, ServletConfiguration.ADD_COMMAND + collection.getName());
     1145            Gatherer.configGS3Server(Configuration.site_name, ServletConfiguration.ADD_COMMAND + collection.getName());
    11461146        } 
    11471147
     
    13401340        // Ensure that the local library has released this collection so we can delete the index directory
    13411341        if (!Gatherer.GS3 && Configuration.exec_file != null) {
    1342         Gatherer.self.configServer(GSDLSiteConfig.RELEASE_COMMAND + collection.getName());
     1342        Gatherer.configServer(GSDLSiteConfig.RELEASE_COMMAND + collection.getName());
    13431343
    13441344        // This is very important -- it ensures that the above command has finished
    13451345        // This prevents the nasty "could not remove index directory" race condition!
    1346         Gatherer.self.configServer("");
     1346        Gatherer.configServer("");
    13471347        }
    13481348
  • trunk/gli/src/org/greenstone/gatherer/collection/DeleteCollectionPrompt.java

    r8243 r8597  
    310310        // first of all we must release it from the local library
    311311        if (Configuration.exec_file != null) {
    312         ///ystem.err.println("Local Library Found!");
    313         Gatherer.self.configServer(GSDLSiteConfig.RELEASE_COMMAND + collection.getShortName());
     312        Gatherer.configServer(GSDLSiteConfig.RELEASE_COMMAND + collection.getShortName());
    314313        // This is very important -- it ensures that the above command has finished
    315         Gatherer.self.configServer("");
     314        Gatherer.configServer("");
    316315        }
    317316
Note: See TracChangeset for help on using the changeset viewer.