Ignore:
Timestamp:
2017-02-08T18:31:18+13:00 (7 years ago)
Author:
ak19
Message:

Round 1 of commits for getting OAI deletion policy to work with GS2 (server end). The perl code writing out the OAI db and the GS3 server code implementing the deletion policy had already been completed earlier (end 2016).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/runtime-src/src/oaiservr/recordaction.cpp

    r24286 r31387  
    148148  // Check a document with the specified identifier exists
    149149  text_tset metadata;
    150   if (!get_info(identifier, collection, "", metadata, false, protocol, this->gsdlResponse, *logout))
     150  if (!get_oai_info(identifier, collection, "", metadata, false, protocol, this->gsdlResponse, *logout))
    151151  {
    152152    this->errorType = "idDoesNotExist";
     
    200200 
    201201  // get the document information
    202   if (!get_info(OID, collection, "", metadata, false, protocol, this->gsdlResponse, logout)) {
     202  if (!get_oai_info(OID, collection, "", metadata, false, protocol, this->gsdlResponse, logout)) {
    203203
    204204    this->errorType = "idDoesNotExist";
     
    208208      return false;
    209209    }
     210  }
     211  else {   
     212    this->errorType = "";
    210213  }
    211214
     
    232235  ResultDocInfo_t doc_info = this->gsdlResponse.docInfo[0];
    233236  text_t lastModified = "";
     237  text_t deleted_status = "";
    234238
    235239  // Fills lastModified with the date from the document in doc_info, in the format YYYY-MM-DD
    236240  this->getLastModifiedDate(doc_info, lastModified);
     241  this->getMeta(doc_info, "oaiinf.status", deleted_status);
    237242
    238243  // If the ID exists, output record for oai response (OAI v1.1)
     
    246251   
    247252    // output header part of oai response
    248     this->output_record_header(output, oaiLabel, lastModified,
     253    this->output_record_header(output, oaiLabel, lastModified, deleted_status,
    249254                   doc_info.metadata["memberof"].values, oaiVersion);
    250255   
    251     if (this->errorType != "cannotDisseminateFormat"){
     256    // only output <metadata /> section if record is not marked as deleted
     257    if (this->errorType != "cannotDisseminateFormat" && deleted_status != "D") {
    252258      if (this->formatMap[metadataPrefix].get_class()->output_metadata(output, collection, doc_info)) {
    253259    //  output 'about' part of oai response - we probably won't ever use this
Note: See TracChangeset for help on using the changeset viewer.