Skip to content

Commit

Permalink
pkp/pkp-lib#9926 optional custom url path in onix export data
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitlinnewson committed Jun 17, 2024
1 parent fba8ca3 commit bab4f04
Showing 1 changed file with 12 additions and 5 deletions.
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 @@ -519,7 +519,14 @@ function createProductNode($doc, $submission, $publicationFormat) {
$publisherNode->appendChild($websiteNode);

$websiteNode->appendChild($this->_buildTextNode($doc, 'WebsiteRole', '29')); // 29 -> Web page for full content
$websiteNode->appendChild($this->_buildTextNode($doc, 'WebsiteLink', $request->url($context->getPath(), 'catalog', 'book', $publication->getData('submissionId'))));

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

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

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

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

Expand Down Expand Up @@ -683,7 +690,7 @@ function createProductNode($doc, $submission, $publicationFormat) {
$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', $publication->getData('submissionId'))));
$supplierWebsiteNode->appendChild($this->_buildTextNode($doc, 'WebsiteLink', $request->url($context->getPath(), 'catalog', 'book', $websiteUrlId)));

unset($supplierNode);
unset($supplierWebsiteNode);
Expand Down

0 comments on commit bab4f04

Please sign in to comment.