Skip to content

Commit

Permalink
Merge pull request #1650 from kaitlinnewson/9925-3_3_0
Browse files Browse the repository at this point in the history
pkp/pkp-lib#9925 add license data to Onix export
  • Loading branch information
bozana authored Aug 2, 2024
2 parents 0624594 + 7c5f95c commit 78a714d
Showing 1 changed file with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,29 @@ function createProductNode($doc, $submission, $publicationFormat) {
$descDetailNode->appendChild($this->_buildTextNode($doc, 'EpubTechnicalProtection', $publicationFormat->getTechnicalProtectionCode()));
}

/* --- License information --- */

$publication = $submission->getCurrentPublication();

if ($publication->isCCLicense()) {
AppLocale::requireComponents(LOCALE_COMPONENT_PKP_SUBMISSION); // For CC License Names
$licenseOpts = Application::getCCLicenseOptions();
$licenseUrl = $publication->getData('licenseUrl');
if (array_key_exists($licenseUrl, $licenseOpts)) {
$licenseName = (__($licenseOpts[$licenseUrl], [], $publication->getData('locale')));

$epubLicenseNode = $doc->createElementNS($deployment->getNamespace(), 'EpubLicense');
$descDetailNode->appendChild($epubLicenseNode);
$epubLicenseNode->appendChild($this->_buildTextNode($doc, 'EpubLicenseName', $licenseName));

$epubLicenseExpressionNode = $doc->createElementNS($deployment->getNamespace(), 'EpubLicenseExpression');
$epubLicenseNode->appendChild($epubLicenseExpressionNode);

$epubLicenseExpressionNode->appendChild($this->_buildTextNode($doc, 'EpubLicenseExpressionType', '02'));
$epubLicenseExpressionNode->appendChild($this->_buildTextNode($doc, 'EpubLicenseExpressionLink', $licenseUrl));
}
}

/* --- Collection information, first for series and then for product --- */

/* --- Series information, if this monograph is part of one. --- */
Expand Down Expand Up @@ -299,7 +322,6 @@ function createProductNode($doc, $submission, $publicationFormat) {

$productTitleDetailNode->appendChild($titleElementNode);

$publication = $submission->getCurrentPublication();
if (!$publication->getLocalizedData('prefix') || !$publication->getLocalizedData('title')) {
$titleElementNode->appendChild($this->_buildTextNode($doc, 'TitleText', trim($publication->getLocalizedData('prefix') ?? $publication->getLocalizedTitle())));
} else {
Expand Down

0 comments on commit 78a714d

Please sign in to comment.