Skip to content

Commit

Permalink
pkp/pkp-lib#10292 Controlled vocab dao to eloquent model (#51)
Browse files Browse the repository at this point in the history
* pkp/pkp-lib#10292 Controlled vocab dao to eloquent model

* pkp/pkp-lib#10292 removed extended vocab classes
  • Loading branch information
touhidurabir authored Jan 4, 2025
1 parent c6d8f1c commit 8dd7701
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions OAIMetadataFormat_JATS.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
namespace APP\plugins\oaiMetadataFormats\oaiJats;

use APP\facades\Repo;
use PKP\oai\OAIMetadataFormat;
use PKP\db\DAORegistry;
use PKP\submissionFile\SubmissionFile;
use APP\core\Application;
use APP\issue\IssueAction;
use DOMDocument;
use PKP\controlledVocab\ControlledVocab;
use PKP\oai\OAIMetadataFormat;
use PKP\db\DAORegistry;
use PKP\submissionFile\SubmissionFile;
use DOMXPath;
use PKP\plugins\PluginRegistry;
use PKP\plugins\Hook;
Expand Down Expand Up @@ -310,12 +311,19 @@ protected function _mungeMetadata($doc, $journal, $article, $section, $issue) {

// Set the article keywords.
$keywordGroupNode = $xpath->query('//article/front/article-meta/kwd-group')->item(0);
/** @var SubmissionKeywordDAO $submissionKeywordDao */
$submissionKeywordDao = DAORegistry::getDAO('SubmissionKeywordDAO');

while (($kwdGroupNodes = $articleMetaNode->getElementsByTagName('kwd-group'))->length !== 0) {
$articleMetaNode->removeChild($kwdGroupNodes->item(0));
}
foreach ($submissionKeywordDao->getKeywords($publication->getId()) as $locale => $keywords) {

$keywordVocabs = Repo::controlledVocab()->getBySymbolic(
ControlledVocab::CONTROLLED_VOCAB_SUBMISSION_KEYWORD,
Application::ASSOC_TYPE_PUBLICATION,
$publication->getId(),
$journal->getSupportedLocales()
);

foreach ($keywordVocabs as $locale => $keywords) {
if (empty($keywords)) continue;

$kwdGroupNode = $this->_addChildInOrder($articleMetaNode, $doc->createElement('kwd-group'));
Expand Down

0 comments on commit 8dd7701

Please sign in to comment.