Skip to content

Commit

Permalink
Merge pull request #611 from thoth-pub/feature/610_change_landing_pag…
Browse files Browse the repository at this point in the history
…e_code

Feature/610 change landing page code
  • Loading branch information
brendan-oconnell authored Jul 12, 2024
2 parents 1bfaf32 + c74f603 commit 063dc8c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- [538](https://github.com/thoth-pub/thoth/issues/538) - Update Project MUSE ONIX 3.0 export to reflect new specifications provided by Project MUSE.

### Fixed
- [610](https://github.com/thoth-pub/thoth/issues/610) - Update <WebsiteRole> code for Work Landing Page in all ONIX exports from "01" (Publisher’s corporate website) to "02" (Publisher’s website for a specified work).

## [[0.12.6]](https://github.com/thoth-pub/thoth/releases/tag/v0.12.6) - 2024-06-17
### Fixed
- [#513](https://github.com/thoth-pub/thoth/issues/513) - Expand DOI regex to include `+`, `[`, and `]`
Expand Down
6 changes: 3 additions & 3 deletions thoth-export-server/src/xml/onix21_ebsco_host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ impl XmlElementBlock<Onix21EbscoHost> for Work {
websites.insert(
landing_page.to_string(),
(
"01".to_string(),
"02".to_string(),
"Publisher's website: web shop".to_string(),
),
);
Expand Down Expand Up @@ -1028,7 +1028,7 @@ mod tests {
assert!(output
.contains(r#" <IDValue>urn:uuid:00000000-0000-0000-aaaa-000000000001</IDValue>"#));
assert!(output.contains(r#" <Website>"#));
assert!(output.contains(r#" <WebsiteRole>01</WebsiteRole>"#));
assert!(output.contains(r#" <WebsiteRole>02</WebsiteRole>"#));
assert!(output.contains(
r#" <WebsiteDescription>Publisher's website: web shop</WebsiteDescription>"#
));
Expand Down Expand Up @@ -1129,7 +1129,7 @@ mod tests {
// No subtitle supplied (within Thoth UI this would automatically update full_title)
assert!(!output.contains(r#" <Subtitle>Book Subtitle</Subtitle>"#));
// No landing page supplied
assert!(!output.contains(r#" <WebsiteRole>01</WebsiteRole>"#));
assert!(!output.contains(r#" <WebsiteRole>02</WebsiteRole>"#));
assert!(!output.contains(
r#" <WebsiteDescription>Publisher's website: web shop</WebsiteDescription>"#
));
Expand Down
6 changes: 3 additions & 3 deletions thoth-export-server/src/xml/onix21_proquest_ebrary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl XmlElementBlock<Onix21ProquestEbrary> for Work {
websites.insert(
landing_page.to_string(),
(
"01".to_string(),
"02".to_string(),
"Publisher's website: web shop".to_string(),
),
);
Expand Down Expand Up @@ -1020,7 +1020,7 @@ mod tests {
assert!(output
.contains(r#" <IDValue>urn:uuid:00000000-0000-0000-aaaa-000000000001</IDValue>"#));
assert!(output.contains(r#" <Website>"#));
assert!(output.contains(r#" <WebsiteRole>01</WebsiteRole>"#));
assert!(output.contains(r#" <WebsiteRole>02</WebsiteRole>"#));
assert!(output.contains(
r#" <WebsiteDescription>Publisher's website: web shop</WebsiteDescription>"#
));
Expand Down Expand Up @@ -1118,7 +1118,7 @@ mod tests {
// No subtitle supplied (within Thoth UI this would automatically update full_title)
assert!(!output.contains(r#" <Subtitle>Book Subtitle</Subtitle>"#));
// No landing page supplied
assert!(!output.contains(r#" <WebsiteRole>01</WebsiteRole>"#));
assert!(!output.contains(r#" <WebsiteRole>02</WebsiteRole>"#));
assert!(!output.contains(
r#" <WebsiteDescription>Publisher's website: web shop</WebsiteDescription>"#
));
Expand Down
6 changes: 3 additions & 3 deletions thoth-export-server/src/xml/onix3_jstor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ impl XmlElementBlock<Onix3Jstor> for Work {
supplies.insert(
landing_page.to_string(),
(
"01".to_string(),
"02".to_string(),
"Publisher's website: web shop".to_string(),
),
);
Expand Down Expand Up @@ -958,7 +958,7 @@ mod tests {
assert!(output.contains(r#" <SupplierRole>09</SupplierRole>"#));
assert!(output.contains(r#" <SupplierName>OA Editions</SupplierName>"#));
assert!(output.contains(r#" <Website>"#));
assert!(output.contains(r#" <WebsiteRole>01</WebsiteRole>"#));
assert!(output.contains(r#" <WebsiteRole>02</WebsiteRole>"#));
assert!(output.contains(
r#" <WebsiteDescription>Publisher's website: web shop</WebsiteDescription>"#
));
Expand Down Expand Up @@ -1040,7 +1040,7 @@ mod tests {
assert!(!output.contains(r#" <PublishingDateRole>01</PublishingDateRole>"#));
assert!(!output.contains(r#" <Date dateformat="00">19991231</Date>"#));
// No landing page supplied: only one SupplyDetail block, linking to PDF download
assert!(!output.contains(r#" <WebsiteRole>01</WebsiteRole>"#));
assert!(!output.contains(r#" <WebsiteRole>02</WebsiteRole>"#));
assert!(!output.contains(
r#" <WebsiteDescription>Publisher's website: web shop</WebsiteDescription>"#
));
Expand Down
6 changes: 3 additions & 3 deletions thoth-export-server/src/xml/onix3_oapen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ impl XmlElementBlock<Onix3Oapen> for Work {
supplies.insert(
landing_page.to_string(),
(
"01".to_string(),
"02".to_string(),
"Publisher's website: web shop".to_string(),
),
);
Expand Down Expand Up @@ -1132,7 +1132,7 @@ mod tests {
assert!(output.contains(r#" <SupplierRole>09</SupplierRole>"#));
assert!(output.contains(r#" <SupplierName>OA Editions</SupplierName>"#));
assert!(output.contains(r#" <Website>"#));
assert!(output.contains(r#" <WebsiteRole>01</WebsiteRole>"#));
assert!(output.contains(r#" <WebsiteRole>02</WebsiteRole>"#));
assert!(output.contains(
r#" <WebsiteDescription>Publisher's website: web shop</WebsiteDescription>"#
));
Expand Down Expand Up @@ -1195,7 +1195,7 @@ mod tests {
assert!(!output.contains(r#" <PublishingDateRole>19</PublishingDateRole>"#));
assert!(!output.contains(r#" <Date dateformat="05">1999</Date>"#));
// No landing page supplied: only one SupplyDetail block, linking to PDF download
assert!(!output.contains(r#" <WebsiteRole>01</WebsiteRole>"#));
assert!(!output.contains(r#" <WebsiteRole>02</WebsiteRole>"#));
assert!(!output.contains(
r#" <WebsiteDescription>Publisher's website: web shop</WebsiteDescription>"#
));
Expand Down
6 changes: 3 additions & 3 deletions thoth-export-server/src/xml/onix3_overdrive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ impl XmlElementBlock<Onix3Overdrive> for Work {
supplies.insert(
landing_page.to_string(),
(
"01".to_string(),
"02".to_string(),
"Publisher's website: web shop".to_string(),
),
);
Expand Down Expand Up @@ -1314,7 +1314,7 @@ mod tests {
assert!(output.contains(r#" <SupplierRole>09</SupplierRole>"#));
assert!(output.contains(r#" <SupplierName>OA Editions</SupplierName>"#));
assert!(output.contains(r#" <Website>"#));
assert!(output.contains(r#" <WebsiteRole>01</WebsiteRole>"#));
assert!(output.contains(r#" <WebsiteRole>02</WebsiteRole>"#));
assert!(output.contains(
r#" <WebsiteDescription>Publisher's website: web shop</WebsiteDescription>"#
));
Expand Down Expand Up @@ -1386,7 +1386,7 @@ mod tests {
// No place supplied
assert!(!output.contains(r#" <CityOfPublication>León, Spain</CityOfPublication>"#));
// No landing page supplied: only one SupplyDetail block, linking to ebook download
assert!(!output.contains(r#" <WebsiteRole>01</WebsiteRole>"#));
assert!(!output.contains(r#" <WebsiteRole>02</WebsiteRole>"#));
assert!(!output.contains(
r#" <WebsiteDescription>Publisher's website: web shop</WebsiteDescription>"#
));
Expand Down

0 comments on commit 063dc8c

Please sign in to comment.