1 | #include "rfc1807.h"
|
---|
2 |
|
---|
3 | const text_t rfc1807::formatName()
|
---|
4 | {
|
---|
5 | return "rfc1807";
|
---|
6 | }
|
---|
7 |
|
---|
8 | const text_t rfc1807::formatPrefix() {
|
---|
9 | return "rfc1807";
|
---|
10 | }
|
---|
11 |
|
---|
12 | bool rfc1807::output_record(ostream &output, recptproto *protocol, const text_t &collection,
|
---|
13 | const text_t &record_OID)
|
---|
14 | {
|
---|
15 | return metaformat::output_record(output, protocol, collection, record_OID);
|
---|
16 | }
|
---|
17 |
|
---|
18 | void rfc1807::output_metadata_header(ostream &output)
|
---|
19 | {
|
---|
20 | output << "<metadata>\n";
|
---|
21 |
|
---|
22 | if(this->oaiConfigure->getOAIVersion() <= 110){
|
---|
23 | // output rfc1807 wrapper for OAI v1.1
|
---|
24 | output << "<rfc1807 xmlns=\"http://info.internet.isi.edu:80/in-notes/rfc/files/rfc1807.txt\"" << endl;
|
---|
25 | output << " xmlns:xsi=\"http://www.w3c.org/2001/XMLSchema-instance\"" << endl;
|
---|
26 | output << " xsi:schemaLocation=\"http://info.internet.isi.edu:80/in-notes/rfc/files/rfc1807.txt"
|
---|
27 | << endl;
|
---|
28 | output << " http://www.openarchives.org/OAI/1.1/rfc1807.xsd\">" << endl;
|
---|
29 | }
|
---|
30 | else {
|
---|
31 | // TODO: output rfc1807 wrapper for OAI v2.0
|
---|
32 | output << "<rfc1807 xmlns=\"http://info.internet.isi.edu:80/in-notes/rfc/files/rfc1807.txt\"" << endl;
|
---|
33 | output << " xmlns:xsi=\"http://www.w3c.org/2001/XMLSchema-instance\"" << endl;
|
---|
34 | output << " xsi:schemaLocation=\"http://info.internet.isi.edu:80/in-notes/rfc/files/rfc1807.txt"
|
---|
35 | << endl;
|
---|
36 | output << " http://www.openarchives.org/OAI/1.1/rfc1807.xsd\">" << endl;
|
---|
37 | }
|
---|
38 | }
|
---|
39 |
|
---|
40 | void rfc1807::output_metadata_footer(ostream &output)
|
---|
41 | {
|
---|
42 | // end rfc1807 wrapper
|
---|
43 | output << "</rfc1807>" << endl;
|
---|
44 |
|
---|
45 | output << "</metadata>\n";
|
---|
46 | }
|
---|
47 |
|
---|
48 | bool rfc1807::output_formatdata(ostream &output)
|
---|
49 | {
|
---|
50 | // Both versions of the protocol use the same schema (yes?)
|
---|
51 | output << " <metadataPrefix>rfc1807</metadataPrefix>" << endl;
|
---|
52 | output << " <schema>http://www.openarchives.org/OAI/1.1/rfc1807.xsd</schema>" << endl;
|
---|
53 | // N.B.: no namespace for this format
|
---|
54 | output << " <metadataNamespace></metadataNamespace>" << endl;
|
---|
55 |
|
---|
56 | return true;
|
---|
57 | }
|
---|