Ignore:
Timestamp:
2013-06-04T15:56:26+12:00 (11 years ago)
Author:
kjdon
Message:

more changes for super collection stuff. Now can handle having collections in a super colleciton that are not in the main collection list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/runtime-src/src/oaiservr/oaiconfig.cpp

    r27528 r27534  
    110110  }
    111111  return 200;
     112}
     113
     114bool oaiconfig::isValidCollection(const text_t &collection)
     115{
     116  for (int c = 0; c < this->collectList.size(); c++)
     117    if (this->collectList[c] == collection) {
     118      return true;
     119    }
     120  return false;
    112121}
    113122
     
    208217    for (int c = 0; c < cfgline.size(); ++c) {
    209218      this->collectList.push_back(cfgline[c]);
     219      addToAllCollectionsList(cfgline[c]);
    210220    }
    211221  }
    212222  else if (key == "oaisupercollection" && cfgline.size() > 1) {
    213223
    214     // Configure a hierarchical super set
     224    // Configure a super collection set
    215225    // The line should read
    216226    //
     
    240250      }
    241251      this->collectMap[sub_coll]->superCollectList.push_back(super_set);
     252      addToAllCollectionsList(sub_coll);
    242253    }
    243254  }
     
    358369  }
    359370}
    360 
     371 
     372void oaiconfig::addToAllCollectionsList(const text_t coll_name) {
     373
     374  for (int c=0; c<this->allCollectList.size(); c++) {
     375    if (allCollectList[c] == coll_name) return;
     376  }
     377  this->allCollectList.push_back(coll_name);
     378 
     379}
    361380
    362381text_t oaiconfig::generateBaseServerURL() {
     
    481500}
    482501
    483 text_tarray oaiconfig::getSuperCollectionsForThisCollection(const text_t &collection) {
     502
     503text_tarray oaiconfig::getSuperCollectionsForThisCollection(const text_t &collection)
     504{
    484505
    485506  text_tarray super_colls;
Note: See TracChangeset for help on using the changeset viewer.