- Timestamp:
- 2010-03-03T14:59:22+13:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/runtime-src/src/oaiservr/dublincore.cpp
r18895 r21761 1 1 2 2 #include "dublincore.h" 3 #include "gsdltools.h" 3 4 4 5 dublin_core::dublin_core() : metaformat() { … … 72 73 } 73 74 75 bool dublin_core::output_custom_metadata(ostream &output, outconvertclass &outconvert, bool &headerDone, const text_t &collection, ResultDocInfo_t &docInfo) { 76 text_t value = get_metadata_value(docInfo, "srclink_file"); 77 if (value.empty()) { 78 value = "gs doc"; // todo, situation where no source doc. 79 } else { 80 if (starts_with(value, "[")) { 81 // its a format statement type value eg [SourceFile], need to get the appropriate metadata 82 value = substr(findchar(value.begin(), value.end(), '[')+1,findchar(value.begin(), value.end(), ']') ); 83 value = get_metadata_value(docInfo, value); 84 } 85 } 86 if (!value.empty()) { 87 text_t assocfilepath = get_metadata_value(docInfo, "assocfilepath"); 88 if (!assocfilepath.empty()) { 89 value = this->oaiConfigure->getCollectionConfig("", "baseDocRoot")+"/collect/"+collection+"/index/assoc/"+assocfilepath+"/"+value; 90 } else { 91 value = ""; 92 } 93 94 } 95 if (!value.empty()) { 96 if (!headerDone) { 97 this->output_metadata_header(output); 98 headerDone = true; 99 } 100 if (this->oaiConfigure->getOAIVersion() >= 200) { 101 output << outconvert << " <dc:identifier>" << xml_safe(value) << "</dc:identifier>\n"; 102 } 103 else { 104 output << outconvert << " <identifier>" << xml_safe(value) << "</identifier>\n"; 105 } 106 } 107 } 108 74 109 bool dublin_core::output_formatdata(ostream &output) 75 110 {
Note:
See TracChangeset
for help on using the changeset viewer.