source: main/tags/2.80/gsdl/src/oaiservr/rfc1807.cpp@ 24527

Last change on this file since 24527 was 8219, checked in by cs025, 20 years ago

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

  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1#include "rfc1807.h"
2
3const text_t rfc1807::formatName()
4{
5 return "rfc1807";
6}
7
8const text_t rfc1807::formatPrefix() {
9 return "rfc1807";
10}
11
12bool 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
18void 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
40void rfc1807::output_metadata_footer(ostream &output)
41{
42 // end rfc1807 wrapper
43 output << "</rfc1807>" << endl;
44
45 output << "</metadata>\n";
46}
47
48bool 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
54 // N.B.: no namespace for this format
55 return true;
56}
Note: See TracBrowser for help on using the repository browser.