curation_concerns-models 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -0
  3. data/Rakefile +1 -1
  4. data/app/actors/concerns/curation_concerns/manages_embargoes_actor.rb +11 -19
  5. data/app/actors/curation_concerns/base_actor.rb +41 -45
  6. data/app/actors/curation_concerns/embargo_actor.rb +19 -0
  7. data/app/actors/curation_concerns/file_set_actor.rb +200 -0
  8. data/app/actors/curation_concerns/lease_actor.rb +19 -0
  9. data/app/actors/curation_concerns/work_actor_behavior.rb +55 -58
  10. data/app/indexers/curation_concerns/collection_indexer.rb +10 -0
  11. data/app/indexers/curation_concerns/file_set_indexing_service.rb +24 -0
  12. data/app/{services/curation_concerns/generic_work_indexing_service.rb → indexers/curation_concerns/work_indexing_service.rb} +6 -6
  13. data/app/jobs/active_fedora_id_based_job.rb +5 -12
  14. data/app/jobs/audit_job.rb +11 -17
  15. data/app/jobs/characterize_job.rb +8 -7
  16. data/app/jobs/create_derivatives_job.rb +8 -11
  17. data/app/jobs/import_url_job.rb +12 -25
  18. data/app/jobs/ingest_file_job.rb +16 -0
  19. data/app/jobs/ingest_local_file_job.rb +14 -35
  20. data/app/jobs/resolrize_job.rb +3 -5
  21. data/app/jobs/upload_set_update_job.rb +68 -0
  22. data/app/models/checksum_audit_log.rb +2 -3
  23. data/app/models/concerns/curation_concerns/ability.rb +18 -10
  24. data/app/models/concerns/curation_concerns/basic_metadata.rb +1 -3
  25. data/app/models/concerns/curation_concerns/collection_behavior.rb +13 -14
  26. data/app/models/concerns/curation_concerns/file_set/belongs_to_upload_sets.rb +15 -0
  27. data/app/models/concerns/curation_concerns/{generic_file → file_set}/belongs_to_works.rb +8 -14
  28. data/app/models/concerns/curation_concerns/file_set/derivatives.rb +54 -0
  29. data/app/models/concerns/curation_concerns/{generic_file → file_set}/full_text_indexing.rb +1 -2
  30. data/app/models/concerns/curation_concerns/{generic_file → file_set}/indexing.rb +2 -2
  31. data/app/models/concerns/curation_concerns/{generic_file → file_set}/versions.rb +2 -3
  32. data/app/models/concerns/curation_concerns/file_set_behavior.rb +36 -0
  33. data/app/models/concerns/curation_concerns/generic_file.rb +1 -1
  34. data/app/models/concerns/curation_concerns/has_representative.rb +6 -7
  35. data/app/models/concerns/curation_concerns/human_readable_type.rb +5 -7
  36. data/app/models/concerns/curation_concerns/permissions.rb +2 -2
  37. data/app/models/concerns/curation_concerns/permissions/readable.rb +0 -1
  38. data/app/models/concerns/curation_concerns/permissions/writable.rb +10 -51
  39. data/app/models/concerns/curation_concerns/serializers.rb +3 -5
  40. data/app/models/concerns/curation_concerns/solr_document_behavior.rb +37 -40
  41. data/app/models/concerns/curation_concerns/upload_set_behavior.rb +38 -0
  42. data/app/models/concerns/curation_concerns/user.rb +4 -51
  43. data/app/models/concerns/curation_concerns/with_file_sets.rb +28 -0
  44. data/app/models/concerns/curation_concerns/{generic_work_behavior.rb → work_behavior.rb} +12 -6
  45. data/app/models/curation_concerns/classify_concern.rb +7 -7
  46. data/app/models/curation_concerns/quick_classification_query.rb +6 -7
  47. data/app/models/single_use_link.rb +34 -0
  48. data/app/models/upload_set.rb +3 -0
  49. data/app/services/curation_concerns/derivative_path.rb +32 -0
  50. data/app/services/curation_concerns/{generic_file_audit_service.rb → file_set_audit_service.rb} +17 -18
  51. data/app/services/curation_concerns/indexes_thumbnails.rb +14 -0
  52. data/app/services/curation_concerns/local_file_service.rb +10 -0
  53. data/app/services/curation_concerns/lock_manager.rb +40 -0
  54. data/app/services/curation_concerns/noid.rb +1 -1
  55. data/app/services/curation_concerns/persist_derivatives.rb +33 -0
  56. data/app/services/curation_concerns/persist_directly_contained_output_file_service.rb +26 -0
  57. data/app/services/curation_concerns/repository_audit_service.rb +1 -3
  58. data/app/services/curation_concerns/thumbnail_path_service.rb +46 -0
  59. data/app/services/curation_concerns/time_service.rb +7 -0
  60. data/app/services/curation_concerns/versioning_service.rb +11 -12
  61. data/curation_concerns-models.gemspec +6 -6
  62. data/lib/curation_concerns/configuration.rb +154 -0
  63. data/lib/curation_concerns/messages.rb +26 -26
  64. data/lib/curation_concerns/models.rb +5 -14
  65. data/lib/curation_concerns/models/engine.rb +0 -30
  66. data/lib/curation_concerns/models/utils.rb +4 -4
  67. data/lib/curation_concerns/models/version.rb +1 -1
  68. data/lib/generators/curation_concerns/models/abstract_migration_generator.rb +8 -7
  69. data/lib/generators/curation_concerns/models/clamav_generator.rb +3 -3
  70. data/lib/generators/curation_concerns/models/install_generator.rb +13 -20
  71. data/lib/generators/curation_concerns/models/templates/app/models/file_set.rb +4 -0
  72. data/lib/generators/curation_concerns/models/templates/config/clamav.rb +1 -1
  73. data/lib/generators/curation_concerns/models/templates/config/curation_concerns.rb +52 -65
  74. data/lib/generators/curation_concerns/models/templates/config/redis_config.rb +13 -17
  75. data/lib/generators/curation_concerns/models/templates/config/resque_config.rb +2 -1
  76. data/lib/generators/curation_concerns/models/templates/migrations/create_checksum_audit_logs.rb +3 -3
  77. data/lib/generators/curation_concerns/models/templates/migrations/create_single_use_links.rb +12 -0
  78. data/lib/tasks/curation_concerns-models_tasks.rake +4 -62
  79. data/lib/tasks/migrate.rake +1 -1
  80. data/lib/tasks/resque.rake +1 -0
  81. data/lib/tasks/solr_reindex.rake +1 -1
  82. metadata +59 -52
  83. data/app/actors/curation_concerns/generic_file_actor.rb +0 -150
  84. data/app/jobs/active_fedora_pid_based_job.rb +0 -6
  85. data/app/jobs/copy_permissions_job.rb +0 -24
  86. data/app/models/concerns/curation_concerns/generic_file/characterization.rb +0 -89
  87. data/app/models/concerns/curation_concerns/generic_file/content.rb +0 -8
  88. data/app/models/concerns/curation_concerns/generic_file/export.rb +0 -343
  89. data/app/models/concerns/curation_concerns/generic_file_behavior.rb +0 -44
  90. data/app/models/concerns/curation_concerns/with_basic_metadata.rb +0 -98
  91. data/app/models/concerns/curation_concerns/with_generic_files.rb +0 -29
  92. data/app/models/datastreams/fits_datastream.rb +0 -148
  93. data/app/services/curation_concerns/characterization_service.rb +0 -71
  94. data/app/services/curation_concerns/full_text_extraction_service.rb +0 -38
  95. data/app/services/curation_concerns/generic_file_indexing_service.rb +0 -14
  96. data/lib/curation_concerns/models/resque.rb +0 -36
  97. data/lib/generators/curation_concerns/models/fulltext_generator.rb +0 -28
  98. data/lib/generators/curation_concerns/models/templates/app/models/generic_file.rb +0 -4
  99. data/lib/generators/curation_concerns/models/templates/config/resque_admin.rb +0 -10
@@ -2,13 +2,12 @@ module CurationConcerns::HasRepresentative
2
2
  extend ActiveSupport::Concern
3
3
 
4
4
  included do
5
- property :representative, predicate: RDF::URI.new('http://opaquenamespace.org/ns/hydra/representative'), multiple: false
6
- end
5
+ belongs_to :representative,
6
+ predicate: ::RDF::Vocab::EBUCore.hasRelatedMediaFragment,
7
+ class_name: 'ActiveFedora::Base'
7
8
 
8
- def to_solr(solr_doc={})
9
- super.tap do |solr_doc|
10
- solr_doc[Solrizer.solr_name('representative', :stored_searchable)] = representative
11
- end
9
+ belongs_to :thumbnail,
10
+ predicate: ::RDF::Vocab::EBUCore.hasRelatedImage,
11
+ class_name: 'ActiveFedora::Base'
12
12
  end
13
-
14
13
  end
@@ -1,5 +1,5 @@
1
1
  module CurationConcerns
2
- module HumanReadableType
2
+ module HumanReadableType
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
@@ -11,13 +11,11 @@ module CurationConcerns
11
11
  self.class.human_readable_type
12
12
  end
13
13
 
14
- def to_solr(solr_doc={})
15
- super(solr_doc).tap do |solr_doc|
16
- solr_doc[Solrizer.solr_name('human_readable_type',:facetable)] = human_readable_type
17
- solr_doc[Solrizer.solr_name('human_readable_type', :stored_searchable)] = human_readable_type
14
+ def to_solr(solr_doc = {})
15
+ super(solr_doc).tap do |doc|
16
+ doc[Solrizer.solr_name('human_readable_type', :facetable)] = human_readable_type
17
+ doc[Solrizer.solr_name('human_readable_type', :stored_searchable)] = human_readable_type
18
18
  end
19
19
  end
20
-
21
20
  end
22
21
  end
23
-
@@ -1,7 +1,7 @@
1
1
  module CurationConcerns
2
2
  module Permissions
3
3
  extend ActiveSupport::Concern
4
- include CurationConcerns::Permissions::Writable
5
- include CurationConcerns::Permissions::Readable
4
+ include CurationConcerns::Permissions::Writable
5
+ include CurationConcerns::Permissions::Readable
6
6
  end
7
7
  end
@@ -13,7 +13,6 @@ module CurationConcerns
13
13
  def private?
14
14
  !(public? || registered?)
15
15
  end
16
-
17
16
  end
18
17
  end
19
18
  end
@@ -3,7 +3,7 @@ module CurationConcerns
3
3
  module Writable
4
4
  extend ActiveSupport::Concern
5
5
 
6
- #we're overriding the permissions= method which is in Hydra::AccessControls::Permissions
6
+ # we're overriding the permissions= method which is in Hydra::AccessControls::Permissions
7
7
  include Hydra::AccessControls::Permissions
8
8
  include Hydra::AccessControls::Visibility
9
9
 
@@ -14,62 +14,21 @@ module CurationConcerns
14
14
  def paranoid_permissions
15
15
  valid = true
16
16
  paranoid_edit_permissions.each do |validation|
17
- if validation[:condition].call(self)
18
- errors[validation[:key]] ||= []
19
- errors[validation[:key]] << validation[:message]
20
- valid = false
21
- end
17
+ next unless validation[:condition].call(self)
18
+ errors[validation[:key]] ||= []
19
+ errors[validation[:key]] << validation[:message]
20
+ valid = false
22
21
  end
23
- return valid
22
+ valid
24
23
  end
25
24
 
26
25
  def paranoid_edit_permissions
27
26
  [
28
- {key: :edit_users, message: 'Depositor must have edit access', condition: lambda { |obj| !obj.edit_users.include?(obj.depositor) }},
29
- {key: :edit_groups, message: 'Public cannot have edit access', condition: lambda { |obj| obj.edit_groups.include?('public') }},
30
- {key: :edit_groups, message: 'Registered cannot have edit access', condition: lambda { |obj| obj.edit_groups.include?('registered') }}
27
+ { key: :edit_users, message: 'Depositor must have edit access', condition: ->(obj) { !obj.edit_users.include?(obj.depositor) } },
28
+ { key: :edit_groups, message: 'Public cannot have edit access', condition: ->(obj) { obj.edit_groups.include?('public') } },
29
+ { key: :edit_groups, message: 'Registered cannot have edit access', condition: ->(obj) { obj.edit_groups.include?('registered') } }
31
30
  ]
32
31
  end
33
-
34
- def clear_permissions!
35
- self.permissions = []
36
- end
37
-
38
- ## Updates those permissions that are provided to it. Does not replace any permissions unless they are provided
39
- # def permissions=(params)
40
- # raise "Fixme #{params}"
41
- # perm_hash = permission_hash
42
- # params[:new_user_name].each { |name, access| perm_hash['person'][name] = access } if params[:new_user_name].present?
43
- # params[:new_group_name].each { |name, access| perm_hash['group'][name] = access } if params[:new_group_name].present?
44
-
45
- # params[:user].each { |name, access| perm_hash['person'][name] = access} if params[:user]
46
- # params[:group].each { |name, access| perm_hash['group'][name] = access if ['read', 'edit'].include?(access)} if params[:group]
47
-
48
- # # rightsMetadata.update_permissions(perm_hash)
49
- # end
50
-
51
- # def permissions
52
- # raise "Fixme "
53
- # perms = super
54
- # perms.map {|p| { name: p.name, access: p.access, type:p.type } }
55
- # end
56
-
57
- private
58
-
59
- def permission_hash
60
- old_perms = self.permissions
61
- user_perms = {}
62
- old_perms.select{|r| r[:type] == 'user'}.each do |r|
63
- user_perms[r[:name]] = r[:access]
64
- end
65
- user_perms
66
- group_perms = {}
67
- old_perms.select{|r| r[:type] == 'group'}.each do |r|
68
- group_perms[r[:name]] = r[:access]
69
- end
70
- {'person'=>user_perms, 'group'=>group_perms}
71
- end
72
-
73
32
  end
74
33
  end
75
- end
34
+ end
@@ -1,15 +1,13 @@
1
1
  module CurationConcerns
2
2
  module Serializers
3
-
4
3
  def to_s
5
4
  if title.present?
6
- Array(title).join(" | ")
5
+ Array(title).join(' | ')
7
6
  elsif label.present?
8
- Array(label).join(" | ")
7
+ Array(label).join(' | ')
9
8
  else
10
- "No Title"
9
+ 'No Title'
11
10
  end
12
11
  end
13
-
14
12
  end
15
13
  end
@@ -1,15 +1,12 @@
1
1
  module CurationConcerns
2
2
  module SolrDocumentBehavior
3
+ extend ActiveSupport::Concern
4
+ include Hydra::Works::MimeTypes
5
+
3
6
  def title_or_label
4
7
  title || label
5
8
  end
6
9
 
7
- ##
8
- # Give our SolrDocument an ActiveModel::Naming appropriate route_key
9
- def route_key
10
- get(Solrizer.solr_name('has_model', :symbol)).split(':').last.downcase
11
- end
12
-
13
10
  def to_param
14
11
  id
15
12
  end
@@ -43,12 +40,12 @@ module CurationConcerns
43
40
  Array(self[Solrizer.solr_name('human_readable_type', :stored_searchable)]).first
44
41
  end
45
42
 
46
- def representative
47
- Array(self[Solrizer.solr_name('representative', :stored_searchable)]).first
43
+ def representative_id
44
+ fetch(Solrizer.solr_name('hasRelatedMediaFragment', :symbol), []).first
48
45
  end
49
46
 
50
47
  def date_uploaded
51
- field = self[Solrizer.solr_name("date_uploaded", :stored_sortable, type: :date)]
48
+ field = self[Solrizer.solr_name('date_uploaded', :stored_sortable, type: :date)]
52
49
  return unless field.present?
53
50
  begin
54
51
  Date.parse(field).to_formatted_s(:standard)
@@ -58,7 +55,7 @@ module CurationConcerns
58
55
  end
59
56
 
60
57
  def depositor(default = '')
61
- val = Array(self[Solrizer.solr_name("depositor")]).first
58
+ val = Array(self[Solrizer.solr_name('depositor')]).first
62
59
  val.present? ? val : default
63
60
  end
64
61
 
@@ -75,61 +72,61 @@ module CurationConcerns
75
72
  end
76
73
 
77
74
  def file_format
78
- Array(self[Solrizer.solr_name('file_format')]).first
75
+ Array(self[Solrizer.solr_name('file_format')]).first
79
76
  end
80
77
 
81
78
  def creator
82
- Array(self[Solrizer.solr_name("creator")]).first
83
- end
84
-
85
- def tags
86
- Array(self[Solrizer.solr_name("tag")])
79
+ fetch(Solrizer.solr_name('creator'), [])
87
80
  end
88
81
 
89
- def resource_type
90
- Array(self[Solrizer.solr_name("resource_type")])
82
+ def contributor
83
+ fetch(Solrizer.solr_name('contributor'), [])
91
84
  end
92
85
 
93
- def mime_type
94
- Array(self[Solrizer.solr_name("mime_type")]).first
86
+ def subject
87
+ fetch(Solrizer.solr_name('subject'), [])
95
88
  end
96
89
 
97
- def read_groups
98
- Array(self[::Ability.read_group_field])
90
+ def publisher
91
+ fetch(Solrizer.solr_name('publisher'), [])
99
92
  end
100
93
 
101
- def edit_groups
102
- Array(self[::Ability.edit_group_field])
94
+ def language
95
+ fetch(Solrizer.solr_name('language'), [])
103
96
  end
104
97
 
105
- def edit_people
106
- Array(self[::Ability.edit_user_field])
98
+ def tags
99
+ fetch(Solrizer.solr_name('tag'), [])
107
100
  end
108
101
 
109
- def public?
110
- read_groups.include?('public')
102
+ def embargo_release_date
103
+ self[Hydra.config.permissions.embargo.release_date]
111
104
  end
112
105
 
113
- def registered?
114
- read_groups.include?('registered')
106
+ def lease_expiration_date
107
+ self[Hydra.config.permissions.lease.expiration_date]
115
108
  end
116
109
 
117
- def pdf?
118
- ['application/pdf'].include? self.mime_type
110
+ def rights
111
+ self[Solrizer.solr_name('rights')]
119
112
  end
120
113
 
121
- def image?
122
- ['image/png','image/jpeg', 'image/jpg', 'image/jp2', 'image/bmp', 'image/gif', 'image/tiff'].include? self.mime_type
114
+ def mime_type
115
+ self[Solrizer.solr_name('mime_type', :stored_sortable)]
123
116
  end
124
117
 
125
- def video?
126
- ['video/mpeg', 'video/mp4', 'video/webm', 'video/x-msvideo', 'video/avi', 'video/quicktime', 'application/mxf'].include? self.mime_type
118
+ def read_groups
119
+ fetch(Hydra.config.permissions.read.group, [])
127
120
  end
128
121
 
129
- def audio?
130
- # audio/x-wave is the mime type that fits 0.6.0 returns for a wav file.
131
- # audio/mpeg is the mime type that fits 0.6.0 returns for an mp3 file.
132
- ['audio/mp3', 'audio/mpeg', 'audio/x-wave', 'audio/x-wav', 'audio/ogg'].include? self.mime_type
122
+ def visibility
123
+ @visibility ||= if read_groups.include? Hydra::AccessControls::AccessRight::PERMISSION_TEXT_VALUE_PUBLIC
124
+ Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
125
+ elsif read_groups.include? Hydra::AccessControls::AccessRight::PERMISSION_TEXT_VALUE_AUTHENTICATED
126
+ Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
127
+ else
128
+ Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
129
+ end
133
130
  end
134
131
  end
135
132
  end
@@ -0,0 +1,38 @@
1
+ module CurationConcerns
2
+ module UploadSetBehavior
3
+ extend ActiveSupport::Concern
4
+ include Hydra::AccessControls::Permissions
5
+ include CurationConcerns::Noid
6
+
7
+ included do
8
+ has_many :file_sets, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf
9
+
10
+ property :creator, predicate: ::RDF::DC.creator
11
+ property :title, predicate: ::RDF::DC.title
12
+ property :status, predicate: ::RDF::DC.type
13
+ end
14
+
15
+ module ClassMethods
16
+ def find_or_create(id)
17
+ UploadSet.find(id)
18
+ rescue ActiveFedora::ObjectNotFoundError
19
+ safe_create(id)
20
+ end
21
+
22
+ private
23
+
24
+ # This method handles most race conditions gracefully.
25
+ # If an upload_set with the same ID is created by another thread
26
+ # we fetch the upload_set that was created (rather than throwing
27
+ # an error) and continute.
28
+ def safe_create(id)
29
+ UploadSet.create(id: id)
30
+ rescue ActiveFedora::IllegalOperation
31
+ # This is the exception thrown by LDP when we attempt to
32
+ # create a duplicate object. If we can find the object
33
+ # then we are good to go.
34
+ UploadSet.find(id)
35
+ end
36
+ end
37
+ end
38
+ end
@@ -1,65 +1,18 @@
1
1
  module CurationConcerns::User
2
2
  extend ActiveSupport::Concern
3
-
4
- # Copied piecemeal from the pcdm branch of sufia-models. More may yet be necessary.
5
-
6
3
  included do
7
- # Connects this user object to Blacklight's Bookmarks and Folders.
8
- include Blacklight::User
9
- include Hydra::User
10
-
11
4
  delegate :can?, :cannot?, to: :ability
12
-
13
- attr_accessor :update_directory
14
- end
15
-
16
- # Format the json for select2 which requires just an id and a field called text.
17
- # If we need an alternate format we should probably look at a json template gem
18
- def as_json(opts = nil)
19
- { id: user_key, text: display_name ? "#{display_name} (#{user_key})" : user_key }
20
- end
21
-
22
- # Populate user instance with attributes from remote system (e.g., LDAP)
23
- # There is no default implementation -- override this in your application
24
- # def populate_attributes
25
- # end
26
-
27
- def email_address
28
- self.email
29
- end
30
-
31
- def name
32
- self.display_name.titleize || raise
33
- rescue
34
- self.user_key
35
5
  end
36
6
 
37
7
  # Redefine this for more intuitive keys in Redis
38
8
  def to_param
39
- # hack because rails doesn't like periods in urls.
9
+ # HACK: because rails doesn't like periods in urls.
40
10
  user_key.gsub(/\./, '-dot-')
41
11
  end
42
12
 
43
- # The basic groups method, override or will fallback to S ufia::Ldap::User
44
- # def groups
45
- # @groups ||= self.group_list ? self.group_list.split(";?;") : []
46
- # end
47
-
48
- def ability
49
- @ability ||= ::Ability.new(self)
50
- end
51
-
52
- module ClassMethods
53
- def current
54
- Thread.current[:user]
55
- end
13
+ private
56
14
 
57
- def current=(user)
58
- Thread.current[:user] = user
15
+ def ability
16
+ @ability ||= ::Ability.new(self)
59
17
  end
60
-
61
- # def from_url_component(component)
62
- # User.find_by_user_key(component.gsub(/-dot-/, '.'))
63
- # end
64
- end
65
18
  end
@@ -0,0 +1,28 @@
1
+ # Copied from Curate
2
+ module CurationConcerns
3
+ module WithFileSets
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ # The file_sets association and its accessor methods comes from Hydra::Works::AggregatesFileSets
8
+ before_destroy :before_destroy_cleanup_file_sets
9
+ end
10
+
11
+ # Stopgap unil ActiveFedora ContainerAssociation includes an *_ids accessor.
12
+ # At the moment, this is no more efficient than calling file_sets, but hopefully that will change in the future.
13
+ def file_set_ids
14
+ file_sets.map(&:id)
15
+ end
16
+
17
+ def before_destroy_cleanup_file_sets
18
+ file_sets.each(&:destroy)
19
+ end
20
+
21
+ def copy_visibility_to_files
22
+ file_sets.each do |fs|
23
+ fs.visibility = visibility
24
+ fs.save!
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,7 +1,7 @@
1
- module CurationConcerns::GenericWorkBehavior
1
+ module CurationConcerns::WorkBehavior
2
2
  extend ActiveSupport::Concern
3
3
 
4
- include Hydra::Works::GenericWorkBehavior
4
+ include Hydra::Works::WorkBehavior
5
5
  include ::CurationConcerns::HumanReadableType
6
6
  include CurationConcerns::Noid
7
7
  include CurationConcerns::Permissions
@@ -9,7 +9,7 @@ module CurationConcerns::GenericWorkBehavior
9
9
  include Hydra::WithDepositor
10
10
  include Solrizer::Common
11
11
  include ::CurationConcerns::HasRepresentative
12
- include ::CurationConcerns::WithGenericFiles
12
+ include ::CurationConcerns::WithFileSets
13
13
  include Hydra::AccessControls::Embargoable
14
14
 
15
15
  included do
@@ -19,12 +19,18 @@ module CurationConcerns::GenericWorkBehavior
19
19
 
20
20
  module ClassMethods
21
21
  def indexer
22
- CurationConcerns::GenericWorkIndexingService
22
+ CurationConcerns::WorkIndexingService
23
23
  end
24
24
  end
25
25
 
26
26
  def to_s
27
- title.join(', ')
27
+ if title.present?
28
+ Array(title).join(' | ')
29
+ elsif label.present?
30
+ Array(label).join(' | ')
31
+ else
32
+ 'No Title'
33
+ end
28
34
  end
29
35
 
30
36
  # Returns a string identifying the path associated with the object. ActionPack uses this to find a suitable partial to represent the object.
@@ -32,7 +38,7 @@ module CurationConcerns::GenericWorkBehavior
32
38
  "curation_concerns/#{super}"
33
39
  end
34
40
 
35
- def can_be_member_of_collection?(collection)
41
+ def can_be_member_of_collection?(_collection)
36
42
  true
37
43
  end
38
44
  end