Changeset 8219


Ignore:
Timestamp:
2004-10-06T05:34:24+13:00 (20 years ago)
Author:
cs025
Message:

Fixes and extensions to remedy small changes with OAI and tidying of code...

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

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/oaiservr/Makefile.in

    r8182 r8219  
    194194
    195195install:
    196     install -m 755 -s library ../../cgi-bin
     196    install -m 755 -s oaimain ../../cgi-bin
    197197
    198198depend:
  • trunk/gsdl/src/oaiservr/abstractlistaction.cpp

    r8182 r8219  
    44#include "oaitools.h"
    55
    6 #define MAXRECORDS 10
     6// The following makes sure that we don't actually use ResumptionTokens
     7#define MAXRECORDS -1
    78
    89bool abstractlistaction::validateAction(recptproto *protocol, oaiargs &params, int &numArgs)
     
    144145  }
    145146
    146   // do a resumption token if required
    147   if (this->replyToken != NULL) {
     147  // do a resumption token if required; errors cancel a token...
     148  if (this->replyToken != NULL && this->errorType != "") {
    148149    output << "<resumptionToken>";
    149150    output << this->replyToken->getToken();
  • trunk/gsdl/src/oaiservr/dublincore.cpp

    r8182 r8219  
     1
    12#include "dublincore.h"
    23
     
    67
    78const text_t dublin_core::formatPrefix() {
    8   return "dc.";
     9  return "dc";
    910}
    1011
  • trunk/gsdl/src/oaiservr/metaformat.cpp

    r8182 r8219  
    2727
    2828  for (int item = 0; item < values.size(); item ++) {
    29     if ((this->formatPrefix() == "dc.") && (this->oaiConfigure->getOAIVersion() >= 200)){
    30       output << "        <dc:" << label << ">" << values[item] << "</dc:" << label << ">\n";
     29    if (this->oaiConfigure->getOAIVersion() >= 200) { // TODO: GRB: This code may need to be subclassed by dc for 200 and later...
     30      output << "        <" << this->formatPrefix() << ":" << label << ">" << values[item] << "</" << this->formatPrefix() << ":" << label << ">\n";
    3131    }
    3232    else {
     
    5050  while (here != end) {
    5151    start = last = here->first.begin();
    52     last += this->formatPrefix().size(); // Move last so that it is one place beyond where the "." should be.
    53     metaItem = substr(start, last);      // Gets the substring starting at start and going up to (but
    54                                          // not including) last. This should be "dc." (for example)
    55    
     52
     53    if (here->first.size() < this->formatPrefix().size() ||
     54    here->first[this->formatPrefix().size()] != '.') {
     55      metaItem == "";
     56    }
     57    else {
     58      last += this->formatPrefix().size() + 1; // Move last so that it is one place beyond where the "." should be.
     59      metaItem = substr(start, last);          // Gets the substring starting at start and going up to (but
     60                                               // not including) last. This should be "dc." (for example)
     61    }
     62
    5663    if (metaItem == this->formatPrefix()) {
    5764      metaItem = substr(last, here->first.end()); // Get the rest of the metadata tag (it's name)
  • trunk/gsdl/src/oaiservr/oaiconfig.cpp

    r8182 r8219  
    120120    this->collectMap[this->collection]->fieldMap[index] = name;
    121121   
    122     //    cerr << "Mapping " << index << " to " << name << " in " << this->collection << endl;
     122    // cerr << "Mapping " << index << " to " << name << " in " << this->collection << endl;
    123123   
    124124    // TODO: check that the mapped field is actually in use
  • trunk/gsdl/src/oaiservr/oaitools.cpp

    r8182 r8219  
    1919      gsdl_id = response.docInfo[0].OID;
    2020    }
    21     else         // Response.docInfo is empty, meaning the doc in question didn't have an oai_id number.
     21    else {
     22      // Response.docInfo is empty, meaning the doc in question didn't have an oai_id number.
    2223      return gsdl_id; // Return the empty string to indicate this.
     24    }
    2325  }
    2426
  • trunk/gsdl/src/oaiservr/resumptiontoken.cpp

    r8182 r8219  
    113113  }
    114114  reply = reply + ",";
     115  cout << "OK" << flush;
    115116  reply.append(this->startItem);
    116117  reply = reply + "-" + buildDate;
  • trunk/gsdl/src/oaiservr/rfc1807.cpp

    r8182 r8219  
    77
    88const text_t rfc1807::formatPrefix() {
    9   return "rfc1807.";
     9  return "rfc1807";
    1010}
    1111
Note: See TracChangeset for help on using the changeset viewer.