From e3052d0de4f639160091848b4add9d12ed001636 Mon Sep 17 00:00:00 2001 From: rhigman <73792779+rhigman@users.noreply.github.com> Date: Tue, 31 Oct 2023 11:28:43 +0000 Subject: [PATCH] Update ProQuest ONIX 2.1 (replace zero price composite with UnpricedItemType) based on feedback from ProQuest --- CHANGELOG.md | 2 ++ .../src/xml/onix21_proquest_ebrary.rs | 20 ++++--------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 643e6f4c..ebd40b1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed - Upgrade rust to `1.73.0` in production and development `Dockerfile` - Upgrade build dependencies (npm `v10.2.0`, node `v18.18.2`, n `v9.2.0` and rollup `v4.1.4`) in production and development `Dockerfile` + - [519](https://github.com/thoth-pub/thoth/issues/519) - Update ProQuest Ebrary (Ebook Central) ONIX output pricing ## [[0.11.7]](https://github.com/thoth-pub/thoth/releases/tag/v0.11.7) - 2023-10-02 ### Changed diff --git a/thoth-export-server/src/xml/onix21_proquest_ebrary.rs b/thoth-export-server/src/xml/onix21_proquest_ebrary.rs index 7408e83c..66220072 100644 --- a/thoth-export-server/src/xml/onix21_proquest_ebrary.rs +++ b/thoth-export-server/src/xml/onix21_proquest_ebrary.rs @@ -405,18 +405,9 @@ impl XmlElementBlock for Work { w.write(XmlEvent::Characters("Open access")) .map_err(|e| e.into()) })?; - // ProQuest Ebrary require the price point for Open Access titles to be listed as "0.00 USD". - write_element_block("Price", w, |w| { - // 02 RRP including tax - write_element_block("PriceTypeCode", w, |w| { - w.write(XmlEvent::Characters("02")).map_err(|e| e.into()) - })?; - write_element_block("PriceAmount", w, |w| { - w.write(XmlEvent::Characters("0.00")).map_err(|e| e.into()) - })?; - write_element_block("CurrencyCode", w, |w| { - w.write(XmlEvent::Characters("USD")).map_err(|e| e.into()) - }) + // ProQuest Ebrary require Open Access titles to be listed as 01 Free of charge + write_element_block("UnpricedItemType", w, |w| { + w.write(XmlEvent::Characters("01")).map_err(|e| e.into()) }) }) }) @@ -1072,10 +1063,7 @@ mod tests { assert!(output.contains(r#" R"#)); assert!(output .contains(r#" Open access"#)); - assert!(output.contains(r#" "#)); - assert!(output.contains(r#" 02"#)); - assert!(output.contains(r#" 0.00"#)); - assert!(output.contains(r#" USD"#)); + assert!(output.contains(r#" 01"#)); // Remove some values to test non-output of optional blocks test_work.doi = None;