Ignore:
Timestamp:
2008-08-12T11:57:10+12:00 (16 years ago)
Author:
mdewsnip
Message:

Completely tidied up abstractlistaction::validateAction() to handle the resumptionToken argument properly, and to structure the checking code more consistently.

File:
1 edited

Legend:

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

    r15428 r16710  
    66
    77bool listidsaction::validateAction(recptproto *protocol, oaiargs &params)
    8 {
    9   int params_size = params.getSize();
    10   int numArgs  = 1; // For "verb" arg
    11 
    12   if (!abstractlistaction::validateAction(protocol, params, numArgs)) {
    13     return false;
    14   }
    15 
    16   // In OAI v1.1 metadataPrefix is not allowed.
    17   if (this->configuration->getOAIVersion() <= 110){
    18     if(numArgs != params_size){
    19       this->errorType = "badArgument";
    20       return false;
    21     }
    22   }
    23   else { // In OAI v2.0, it is compulsory
    24     text_t metaFormat = params["metadataPrefix"];
    25     if (metaFormat == ""){
    26       this->errorType = "badArgument";
    27       return false;
    28     }
    29     else { // If it isn't empty, increase the valid args count and compare this to the total num of args
    30       if (++numArgs != params_size){
    31     this->errorType = "badArgument";
    32     return false;
    33       }
    34     }
    35     // Check that the metadataPrefix is a format we support
    36     if (this->formatNotSupported(metaFormat)){
    37       this->errorType = "cannotDisseminateFormat";
    38       return false;
    39     }
    40   }
    41   this->errorType = "";
    42   return true;
     8{
     9  return abstractlistaction::validateAction(protocol, params);
    4310}
    4411
Note: See TracChangeset for help on using the changeset viewer.