source: gsdl/trunk/runtime-src/src/oaiservr/listidsaction.cpp@ 16710

Last change on this file since 16710 was 16710, checked in by mdewsnip, 16 years ago

Completely tidied up abstractlistaction::validateAction() to handle the resumptionToken argument properly, and to structure the checking code more consistently.

  • Property svn:keywords set to Author Date Id Revision
File size: 1.3 KB
Line 
1#include "listidsaction.h"
2#include "recptprototools.h"
3#include "oaitools.h"
4
5//--------------------------------------------------------------------------------------------------
6
7bool listidsaction::validateAction(recptproto *protocol, oaiargs &params)
8{
9 return abstractlistaction::validateAction(protocol, params);
10}
11
12//--------------------------------------------------------------------------------------------------
13
14bool listidsaction::output_document(ostream& output, recptproto *protocol, const text_t &collection,
15 const text_t &OID, const text_t &metadataPrefix /* ignored */)
16{
17 FilterResponse_t response;
18 ResultDocInfo_t doc_info;
19 text_tset metadata;
20 ofstream logout("oai.log", ios::app);
21 text_t lastModified;
22 int oaiVersion = this->configuration->getOAIVersion();
23
24 get_info(OID, collection, "", metadata, false, protocol, response, logout);
25 doc_info = response.docInfo[0];
26 this->getLastModifiedDate(doc_info, lastModified);
27
28 // output the record for this document
29 text_t oaiLabel = OID;
30 oaiclassifier::toOAI(collection, oaiLabel);
31
32 if(oaiVersion <= 110)
33 output << " <identifier>" << oaiLabel << "</identifier>\n";
34 else
35 this->output_record_header(output, oaiLabel, lastModified,
36 doc_info.metadata["memberof"].values, oaiVersion);
37
38 return true;
39}
Note: See TracBrowser for help on using the repository browser.