/** * Register the article's metadata with the SWORD deposit. */ function setMetadata() { $this->package->setCustodian($this->journal->getSetting('contactName')); $this->package->setTitle(html_entity_decode($this->article->getTitle($this->journal->getPrimaryLocale()), ENT_QUOTES, 'UTF-8')); $this->package->setAbstract(html_entity_decode(strip_tags($this->article->getAbstract($this->journal->getPrimaryLocale())), ENT_QUOTES, 'UTF-8')); $this->package->setType($this->section->getIdentifyType($this->journal->getPrimaryLocale())); // The article can be published or not. Support either. if (is_a($this->article, 'PublishedArticle')) { $doi = $this->article->getPubId('doi'); if ($doi !== null) { $this->package->setIdentifier($doi); } } foreach ($this->article->getAuthors() as $author) { $creator = $author->getFullName(true); $affiliation = $author->getAffiliation($this->journal->getPrimaryLocale()); if (!empty($affiliation)) { $creator .= "; {$affiliation}"; } $this->package->addCreator($creator); } // The article can be published or not. Support either. if (is_a($this->article, 'PublishedArticle')) { $plugin = PluginRegistry::loadPlugin('citationFormats', 'bibtex'); $this->package->setCitation(html_entity_decode(strip_tags($plugin->fetchCitation($this->article, $this->issue, $this->journal)), ENT_QUOTES, 'UTF-8')); } }