- Timestamp:
- 2017-08-18T19:28:42+12:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/runtime-src/src/oaiservr/oaiaction.cpp
r31390 r31903 551 551 } 552 552 553 // works out the earliest date/timestamp of the OAI repository, 554 // which compares and then selects the earliest timestamp value among all collections. 555 // In the past, the earliest date/timestamp used to be the unix epoch, 556 // later it became the earliest among each collection's builddate in build.cfg, 557 // and now, after implementing the OAI deletion policy, it needed to become the earliest 558 // among each collection's OAI_EARLIESTTIMESTAMP_OID record's timestamp value. 559 553 560 text_t oaiaction::calcEarliestDatestamp(recptproto *protocol, oaiargs ¶ms) { 554 561 … … 570 577 // (the earliestDatestamp for a collection has already been extracted from 571 578 // their build.cfg file at this point by collectserver::configure. The field 572 // is declared in comtypes.h) 573 579 // is declared in comtypes.h) 580 581 // We've changed this again to grab the timestamp field of the OAI_EARLIESTTIMESTAMP_OID 582 // record of each collection's oai-inf.db (representing the time that collection was 583 // built for the very first time) and choosing the earliest among all of them. 574 584 575 585 // Get a list of the OAI-enabled collections available … … 597 607 collection_iterator++; 598 608 } 609 610 ofstream logout("oai.log", ios::app); 599 611 600 612 // Now loop through the remaining collections … … 604 616 collection_name = (*collection_iterator); 605 617 618 text_tset metadata; 619 FilterResponse_t response; 620 621 // get timestamps from etc/oai-inf.<db> now, no longer from build.cfg 622 // request the special record with OID=OAI_EARLIESTTIMESTAMP_OID for the collection 623 bool status_ok = get_oai_info(OAI_EARLIESTTIMESTAMP_OID, collection_name, "", metadata, false, protocol, response, logout); 624 625 if(status_ok) { 626 ResultDocInfo_t doc_info = response.docInfo[0]; 627 text_t collEarliestTimestamp; 628 // the timestamp we want lives in the "lastmodified" field of the OAI_EARLIESTTIMESTAMP_OID record 629 this->getLastModifiedDate(doc_info, collEarliestTimestamp); 630 631 if(earliestDatestamp == "") { // first earliestdatestamp we've seen for an oai collection 632 earliestDatestamp = collEarliestTimestamp; 633 } else if(collEarliestTimestamp < earliestDatestamp) { 634 earliestDatestamp = collEarliestTimestamp; 635 } 636 } /*else { // collection may not have oai-inf.db (yet), check build.cfg? 637 // No: no need to use the old way as fallback 638 606 639 ColInfoResponse_t cinfo; 607 640 comerror_t err; … … 618 651 } 619 652 } 653 } 654 */ 620 655 collection_iterator++; 621 656 622 } 657 } 658 logout.close(); 623 659 } 624 660
Note:
See TracChangeset
for help on using the changeset viewer.