dina 3.3.2.0 → 3.3.5.0
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 40974ccc22f630f761b1df813bb15ed0afa2ae53f7a589c0dd264cfb30b3bd9c
|
|
4
|
+
data.tar.gz: 2b8fec89f74211d0797831c0a4c20d6683331697648cb0b172f77f926ff6abac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 39646e6b949fd93af882d42de82eef38b7471a2a7e8826ef6ce71ebbd85a986fae1d37ec23548425dc92cbbbaac581622205b9d733567963ec3dc9c106f682df
|
|
7
|
+
data.tar.gz: 8fefe11dca7a890e0f56e175700b41c19f109e6fbf340bcd802445aba1396c694a379c422c32dda427ca01b976a5f8d8554ec5ad5552644526f8187815a17e7e
|
|
@@ -7,6 +7,11 @@ module Dina
|
|
|
7
7
|
property :code, type: :string
|
|
8
8
|
property :multilingualDescription, type: :multilingual_description
|
|
9
9
|
property :siteGeom, type: :geospatial
|
|
10
|
+
property :dwcCountry, type: :string
|
|
11
|
+
property :dwcCountryCode, type: :string
|
|
12
|
+
property :dwcStateProvince, type: :string
|
|
13
|
+
property :geographicPlaceNameSource, type: :string
|
|
14
|
+
property :geographicPlaceNameSourceDetail, type: :hash, default: {}
|
|
10
15
|
property :createdBy, type: :string
|
|
11
16
|
property :createdOn, type: :time
|
|
12
17
|
|
|
@@ -22,5 +27,14 @@ module Dina
|
|
|
22
27
|
"site"
|
|
23
28
|
end
|
|
24
29
|
|
|
30
|
+
private
|
|
31
|
+
|
|
32
|
+
def on_before_save
|
|
33
|
+
if self.geographicPlaceNameSource.nil?
|
|
34
|
+
self.geographicPlaceNameSourceDetail = nil
|
|
35
|
+
end
|
|
36
|
+
super
|
|
37
|
+
end
|
|
38
|
+
|
|
25
39
|
end
|
|
26
40
|
end
|
|
@@ -8,6 +8,7 @@ module Dina
|
|
|
8
8
|
self.parser = FileParser
|
|
9
9
|
|
|
10
10
|
custom_endpoint :download, on: :collection, request_method: :get
|
|
11
|
+
custom_endpoint :info, on: :collection, request_method: :get
|
|
11
12
|
|
|
12
13
|
property :id, type: :string, default: SecureRandom.uuid_v7
|
|
13
14
|
property :group, type: :string
|
|
@@ -17,6 +17,7 @@ module Dina
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def run(request_method, path, params: nil, headers: {}, body: nil)
|
|
20
|
+
|
|
20
21
|
if request_method == :get && path == "file/download"
|
|
21
22
|
path = "file" + "/#{params[:group].downcase}/#{params[:fileIdentifier]}"
|
|
22
23
|
if params[:isDerivative]
|
|
@@ -26,6 +27,14 @@ module Dina
|
|
|
26
27
|
response = @faraday.run_request(request_method, path, body, headers) do |request|
|
|
27
28
|
end
|
|
28
29
|
response
|
|
30
|
+
elsif request_method == :get && path == "file/info"
|
|
31
|
+
path = "file-info" + "/#{params[:group].downcase}/#{params[:fileIdentifier]}#{params[:fileExtension]}"
|
|
32
|
+
if params[:isDerivative]
|
|
33
|
+
path = "file-info" + "/#{params[:group].downcase}/derivative/#{params[:fileIdentifier]}#{params[:fileExtension]}"
|
|
34
|
+
end
|
|
35
|
+
response = @faraday.run_request(request_method, path, body, headers) do |request|
|
|
36
|
+
end
|
|
37
|
+
response
|
|
29
38
|
else
|
|
30
39
|
path = path + "/#{body[:data]["attributes"]["group"].downcase}"
|
|
31
40
|
if body[:data]["attributes"].key?("isDerivative")
|
|
@@ -44,15 +53,13 @@ module Dina
|
|
|
44
53
|
response = @faraday.run_request(request_method, path, body, headers) do |request|
|
|
45
54
|
request.params.update(params) if params
|
|
46
55
|
end
|
|
47
|
-
|
|
48
|
-
|
|
56
|
+
|
|
57
|
+
body = response.body.dup
|
|
58
|
+
response.body["meta"] = body["meta"]
|
|
49
59
|
response.body["errors"] = []
|
|
50
|
-
response.body["data"] =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"relationships" => {},
|
|
54
|
-
"attributes" => attributes
|
|
55
|
-
}
|
|
60
|
+
response.body["data"] = body["data"]
|
|
61
|
+
response.body["data"]["type"] = "file"
|
|
62
|
+
|
|
56
63
|
response
|
|
57
64
|
end
|
|
58
65
|
end
|
|
@@ -12,8 +12,9 @@ module Dina
|
|
|
12
12
|
property :fileIdentifier, type: :string
|
|
13
13
|
property :bucket, type: :string
|
|
14
14
|
property :acCaption, type: :string
|
|
15
|
-
property :acDigitizationDate, type: :string
|
|
15
|
+
property :acDigitizationDate, type: :string, default: Time.now.iso8601.to_s
|
|
16
16
|
property :xmpMetadataDate, type: :time
|
|
17
|
+
property :filename, type: :string
|
|
17
18
|
property :originalFilename, type: :string
|
|
18
19
|
property :fileExtension, type: :string
|
|
19
20
|
property :acHashFunction, type: :string, default: "SHA-1"
|
|
@@ -27,7 +28,9 @@ module Dina
|
|
|
27
28
|
property :managedAttributes, type: :hash
|
|
28
29
|
property :acTags, type: :array
|
|
29
30
|
property :orientation, type: :integer
|
|
31
|
+
property :isExternalResource, type: :boolean, default: false
|
|
30
32
|
property :resourceExternalURL, type: :string
|
|
33
|
+
property :sourceSet, type: :string
|
|
31
34
|
|
|
32
35
|
has_one :acMetadataCreator, class_name: "Person"
|
|
33
36
|
has_one :dcCreator, class_name: "Person"
|
data/lib/dina/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dina
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.3.
|
|
4
|
+
version: 3.3.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David P. Shorthouse
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2026-
|
|
12
|
+
date: 2026-04-24 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: json_api_client
|