- Timestamp:
- 2017-02-08T18:31:18+13:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/runtime-src/src/colservr/collectserver.cpp
r29100 r31387 515 515 thisfilter->filter (request, response, err, logout); 516 516 if (err != noError) return; 517 517 518 // fill in the metadata for each of the OIDs (if it is requested) 518 519 if (request.filterResultOptions & FRmetadata) { 520 519 521 bool processed = false; 520 522 ResultDocInfo_tarray::iterator resultdoc_here = response.docInfo.begin(); 521 523 ResultDocInfo_tarray::iterator resultdoc_end = response.docInfo.end(); 522 524 while (resultdoc_here != resultdoc_end) { 525 526 text_t deleted_status = ""; 527 bool append_metadata = (request.filterResultOptions & FROAI) ? true : false; 528 523 529 // try each of the sources in turn 524 530 sourcelistclass::iterator source_here = sources.begin(); … … 526 532 while (source_here != source_end) { 527 533 assert ((*source_here).s != NULL); 534 535 // first check for oai metadata from the oai_db, if asked for it (if FROAI is set) 536 if(((*source_here).s != NULL) && 537 request.filterResultOptions & FROAI && 538 ((*source_here).s->get_oai_metadata(request.requestParams, request.refParams, 539 request.getParents, request.fields, 540 (*resultdoc_here).OID, deleted_status, (*resultdoc_here).metadata, 541 err, logout))) { 542 543 if (err != noError) return; 544 545 processed = true; 546 } 547 548 // We may or may not have got oai_meta (depends on if FROAI was set). 549 // If we didn't get oai_meta, then deleted_status would still be "". 550 // If we did get oai_meta, and if the deleted_status for the OID was D for deleted entry, 551 // don't bother getting any other metadata, as there will be no entry for that OID in index db. 552 553 // Note that if we did get oai_meta and OID marked as existing, we're in append_mode: 554 // don't let get_metadata() clear the metadata list, as there's already stuff in there 555 //if(deleted_status == "E") append_metadata = true; 556 528 557 if (((*source_here).s != NULL) && 558 deleted_status != "D" && 529 559 ((*source_here).s->get_metadata(request.requestParams, request.refParams, 530 560 request.getParents, request.fields, 531 561 (*resultdoc_here).OID, (*resultdoc_here).metadata, 532 err, logout))) { 533 if (err != noError) return; 534 processed = true; 535 break; 562 err, logout, append_metadata))) { 563 if (err != noError) return; // check for errors again 564 565 processed = processed || true; // processed would not have been set yet if not doing FROAI. Set now. 566 // OR-ing isn't necessary, but indicates some consideration of both get oai meta & get meta success 536 567 } 568 569 if(processed) break; 570 537 571 ++source_here; 538 572 } … … 548 582 } 549 583 } 550 584 551 585 err = noError; 552 586 }
Note:
See TracChangeset
for help on using the changeset viewer.