diff --git a/app/forms/hyrax/image_work_form.rb b/app/forms/hyrax/image_work_form.rb index b7c965b7a..c42a32668 100644 --- a/app/forms/hyrax/image_work_form.rb +++ b/app/forms/hyrax/image_work_form.rb @@ -3,11 +3,11 @@ class ImageWorkForm < ::Hyrax::GeoWorkForm include ::GeoWorks::BasicGeoMetadataForm include ::GeoWorks::ExternalMetadataFileForm self.model_class = ::ImageWork - self.terms += [:viewing_direction, :viewing_hint, :alternative, :edition, :cartographic_scale] + self.terms += [:viewing_direction, :viewing_hint, :alternative, :edition, :cartographic_scale, :contents] self.required_fields = [:title, :source_metadata_identifier, :rights_statement, :coverage] def secondary_terms - super + [:cartographic_scale, :alternative, :edition] + super + [:cartographic_scale, :alternative, :edition, :contents] end end end diff --git a/app/models/concerns/solr_geo_metadata.rb b/app/models/concerns/solr_geo_metadata.rb index 8c12997eb..650d3adac 100644 --- a/app/models/concerns/solr_geo_metadata.rb +++ b/app/models/concerns/solr_geo_metadata.rb @@ -9,6 +9,10 @@ def edition Array(self[Solrizer.solr_name("edition")]) end + def contents + Array(self[Solrizer.solr_name("contents")]) + end + def cartographic_scale Array(self[Solrizer.solr_name("cartographic_scale")]).first end diff --git a/app/presenters/image_work_show_presenter.rb b/app/presenters/image_work_show_presenter.rb index 6b3025a98..91db88754 100644 --- a/app/presenters/image_work_show_presenter.rb +++ b/app/presenters/image_work_show_presenter.rb @@ -1,5 +1,6 @@ class ImageWorkShowPresenter < GeoWorks::ImageWorkShowPresenter include PlumAttributes delegate :viewing_hint, :viewing_direction, :logical_order, :logical_order_object, :ocr_language, - :cartographic_projection, :cartographic_scale, :alternative, :edition, :pdf_type, to: :solr_document + :cartographic_projection, :cartographic_scale, :alternative, :edition, :pdf_type, + :contents, to: :solr_document end diff --git a/app/schemas/plum_schema.rb b/app/schemas/plum_schema.rb index 53a2557cf..c9a12ccf8 100644 --- a/app/schemas/plum_schema.rb +++ b/app/schemas/plum_schema.rb @@ -6,6 +6,7 @@ class PlumSchema < ActiveTriples::Schema property :alternative, predicate: ::RDF::Vocab::DC.alternative property :identifier, predicate: ::RDF::Vocab::DC.identifier property :replaces, predicate: ::RDF::Vocab::DC.replaces + property :contents, predicate: ::RDF::Vocab::DC.tableOfContents property :rights_statement, predicate: ::RDF::Vocab::EDM.rights property :rights_note, predicate: ::RDF::Vocab::DC11.rights property :source_metadata_identifier, predicate: ::PULTerms.metadata_id diff --git a/spec/forms/hyrax/image_work_form_spec.rb b/spec/forms/hyrax/image_work_form_spec.rb index 7ef2fe206..10feb9c39 100644 --- a/spec/forms/hyrax/image_work_form_spec.rb +++ b/spec/forms/hyrax/image_work_form_spec.rb @@ -7,7 +7,7 @@ describe "#secondary_terms" do subject { form.secondary_terms } it do - is_expected.to include(:cartographic_scale, :edition, :alternative) + is_expected.to include(:cartographic_scale, :edition, :alternative, :contents) end end end diff --git a/spec/models/solr_document_spec.rb b/spec/models/solr_document_spec.rb index ae48088fe..87695873a 100644 --- a/spec/models/solr_document_spec.rb +++ b/spec/models/solr_document_spec.rb @@ -16,6 +16,7 @@ height_is: 400, cartographic_scale_tesim: ['Scale 1:2,000,000'], alternative_tesim: ['Alt title 1', 'Alt title 2'], + contents_tesim: ['Chapter 1', 'Chapter 2'], viewing_hint_tesim: ["Viewing Hint"], exhibit_id_tesim: ["test"], rights_statement_tesim: ["test"], @@ -174,5 +175,8 @@ it '#alternative returns multivalued array' do expect(subject.alternative).to eq(['Alt title 1', 'Alt title 2']) end + it '#tableOfContents returns multivalued array' do + expect(subject.contents).to eq(['Chapter 1', 'Chapter 2']) + end end end