Changeset 20626


Ignore:
Timestamp:
2009-09-18T11:14:42+12:00 (15 years ago)
Author:
mdewsnip
Message:

Fixed some inconsistencies in the resumption tokens used in the ListSets service, and removed the collection build date because this request is not collection-specific.

File:
1 edited

Legend:

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

    r20590 r20626  
    8989  this->setsOutput = 0;
    9090
    91   text_t collection = "";
     91  text_t position = "";
    9292
    9393  // Process the resumptionToken if there is one
     
    9595  {
    9696    ResumptionToken resumption_token(params["resumptionToken"]);
    97     collection = resumption_token.getSet();
     97    position = resumption_token.getPosition();
    9898  }
    9999
     
    105105  }
    106106
     107  // Get the current collection from the position value
     108  text_t collection_name = "";
     109  oaiclassifier::toGSDL(collection_name, position);
     110
    107111  // Find the starting collection
    108112  text_tarray::iterator collection_iterator = collections.begin();
    109113  while (collection_iterator != collections.end())
    110114  {
    111     if (collection == "" || collection == *collection_iterator)
     115    if (collection_name == "" || collection_name == *collection_iterator)
    112116    {
    113117      break;
     
    120124  while (collection_iterator != collections.end())
    121125  {
    122     collection = (*collection_iterator);
     126    collection_name = (*collection_iterator);
    123127
    124128    // If we've output the desired number of records return a resumptionToken and we're done
    125129    if (this->setsOutput == this->configuration->resumeAfter())
    126130    {
    127       // Get the buildDate from the build.cfg file
    128       ColInfoResponse_t cinfo;
    129       comerror_t err;
    130       protocol->get_collectinfo(collection, cinfo, err, cerr);
    131 
    132       ResumptionToken resumption_token(cinfo.buildDate, collection, "", "", "", "");
     131      ResumptionToken resumption_token("", "", "", "", "", collection_name);
    133132
    134133      // Don't add any whitespace around the resumption token as it can confuse harvesters/validators
     
    138137
    139138    // If output_content_for_col() returns false a resumption token has been output, so it's time to stop
    140     if (output_content_for_col(output, protocol, params, collection) == false)
     139    if (output_content_for_col(output, protocol, params, collection_name) == false)
    141140    {
    142141      return true;
     
    173172    while (set_iterator != sets_response.docInfo.end())
    174173    {
    175       if (position == "" || position == (*set_iterator).OID)
     174      if (position == "" || position == (collection + ":" + (*set_iterator).OID))
    176175      {
    177176    break;
     
    183182
    184183  // Output the collection as a set
    185   if (position == "")
     184  if (position == "" || position == collection)
    186185  {
    187186    output << "  <set>" << endl;
     
    209208      if (this->setsOutput == this->configuration->resumeAfter())
    210209      {
    211     // Get the buildDate from the build.cfg file
    212     ColInfoResponse_t cinfo;
    213     comerror_t err;
    214     protocol->get_collectinfo(collection, cinfo, err, cerr);
    215 
    216     ResumptionToken resumption_token(cinfo.buildDate, collection, "", "", "", set);
     210    ResumptionToken resumption_token("", "", "", "", "", collection + ":" + set);
    217211
    218212    // Don't add any whitespace around the resumption token as it can confuse harvesters/validators
Note: See TracChangeset for help on using the changeset viewer.