diff --git a/app/controllers/application_controller_decorator.rb b/app/controllers/application_controller_decorator.rb
index 3273c35..a02af69 100644
--- a/app/controllers/application_controller_decorator.rb
+++ b/app/controllers/application_controller_decorator.rb
@@ -47,7 +47,7 @@ def deny_access_for_anonymous_user(exception, json_message)
# rubocop:disable Metrics/AbcSize
def global_request_logging
FileUtils.mkdir_p(Rails.root.join('log')) unless Dir.exist?(Rails.root.join('log'))
- rl = ActiveSupport::Logger.new('log/request.log')
+ rl = ActiveSupport::Logger.new(Rails.root.join('log', 'request.log'))
if request.host&.match('blc.hykucommons')
http_request_header_keys = request.headers.env.keys.select { |header_name| header_name.match("^HTTP.*|^X-User.*") }
http_request_headers = request.headers.env.select { |header_name, _header_value| http_request_header_keys.index(header_name) }
diff --git a/app/controllers/hyrax/cdls_controller.rb b/app/controllers/hyrax/cdls_controller.rb
index d298641..5e0b274 100644
--- a/app/controllers/hyrax/cdls_controller.rb
+++ b/app/controllers/hyrax/cdls_controller.rb
@@ -5,8 +5,13 @@ module Hyrax
class CdlsController < ApplicationController
# Adds Hyrax behaviors to the controller.
include Hyrax::WorksControllerBehavior
+ include Hyku::WorksControllerBehavior
include Hyrax::BreadcrumbsForWorks
- self.curation_concern_type = ::Cdl
+ self.curation_concern_type = ::CdlResource
+
+ # Use a Valkyrie aware form service to generate Valkyrie::ChangeSet style
+ # forms.
+ self.work_form_service = Hyrax::FormFactory.new
# Use this line if you want to use a custom presenter
self.show_presenter = Hyrax::CdlPresenter
diff --git a/app/controllers/hyrax/etds_controller.rb b/app/controllers/hyrax/etds_controller.rb
index e0d3776..6cfb806 100644
--- a/app/controllers/hyrax/etds_controller.rb
+++ b/app/controllers/hyrax/etds_controller.rb
@@ -5,8 +5,13 @@ module Hyrax
class EtdsController < ApplicationController
# Adds Hyrax behaviors to the controller.
include Hyrax::WorksControllerBehavior
+ include Hyku::WorksControllerBehavior
include Hyrax::BreadcrumbsForWorks
- self.curation_concern_type = ::Etd
+ self.curation_concern_type = ::EtdResource
+
+ # Use a Valkyrie aware form service to generate Valkyrie::ChangeSet style
+ # forms.
+ self.work_form_service = Hyrax::FormFactory.new
# Use this line if you want to use a custom presenter
self.show_presenter = Hyrax::EtdPresenter
diff --git a/app/controllers/hyrax/oers_controller.rb b/app/controllers/hyrax/oers_controller.rb
index 20d66c1..ea4879c 100644
--- a/app/controllers/hyrax/oers_controller.rb
+++ b/app/controllers/hyrax/oers_controller.rb
@@ -5,8 +5,13 @@ module Hyrax
class OersController < ApplicationController
# Adds Hyrax behaviors to the controller.
include Hyrax::WorksControllerBehavior
+ include Hyku::WorksControllerBehavior
include Hyrax::BreadcrumbsForWorks
- self.curation_concern_type = ::Oer
+ self.curation_concern_type = ::OerResource
+
+ # Use a Valkyrie aware form service to generate Valkyrie::ChangeSet style
+ # forms.
+ self.work_form_service = Hyrax::FormFactory.new
# Use this line if you want to use a custom presenter
self.show_presenter = Hyrax::OerPresenter
diff --git a/app/forms/cdl_resource_form.rb b/app/forms/cdl_resource_form.rb
new file mode 100644
index 0000000..b2bcccd
--- /dev/null
+++ b/app/forms/cdl_resource_form.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+# Generated via
+# `rails generate hyrax:work_resource CdlResource`
+#
+# @see https://github.com/samvera/hyrax/wiki/Hyrax-Valkyrie-Usage-Guide#forms
+# @see https://github.com/samvera/valkyrie/wiki/ChangeSets-and-Dirty-Tracking
+class CdlResourceForm < Hyrax::Forms::ResourceForm(CdlResource)
+ # include Hyrax::FormFields(:basic_metadata)
+ include Hyrax::FormFields(:cdl_resource)
+ include Hyrax::FormFields(:with_pdf_viewer)
+ include Hyrax::FormFields(:with_video_embed)
+
+ # Define custom form fields using the Valkyrie::ChangeSet interface
+ #
+ # property :my_custom_form_field
+
+ # if you want a field in the form, but it doesn't have a directly corresponding
+ # model attribute, make it virtual
+ #
+ # property :user_input_not_destined_for_the_model, virtual: true
+end
diff --git a/app/forms/etd_resource_form.rb b/app/forms/etd_resource_form.rb
new file mode 100644
index 0000000..4838446
--- /dev/null
+++ b/app/forms/etd_resource_form.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+# Generated via
+# `rails generate hyrax:work_resource EtdResource`
+#
+# @see https://github.com/samvera/hyrax/wiki/Hyrax-Valkyrie-Usage-Guide#forms
+# @see https://github.com/samvera/valkyrie/wiki/ChangeSets-and-Dirty-Tracking
+class EtdResourceForm < Hyrax::Forms::ResourceForm(EtdResource)
+ # Commented out basic_metadata because these terms were added to etd_resource so we can customize it.
+ # include Hyrax::FormFields(:basic_metadata)
+ include Hyrax::FormFields(:etd_resource)
+ include Hyrax::FormFields(:with_pdf_viewer)
+ include Hyrax::FormFields(:with_video_embed)
+ include VideoEmbedBehavior::Validation
+ # Define custom form fields using the Valkyrie::ChangeSet interface
+ #
+ # property :my_custom_form_field
+
+ # if you want a field in the form, but it doesn't have a directly corresponding
+ # model attribute, make it virtual
+ #
+ # property :user_input_not_destined_for_the_model, virtual: true
+end
diff --git a/app/forms/oer_resource_form.rb b/app/forms/oer_resource_form.rb
new file mode 100644
index 0000000..0efe325
--- /dev/null
+++ b/app/forms/oer_resource_form.rb
@@ -0,0 +1,86 @@
+# frozen_string_literal: true
+
+# Generated via
+# `rails generate hyrax:work_resource OerResource`
+#
+# @see https://github.com/samvera/hyrax/wiki/Hyrax-Valkyrie-Usage-Guide#forms
+# @see https://github.com/samvera/valkyrie/wiki/ChangeSets-and-Dirty-Tracking
+class OerResourceForm < Hyrax::Forms::ResourceForm(OerResource)
+ # Commented out basic_metadata because these terms were added to etd_resource so we can customize it.
+ # include Hyrax::FormFields(:basic_metadata)
+ include Hyrax::FormFields(:oer_resource)
+ include Hyrax::FormFields(:with_pdf_viewer)
+ include Hyrax::FormFields(:with_video_embed)
+ include VideoEmbedBehavior::Validation
+ # Define custom form fields using the Valkyrie::ChangeSet interface
+ #
+ # property :my_custom_form_field
+
+ # if you want a field in the form, but it doesn't have a directly corresponding
+ # model attribute, make it virtual
+ #
+ # property :user_input_not_destined_for_the_model, virtual: true
+
+ delegate :related_members_attributes=, :previous_version, :newer_version, :alternate_version, :related_item,
+ :previous_version_id, :newer_version_id, :alternate_version_id, :related_item_id, to: :model
+
+ def self.build_permitted_params
+ super + [
+ {
+ related_members_attributes: %i[id _destroy relationship]
+ }
+ ]
+ end
+
+ def previous_version_json
+ return unless previous_version.present?
+
+ previous_version.map do |child|
+ {
+ id: child.id,
+ label: child.to_s,
+ path: @controller.url_for(child),
+ relationship: "previous-version"
+ }
+ end.to_json
+ end
+
+ def newer_version_json
+ return unless newer_version.present?
+
+ newer_version.map do |child|
+ {
+ id: child.id,
+ label: child.to_s,
+ path: @controller.url_for(child),
+ relationship: "newer-version"
+ }
+ end.to_json
+ end
+
+ def alternate_version_json
+ return unless alternate_version.present?
+
+ alternate_version.map do |child|
+ {
+ id: child.id,
+ label: child.to_s,
+ path: @controller.url_for(child),
+ relationship: "alternate-version"
+ }
+ end.to_json
+ end
+
+ def related_item_json
+ return unless related_item.present?
+
+ related_item.map do |child|
+ {
+ id: child.id,
+ label: child.to_s,
+ path: @controller.url_for(child),
+ relationship: "related-item"
+ }
+ end.to_json
+ end
+end
diff --git a/app/helpers/hyrax/override_helper_behavior.rb b/app/helpers/hyrax/override_helper_behavior.rb
index e1717a9..34309b3 100644
--- a/app/helpers/hyrax/override_helper_behavior.rb
+++ b/app/helpers/hyrax/override_helper_behavior.rb
@@ -49,7 +49,7 @@ def truncate_and_iconify_auto_link(field, show_link = true)
# this block is only executed when a link is inserted;
# if we pass text containing no links, it just returns text.
auto_link(html_escape(text)) do |value|
- "#{(' ' + value) if show_link}"
+ "#{(' ' + value) if show_link}"
end
text.truncate(230, separator: ' ')
end
diff --git a/app/indexers/cdl_indexer.rb b/app/indexers/cdl_indexer.rb
index 88f0a23..d2c0b4f 100644
--- a/app/indexers/cdl_indexer.rb
+++ b/app/indexers/cdl_indexer.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Generated via
# `rails generate hyrax:work Cdl`
class CdlIndexer < AppIndexer
diff --git a/app/indexers/cdl_resource_indexer.rb b/app/indexers/cdl_resource_indexer.rb
new file mode 100644
index 0000000..4ef7488
--- /dev/null
+++ b/app/indexers/cdl_resource_indexer.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+# Generated via
+# `rails generate hyrax:work_resource CdlResource`
+class CdlResourceIndexer < Hyrax::ValkyrieWorkIndexer
+ include Hyrax::Indexer(:basic_metadata)
+ include Hyrax::Indexer(:cdl_resource)
+
+ include HykuIndexing
+
+ # Uncomment this block if you want to add custom indexing behavior:
+ # def to_solr
+ # super.tap do |index_document|
+ # index_document[:my_field_tesim] = resource.my_field.map(&:to_s)
+ # index_document[:other_field_ssim] = resource.other_field
+ # end
+ # end
+end
diff --git a/app/indexers/etd_resource_indexer.rb b/app/indexers/etd_resource_indexer.rb
index 5c4580e..cb0ae1d 100644
--- a/app/indexers/etd_resource_indexer.rb
+++ b/app/indexers/etd_resource_indexer.rb
@@ -1,22 +1,16 @@
# frozen_string_literal: true
-
-# TODO: temporarily added to see if iiif print engine spec error would resolve. (it did)
-# so some of the spec failures is because the models haven't been
-# valkyrized
-
# Generated via
-# `rails generate hyrax:work_resource GenericWorkResource`
+# `rails generate hyrax:work_resource EtdResource`
class EtdResourceIndexer < Hyrax::ValkyrieWorkIndexer
- # TODO: specify custom properties for this work type
-
- # include Hyrax::Indexer(:basic_metadata)
- # include Hyrax::Indexer(:bulkrax_metadata)
- # include Hyrax::Indexer(:generic_work_resource)
- # include Hyrax::Indexer(:with_pdf_viewer)
- # include Hyrax::Indexer(:with_video_embed)
+ include Hyrax::Indexer(:basic_metadata)
+ include Hyrax::Indexer(:bulkrax_metadata)
+ include Hyrax::Indexer(:etd_resource)
+ include Hyrax::Indexer(:with_pdf_viewer)
+ include Hyrax::Indexer(:with_video_embed)
include HykuIndexing
+
# Uncomment this block if you want to add custom indexing behavior:
# def to_solr
# super.tap do |index_document|
@@ -24,4 +18,4 @@ class EtdResourceIndexer < Hyrax::ValkyrieWorkIndexer
# index_document[:other_field_ssim] = resource.other_field
# end
# end
-end
\ No newline at end of file
+end
diff --git a/app/indexers/oer_resource_indexer.rb b/app/indexers/oer_resource_indexer.rb
new file mode 100644
index 0000000..3ed693c
--- /dev/null
+++ b/app/indexers/oer_resource_indexer.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+# Generated via
+# `rails generate hyrax:work_resource OerResource`
+class OerResourceIndexer < Hyrax::ValkyrieWorkIndexer
+ include Hyrax::Indexer(:basic_metadata)
+ include Hyrax::Indexer(:bulkrax_metadata)
+ include Hyrax::Indexer(:oer_resource)
+ include Hyrax::Indexer(:with_pdf_viewer)
+ include Hyrax::Indexer(:with_video_embed)
+
+ include HykuIndexing
+
+ # Uncomment this block if you want to add custom indexing behavior:
+ # def to_solr
+ # super.tap do |index_document|
+ # index_document[:my_field_tesim] = resource.my_field.map(&:to_s)
+ # index_document[:other_field_ssim] = resource.other_field
+ # end
+ # end
+end
diff --git a/app/jobs/create_group_and_add_members_job.rb b/app/jobs/create_group_and_add_members_job.rb
index 53503a1..9211141 100644
--- a/app/jobs/create_group_and_add_members_job.rb
+++ b/app/jobs/create_group_and_add_members_job.rb
@@ -13,10 +13,10 @@ class CreateGroupAndAddMembersJob < ApplicationJob
queue_as :default
def perform(cdl_id, retries = 0)
- work = Cdl.where(id: cdl_id).first
+ work = Hyrax.query_service.find_by(id: cdl_id)
return if work.nil?
- page_count = work.file_sets.first.page_count.first.to_i
+ page_count = work.members.first.original_file.page_count.first.to_i
child_model = work.iiif_print_config.pdf_split_child_model
child_works_count = work.members.select { |member| member.is_a?(child_model) }.count
@@ -28,7 +28,7 @@ def perform(cdl_id, retries = 0)
assign_read_groups(member, group.name)
end
- work.save
+ Hyrax.persister.save(resource: work)
group.save
else
return if retries > RETRY_MAX
@@ -42,7 +42,7 @@ def perform(cdl_id, retries = 0)
def assign_read_groups(member, group_name)
member.read_groups = [group_name]
- member.save
+ Hyrax.persister.save(resource: member)
member.members.each do |sub_member|
assign_read_groups(sub_member, group_name)
end
diff --git a/app/jobs/destroy_cdl_group_job.rb b/app/jobs/destroy_cdl_group_job.rb
index ddb9115..29d0204 100644
--- a/app/jobs/destroy_cdl_group_job.rb
+++ b/app/jobs/destroy_cdl_group_job.rb
@@ -1,5 +1,9 @@
# frozen_string_literal: true
+# Probably not needed because we're only going to ever
+# be destroying one group so a background job is unnecessary.
+# Leaving it here for now because the Cdl model still references it.
+# But in Valkyrie, we're going to just destroy the group in the Listener.
class DestroyCdlGroupJob < ApplicationJob
queue_as :default
diff --git a/app/jobs/iiif_print/create_relationships_job_decorator.rb b/app/jobs/iiif_print/create_relationships_job_decorator.rb
index 0141351..c56e4b9 100644
--- a/app/jobs/iiif_print/create_relationships_job_decorator.rb
+++ b/app/jobs/iiif_print/create_relationships_job_decorator.rb
@@ -34,7 +34,7 @@ def perform(parent_id:, parent_model:, child_model:, retries: 0, **)
# report failures & keep pending relationships
raise "CreateRelationshipsJob failed for parent id: #{@parent_id} " \
"had #{@number_of_successes} successes & #{@number_of_failures} failures, " \
- "with errors: #{@errors}. Wanted #{@pending_children} children."
+ "with errors: #{@errors}. Wanted #{@pending_children.count} children."
end
# OVERRIDE begin
diff --git a/app/models/cdl_resource.rb b/app/models/cdl_resource.rb
new file mode 100644
index 0000000..bd29638
--- /dev/null
+++ b/app/models/cdl_resource.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+# Generated via
+# `rails generate hyrax:work_resource CdlResource`
+class CdlResource < Hyrax::Work
+ # Commented out basic_metadata because these terms were added to etd_resource so we can customize it.
+ # include Hyrax::Schema(:basic_metadata)
+ include Hyrax::Schema(:cdl_resource)
+ include Hyrax::Schema(:bulkrax_metadata)
+ include Hyrax::Schema(:with_pdf_viewer)
+ include Hyrax::Schema(:with_video_embed)
+ include Hyrax::ArResource
+ include Hyrax::NestedWorks
+
+ Hyrax::ValkyrieLazyMigration.migrating(self, from: Cdl)
+
+ include IiifPrint.model_configuration(
+ pdf_split_child_model: GenericWorkResource,
+ pdf_splitter_service: IiifPrint::TenantConfig::PdfSplitter
+ )
+
+ prepend OrderAlready.for(:creator)
+end
diff --git a/app/models/etd_resource.rb b/app/models/etd_resource.rb
new file mode 100644
index 0000000..27b4294
--- /dev/null
+++ b/app/models/etd_resource.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+# Generated via
+# `rails generate hyrax:work_resource EtdResource`
+class EtdResource < Hyrax::Work
+ # Commented out basic_metadata because these terms were added to etd_resource so we can customize it.
+ # include Hyrax::Schema(:basic_metadata)
+ include Hyrax::Schema(:etd_resource)
+ include Hyrax::Schema(:bulkrax_metadata)
+ include Hyrax::Schema(:with_pdf_viewer)
+ include Hyrax::Schema(:with_video_embed)
+ include Hyrax::ArResource
+ include Hyrax::NestedWorks
+
+ Hyrax::ValkyrieLazyMigration.migrating(self, from: Etd)
+
+ include IiifPrint.model_configuration(
+ pdf_split_child_model: GenericWorkResource,
+ pdf_splitter_service: IiifPrint::TenantConfig::PdfSplitter
+ )
+
+ prepend OrderAlready.for(:creator)
+end
diff --git a/app/models/oer_resource.rb b/app/models/oer_resource.rb
new file mode 100644
index 0000000..ea6e0b7
--- /dev/null
+++ b/app/models/oer_resource.rb
@@ -0,0 +1,39 @@
+# frozen_string_literal: true
+
+# Generated via
+# `rails generate hyrax:work_resource OerResource`
+class OerResource < Hyrax::Work
+ # Commented out basic_metadata because these terms were added to etd_resource so we can customize it.
+ # include Hyrax::Schema(:basic_metadata)
+ include Hyrax::Schema(:oer_resource)
+ include Hyrax::Schema(:bulkrax_metadata)
+ include Hyrax::Schema(:with_pdf_viewer)
+ include Hyrax::Schema(:with_video_embed)
+ include Hyrax::ArResource
+ include Hyrax::NestedWorks
+
+ Hyrax::ValkyrieLazyMigration.migrating(self, from: Oer)
+
+ include IiifPrint.model_configuration(
+ pdf_split_child_model: GenericWorkResource,
+ pdf_splitter_service: IiifPrint::TenantConfig::PdfSplitter
+ )
+
+ prepend OrderAlready.for(:creator)
+
+ def previous_version
+ @previous_version ||= Hyrax.query_service.find_by(id: previous_version_id) if previous_version_id.present?
+ end
+
+ def newer_version
+ @newer_version ||= Hyrax.query_service.find_by(id: newer_version_id) if newer_version_id.present?
+ end
+
+ def alternate_version
+ @alternate_version ||= Hyrax.query_service.find_by(id: alternate_version_id) if alternate_version_id.present?
+ end
+
+ def related_item
+ @related_item ||= Hyrax.query_service.find_by(id: related_item_id) if related_item_id.present?
+ end
+end
diff --git a/app/services/hyku_knapsack/active_fedora_property_locator.rb b/app/services/hyku_knapsack/active_fedora_property_locator.rb
new file mode 100644
index 0000000..21fd87c
--- /dev/null
+++ b/app/services/hyku_knapsack/active_fedora_property_locator.rb
@@ -0,0 +1,71 @@
+# frozen_string_literal: true
+
+module HykuKnapsack
+ class ActiveFedoraPropertyLocator
+ attr_reader :klass, :properties
+
+ def initialize(klass)
+ @klass = klass
+ locate
+ generate_dynamic_methods
+ end
+
+ def from_app
+ properties.select { |_k, file_path| from_root?(file_path) }
+ end
+
+ def from_gems
+ properties.reject { |_k, file_path| from_root?(file_path) }
+ end
+
+ private
+
+ # @return [Hash] a hash of property names and their file paths (with line numbers)
+ # @example
+ # {:has_model=>"/usr/local/bundle/gems/active-fedora-14.0.1/lib/active_fedora/fedora_attributes.rb:15",
+ # :create_date=>"/usr/local/bundle/gems/active-fedora-14.0.1/lib/active_fedora/fedora_attributes.rb:16"}
+ def locate
+ @properties ||= klass.properties.keys.map(&:to_sym).index_with do |property_name|
+ find_property_definition(klass, property_name)
+ end
+ end
+
+ def find_property_definition(klass, property_name)
+ klass.ancestors.each do |ancestor|
+ next unless ancestor.name # Skip anonymous modules
+ file_path, _line_num = Object.const_source_location(ancestor.name)
+ next unless file_path
+
+ File.read(file_path).force_encoding("UTF-8").scrub.each_line.with_index do |line, line_num|
+ return "#{file_path}:#{line_num + 1}" if match_property_definition?(line, property_name)
+ end
+ end
+
+ nil
+ end
+
+ def match_property_definition?(line, property_name)
+ # TODO: If we get a nil as a file_path then we need to improve the regexp
+ regexp = /^\s*(property|[\w.]+\.property)\s*\(?\s*:\s*#{property_name}\b/
+ !line.strip.start_with?('#') && line.match?(regexp) # Skip commented lines
+ end
+
+ def from_root?(file_path)
+ file_path.starts_with?(HykuKnapsack::Engine.root.to_s) || file_path.starts_with?(Rails.root.to_s)
+ end
+
+ def generate_dynamic_methods
+ method_suffixes = properties.values.each_with_object([]) do |file_path, arr|
+ next unless file_path
+ suffix = file_path.split('/').last.split('.').first
+ arr << suffix unless arr.include?(suffix)
+ end
+
+ method_suffixes.each do |suffix|
+ self.class.define_method("from_#{suffix}") do
+ properties.select { |_k, file_path| file_path.split('.rb').first.include?(suffix) }
+ end
+ end
+ end
+ end
+end
diff --git a/app/services/hyrax/simple_schema_loader_decorator.rb b/app/services/hyrax/simple_schema_loader_decorator.rb
index 07adc3b..413e44c 100644
--- a/app/services/hyrax/simple_schema_loader_decorator.rb
+++ b/app/services/hyrax/simple_schema_loader_decorator.rb
@@ -5,7 +5,7 @@
module Hyrax
module SimpleSchemaLoaderDecorator
def config_search_paths
- super + [HykuKnapsack::Engine.root]
+ [HykuKnapsack::Engine.root] + super
end
end
end
diff --git a/app/services/listeners/cdl_listener.rb b/app/services/listeners/cdl_listener.rb
new file mode 100644
index 0000000..d395e13
--- /dev/null
+++ b/app/services/listeners/cdl_listener.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+module Listeners
+ class CdlListener
+ def on_object_deleted(event)
+ object = event[:object]
+ return unless object.is_a?(CdlResource)
+
+ id = object.id
+ Hyrax::Group.find_by(name: id)&.destroy
+ end
+ end
+end
diff --git a/app/views/hyrax/cdl_resources/_cdl_resource.html.erb b/app/views/hyrax/cdl_resources/_cdl_resource.html.erb
new file mode 100644
index 0000000..dfa344b
--- /dev/null
+++ b/app/views/hyrax/cdl_resources/_cdl_resource.html.erb
@@ -0,0 +1,2 @@
+<%# This is a search result view %>
+<%= render 'catalog/document', document: cdl_resource, document_counter: cdl_resource_counter %>
diff --git a/app/views/hyrax/etd_resources/_etd_resource.html.erb b/app/views/hyrax/etd_resources/_etd_resource.html.erb
new file mode 100644
index 0000000..f71dd2d
--- /dev/null
+++ b/app/views/hyrax/etd_resources/_etd_resource.html.erb
@@ -0,0 +1,2 @@
+<%# This is a search result view %>
+<%= render 'catalog/document', document: etd_resource, document_counter: etd_resource_counter %>
diff --git a/app/views/hyrax/oer_resources/_oer_resource.html.erb b/app/views/hyrax/oer_resources/_oer_resource.html.erb
new file mode 100644
index 0000000..53ae27d
--- /dev/null
+++ b/app/views/hyrax/oer_resources/_oer_resource.html.erb
@@ -0,0 +1,2 @@
+<%# This is a search result view %>
+<%= render 'catalog/document', document: oer_resource, document_counter: oer_resource_counter %>
diff --git a/app/views/hyrax/oers/_related_items.html.erb b/app/views/hyrax/oers/_related_items.html.erb
index bf9c2e1..551c12a 100644
--- a/app/views/hyrax/oers/_related_items.html.erb
+++ b/app/views/hyrax/oers/_related_items.html.erb
@@ -1,7 +1,7 @@
-<% previous_members = presenter.member_presenters_for(presenter.previous_versions) %>
-<% newer_members = presenter.member_presenters_for(presenter.newer_versions) %>
-<% alternate_members = presenter.member_presenters_for(presenter.alternate_versions) %>
-<% related_items = presenter.member_presenters_for(presenter.related_items) %>
+<% previous_members = presenter.member_presenters(presenter.previous_versions) %>
+<% newer_members = presenter.member_presenters(presenter.newer_versions) %>
+<% alternate_members = presenter.member_presenters(presenter.alternate_versions) %>
+<% related_items = presenter.member_presenters(presenter.related_items) %>
<% if previous_members.present? || newer_members.present? || alternate_members.present? || related_items.present? %>
<%= t('hyrax.oer.show.related_items') %>