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-1730 - Remove model fields which duplicate basic metadata #992

Merged
merged 7 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from 6 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
4 changes: 2 additions & 2 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def single_item_search_builder(id)
# Search fields
# include all fields available to allow searching across all attributes
config.add_show_field solr_name('academic_concentration', :stored_searchable), label: 'Academic Concentration'
config.add_show_field solr_name('access', :stored_searchable), label: 'Access'
config.add_show_field solr_name('access_right', :stored_searchable), label: 'Access Right'
config.add_show_field solr_name('admin_note', :stored_searchable), label: 'Admin Note'
config.add_show_field solr_name('affiliation', :stored_searchable), label: 'Departments', link_to_search: solr_name('affiliation', :facetable)
config.add_show_field solr_name('affiliation_label', :stored_searchable)
Expand Down Expand Up @@ -168,13 +168,13 @@ def single_item_search_builder(id)
config.add_show_field solr_name('place_of_publication', :stored_searchable), label: 'Place of Publication'
config.add_show_field solr_name('publisher', :stored_searchable), label: 'Publisher'
config.add_show_field solr_name('rights_holder', :stored_searchable), label: 'Rights Holder'
config.add_show_field solr_name('rights_notes', :stored_searchable), label: 'Rights Notes'
config.add_show_field solr_name('rights_statement_label', :stored_searchable), label: 'Rights Statement Label'
config.add_show_field solr_name('series', :stored_searchable), label: 'Series'
config.add_show_field solr_name('source', :stored_searchable), label: 'Source'
config.add_show_field solr_name('subject', :stored_searchable), label: 'Subject'
config.add_show_field solr_name('table_of_contents', :stored_searchable), label: 'Table of Contents'
config.add_show_field solr_name('url', :stored_searchable), label: 'Url'
config.add_show_field solr_name('use', :stored_searchable), label: 'Use'

# "fielded" search configuration. Used by pulldown among other places.
# For supported keys in hash, see rdoc for Blacklight::SearchFields
Expand Down
8 changes: 4 additions & 4 deletions app/forms/hyrax/article_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class ArticleForm < ::SingleValueForm

self.model_class = ::Article

self.terms += [:resource_type, :access, :admin_note, :bibliographic_citation, :copyright_date,
self.terms += [:resource_type, :admin_note, :bibliographic_citation, :copyright_date,
sharonluong marked this conversation as resolved.
Show resolved Hide resolved
:date_captured, :date_issued, :date_other, :dcmi_type, :digital_collection, :doi, :edition, :extent,
:funder, :issn, :journal_title, :journal_volume, :journal_issue, :note, :page_start, :page_end,
:peer_review_status, :place_of_publication, :rights_holder, :translator, :use, :deposit_agreement,
:peer_review_status, :place_of_publication, :rights_holder, :translator, :deposit_agreement,
:agreement]

self.required_fields = [:title, :creator, :abstract, :date_issued]
Expand All @@ -20,8 +20,8 @@ class ArticleForm < ::SingleValueForm

self.single_value_fields = [:title, :license]

self.admin_only_terms = [:dcmi_type, :access, :admin_note, :bibliographic_citation, :copyright_date, :date_captured, :date_other,
:digital_collection, :doi, :extent, :identifier, :rights_holder, :translator, :use]
self.admin_only_terms += [:bibliographic_citation, :copyright_date, :date_captured, :date_other,
:digital_collection, :extent, :identifier, :rights_holder, :translator]
self.default_term_values = { dcmi_type: ['http://purl.org/dc/dcmitype/Text'],
language: ['http://id.loc.gov/vocabulary/iso639-2/eng'],
rights_statement: 'http://rightsstatements.org/vocab/InC/1.0/' }
Expand Down
1 change: 0 additions & 1 deletion app/forms/hyrax/artwork_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class ArtworkForm < ::SingleValueForm

# Add overrides for required properties which are becoming single-valued
self.single_value_fields = [:title, :license]
self.admin_only_terms = [:admin_note, :dcmi_type, :doi]
self.default_term_values = { dcmi_type: ['http://purl.org/dc/dcmitype/Image'],
rights_statement: 'http://rightsstatements.org/vocab/InC/1.0/' }

Expand Down
2 changes: 1 addition & 1 deletion app/forms/hyrax/data_set_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DataSetForm < ::SingleValueForm

self.single_value_fields = [:title, :license]

self.admin_only_terms = [:dcmi_type, :access, :admin_note, :doi, :extent, :rights_holder, :rights_statement, :copyright_date]
sharonluong marked this conversation as resolved.
Show resolved Hide resolved
self.admin_only_terms += [:extent, :rights_holder, :rights_statement, :copyright_date]
self.default_term_values = { dcmi_type: ['http://purl.org/dc/dcmitype/Dataset'],
rights_statement: 'http://rightsstatements.org/vocab/InC/1.0/',
language: ['http://id.loc.gov/vocabulary/iso639-2/eng'] }
Expand Down
6 changes: 3 additions & 3 deletions app/forms/hyrax/dissertation_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ class DissertationForm < ::SingleValueForm
class_attribute :single_value_fields

self.model_class = ::Dissertation
self.terms += [:access, :admin_note, :advisor, :reviewer, :date_issued,
self.terms += [:admin_note, :advisor, :reviewer, :date_issued,
:dcmi_type, :degree, :degree_granting_institution, :doi, :graduation_year, :note,
:place_of_publication, :resource_type, :use, :deposit_agreement, :agreement]
:place_of_publication, :resource_type, :deposit_agreement, :agreement]

self.terms -= [:bibliographic_citation, :date_created, :description, :source, :related_url]
self.required_fields = [:title, :creator, :date_issued]
self.single_value_fields = [:title, :license]

self.admin_only_terms = [:dcmi_type, :admin_note, :degree_granting_institution, :doi]
self.admin_only_terms += [:degree_granting_institution]
self.default_term_values = { dcmi_type: ['http://purl.org/dc/dcmitype/Text'],
language: ['http://id.loc.gov/vocabulary/iso639-2/eng'] }

Expand Down
6 changes: 3 additions & 3 deletions app/forms/hyrax/general_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ class GeneralForm < ::SingleValueForm

self.model_class = ::General

self.terms += [:resource_type, :admin_note, :bibliographic_citation, :academic_concentration, :access, :advisor,
self.terms += [:resource_type, :admin_note, :bibliographic_citation, :academic_concentration, :advisor,
:arranger, :composer, :project_director, :researcher, :reviewer, :translator,
:award, :conference_name, :copyright_date, :date_captured, :date_issued,
:date_other, :dcmi_type, :degree, :degree_granting_institution, :digital_collection, :doi, :edition, :extent, :funder,
:graduation_year, :isbn, :issn, :journal_issue, :journal_title, :journal_volume,
:kind_of_data, :last_modified_date, :medium, :methodology, :note, :page_start, :page_end, :peer_review_status,
:place_of_publication, :rights_holder, :series, :sponsor, :table_of_contents, :use, :deposit_agreement, :agreement]
:place_of_publication, :rights_holder, :series, :sponsor, :table_of_contents, :deposit_agreement, :agreement]

self.required_fields = [:title, :dcmi_type]

self.terms -= [:date_created, :source]

self.single_value_fields = [:title, :license]

self.admin_only_terms = [:dcmi_type, :admin_note, :degree_granting_institution, :digital_collection, :doi]
self.admin_only_terms += [:degree_granting_institution, :digital_collection]

self.default_term_values = { language: ['http://id.loc.gov/vocabulary/iso639-2/eng'] }

Expand Down
7 changes: 3 additions & 4 deletions app/forms/hyrax/honors_thesis_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class HonorsThesisForm < ::SingleValueForm

class_attribute :single_value_fields

self.terms += [:academic_concentration, :access, :admin_note, :advisor, :award, :date_issued, :dcmi_type, :degree,
:degree_granting_institution, :doi, :extent, :graduation_year, :note, :use, :resource_type,
self.terms += [:academic_concentration, :admin_note, :advisor, :award, :date_issued, :dcmi_type, :degree,
:degree_granting_institution, :doi, :extent, :graduation_year, :note, :resource_type,
:deposit_agreement, :agreement]

self.terms -= [:contributor, :description, :identifier, :publisher, :source, :date_created]
Expand All @@ -18,8 +18,7 @@ class HonorsThesisForm < ::SingleValueForm

self.single_value_fields = [:title, :license]

self.admin_only_terms = [:dcmi_type, :academic_concentration, :access, :admin_note, :award,
:degree_granting_institution, :doi, :extent, :use]
self.admin_only_terms += [:academic_concentration, :award, :degree_granting_institution, :extent]

self.default_term_values = { dcmi_type: ['http://purl.org/dc/dcmitype/Text'],
rights_statement: 'http://rightsstatements.org/vocab/InC/1.0/',
Expand Down
2 changes: 1 addition & 1 deletion app/forms/hyrax/journal_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class JournalForm < ::SingleValueForm

self.single_value_fields = [:title, :license]

self.admin_only_terms = [:dcmi_type, :access, :admin_note, :alternative_title, :digital_collection, :doi, :use]
self.admin_only_terms += [:alternative_title, :digital_collection]
self.default_term_values = { dcmi_type: ['http://purl.org/dc/dcmitype/Text'],
language: ['http://id.loc.gov/vocabulary/iso639-2/eng'],
rights_statement: 'http://rightsstatements.org/vocab/InC/1.0/' }
Expand Down
6 changes: 3 additions & 3 deletions app/forms/hyrax/masters_paper_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ class MastersPaperForm < ::SingleValueForm
class_attribute :single_value_fields

self.model_class = ::MastersPaper
self.terms += [:academic_concentration, :access, :admin_note, :advisor, :reviewer, :date_issued, :dcmi_type, :degree,
self.terms += [:academic_concentration, :admin_note, :advisor, :reviewer, :date_issued, :dcmi_type, :degree,
:degree_granting_institution, :doi, :extent, :graduation_year, :note,
:use, :resource_type, :deposit_agreement, :agreement]
:resource_type, :deposit_agreement, :agreement]

self.terms -= [:contributor, :publisher, :identifier, :related_url, :source, :description, :date_created]

Expand All @@ -17,7 +17,7 @@ class MastersPaperForm < ::SingleValueForm

self.single_value_fields = [:title, :license]

self.admin_only_terms = [:dcmi_type, :access, :admin_note, :degree_granting_institution, :doi, :extent, :use]
self.admin_only_terms += [:degree_granting_institution, :extent]
self.default_term_values = { dcmi_type: ['http://purl.org/dc/dcmitype/Text'],
rights_statement: 'http://rightsstatements.org/vocab/InC/1.0/',
language: ['http://id.loc.gov/vocabulary/iso639-2/eng'] }
Expand Down
2 changes: 1 addition & 1 deletion app/forms/hyrax/multimed_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MultimedForm < ::SingleValueForm

self.single_value_fields = [:title, :license]

self.admin_only_terms = [:dcmi_type, :access, :admin_note, :digital_collection, :doi, :medium]
self.admin_only_terms += [:digital_collection, :medium]

self.default_term_values = { rights_statement: 'http://rightsstatements.org/vocab/InC/1.0/',
language: ['http://id.loc.gov/vocabulary/iso639-2/eng'] }
Expand Down
2 changes: 1 addition & 1 deletion app/forms/hyrax/scholarly_work_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ScholarlyWorkForm < ::SingleValueForm

self.single_value_fields = [:title, :license]

self.admin_only_terms = [:dcmi_type, :access, :admin_note, :description, :digital_collection, :doi, :use]
self.admin_only_terms += [:description, :digital_collection]

self.default_term_values = { dcmi_type: ['http://purl.org/dc/dcmitype/Text'],
rights_statement: 'http://rightsstatements.org/vocab/InC/1.0/',
Expand Down
2 changes: 1 addition & 1 deletion app/forms/single_value_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class SingleValueForm < Hyrax::Forms::WorkForm

# Field which will not be rendered to the work form
class_attribute :admin_only_terms
self.admin_only_terms = Array.new
self.admin_only_terms = [:access_right, :admin_note, :dcmi_type, :doi, :rights_notes]
sharonluong marked this conversation as resolved.
Show resolved Hide resolved
# Map of fields to default values
class_attribute :default_term_values
self.default_term_values = Hash.new
Expand Down
8 changes: 0 additions & 8 deletions app/models/article.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ class Article < ActiveFedora::Base
index.as :stored_searchable
end

property :access, predicate: ::RDF::Vocab::DC.accessRights, multiple: false do |index|
index.as :stored_searchable
end

property :admin_note, predicate: ::RDF::URI('http://cdr.unc.edu/definitions/model#AdminNote'), multiple: false do |index|
index.as :stored_searchable
end
Expand Down Expand Up @@ -127,10 +123,6 @@ class Article < ActiveFedora::Base
index.as :stored_searchable
end

property :use, predicate: ::RDF::Vocab::DC11.rights do |index|
index.as :stored_searchable
end

# This must be included at the end, because it finalizes the metadata
# schema (by adding accepts_nested_attributes)
include ::Hyrax::BasicMetadata
Expand Down
8 changes: 0 additions & 8 deletions app/models/dissertation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ class Dissertation < ActiveFedora::Base
index.as :stored_searchable
end

property :access, predicate: ::RDF::Vocab::DC.accessRights, multiple: false do |index|
index.as :stored_searchable
end

property :admin_note, predicate: ::RDF::URI('http://cdr.unc.edu/definitions/model#AdminNote'), multiple: false do |index|
index.as :stored_searchable
end
Expand Down Expand Up @@ -84,10 +80,6 @@ class Dissertation < ActiveFedora::Base
index.as :stored_searchable
end

property :use, predicate: ::RDF::Vocab::DC11.rights do |index|
index.as :stored_searchable
end

# This must be included at the end, because it finalizes the metadata
# schema (by adding accepts_nested_attributes)
include ::Hyrax::BasicMetadata
Expand Down
8 changes: 0 additions & 8 deletions app/models/general.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ class General < ActiveFedora::Base
index.as :stored_searchable
end

property :access, predicate: ::RDF::Vocab::DC.accessRights, multiple: false do |index|
index.as :stored_searchable
end

property :admin_note, predicate: ::RDF::URI('http://cdr.unc.edu/definitions/model#AdminNote'), multiple: false do |index|
index.as :stored_searchable
end
Expand Down Expand Up @@ -214,10 +210,6 @@ class General < ActiveFedora::Base
index.as :stored_searchable
end

property :use, predicate: ::RDF::Vocab::DC11.rights do |index|
index.as :stored_searchable
end

# This must be included at the end, because it finalizes the metadata
# schema (by adding accepts_nested_attributes)
include ::Hyrax::BasicMetadata
Expand Down
8 changes: 0 additions & 8 deletions app/models/honors_thesis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ class HonorsThesis < ActiveFedora::Base
index.as :stored_searchable
end

property :access, predicate: ::RDF::Vocab::DC.accessRights, multiple: false do |index|
index.as :stored_searchable
end

property :admin_note, predicate: ::RDF::URI('http://cdr.unc.edu/definitions/model#AdminNote'), multiple: false do |index|
index.as :stored_searchable
end
Expand Down Expand Up @@ -92,10 +88,6 @@ class HonorsThesis < ActiveFedora::Base
index.as :stored_searchable
end

property :use, predicate: ::RDF::Vocab::DC11.rights do |index|
index.as :stored_searchable
end

# This must be included at the end, because it finalizes the metadata
# schema (by adding accepts_nested_attributes)
include ::Hyrax::BasicMetadata
Expand Down
8 changes: 0 additions & 8 deletions app/models/masters_paper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ class MastersPaper < ActiveFedora::Base
index.as :stored_searchable
end

property :access, predicate: ::RDF::Vocab::DC.accessRights, multiple: false do |index|
index.as :stored_searchable
end

property :advisors, predicate: ::RDF::URI('http://id.loc.gov/vocabulary/relators/ths'), class_name: 'Person' do |index|
index.as :stored_searchable
end
Expand Down Expand Up @@ -84,10 +80,6 @@ class MastersPaper < ActiveFedora::Base
index.as :stored_searchable
end

property :use, predicate: ::RDF::Vocab::DC11.rights do |index|
index.as :stored_searchable
end

# This must be included at the end, because it finalizes the metadata
# schema (by adding accepts_nested_attributes)
include ::Hyrax::BasicMetadata
Expand Down
4 changes: 2 additions & 2 deletions app/presenters/hyrax/article_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# `rails generate hyrax:work Article`
module Hyrax
class ArticlePresenter < Hyrax::WorkShowPresenter
delegate :abstract, :access, :admin_note, :alternative_title, :bibliographic_citation, :copyright_date, :creator_display, :date_captured,
delegate :abstract, :admin_note, :alternative_title, :bibliographic_citation, :copyright_date, :creator_display, :date_captured,
:date_issued, :date_other, :dcmi_type, :digital_collection, :deposit_record, :doi, :edition, :extent, :funder,
:issn, :journal_issue, :journal_title, :journal_volume, :language_label,
:license_label, :note, :page_end, :page_start, :peer_review_status, :place_of_publication, :rights_holder,
:rights_statement_label, :translator_display, :use, to: :solr_document
:rights_statement_label, :translator_display, to: :solr_document

# See: WorkShowPresenter.scholarly?
def scholarly?
Expand Down
4 changes: 2 additions & 2 deletions app/presenters/hyrax/dissertation_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# `rails generate hyrax:work Dissertation`
module Hyrax
class DissertationPresenter < Hyrax::WorkShowPresenter
delegate :abstract, :access, :admin_note, :advisor_display, :alternative_title, :contributor_display,
delegate :abstract, :admin_note, :advisor_display, :alternative_title, :contributor_display,
:creator_display, :date_issued, :dcmi_type, :degree, :degree_granting_institution, :deposit_record, :doi,
:graduation_year, :language_label, :license_label, :note, :place_of_publication,
:resource_type, :reviewer_display, :rights_statement_label, :use, to: :solr_document
:resource_type, :reviewer_display, :rights_statement_label, to: :solr_document

# See: WorkShowPresenter.scholarly?
def scholarly?
Expand Down
4 changes: 2 additions & 2 deletions app/presenters/hyrax/general_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
# `rails generate hyrax:work General`
module Hyrax
class GeneralPresenter < Hyrax::WorkShowPresenter
delegate :abstract, :academic_concentration, :access, :admin_note, :advisor_display, :alternative_title, :arranger_display,
delegate :abstract, :academic_concentration, :admin_note, :advisor_display, :alternative_title, :arranger_display,
:award, :bibliographic_citation, :composer_display, :conference_name, :contributor_display,
:copyright_date, :creator_display, :date_captured, :date_issued, :date_other, :dcmi_type, :degree,
:degree_granting_institution, :deposit_record, :digital_collection, :doi, :edition, :extent,
:funder, :graduation_year, :isbn, :issn, :journal_issue, :journal_title,
:journal_volume, :kind_of_data, :last_modified_date, :language_label, :license_label, :medium, :methodology,
:note, :page_start, :page_end, :peer_review_status, :place_of_publication,
:project_director_display, :researcher_display, :reviewer_display, :rights_holder, :rights_statement_label,
:series, :sponsor, :table_of_contents, :translator_display, :url, :use, to: :solr_document
:series, :sponsor, :table_of_contents, :translator_display, :url, to: :solr_document

# See: WorkShowPresenter.scholarly?
def scholarly?
Expand Down
4 changes: 2 additions & 2 deletions app/presenters/hyrax/honors_thesis_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# `rails generate hyrax:work HonorsThesis`
module Hyrax
class HonorsThesisPresenter < Hyrax::WorkShowPresenter
delegate :abstract, :academic_concentration, :access, :admin_note, :advisor_display, :alternative_title, :award,
delegate :abstract, :academic_concentration, :admin_note, :advisor_display, :alternative_title, :award,
:creator_display, :date_issued, :dcmi_type, :degree, :degree_granting_institution, :deposit_record, :doi,
:extent, :graduation_year, :language_label, :license_label, :note,
:rights_statement_label, :url, :use, to: :solr_document
:rights_statement_label, :url, to: :solr_document

# See: WorkShowPresenter.scholarly?
def scholarly?
Expand Down
4 changes: 2 additions & 2 deletions app/presenters/hyrax/masters_paper_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# `rails generate hyrax:work MastersPaper`
module Hyrax
class MastersPaperPresenter < Hyrax::WorkShowPresenter
delegate :abstract, :academic_concentration, :access, :admin_note, :advisor_display, :creator_display, :date_issued, :dcmi_type,
delegate :abstract, :academic_concentration, :admin_note, :advisor_display, :creator_display, :date_issued, :dcmi_type,
:degree, :degree_granting_institution, :deposit_record, :doi, :extent,
:graduation_year, :language_label, :license_label, :note, :reviewer_display, :rights_statement_label, :use,
:graduation_year, :language_label, :license_label, :note, :reviewer_display, :rights_statement_label,
to: :solr_document

# See: WorkShowPresenter.scholarly?
Expand Down
Loading
Loading