dor-services-client 3.8.0 → 3.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/dor/services/client/metadata.rb +22 -0
- data/lib/dor/services/client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f823d797fe922ae8ba36b3bc55649a4963c7c466ab12d1f1608ef6f4c272b5a5
|
4
|
+
data.tar.gz: b9344e954cdef65a76a744707cd7cf699a311af0d04c40890352fa0dabb97c0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8725e1fce38fe15c77f0c0ce45da465a29e6ccdf0b83cf3018cd8927ac1cb5ea4081a169a746e8dc2ed577f4f80f3c1919256ce33bbb4e8aff4809d33ff34547
|
7
|
+
data.tar.gz: a4d14beeafaf4a070a12f5d38bf44201e5c858ba35232d4f9a999af1c4bddad78c9f405c075e7a189715266e9ad210de867cbbab26b86c629f597c4526d51c17
|
data/README.md
CHANGED
@@ -102,6 +102,14 @@ object_client.metadata.dublin_core
|
|
102
102
|
# Get the public descriptive XML representation
|
103
103
|
object_client.metadata.descriptive
|
104
104
|
|
105
|
+
# Update legacy XML representation
|
106
|
+
object_client.metadata.legacy_update(
|
107
|
+
descriptive: {
|
108
|
+
updated: Time.now,
|
109
|
+
content: '<descMetadata/>'
|
110
|
+
}
|
111
|
+
)
|
112
|
+
|
105
113
|
# Return the Cocina metadata
|
106
114
|
object_client.find
|
107
115
|
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'active_support/json' # required for serializing time as iso8601
|
4
|
+
|
3
5
|
module Dor
|
4
6
|
module Services
|
5
7
|
class Client
|
@@ -11,6 +13,26 @@ module Dor
|
|
11
13
|
@object_identifier = object_identifier
|
12
14
|
end
|
13
15
|
|
16
|
+
# Updates using the legacy SDR/Fedora3 metadata
|
17
|
+
# @param [Hash<Symbol,Hash>] opts the options for legacy update
|
18
|
+
# @option opts [Hash] :descriptive Data for descriptive metadata
|
19
|
+
# @option opts [Hash] :rights Data for access rights metadata
|
20
|
+
# @option opts [Hash] :content Data for structural metadata
|
21
|
+
# @option opts [Hash] :technical Data for technical metadata
|
22
|
+
# @example:
|
23
|
+
# legacy_update(descriptive: { updated: '2001-12-20', content: '<descMetadata />' })
|
24
|
+
def legacy_update(opts)
|
25
|
+
opts = opts.slice(:descriptive, :rights, :content, :technical)
|
26
|
+
resp = connection.patch do |req|
|
27
|
+
req.url "#{base_path}/legacy"
|
28
|
+
req.headers['Content-Type'] = 'application/json'
|
29
|
+
req.body = opts.to_json
|
30
|
+
end
|
31
|
+
return if resp.success?
|
32
|
+
|
33
|
+
raise UnexpectedResponse, ResponseErrorFormatter.format(response: resp, object_identifier: object_identifier)
|
34
|
+
end
|
35
|
+
|
14
36
|
# @return [String, NilClass] The Dublin Core XML representation of the object or nil if response is 404
|
15
37
|
# @raise [UnexpectedResponse] on an unsuccessful response from the server
|
16
38
|
def dublin_core
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dor-services-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-11-
|
12
|
+
date: 2019-11-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|