From a759fa19b3bf131e25c9ae4f18e395a9ab5da76d Mon Sep 17 00:00:00 2001 From: Erik Hanson Date: Wed, 3 Apr 2024 09:54:50 -0700 Subject: [PATCH] pkp/pkp-lib#9525 Include affiliation/ROR in Crossref deposit --- filter/ArticleCrossrefXmlFilter.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/filter/ArticleCrossrefXmlFilter.php b/filter/ArticleCrossrefXmlFilter.php index 58cef09..c2840ad 100644 --- a/filter/ArticleCrossrefXmlFilter.php +++ b/filter/ArticleCrossrefXmlFilter.php @@ -189,6 +189,27 @@ public function createJournalArticleNode($doc, $submission) } } + // Affiliation/ROR + $affiliation = $author->getData('affiliation', $locale); + if ($affiliation) { + $affiliationsNode = $doc->createElementNS($deployment->getNamespace(), 'affiliations'); + + $institutionNode = $doc->createElementNS($deployment->getNamespace(), 'institution'); + + $institutionNameNode = $doc->createElementNS($deployment->getNamespace(), 'institution_name', htmlspecialchars($affiliation, ENT_COMPAT, 'UTF-8')); + $institutionNode->appendChild($institutionNameNode); + + $rorId = $author->getData('rorId'); + if ($rorId) { + $institutionIdNode = $doc->createElementNS($deployment->getNamespace(), 'institution_id', $rorId); + $institutionIdNode->setAttribute('type', 'ror'); + $institutionNode->appendChild($institutionIdNode); + } + + $affiliationsNode->appendChild($institutionNode); + $personNameNode->appendChild($affiliationsNode); + } + $contributorsNode->appendChild($personNameNode); $isFirst = false; }