Skip to content

Commit

Permalink
pkp/pkp-lib#9877 consider monograph DOI via OAI
Browse files Browse the repository at this point in the history
  • Loading branch information
bozana committed Jul 1, 2024
1 parent 65a7c64 commit 1163b17
Showing 1 changed file with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use APP\publicationFormat\PublicationFormat;
use APP\section\Section;
use APP\submission\Submission;
use PKP\context\Context;
use PKP\db\DAORegistry;
use PKP\facades\Locale;
use PKP\i18n\LocaleConversion;
Expand Down Expand Up @@ -163,18 +164,24 @@ public function extractMetadataFromDataObject(&$publicationFormat)
$pubIdPlugins = PluginRegistry::loadCategory('pubIds', true);
foreach ((array) $pubIdPlugins as $plugin) {
$pubId = $plugin->getPubId($publicationFormat);
if ($plugin->getSetting($press->getId(), 'enableRepresentationDoi')) {
$pubId = $plugin->getPubId($publicationFormat);
}
if (!$pubId && $plugin->getSetting($press->getId(), 'enablePublicationDoi')) {
$pubId = $plugin->getPubId($publication);
}
if ($pubId) {
$dc11Description->addStatement('dc:identifier', $pubId);
}
}
$context = $request->getContext();
if (!$context) {
$contextDao = Application::getContextDAO();
/** @var Press */
$context = $contextDao->getById($monograph->getData('contextId'));
}
if ($context->areDoisEnabled()) {
$doi = $publicationFormat->getDoi();
if ($press->areDoisEnabled()) {
$enabledDoiTypes = $press->getData(Context::SETTING_ENABLED_DOI_TYPES) ?? [];
if (in_array(Repo::doi()::TYPE_REPRESENTATION, $enabledDoiTypes)) {
$doi = $publicationFormat->getDoi();
}
if (!$doi && in_array(Repo::doi()::TYPE_PUBLICATION, $enabledDoiTypes)) {
$doi = $publication->getDoi();
}
if ($doi) {
$dc11Description->addStatement('dc:identifier', $doi);
}
Expand Down

0 comments on commit 1163b17

Please sign in to comment.