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 | | } |
| 78 | // try srclink_file |
| 79 | value = get_metadata_value(docInfo, "srclink_file"); |
| 80 | if (value.empty()) { |
| 81 | // we have no file to link to, so link to the Greenstone version of the |
| 82 | // document |
| 83 | value = this->oaiConfigure->getBaseLibraryURL()+"?a=d&c="+collection+"&d="+docInfo.OID; |
| 84 | } else { |
| 85 | if (starts_with(value, "[")) { |
| 86 | // its a format statement type value eg [SourceFile], need to get the appropriate metadata |
| 87 | value = substr(findchar(value.begin(), value.end(), '[')+1,findchar(value.begin(), value.end(), ']') ); |
| 88 | value = get_metadata_value(docInfo, value); |
| 89 | } |
| 90 | |
| 91 | if (!value.empty()) { |
| 92 | text_t assocfilepath = get_metadata_value(docInfo, "assocfilepath"); |
| 93 | if (!assocfilepath.empty()) { |
| 94 | value = this->oaiConfigure->getBaseDocRoot()+"/collect/"+collection+"/index/assoc/"+assocfilepath+"/"+value; |
| 95 | } else { |
| 96 | value = ""; |
| 97 | } |
| 98 | } |
| 99 | } |