1 |
|
---|
2 | #include "dublincore.h"
|
---|
3 |
|
---|
4 | const text_t dublin_core::formatName() {
|
---|
5 | return "oai_dc";
|
---|
6 | }
|
---|
7 |
|
---|
8 | const text_t dublin_core::formatPrefix() {
|
---|
9 | return "dc";
|
---|
10 | }
|
---|
11 |
|
---|
12 | bool dublin_core::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 dublin_core::output_metadata_header(ostream &output)
|
---|
19 | {
|
---|
20 | output << " <metadata>\n";
|
---|
21 |
|
---|
22 | if (this->oaiConfigure->getOAIVersion() <= 110){
|
---|
23 | // output dublin core wrapper for OAI v1.1
|
---|
24 | output << " <dc xmlns=\"http://purl.org/dc/elements/1.1/\"\n"
|
---|
25 | << " xmlns:xsi=\"http://www.w3c.org/2001/XMLSchema-instance\"\n"
|
---|
26 | << " xsi:schemaLocation=\"http://purl.org/dc/elements/1.1/\n"
|
---|
27 | << " http://www.openarchives.org/OAI/1.1/dc.xsd\">\n";
|
---|
28 | }
|
---|
29 | else {
|
---|
30 | output << " <oai_dc:dc\n"
|
---|
31 | << " xmlns:oai_dc=\"http://www.openarchives.org/OAI/2.0/oai_dc/\"\n"
|
---|
32 | << " xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n"
|
---|
33 | << " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
|
---|
34 | << " xsi:schemaLocation=\"http://www.openarchives.org/OAI/2.0/oai_dc/\n"
|
---|
35 | << " http://www.openarchives.org/OAI/2.0/oai_dc.xsd\">\n";
|
---|
36 | }
|
---|
37 | }
|
---|
38 |
|
---|
39 | void dublin_core::output_metadata_footer(ostream &output)
|
---|
40 | {
|
---|
41 | if (this->oaiConfigure->getOAIVersion() <= 110) {
|
---|
42 | output << " </dc>" << endl;
|
---|
43 | }
|
---|
44 | else {
|
---|
45 | output << " </oai_dc:dc>" << endl;
|
---|
46 | }
|
---|
47 |
|
---|
48 | output << " </metadata>" << endl;
|
---|
49 | output.flush();
|
---|
50 | }
|
---|
51 |
|
---|
52 | bool dublin_core::output_formatdata(ostream &output)
|
---|
53 | {
|
---|
54 | output << " <metadataPrefix>oai_dc</metadataPrefix>" << endl;
|
---|
55 |
|
---|
56 | if (this->oaiConfigure->getOAIVersion() <= 110) {
|
---|
57 | output << " <schema>http://www.openarchives.org/OAI/1.1/dc.xsd</schema>" << endl
|
---|
58 | << " <metadataNamespace>http://purl.org/dc/elements/1.1/</metadataNamespace>" << endl;
|
---|
59 | }
|
---|
60 | else {
|
---|
61 | output << " <schema>http://www.openarchives.org/OAI/2.0/oai_dc.xsd</schema>" << endl
|
---|
62 | << " <metadataNamespace>http://www.openarchives.org/OAI/2.0/oai_dc/</metadataNamespace>"
|
---|
63 | << endl;
|
---|
64 | }
|
---|
65 | return true;
|
---|
66 | }
|
---|
67 |
|
---|