Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkp/pkp-lib#9926 add download url to onix export data #1593

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function createProductNode($doc, $submission, $publicationFormat) {
$descDetailNode = $doc->createElementNS($deployment->getNamespace(), 'DescriptiveDetail');

$descDetailNode->appendChild($this->_buildTextNode($doc, 'ProductComposition',
$publicationFormat->getProductCompositionCode() ? $publicationFormat->getProductCompositionCode() : '00')); // single item, trade only, etc. Default to single item if not specified.
$publicationFormat->getProductCompositionCode() ? $publicationFormat->getProductCompositionCode() : '00')); // single item, trade only, etc. Default to single item if not specified.

$descDetailNode->appendChild($this->_buildTextNode($doc, 'ProductForm', $publicationFormat->getEntryKey())); // paperback, hardcover, etc

Expand Down Expand Up @@ -237,7 +237,7 @@ function createProductNode($doc, $submission, $publicationFormat) {
}
}

if($publicationFormat->getCountryManufactureCode() != '') {
if ($publicationFormat->getCountryManufactureCode() != '') {
$descDetailNode->appendChild($this->_buildTextNode($doc, 'CountryOfManufacture', $publicationFormat->getCountryManufactureCode()));
}

Expand Down Expand Up @@ -412,7 +412,7 @@ function createProductNode($doc, $submission, $publicationFormat) {
$subjectNode->appendChild($this->_buildTextNode($doc, 'SubjectSchemeVersion', '2')); // Version 2 of ^^

$submissionSubjectDao = DAORegistry::getDAO('SubmissionSubjectDAO');
$allSubjects = $submissionSubjectDao->getSubjects($publication->getId(), array_keys(AppLocale::getSupportedFormLocales()));
$allSubjects = $submissionSubjectDao->getSubjects($publication->getId(), array_keys(AppLocale::getSupportedFormLocales()));
$uniqueSubjects = array();
foreach ($allSubjects as $locale => $subjects) {
$uniqueSubjects = array_merge($uniqueSubjects, $subjects);
Expand Down Expand Up @@ -515,6 +515,19 @@ function createProductNode($doc, $submission, $publicationFormat) {
$websiteNode->appendChild($this->_buildTextNode($doc, 'WebsiteRole', '18')); // 18 -> Publisher's B2C website
$websiteNode->appendChild($this->_buildTextNode($doc, 'WebsiteLink', $request->url($context->getPath())));

$websiteNode = $doc->createElementNS($deployment->getNamespace(), 'Website');
$publisherNode->appendChild($websiteNode);

$websiteNode->appendChild($this->_buildTextNode($doc, 'WebsiteRole', '29')); // 29 -> Web page for full content

$submissionBestId = $publication->getData('submissionId');

if ($publication->getData('urlPath') != '') {
$submissionBestId = $publication->getData('urlPath');
}

$websiteNode->appendChild($this->_buildTextNode($doc, 'WebsiteLink', $request->url($context->getPath(), 'catalog', 'book', $submissionBestId)));

/* --- Publishing Dates --- */

$publicationDates = $publicationFormat->getPublicationDates();
Expand Down Expand Up @@ -672,6 +685,12 @@ function createProductNode($doc, $submission, $publicationFormat) {

unset($supplierWebsiteNode);
}

$supplierWebsiteNode = $doc->createElementNS($deployment->getNamespace(), 'Website');
$supplierNode->appendChild($supplierWebsiteNode);

$supplierWebsiteNode->appendChild($this->_buildTextNode($doc, 'WebsiteRole', '29')); // 29 -> Web page for full content
$supplierWebsiteNode->appendChild($this->_buildTextNode($doc, 'WebsiteLink', $request->url($context->getPath(), 'catalog', 'book', $submissionBestId)));
unset($supplierNode);
unset($supplierWebsiteNode);

Expand Down