1 | #include "listidsaction.h"
|
---|
2 | #include "recptprototools.h"
|
---|
3 | #include "oaitools.h"
|
---|
4 |
|
---|
5 | //--------------------------------------------------------------------------------------------------
|
---|
6 |
|
---|
7 | bool listidsaction::validateAction(recptproto *protocol, oaiargs ¶ms)
|
---|
8 | {
|
---|
9 | return abstractlistaction::validateAction(protocol, params);
|
---|
10 | }
|
---|
11 |
|
---|
12 | //--------------------------------------------------------------------------------------------------
|
---|
13 |
|
---|
14 | bool 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 | }
|
---|