cul_scv_hydra 0.21.7 → 0.21.8

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
  SHA1:
3
- metadata.gz: 5c8a5353976107acfa707e314ae1afe6698b0326
4
- data.tar.gz: a4d19b5fe5534469e8a1e310faff6d676b0ecc72
3
+ metadata.gz: 684ab352172474db992c51f360fe139a1e2fa20b
4
+ data.tar.gz: 40d435f777c2192215ecbe9c5c176e9eae3a8b90
5
5
  SHA512:
6
- metadata.gz: 5d2a4d59be0b5fedbecf90119f5bb1bb48b8f4c9f730fe647ec5ff68ea5c763e07843616f7dc5cc6ac030c7023a262b73ececfe2ba9f9cdbfd74f17695414ee6
7
- data.tar.gz: 8625b83c797cca591ac9b2f5bf789f82854ddfeec47771f7d3cac9230db57ec6225902210c65d679174b229021bf759a439ddb692a3b95d201ff73e4aa45de30
6
+ metadata.gz: 09d4bf1f2144d824113f83ec67e76ec429a9e79201d5d200a0e8d87cc9a92cfde0d8c507e1ab93fe3980a511ec828a8a0f529683d93da42de5d11bbee7bd2340
7
+ data.tar.gz: 964a5e44db39cf013413947d720e7a66beea2994f65a9cb21f85c3e1c48bdb37e704f74c1a4f109fb5e021113c66af8d03d81da644382b411796de0dcbf2138e
@@ -113,6 +113,16 @@ module Cul::Scv::Hydra::Models::Common
113
113
  if (solr_doc["title_display_ssm"].length > 1)
114
114
  solr_doc["title_display_ssm"].uniq!
115
115
  end
116
+
117
+ if solr_doc["contributor_ssim"].present?
118
+ if solr_doc["contributor_ssim"].is_a?(Array)
119
+ solr_doc["contributor_first_si"] = solr_doc["contributor_ssim"].first
120
+ else
121
+ solr_doc["contributor_first_si"] = solr_doc["contributor_ssim"]
122
+ end
123
+ end
124
+
125
+
116
126
  solr_doc["format_ssi"] = [self.route_as]
117
127
 
118
128
  set_size_labels(solr_doc)
@@ -70,10 +70,10 @@ class GenericResource < ::ActiveFedora::Base
70
70
  end
71
71
  end
72
72
 
73
- solr_doc["fulltext_teim"] = []
73
+ solr_doc["fulltext_tesim"] = []
74
74
  unless self.datastreams["fulltext"].nil?
75
- solr_doc["fulltext_teim"] << self.datastreams["fulltext"].content
76
- solr_doc["fulltext_teim"] << solr_doc["title_display_ssm"] unless solr_doc["title_display_ssm"].nil? or solr_doc["title_display_ssm"].length == 0
75
+ solr_doc["fulltext_tesim"] << self.datastreams["fulltext"].content
76
+ solr_doc["fulltext_tesim"] << solr_doc["title_display_ssm"] unless solr_doc["title_display_ssm"].nil? or solr_doc["title_display_ssm"].length == 0
77
77
  end
78
78
 
79
79
  solr_doc
@@ -5,43 +5,51 @@ module Cul::Scv::Hydra::Indexer
5
5
  raise 'Please supply a pid (e.g. rake recursively_index_fedora_objects pid=ldpd:123)'
6
6
  end
7
7
 
8
- unless ActiveFedora::Base.exists?(pid)
9
- raise 'Could not find Fedora object with pid: ' + pid
10
- end
8
+ begin
11
9
 
12
- if pids_to_omit.present? && pids_to_omit.include?(pid)
13
- puts 'Skipping topmost object in this set (' + pid + ') because it has been intentionally omitted...' if verbose_output
14
- else
15
- puts 'Indexing topmost object in this set (' + pid + ')...' if verbose_output
16
- puts 'If this is a BagAggregator with a lot of members, this may take a while...' if verbose_output
10
+ unless ActiveFedora::Base.exists?(pid)
11
+ raise 'Could not find Fedora object with pid: ' + pid
12
+ end
17
13
 
18
- yield pid
14
+ if pids_to_omit.present? && pids_to_omit.include?(pid)
15
+ puts 'Skipping topmost object in this set (' + pid + ') because it has been intentionally omitted...' if verbose_output
16
+ else
17
+ puts 'Indexing topmost object in this set (' + pid + ')...' if verbose_output
18
+ puts 'If this is a BagAggregator with a lot of members, this may take a while...' if verbose_output
19
19
 
20
- end
20
+ yield pid
21
21
 
22
- puts 'Recursively retreieving and indexing all members of ' + pid + '...'
22
+ end
23
23
 
24
- unique_pids = Cul::Scv::Hydra::RisearchMembers.get_recursive_member_pids(pid, true)
24
+ puts 'Recursively retreieving and indexing all members of ' + pid + '...'
25
25
 
26
- total_number_of_members = unique_pids.length
27
- puts 'Recursive search found ' + total_number_of_members.to_s + ' members.' if verbose_output
26
+ unique_pids = Cul::Scv::Hydra::RisearchMembers.get_recursive_member_pids(pid, true)
28
27
 
29
- if pids_to_omit.present?
30
- unique_pids = unique_pids - pids_to_omit
31
28
  total_number_of_members = unique_pids.length
32
- puts 'After checking against the list of omitted pids, the total number of objects to index will be: ' + total_number_of_members.to_s if verbose_output
33
- end
29
+ puts 'Recursive search found ' + total_number_of_members.to_s + ' members.' if verbose_output
34
30
 
35
- i = 1
36
- if total_number_of_members > 0
37
- unique_pids.each {|pid|
31
+ if pids_to_omit.present?
32
+ unique_pids = unique_pids - pids_to_omit
33
+ total_number_of_members = unique_pids.length
34
+ puts 'After checking against the list of omitted pids, the total number of objects to index will be: ' + total_number_of_members.to_s if verbose_output
35
+ end
38
36
 
39
- puts 'Recursing on ' + i.to_s + ' of ' + total_number_of_members.to_s + ' members (' + pid + ')...' if verbose_output
37
+ i = 1
38
+ if total_number_of_members > 0
39
+ unique_pids.each {|pid|
40
40
 
41
- yield pid
41
+ puts 'Recursing on ' + i.to_s + ' of ' + total_number_of_members.to_s + ' members (' + pid + ')...' if verbose_output
42
+
43
+ yield pid
44
+
45
+ i += 1
46
+ }
47
+ end
42
48
 
43
- i += 1
44
- }
49
+ rescue RestClient::Unauthorized => e
50
+ error_message = "Skipping #{pid} due to error: " + e.message + '. Problem with Fedora object?'
51
+ puts error_message
52
+ logger.error error_message if defined?(logger)
45
53
  end
46
54
 
47
55
  puts 'Recursion complete!'
@@ -2,7 +2,7 @@
2
2
  module Cul
3
3
  module Scv
4
4
  module Hydra
5
- VERSION = '0.21.7'
5
+ VERSION = '0.21.8'
6
6
  def self.version
7
7
  VERSION
8
8
  end
@@ -2,7 +2,7 @@
2
2
  module Cul
3
3
  module Scv
4
4
  module Hydra
5
- VERSION = '0.21.6'
5
+ VERSION = '0.21.7'
6
6
  def self.version
7
7
  VERSION
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cul_scv_hydra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.7
4
+ version: 0.21.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Armintor