Changeset 11311 for trunk


Ignore:
Timestamp:
2006-03-08T14:27:44+13:00 (18 years ago)
Author:
kjdon
Message:

anywhere where we determine document/classifier by checking for starting with HASH, I changed to check if starts with CL

Location:
trunk/gsdl/src/oaiservr
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/oaiservr/abstractlistaction.cpp

    r9608 r11311  
    197197      }
    198198     
    199       // Check that the item with the HASH ID 'gsdl_id' has a lastmodified field that fits within
     199      // Check that the item with the 0ID 'gsdl_id' has a lastmodified field that fits within
    200200      // the required date range (if specified).
    201201      if (this->inDateRange(params["from"], params["until"], gsdlCollect, gsdl_id, protocol, output)) {
     
    354354    text_t child = response.docInfo[c].OID;
    355355   
    356     // check for HASH items and exclude them
     356    // distinguish classifiers and documents by checking whether OID
     357    // starts with CL or not
    357358    text_t childHead;
    358359    text_t::const_iterator start = child.begin();
    359360    text_t::const_iterator here  = child.begin();
    360     here += 4;
     361    here += 2;
    361362    childHead = substr(start, here);
    362363   
    363364    // documents we output now
    364     if (childHead == "HASH") {
    365       // Check that the item with the HASH ID 'gsdl_id' has a lastmodified field that fits
     365    if (childHead != "CL") {
     366      // Check that the item with the 0ID 'gsdl_id' has a lastmodified field that fits
    366367      // within the required date range (if specified)
    367368      if (this->inDateRange(from, until, collection, child, protocol, output)) {
     
    386387}
    387388
    388 /*
    389 bool listrecsaction::recurse_set(ostream &output, recptproto *protocol, const text_t &collection, const text_t &classifier, const text_t &metadataPrefix)
    390 {
    391   FilterResponse_t response;
    392   text_tset        metadata;
    393   ofstream         logout("oai.log", ios::app);
    394   bool             prevDocSeen = false;
    395 
    396   get_children(classifier, collection, metadata, false, protocol, response, logout);
    397 
    398   for (int c = 0; c < response.numDocs; ++c) {
    399     text_t child = response.docInfo[c].OID;
    400    
    401     // check for HASH items and exclude them
    402     text_t childHead;
    403     text_t::const_iterator start = child.begin();
    404     text_t::const_iterator here  = child.begin();
    405     here += 4;
    406     childHead = substr(start, here);
    407    
    408     // documents we output now
    409     if (childHead == "HASH") {
    410       this->output_document(output, protocol, collection, child, metadataPrefix);
    411       ++this->outputDocs;
    412       prevDocSeen = true;
    413     }
    414     // children which are classifiers are recursed
    415     else {
    416       prevDocSeen = this->recurse_set(output, protocol, collection, child, metadataPrefix);
    417     }
    418   }
    419   return prevDocSeen;
    420 }
    421 */
    422 
    423 
    424 
    425 
     389
     390
     391
  • trunk/gsdl/src/oaiservr/listsetsaction.cpp

    r9608 r11311  
    6161    // get all the children of the (relevant) classifier data structures
    6262    get_children(browseOID, gsdlCollect, "", metadata, false, protocol, response, logout);
    63  
    6463    // and send them to the "recurse_content" list
    6564    for (int c = 0; c < response.numDocs; ++c) {
     
    8584  // get the document information
    8685  if (!get_info(classifier, collection, "", metadata, false, protocol, response, logout)) {
    87     // cerr << "Bad identifier or protocol " << classifier << endl;
     86    //cerr << "recurse content: Bad identifier or protocol " << classifier << endl;
    8887    return;
    8988  }
     
    146145      continue;
    147146
    148     // check for HASH items and exclude them
     147    // check for non classifier items and exclude them
    149148    text_t childHead;
    150149    text_t::const_iterator start = child.begin();
    151150    text_t::const_iterator here  = child.begin();
    152     here += 4;
     151    here += 2;
    153152    childHead = substr(start, here);
    154153
    155     if (childHead == "HASH")
     154    if (childHead != "CL")
    156155      continue;
    157156
  • trunk/gsdl/src/oaiservr/metaformat.cpp

    r10738 r11311  
    139139  text_t::const_iterator start = OID.begin();
    140140  text_t::const_iterator here  = OID.begin();
    141   here += 4;
     141  here += 2;
    142142  childHead = substr(start, here);
    143143
    144144  // if it isn't a document, kill it now
    145   if (childHead != "HASH") {
     145  if (childHead == "CL") {
    146146    //    cerr << "Not a document" << endl;
    147147    return false;
  • trunk/gsdl/src/oaiservr/recordaction.cpp

    r9608 r11311  
    9292  // get the document information
    9393  if (!get_info(OID, collection, "", metadata, false, protocol, this->gsdlResponse, logout)) {
     94
    9495    this->errorType = "idDoesNotExist";
    9596
     
    111112  text_t::const_iterator start = OID.begin();
    112113  text_t::const_iterator here  = OID.begin();
    113   here += 4;
     114  here += 2;
    114115  childHead = substr(start, here);
    115116 
    116117  // if it isn't a document, kill it now
    117   if (childHead != "HASH") {
     118  if (childHead == "CL") {
    118119    cerr << "Not a document" << endl;
    119120    return false;
Note: See TracChangeset for help on using the changeset viewer.