getFileType() . "\" xlink:href=\"" . htmlspecialchars($request->url($journal->getPath(), 'article', 'download', array($article->getBestArticleId(), $galley->getBestGalleyId()), null, null, true)) . "\" />\n";
- }
- }
- }
+ // Publication keywords (guard against missing publication and DAO differences across OJS versions)
+ if ($publication) {
+ $pubKeywords = $publication->getData('keywords'); // expected: [locale => [kw1, kw2, ...]]
+ if (is_array($pubKeywords)) {
+ foreach ($pubKeywords as $locale => $keywords) {
+ if (empty($keywords) || !is_array($keywords)) continue;
+ $response .= "\t\t\t\n";
+ foreach ($keywords as $keyword) {
+ $response .= "\t\t\t\t" . htmlspecialchars($keyword) . "\n";
+ }
+ $response .= "\t\t\t\n";
+ }
+ }
+ }
- // Keywords
- $subjects = array();
- if (is_array($article->getSubject(null))) foreach ($article->getSubject(null) as $locale => $subject) {
- $s = array_map('trim', explode(';', $subject));
- if (!empty($s)) $subjects[$locale] = $s;
- }
- if (!empty($subjects)) foreach ($subjects as $locale => $s) {
- $response .= "\t\t\t\n";
- foreach ($s as $subject) $response .= "\t\t\t\t" . htmlspecialchars($subject) . "\n";
- $response .= "\t\t\t\n";
- }
+ // abstract
+ if ($article->getData('abstract', $articleLocale)) {
+ $abstract = PKPString::html2text($article->getData('abstract', $articleLocale));
+ $response .= "\t\t\t" . htmlspecialchars($abstract) . "
\n";
+ }
+ // Include translated abstracts
+ $abstracts = $article->getData('abstract');
+ if (is_array($abstracts)) foreach ($abstracts as $locale => $abstract) {
+ if ($locale == $articleLocale) continue;
+ if ($abstract) {
+ $abstract = PKPString::html2text($abstract);
+ $response .= "\t\t\t" . htmlspecialchars($abstract) . "
\n";
+ }
+ }
- $submissionKeywordDao = DAORegistry::getDAO('SubmissionKeywordDAO');
- foreach ($submissionKeywordDao->getKeywords($publication->getId(), $journal->getSupportedLocales()) as $locale => $keywords) {
- if (empty($keywords)) continue;
- // Load the article.subject locale key in possible other languages
- $response .= "\t\t\t\n";
- foreach ($keywords as $keyword) $response .= "\t\t\t\t" . htmlspecialchars($keyword) . "\n";
- $response .= "\t\t\t\n";
- }
+ // Page count
+ $response .=
+ ($pageInfo ? "\t\t\t\n" : '');
- // abstract
- if ($article->getAbstract($articleLocale)) {
- $abstract = PKPString::html2text($article->getAbstract($articleLocale));
- $response .= "\t\t\t" . htmlspecialchars($abstract) . "
\n";
- }
- // Include translated abstracts
- foreach ($article->getAbstract(null) as $locale => $abstract) {
- if ($locale == $articleLocale) continue;
- if ($abstract){
- $abstract = PKPString::html2text($abstract);
- $response .= "\t\t\t" . htmlspecialchars($abstract) . "
\n";
- }
- }
+ // OpenAIRE COAR Access Rights and OpenAIRE COAR Resource Type
+ $coarAccessRights = $this->_getCoarAccessRights();
+ $coarResourceLabel = $parentPlugin && method_exists($parentPlugin, '_getCoarResourceType') ? $parentPlugin->_getCoarResourceType($resourceType) : null;
- // Page count
- $response .=
- ($pageInfo?"\t\t\t\n":'');
+ if ($accessRights || $coarResourceLabel) {
+ $response .= "\t\t\t\n";
+ if ($accessRights) $response .=
+ "\t\t\t\t\n" .
+ "\t\t\t\t\t" . $coarAccessRights[$accessRights]['label'] . "\n" .
+ "\t\t\t\t\t" . $coarAccessRights[$accessRights]['url'] . "\n" .
+ "\t\t\t\t\n";
+ if ($coarResourceLabel) $response .=
+ "\t\t\t\t\n" .
+ "\t\t\t\t\t" . $coarResourceLabel . "\n" .
+ "\t\t\t\t\t" . $resourceType . "\n" .
+ "\t\t\t\t\n";
+ $response .= "\t\t\t\n";
+ }
- // OpenAIRE COAR Access Rights and OpenAIRE COAR Resource Type
- $coarAccessRights = $this->_getCoarAccessRights();
- $coarResourceLabel = $parentPlugin->_getCoarResourceType($resourceType);
+ $response .=
+ "\t\t