Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HYC-1739 - Blacklight class overrides #996

Merged
merged 8 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
250 changes: 0 additions & 250 deletions app/helpers/blacklight/facets_helper_behavior.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
# [hyc-override] override file from blacklight gem
# frozen_string_literal: true

require 'builder'

# This module provides Dublin Core export based on the document's semantic values
module Blacklight::Document::DublinCore
# [hyc-override] https://github.com/projectblacklight/blacklight/tree/v7.33.1/app/models/concerns/blacklight/document/dublin_core.rb
Blacklight::Document::DublinCore.module_eval do
include HycHelper

def self.extended(document)
# Register our exportable formats
Blacklight::Document::DublinCore.register_export_formats(document)
end

def self.register_export_formats(document)
document.will_export_as(:xml)
document.will_export_as(:dc_xml, 'text/xml')
document.will_export_as(:oai_dc_xml, 'text/xml')
end

# added thumbnail as separate field to help with ordering
# [hyc-override] added thumbnail as separate field to help with ordering
def dublin_core_field_names
[:contributor, :coverage, :creator, :date, :description, :format, :identifier, :language, :publisher, :relation,
:rights, :source, :subject, :title, :type, :thumbnail]
Expand Down Expand Up @@ -80,18 +65,9 @@ def export_as_oai_dc_xml
xml.target!
end

alias_method :export_as_xml, :export_as_oai_dc_xml
alias_method :export_as_dc_xml, :export_as_oai_dc_xml

# Used by ruby-oai gem to determine if a status=deleted header should be added.
# [hyc-override] Used by ruby-oai gem to determine if a status=deleted header should be added.
# See OAI::Provider::Response::RecordResponse
def deleted?
fetch('workflow_state_name_ssim', nil)&.include?('withdrawn')
end

private

def dublin_core_field_name?(field)
dublin_core_field_names.include? field.to_sym
end
end
96 changes: 0 additions & 96 deletions lib/blacklight_oai_provider/solr_document_wrapper.rb

This file was deleted.

Loading
Loading