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/listrecsaction.cpp

    r24412 r27534  
    165165    text_t set = params["set"];
    166166
     167    // Is the set a super collection??
     168    text_tarray &super_collections = this->configuration->getSuperCollectionsList();
     169    bool super_collection_found = false;
     170    for (int c = 0; c < super_collections.size(); c++)
     171    {
     172      if (super_collections[c] == set)
     173      {
     174    super_collection_found = true;
     175    break;
     176      }
     177    }
     178    if (super_collection_found) {
     179      this->errorType = "";
     180      return true;
     181    }
     182
    167183    // Extract the collection name from the set specification
    168184    text_t collection = "";
     
    180196   
    181197    // Check the collection is one that is in the list in the oai.cfg file
    182     text_tarray &collections = this->configuration->getCollectionsList();
    183     bool collection_found = false;
    184     for (int c = 0; c < collections.size(); c++)
    185     {
    186       if (collections[c] == collection)
    187       {
    188     collection_found = true;
    189     break;
    190       }
    191     }
    192 
    193     // The collection was not found
    194     if (!collection_found)
    195     {
    196       this->errorType = "badArgument";
    197       return false;
    198     }
     198    if (!this->configuration->isValidCollection(collection)) {
     199      this->errorType = "badArgument";
     200      return false;
     201    }     
    199202
    200203    // Check the child set if it was given
Note: See TracChangeset for help on using the changeset viewer.