dor-services 5.10.3 → 5.10.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/dev_console_env.rb +43 -63
- data/lib/dor/datastreams/identity_metadata_ds.rb +1 -1
- data/lib/dor/models/identifiable.rb +0 -11
- data/lib/dor/models/publishable.rb +1 -2
- data/lib/dor/models/releaseable.rb +6 -18
- data/lib/dor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c643c1a3d63b56fd2e74475941e379a93a7220a
|
4
|
+
data.tar.gz: 7b7f607b5a01f5acf6b3e876e59f9954e4ae0782
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb4b9b98f90f2b21061f5b563d1574434baa47894f3d8cc0abc2d7fef9e667633272c431198ed75c6d388be8262c6ca1d3274b06f96e31ea3c88fef30bbbed8c
|
7
|
+
data.tar.gz: 66b565537443097f8b2bc32538cad5bffbdc3bb97595dd28cca1cdd2801981c07e936ca73bde863fd8d9ef57a9f673dd877742e289d8bcd93fe40562470b398e
|
data/config/dev_console_env.rb
CHANGED
@@ -1,86 +1,66 @@
|
|
1
1
|
cert_dir = File.join(File.dirname(__FILE__), "certs")
|
2
2
|
|
3
3
|
Dor::Config.configure do
|
4
|
+
|
4
5
|
fedora do
|
5
6
|
url 'https://sul-dor-test.stanford.edu/fedora'
|
6
7
|
end
|
7
8
|
|
8
9
|
ssl do
|
9
10
|
cert_file File.join(cert_dir,"dlss-dev-petucket-dor-dev.crt")
|
10
|
-
key_file
|
11
|
+
key_file File.join(cert_dir,"dlss-dev-petucket-dor-dev.key")
|
11
12
|
key_pass ''
|
12
13
|
end
|
13
|
-
|
14
|
+
|
15
|
+
sdr do
|
16
|
+
url 'http://localhost'
|
17
|
+
local_workspace_root '/dor/workspace'
|
18
|
+
local_export_home '/dor/export'
|
19
|
+
end
|
20
|
+
|
14
21
|
suri do
|
15
22
|
mint_ids true
|
16
23
|
id_namespace 'druid'
|
17
|
-
url '
|
24
|
+
url 'http://sul-lyberservices-test.stanford.edu'
|
18
25
|
user 'labware'
|
19
26
|
pass 'lyberteam'
|
20
27
|
end
|
21
|
-
|
22
|
-
metadata do
|
23
|
-
exist.url 'http://viewer:l3l%40nd@lyberapps-dev.stanford.edu/exist/rest/'
|
24
|
-
catalog.url 'http://lyberservices-prod.stanford.edu/catalog/mods'
|
25
|
-
end
|
26
|
-
|
27
|
-
stacks do
|
28
|
-
local_workspace_root '/dor/workspace'
|
29
|
-
document_cache_host 'sul-purl-test.stanford.edu'
|
30
|
-
local_stacks_root '/stacks'
|
31
|
-
local_document_cache_root '/purl/document_cache'
|
32
|
-
end
|
33
|
-
|
34
|
-
gsearch.url 'http://127.0.0.1:8080/solr/argo_test'
|
35
|
-
solrizer.url 'http://127.0.0.1:8080/solr/argo_test'
|
36
|
-
workflow.url 'https://lyberservices-test.stanford.edu/workflow/'
|
37
|
-
dor_services.url 'https://dorAdmin:dorAdmin@sul-lyberservices-test.stanford.edu/dor'
|
38
28
|
|
39
|
-
|
40
|
-
|
41
|
-
sdr_user 'sdrAdmin'
|
42
|
-
sdr_pass 'sdrAdmin'
|
43
|
-
end
|
29
|
+
solr.url 'https://sul-solr-tester.stanford.edu/argo_stage'
|
30
|
+
workflow.url 'https://sul-lyberservices-test.stanford.edu/workflow/'
|
44
31
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
local_export_home '/dor/export'
|
49
|
-
end
|
32
|
+
purl do
|
33
|
+
base_url 'https://purl-test.stanford.edu/'
|
34
|
+
end
|
50
35
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
datastreams do
|
56
|
-
administrativeMetadata 'optional'
|
57
|
-
contentMetadata 'optional'
|
58
|
-
descMetadata 'required'
|
59
|
-
defaultObjectRights 'optional'
|
60
|
-
events 'optional'
|
61
|
-
embargoMetadata 'optional'
|
62
|
-
identityMetadata 'required'
|
63
|
-
provenanceMetadata 'required'
|
64
|
-
relationshipMetadata 'required'
|
65
|
-
rightsMetadata 'optional'
|
66
|
-
roleMetadata 'optional'
|
67
|
-
sourceMetadata 'optional'
|
68
|
-
technicalMetadata 'optional'
|
69
|
-
versionMetadata 'required'
|
70
|
-
workflows 'optional'
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
36
|
+
remediation do
|
37
|
+
check_for_versioning_required false # this MUST be true in production; can be false in development and test if you want to ignore workflow checks
|
38
|
+
check_for_in_accessioning false # this MUST be true in production; can be false in development and test if you want to ignore workflow checks
|
39
|
+
end
|
74
40
|
|
41
|
+
dor do
|
42
|
+
service_root 'https://dorAdmin:dorAdmin@sul-lyberservices-test.stanford.edu/dor/v1'
|
43
|
+
num_attempts 3 # the number of attempts to contact the dor web service before throwing an exception
|
44
|
+
sleep_time 2 # sleep time in seconds between attempts to contact the dor service
|
45
|
+
default_label 'Untitled' # the default label for an object that is registered when no label is provided in the manifest
|
46
|
+
end
|
75
47
|
|
76
|
-
|
48
|
+
content do
|
49
|
+
content_user 'lyberadmin'
|
50
|
+
content_base_dir '/dor/workspace/'
|
51
|
+
content_server 'lyberservices-test'
|
52
|
+
end
|
53
|
+
status do
|
54
|
+
indexer_url 'http://sulstats-raw.stanford.edu//render/?format=json&from=-1minute&until=now&target=stats.gauges.dor-prod.argo.reindexqueue.queue-size.count'
|
55
|
+
end
|
56
|
+
stacks do
|
57
|
+
document_cache_storage_root '/home/lyberadmin/document_cache'
|
58
|
+
document_cache_host 'purl-test.stanford.edu'
|
59
|
+
document_cache_user 'lyberadmin'
|
60
|
+
local_workspace_root '/dor/workspace'
|
61
|
+
storage_root '/stacks'
|
62
|
+
host 'stacks-test.stanford.edu'
|
63
|
+
user 'lyberadmin'
|
64
|
+
end
|
77
65
|
|
78
|
-
|
79
|
-
# module Dor
|
80
|
-
# CREATE_WORKFLOW = DOR_CREATE_WORKFLOW = true
|
81
|
-
# WF_URI = 'http://lyberservices-test.stanford.edu/workflow'
|
82
|
-
# end
|
83
|
-
#
|
84
|
-
# # External application locations
|
85
|
-
# JHOVE_HOME = File.join(ENV['HOME'], 'jhoveToolkit')
|
86
|
-
#
|
66
|
+
end
|
@@ -40,7 +40,7 @@ class IdentityMetadataDS < ActiveFedora::OmDatastream
|
|
40
40
|
node ? [node['source'], node.text].join(':') : nil
|
41
41
|
end
|
42
42
|
|
43
|
-
# @param [String, Nil]
|
43
|
+
# @param [String, Nil] value, or nil/empty string to delete sourceId node
|
44
44
|
# @return [String, Nil] The same value, as per Ruby convention for assignment operators
|
45
45
|
# @note The actual values assigned will have leading/trailing whitespace stripped.
|
46
46
|
def sourceId=(value)
|
@@ -189,17 +189,6 @@ module Dor
|
|
189
189
|
.any?
|
190
190
|
end
|
191
191
|
|
192
|
-
# Removes all displayTypes from an item in preparation of adding a new display type
|
193
|
-
# @return Boolean True if displayTypes were removed, False if no displayTypes were removed
|
194
|
-
def remove_displayTypes
|
195
|
-
nodes = identityMetadata.ng_xml.search('//displayType')
|
196
|
-
# NOTE: .each after search is different than normal ruby enumerator:
|
197
|
-
# ~ ng_xml.search('//nonexistant_tag').each(&:foo) == 0
|
198
|
-
# ~ [].each(&:foo) == []
|
199
|
-
nodes.each(&:remove)
|
200
|
-
nodes.any?
|
201
|
-
end
|
202
|
-
|
203
192
|
def update_tag(old_tag, new_tag)
|
204
193
|
normtag = normalize_tag(old_tag)
|
205
194
|
identityMetadata.ng_xml.search('//tag')
|
@@ -33,7 +33,6 @@ module Dor
|
|
33
33
|
|
34
34
|
im = datastreams['identityMetadata'].ng_xml.clone
|
35
35
|
im.search('//release').each(&:remove) # remove any <release> tags from public xml which have full history
|
36
|
-
im.root.add_child(release_xml)
|
37
36
|
|
38
37
|
pub.add_child(im.root) # add in modified identityMetadata datastream
|
39
38
|
pub.add_child(datastreams['contentMetadata'].public_xml.root.clone)
|
@@ -81,7 +80,7 @@ module Dor
|
|
81
80
|
# When publishing a PURL, we drop a `aa11bb2222` file into the `local_recent_changes` folder
|
82
81
|
# to notify other applications watching the filesystem (i.e., purl-fetcher).
|
83
82
|
# We also remove any .deletes entry that may have left over from a previous removal
|
84
|
-
# @param [String]
|
83
|
+
# @param [String] local_recent_changes usually `/purl/recent_changes`
|
85
84
|
def publish_notify_on_success(local_recent_changes = Config.stacks.local_recent_changes)
|
86
85
|
raise ArgumentError, "Missing local_recent_changes directory: #{local_recent_changes}" unless File.directory?(local_recent_changes)
|
87
86
|
id = pid.gsub(/^druid:/, '')
|
@@ -209,13 +209,12 @@ module Dor
|
|
209
209
|
end
|
210
210
|
raise ArgumentError, ':what must be self or collection' unless what_correct
|
211
211
|
raise ArgumentError, 'the value set for this tag is not a boolean' if !!tag != tag # rubocop:disable Style/DoubleNegation
|
212
|
-
validate_tag_format(attrs[:tag]) unless attrs[:tag].nil? # Will Raise exception if invalid tag
|
213
212
|
true
|
214
213
|
end
|
215
214
|
|
216
215
|
# Add a release node for the item
|
217
216
|
# Will use the current time if timestamp not supplied. You can supply a timestap for correcting history, etc if desired
|
218
|
-
# Timestamp will be calculated by the function
|
217
|
+
# Timestamp will be calculated by the function
|
219
218
|
#
|
220
219
|
# @param release [Boolean] True or false for the release node
|
221
220
|
# @param attrs [hash] A hash of any attributes to be placed onto the tag
|
@@ -223,16 +222,13 @@ module Dor
|
|
223
222
|
# @raise [ArgumentError] Raised if attributes are improperly supplied
|
224
223
|
#
|
225
224
|
# @example
|
226
|
-
# item.
|
225
|
+
# item.add_release_node(true,{:what=>'self',:to=>'Searchworks',:who=>'petucket'})
|
227
226
|
def add_release_node(release, attrs = {})
|
227
|
+
allowed_release_attributes=[:what,:to,:who,:when] # any other release attributes sent in will be rejected and not stored
|
228
228
|
identity_metadata_ds = identityMetadata
|
229
|
+
attrs.delete_if { |key, value| !allowed_release_attributes.include?(key) }
|
229
230
|
attrs[:when] = Time.now.utc.iso8601 if attrs[:when].nil? # add the timestamp
|
230
|
-
attrs[:displayType] = 'file' if attrs[:displayType].nil? # default to file is no display type is passed
|
231
231
|
valid_release_attributes(release, attrs)
|
232
|
-
|
233
|
-
# Remove the old displayType and then add the one for this tag
|
234
|
-
remove_displayTypes
|
235
|
-
identity_metadata_ds.add_value(:displayType, attrs[:displayType], {})
|
236
232
|
identity_metadata_ds.add_value(:release, release.to_s, attrs)
|
237
233
|
end
|
238
234
|
|
@@ -247,16 +243,8 @@ module Dor
|
|
247
243
|
[:who, :to, :what].each do |check_attr|
|
248
244
|
raise ArgumentError, "#{check_attr} not supplied as a String" if attrs[check_attr].class != String
|
249
245
|
end
|
250
|
-
|
251
|
-
|
252
|
-
%w(self collection).each do |allowed_what_value|
|
253
|
-
what_correct = true if attrs[:what] == allowed_what_value
|
254
|
-
end
|
255
|
-
raise ArgumentError, ':what must be self or collection' unless what_correct
|
256
|
-
raise ArgumentError, 'the value set for this tag is not a boolean' if !!tag != tag # rubocop:disable Style/DoubleNegation
|
257
|
-
raise ArgumentError, ':displayType must be passed in as a String' unless attrs[:displayType].class == String
|
258
|
-
|
259
|
-
validate_tag_format(attrs[:tag]) unless attrs[:tag].nil? # Will Raise exception if invalid tag
|
246
|
+
raise ArgumentError, ':what must be self or collection' unless %w(self collection).include? attrs[:what]
|
247
|
+
raise ArgumentError, 'the value set for this tag is not a boolean' unless [true,false].include? tag
|
260
248
|
true
|
261
249
|
end
|
262
250
|
|
data/lib/dor/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dor-services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.10.
|
4
|
+
version: 5.10.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Klein
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2016-09-
|
17
|
+
date: 2016-09-29 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: active-fedora
|