Changeset 16710 for gsdl/trunk/runtime-src/src/oaiservr/listidsaction.cpp
- Timestamp:
- 2008-08-12T11:57:10+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/runtime-src/src/oaiservr/listidsaction.cpp
r15428 r16710 6 6 7 7 bool listidsaction::validateAction(recptproto *protocol, oaiargs ¶ms) 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); 43 10 } 44 11
Note:
See TracChangeset
for help on using the changeset viewer.