Changeset 20629
- Timestamp:
- 2009-09-18T12:18:01+12:00 (15 years ago)
- Location:
- gsdl/trunk/runtime-src/src/oaiservr
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/runtime-src/src/oaiservr/listsetsaction.cpp
r20626 r20629 186 186 output << " <set>" << endl; 187 187 output << " <setSpec>" << collection << "</setSpec>" << endl; 188 output << " <setName>" << collection << "</setName>" << endl; 188 if (this->configuration->getSetName(collection) != "") 189 { 190 output << " <setName>" << this->configuration->getSetName(collection) << "</setName>" << endl; 191 } 192 else 193 { 194 output << " <setName>" << collection << "</setName>" << endl; 195 } 196 if (this->configuration->getSetDescription(collection) != "") 197 { 198 output << " <setDescription>" << this->configuration->getSetDescription(collection) << "</setDescription>" << endl; 199 } 189 200 output << " </set>" << endl; 190 201 this->setsOutput++; … … 216 227 217 228 // Otherwise output this set and increment the count 218 text_t set_title = set_response.docInfo[0].metadata["Title"].values[0];219 229 output << " <set>" << endl; 220 230 output << " <setSpec>" << collection << ":" << set << "</setSpec>" << endl; 221 output << " <setName>" << collection << ":" << set_title << "</setName>" << endl; 231 if (this->configuration->getSetName(collection + ":" + set) != "") 232 { 233 output << " <setName>" << this->configuration->getSetName(collection + ":" + set) << "</setName>" << endl; 234 } 235 else 236 { 237 output << " <setName>" << set_response.docInfo[0].metadata["Title"].values[0] << "</setName>" << endl; 238 } 239 if (this->configuration->getSetDescription(collection + ":" + set) != "") 240 { 241 output << " <setDescription>" << this->configuration->getSetDescription(collection + ":" + set) << "</setDescription>" << endl; 242 } 222 243 output << " </set>" << endl; 223 244 this->setsOutput++; -
gsdl/trunk/runtime-src/src/oaiservr/oaiconfig.cpp
r20607 r20629 217 217 } 218 218 } 219 else if (key == "oaisetname" && cfgline.size() == 2) { 220 this->setNameMap[cfgline[0]] = cfgline[1]; 221 } 222 else if (key == "oaisetdescription" && cfgline.size() == 2) { 223 this->setDescriptionMap[cfgline[0]] = cfgline[1]; 224 } 219 225 else if (key == "oaiversion" && cfgline.size() >= 1) { 220 226 this->oaiVersion = cfgline[0]; … … 390 396 } 391 397 } 398 399 400 text_t oaiconfig::getSetName(const text_t &setSpec) 401 { 402 if (setNameMap.find(setSpec) != setNameMap.end()) 403 { 404 return setNameMap[setSpec]; 405 } 406 407 return ""; 408 } 409 410 411 text_t oaiconfig::getSetDescription(const text_t &setSpec) 412 { 413 if (setDescriptionMap.find(setSpec) != setDescriptionMap.end()) 414 { 415 return setDescriptionMap[setSpec]; 416 } 417 418 return ""; 419 } -
gsdl/trunk/runtime-src/src/oaiservr/oaiconfig.h
r18903 r20629 34 34 text_t getMapping(const text_t &collection, const text_t &collectfield, const text_t &format); 35 35 text_tmap * getInformation() { return &this->infoMap; } 36 text_t getSetName(const text_t &setSpec); 37 text_t getSetDescription(const text_t &setSpec); 36 38 int getOAIVersion(); 37 39 int resumeAfter(); … … 43 45 text_tmap infoMap; // Holds the information to be given in the case 44 46 // of an OAI identify request 47 text_tmap setNameMap; // Holds user-defined names for the sets 48 text_tmap setDescriptionMap; // Holds user-defined descriptions for the sets 45 49 oaicollectmap collectMap; // The configuration of collections 46 50 text_t collection; // Used to track which collection is being configured
Note:
See TracChangeset
for help on using the changeset viewer.