From 766669695e4ae1c1e6abe01533f9bff22f15d11a Mon Sep 17 00:00:00 2001 From: rhigman <73792779+rhigman@users.noreply.github.com> Date: Thu, 25 Jan 2024 14:41:16 +0000 Subject: [PATCH 01/44] Add infrastructure for full Thoth record ONIX 3.0 output (currently identical to OverDrive, still contains logic/comments specific to it) --- thoth-app/src/models/work/mod.rs | 14 + thoth-export-server/src/data.rs | 8 + thoth-export-server/src/record.rs | 19 +- .../src/specification_query.rs | 1 + thoth-export-server/src/xml/mod.rs | 2 + thoth-export-server/src/xml/onix3_thoth.rs | 1422 +++++++++++++++++ 6 files changed, 1465 insertions(+), 1 deletion(-) create mode 100644 thoth-export-server/src/xml/onix3_thoth.rs diff --git a/thoth-app/src/models/work/mod.rs b/thoth-app/src/models/work/mod.rs index 95bc683d..2ff0f417 100644 --- a/thoth-app/src/models/work/mod.rs +++ b/thoth-app/src/models/work/mod.rs @@ -116,6 +116,7 @@ pub trait DisplayWork { fn marc21_thoth_endpoint(&self) -> String; fn marc21markup_thoth_endpoint(&self) -> String; fn marc21xml_thoth_endpoint(&self) -> String; + fn onix_thoth_endpoint(&self) -> String; fn onix_projectmuse_endpoint(&self) -> String; fn onix_oapen_endpoint(&self) -> String; fn onix_jstor_endpoint(&self) -> String; @@ -156,6 +157,13 @@ impl DisplayWork for WorkWithRelations { ) } + fn onix_thoth_endpoint(&self) -> String { + format!( + "{}/specifications/onix_3.0::thoth/work/{}", + THOTH_EXPORT_API, &self.work_id + ) + } + fn onix_projectmuse_endpoint(&self) -> String { format!( "{}/specifications/onix_3.0::project_muse/work/{}", @@ -424,6 +432,12 @@ impl DisplayWork for WorkWithRelations {