cul_scv_hydra 0.16.4 → 0.16.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTU5MmYwNzQ0M2ZhMDViNWYxYmY4MmZjYWRiOWI4MzkxZWU1N2M4ZA==
4
+ NGZlYjQ5NDJmY2M2Y2E0MTI2MzdkMzNhYTZlZTU0ZGFjYjM2ZTZiNA==
5
5
  data.tar.gz: !binary |-
6
- N2FhYWYzMjM2ZTMwZjRkMzRmNzRmZDUxMDdlNGY4ZDFlM2M0YWNiZA==
6
+ OWUxYjU1YjA5OWZiMDRkZWYyNzZiOGRkMGFjMTFiNWZjNTFiYTE1Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MzM2YzJmZTUwZDIwMjY0NDk2ZjgwYTNmMmQzNWVlMDE1ZjliODZjMGE2NGQw
10
- ZTg3YzBmMTMxOWZhMDkzOWMzYTljN2Y2YjcyNmY5ZWM3NDAwZTM4NWJlNTIw
11
- YTZkOTlhMjNjMjZjZmZkMjZiMzBlNzA5MDIzNjAzYjYyOGE3NmY=
9
+ ZWVhMzEzYjU0ZmRjZGQ0MGU5ZTZhYjc1ZTE4ZDBlMmE2YWQ5NDdhZWVlZTc2
10
+ Y2Y4MjJmZjkxZjBkNjJlMGIzMDdkYWU5MzczZjMzNTcyMzlkZjE1YTM0ZDUx
11
+ MWEzZDg4MDU1NTQxNzlhMzJkNzI0ZjgyMmJlZTE0NzNkZmQ5MzQ=
12
12
  data.tar.gz: !binary |-
13
- ODY1MmU4M2E5NDQyMzIxN2Q2YmIyMDRjZGM3YWEwZjZkNDJlYWY0ZGVlMTY2
14
- NjY4MDcwMDYzMDYyODZhMTE0MzkyODE4MThlZDU2MTE4N2U1YThmOWZjNmJl
15
- ZGNjZGYxMzMzNzNhZjY4ZGQ0ZDc3YjM0MmIzYmQ5YjBjNjgxNzI=
13
+ MmUxNjQyNDA3YzJlNDZmMTI4NDNlZDUwMTEwODE1ODAzMDM0Y2E5NDQzNzcz
14
+ ZWRmNWYwYWI1M2UxY2E1ZTE5ODYzZTBhYzY1NzZkZWVmM2UxOWQ5YmQwYTk0
15
+ MGQxNzNhNTcwOTBmODU3MTFhYzM4NDk2MDQ3Y2UwMDVlMWEzMjU=
@@ -15,13 +15,13 @@ class GenericResource < ::ActiveFedora::Base
15
15
  include ::ActiveFedora::RelsInt
16
16
 
17
17
  has_and_belongs_to_many :containers, :property=>:cul_member_of, :class_name=>'ActiveFedora::Base'
18
-
18
+
19
19
  IMAGE_EXT = {"image/bmp" => 'bmp', "image/gif" => 'gif', "image/jpeg" => 'jpg', "image/png" => 'png', "image/tiff" => 'tif', "image/x-windows-bmp" => 'bmp'}
20
20
  WIDTH = RDF::URI(ActiveFedora::Predicates.find_graph_predicate(:image_width))
21
21
  LENGTH = RDF::URI(ActiveFedora::Predicates.find_graph_predicate(:image_length))
22
-
22
+
23
23
  has_datastream :name => "content", :type=>::ActiveFedora::Datastream, :versionable => true
24
-
24
+
25
25
  def assert_content_model
26
26
  super
27
27
  add_relationship(:rdf_type, Cul::Scv::Hydra::ActiveFedora::RESOURCE_TYPE.to_s)
@@ -42,7 +42,7 @@ class GenericResource < ::ActiveFedora::Base
42
42
  end
43
43
  solr_doc
44
44
  end
45
-
45
+
46
46
  def thumbnail_info
47
47
  thumb = relsint.relationships(datastreams['content'],:foaf_thumb).first
48
48
  if thumb
@@ -61,12 +61,14 @@ class GenericResource < ::ActiveFedora::Base
61
61
  if self.zooming?
62
62
  fz = rels_int.relationships(datastreams['content'], :foaf_zooming).first.object.to_s.split('/')[-1]
63
63
  ds = datastreams[fz]
64
- rft_id = ds.controlGroup == 'E' ? datastreams[fz].dsLocation : legacy_content_path(ds,'info:fedora/datastreams/')
65
- solr_doc['rft_id_ss'] = rft_id
64
+ unless ds.nil?
65
+ rft_id = ds.controlGroup == 'E' ? datastreams[fz].dsLocation : legacy_content_path(ds,'info:fedora/datastreams/')
66
+ solr_doc['rft_id_ss'] = rft_id
67
+ end
66
68
  end
67
69
  solr_doc
68
70
  end
69
-
71
+
70
72
  def thumbnail_info
71
73
  thumb = rels_int.relationships(datastreams['content'],:foaf_thumbnail).first
72
74
  if thumb
@@ -82,7 +84,7 @@ class GenericResource < ::ActiveFedora::Base
82
84
  return {:asset => "cul_scv_hydra/crystal/file.png",:mime=>'image/png'}
83
85
  end
84
86
  end
85
-
87
+
86
88
  def linkable_resources
87
89
  # let's start with the known DSIDs from lindquist, then work our way back to parsing the solrized relsint
88
90
  results = []
@@ -123,7 +125,7 @@ class GenericResource < ::ActiveFedora::Base
123
125
  def zooming?
124
126
  !rels_int.relationships(datastreams['content'], :foaf_zooming).first.blank?
125
127
  end
126
-
128
+
127
129
  private
128
130
  def datastream_as_resource(dsid, props={})
129
131
  ds = datastreams[dsid]
@@ -144,5 +146,5 @@ class GenericResource < ::ActiveFedora::Base
144
146
  base_filename = pid.gsub(/\:/,"")
145
147
  res[:filename] = base_filename + "." + dsid + "." + ds.mimeType.gsub(/^[^\/]+\//,"")
146
148
  res
147
- end
148
- end
149
+ end
150
+ end
@@ -22,7 +22,11 @@ module Cul::Scv::Hydra::Indexer
22
22
  if skip_generic_resources && active_fedora_object.is_a?(GenericResource)
23
23
  puts 'Top level object was skipped because GenericResources are being skipped and it is a GenericResource.'
24
24
  else
25
- active_fedora_object.update_index
25
+ begin
26
+ active_fedora_object.update_index
27
+ rescue Exception => e
28
+ puts 'Encountered problem. Skipping record. Exception: ' + e.message
29
+ end
26
30
  puts 'Done indexing topmost object (' + pid + '). Took ' + (Time.now - START_TIME).to_s + ' seconds' if verbose_output
27
31
  end
28
32
 
@@ -52,7 +56,11 @@ module Cul::Scv::Hydra::Indexer
52
56
  if skip_generic_resources && active_fedora_object.is_a?(GenericResource)
53
57
  puts "skipped (because we're skipping GenericResources." if verbose_output
54
58
  else
55
- active_fedora_object.update_index
59
+ begin
60
+ active_fedora_object.update_index
61
+ rescue Exception => e
62
+ puts 'Encountered problem. Skipping record. Exception: ' + e.message
63
+ end
56
64
  # Display progress
57
65
  puts 'done.' if verbose_output
58
66
  end
@@ -1,7 +1,7 @@
1
1
  module Cul
2
2
  module Scv
3
3
  module Hydra
4
- VERSION = '0.16.4'
4
+ VERSION = '0.16.5'
5
5
  def self.version
6
6
  VERSION
7
7
  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.16.4
4
+ version: 0.16.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Armintor