Changeset 4340


Ignore:
Timestamp:
2003-05-27T11:39:16+12:00 (21 years ago)
Author:
sjboddie
Message:

Tidied up configaction slightly. Running 'a=config&cmd=add-collection'
will now correctly reconfigure the collection if it already exists.

Location:
trunk/gsdl/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/colservr/collectset.cpp

    r2677 r4340  
    220220void collectset::add_collection (const text_t &collection, void *recpt,
    221221                 const text_t &gsdlhome, const text_t &gdbmhome) {
     222
     223  // if an old collection server exists for this collection we should
     224  // delete it first
     225  collectservermapclass::iterator here = cservers.begin();
     226  collectservermapclass::iterator end = cservers.end();
     227  while (here != end) {
     228    if ((*here).second.c != NULL && (*here).first == collection) {
     229      delete (*here).second.c;
     230      cservers.erase (here);
     231      break;
     232    }
     233    here ++;
     234  }
    222235     
    223236  // read config file to see if built with mg or mgpp
     
    314327void collectset::remove_collection (const text_t &collection, ostream &logout) {
    315328
     329  // do nothing if no collection server exists for this collection
     330  if (cservers.getcollectserver(collection) == NULL) return;
     331
    316332  // first unload any cached mg databases - we may need to do something
    317333  // similar to this for mgpp too
  • trunk/gsdl/src/recpt/configaction.cpp

    r4290 r4340  
    5252  arg_ainfo.multiplechar = true;
    5353  arg_ainfo.defaultstatus = cgiarginfo::weak;
    54   arg_ainfo.argdefault = "configure-all";
     54  arg_ainfo.argdefault = "";
    5555  arg_ainfo.savedarginfo = cgiarginfo::mustnot;
    5656  argsinfo.addarginfo (NULL, arg_ainfo);
     
    9191// add it to the null protocol.
    9292void configaction::create_colservr (const text_t &collection, ostream &logout) {
     93
     94  // just in case we're adding a collection that already exists
     95  recpt->uncache_collection(collection);
    9396
    9497  recptprotolistclass *protos = recpt->get_recptprotolist_ptr();
Note: See TracChangeset for help on using the changeset viewer.