atlas_rb 1.3.5 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.version +1 -1
- data/Gemfile.lock +1 -1
- data/lib/atlas_rb/file_set.rb +37 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e15c24fddbec1fba3da8aef5e85d769ddf4861e9bccad136957b342515e34dab
|
|
4
|
+
data.tar.gz: 2044a925120234a5e3fa1553fc3fc4ec2b3dad05c4215af58697c157fc84cdff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a62880ec96483584dc82cacd3a186822ec7af2f64893ede345ccc73f071462106f21b753579dcb6eb9c391018860f828881d4fa7cbe191da4f3e8a76b27d6574
|
|
7
|
+
data.tar.gz: b4f66124c5b5c51e550a13b3c60a01a4ce9d6efaa771577be41d46d8f4172967d5124441db1a2a55c44717b92898175643c35d74afe550405a5d57a75fe73767
|
data/.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.3.
|
|
1
|
+
1.3.6
|
data/Gemfile.lock
CHANGED
data/lib/atlas_rb/file_set.rb
CHANGED
|
@@ -123,5 +123,42 @@ module AtlasRb
|
|
|
123
123
|
multipart(nuid, on_behalf_of: on_behalf_of).patch(ROUTE + id, payload)&.body
|
|
124
124
|
))
|
|
125
125
|
end
|
|
126
|
+
|
|
127
|
+
# Persist the per-page IIIF image-service pointer on a FileSet.
|
|
128
|
+
#
|
|
129
|
+
# Purpose-specific PATCH for the `service_file` Delegate role — the
|
|
130
|
+
# Cantaloupe image-service base URI for this page's JP2, from which a
|
|
131
|
+
# viewer derives any size on demand via `info.json`. Atlas upserts the
|
|
132
|
+
# Delegate (re-setting never mints a duplicate), nesting it in a
|
|
133
|
+
# `:derivative` FileSet under the page; it surfaces in the ordered
|
|
134
|
+
# page listing ({Work.file_sets}) for IIIF manifest assembly.
|
|
135
|
+
#
|
|
136
|
+
# Sibling of {Work.set_thumbnails} / {Work.set_image_derivatives} —
|
|
137
|
+
# a machine-set IIIF URI, not user-authored descriptive content.
|
|
138
|
+
#
|
|
139
|
+
# @param id [String] the FileSet ID.
|
|
140
|
+
# @param uri [String] the IIIF image-service base URI for the page.
|
|
141
|
+
# @param nuid [String, nil] optional acting user's NUID, forwarded as the
|
|
142
|
+
# `User:` header. Required for cerberus-token requests; legacy bearer
|
|
143
|
+
# tokens still resolve without it.
|
|
144
|
+
# @param on_behalf_of [String, nil] optional NUID for the `On-Behalf-Of`
|
|
145
|
+
# header. Falls through to {AtlasRb.config}.default_on_behalf_of when
|
|
146
|
+
# omitted.
|
|
147
|
+
# @return [AtlasRb::Mash] the updated `"file_set"` payload.
|
|
148
|
+
# @raise [AtlasRb::StaleResourceError] if Atlas reports an optimistic-lock
|
|
149
|
+
# conflict that exhausted its internal retry budget (HTTP 409 with
|
|
150
|
+
# `error: "stale_resource"`).
|
|
151
|
+
#
|
|
152
|
+
# @example
|
|
153
|
+
# AtlasRb::FileSet.set_iiif_service(
|
|
154
|
+
# "fs-001",
|
|
155
|
+
# "https://iiif.example.edu/iiif/3/abc.jp2"
|
|
156
|
+
# )
|
|
157
|
+
def self.set_iiif_service(id, uri, nuid: nil, on_behalf_of: nil)
|
|
158
|
+
AtlasRb::Mash.new(JSON.parse(
|
|
159
|
+
connection({}, nuid, on_behalf_of: on_behalf_of)
|
|
160
|
+
.patch(ROUTE + id + "/iiif_service", JSON.dump({ uri: uri }))&.body
|
|
161
|
+
))
|
|
162
|
+
end
|
|
126
163
|
end
|
|
127
164
|
end
|