Changeset 16713


Ignore:
Timestamp:
2008-08-12T12:15:43+12:00 (16 years ago)
Author:
mdewsnip
Message:

The ListRecords action requires the metadataPrefix argument for both versions of OAI.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/runtime-src/src/oaiservr/listrecsaction.cpp

    r16712 r16713  
    2020    param_iterator->first != "resumptionToken" &&
    2121    param_iterator->first != "metadataPrefix")
    22     {
    23       // We've found an invalid argument
    24       invalid_argument_supplied = true;
    25 
    26       // Delete the invalid argument from the list so it doesn't end up in the <request> tag that is returned
    27       params.erase(param_iterator->first);
    28     }
    29 
    30     // The metadataPrefix argument is not allowed in OAI v1.1
    31     else if (param_iterator->first == "metadataPrefix" && this->configuration->getOAIVersion() <= 110)
    3222    {
    3323      // We've found an invalid argument
     
    8272  // ----------------------------------------------------------------------------
    8373
    84   // OAI v2.0 requires metadataPrefix
    85   if (this->configuration->getOAIVersion() > 110)
     74  // The metadataPrefix is required
     75  text_t metadataPrefix = params["metadataPrefix"];
     76
     77  // Check that the metadataPrefix argument exists
     78  if (metadataPrefix == "")
    8679  {
    87     text_t metadataPrefix = params["metadataPrefix"];
    88 
    89     // Check that the metadataPrefix argument exists
    90     if (metadataPrefix == "")
    91     {
    92       this->errorType = "badArgument";
    93       return false;
    94     }
    95     // Check that the metadataPrefix is a format we support
    96     if (this->formatNotSupported(metadataPrefix))
    97     {
    98       this->errorType = "cannotDisseminateFormat";
    99       return false;
    100     }
     80    this->errorType = "badArgument";
     81    return false;
     82  }
     83  // Check that the metadataPrefix is a format we support
     84  if (this->formatNotSupported(metadataPrefix))
     85  {
     86    this->errorType = "cannotDisseminateFormat";
     87    return false;
    10188  }
    10289
Note: See TracChangeset for help on using the changeset viewer.