diff --git a/classes/publication/Publication.php b/classes/publication/Publication.php index 74027d4abed..e21def25782 100644 --- a/classes/publication/Publication.php +++ b/classes/publication/Publication.php @@ -49,12 +49,13 @@ public function getEditorString() * Get the URL to a localized cover image * * @param int $contextId - * + * @param string $preferredLocale Return the cover image in a specified locale. + * * @return string */ - public function getLocalizedCoverImageUrl($contextId) + public function getLocalizedCoverImageUrl($contextId, $preferredLocale = null) { - $coverImage = $this->getLocalizedData('coverImage'); + $coverImage = $this->getLocalizedData('coverImage', $preferredLocale); if (!$coverImage) { return Application::get()->getRequest()->getBaseUrl() . '/templates/images/book-default.png'; diff --git a/plugins/importexport/onix30/filter/MonographONIX30XmlFilter.php b/plugins/importexport/onix30/filter/MonographONIX30XmlFilter.php index 0566beee530..c9e2a5fa2a9 100644 --- a/plugins/importexport/onix30/filter/MonographONIX30XmlFilter.php +++ b/plugins/importexport/onix30/filter/MonographONIX30XmlFilter.php @@ -480,6 +480,17 @@ public function createProductNode($doc, $submission, $publicationFormat) $textContentNode->appendChild($this->_buildTextNode($doc, 'ContentAudience', '00')); // Any audience $textContentNode->appendChild($this->_buildTextNode($doc, 'Text', $abstract)); // Any audience + $supportingResourceNode = $doc->createElementNS($deployment->getNamespace(), 'SupportingResource'); + $collateralDetailNode->appendChild($supportingResourceNode); + $supportingResourceNode->appendChild($this->_buildTextNode($doc, 'ResourceContentType', '01')); // Front cover + $supportingResourceNode->appendChild($this->_buildTextNode($doc, 'ContentAudience', '00')); // Any audience + $supportingResourceNode->appendChild($this->_buildTextNode($doc, 'ResourceMode', '03')); // A still image + + $resourceVersionNode = $doc->createElementNS($deployment->getNamespace(), 'ResourceVersion'); + $supportingResourceNode->appendChild($resourceVersionNode); + $resourceVersionNode->appendChild($this->_buildTextNode($doc, 'ResourceForm', '01')); // Linkable resource + $resourceVersionNode->appendChild($this->_buildTextNode($doc, 'ResourceLink', $publication->getLocalizedCoverImageUrl($context->getId(), $publication->getData('locale')))); + /* --- Publishing Detail --- */ $publishingDetailNode = $doc->createElementNS($deployment->getNamespace(), 'PublishingDetail');