Skip to content

Commit

Permalink
APPS-1798 archive, archive no, box, folder metadata fields (#956)
Browse files Browse the repository at this point in the history
  • Loading branch information
jendiamond authored Jan 18, 2024
1 parent a7e97ce commit 09732c9
Show file tree
Hide file tree
Showing 30 changed files with 229 additions and 27 deletions.
2 changes: 1 addition & 1 deletion app/assets/csv/import_manifest.csv
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Object Type,Title,Item ARK,Parent ARK,Rights.copyrightStatus,File Name,AltIdentifier.local,AltTitle.other,Binding note,Condition note,Coverage.geographic,Date.creation,Date.normalized,Description.caption,Description.fundingNote,Description.latitude,Description.longitude,Description.note,Format.dimensions,Format.extent,Format.medium,Language,Name.architect,Name.photographer,Name.repository,Name.subject,Name.repository,Opac url,Project Name,Publisher.publisherName,Relation.isPartOf,Rights.countryCreation,Rights.rightsHolderContact,Subject,Type.genre,Type.typeOfResource,Place of origin,AltTitle.uniform,Support,Summary,Page layout,Text direction,viewingHint,IIIF Range,Illustrations note,Provenance; Description.history,Table of Contents; Description.tableOfContents,Subject.conceptTopic,Subject.descriptiveTopic,Collation,Foliation note,Foliation,Illuminator,Name.illuminator,Name.lyricist,Name.composer,Scribe,Name.scribe,Masthead,Representative image,Featured image,Tagline,Subject geographic,Subject temporal,Translator,Name.translator,Commentator,Name.commentator,Colophon,Finding Aid URL, Alt ID.url, Rubricator,Name.rubricator,License,Illustrator,Name.illustrator,Calligrapher,Name.calligrapher,Editor,Name.editor,Engraver,Name.engraver,Note,Printmaker,Name.printmaker,Contents note,Description.contents,Content disclaimer,Interviewer,Name.interviewer,Interviewee,Name.interviewee,Cartographer,Name.cartographer,Artist,Name.artist,Recipient,Name.recipient,Director,Name.director,Producer,Name.producer,Program,Subject.culturalObject,Subject.domainTopic,Series,Host,Name.host,Musician,Name.musician,Printer,Name.printer,Researcher,Name.researcher,Statement of Responsibility,References,AdminNote,Description.adminnote,Note.admin,Format,Related Items,Rights.statementLocal,Related Records,Edition,History,External item record,View Record
Object Type,Title,Item ARK,Parent ARK,Rights.copyrightStatus,File Name,AltIdentifier.local,AltTitle.other,Binding note,Condition note,Coverage.geographic,Date.creation,Date.normalized,Description.caption,Description.fundingNote,Description.latitude,Description.longitude,Description.note,Format.dimensions,Format.extent,Format.medium,Language,Name.architect,Name.photographer,Name.repository,Name.subject,Name.repository,Opac url,Project Name,Publisher.publisherName,Relation.isPartOf,Rights.countryCreation,Rights.rightsHolderContact,Subject,Type.genre,Type.typeOfResource,Place of origin,AltTitle.uniform,Support,Summary,Page layout,Text direction,viewingHint,IIIF Range,Illustrations note,Provenance; Description.history,Table of Contents; Description.tableOfContents,Subject.conceptTopic,Subject.descriptiveTopic,Collation,Foliation note,Foliation,Illuminator,Name.illuminator,Name.lyricist,Name.composer,Scribe,Name.scribe,Masthead,Representative image,Featured image,Tagline,Subject geographic,Subject temporal,Translator,Name.translator,Commentator,Name.commentator,Colophon,Finding Aid URL, Alt ID.url, Rubricator,Name.rubricator,License,Illustrator,Name.illustrator,Calligrapher,Name.calligrapher,Editor,Name.editor,Engraver,Name.engraver,Note,Printmaker,Name.printmaker,Contents note,Description.contents,Content disclaimer,Interviewer,Name.interviewer,Interviewee,Name.interviewee,Cartographer,Name.cartographer,Artist,Name.artist,Recipient,Name.recipient,Director,Name.director,Producer,Name.producer,Program,Subject.culturalObject,Subject.domainTopic,Series,Host,Name.host,Musician,Name.musician,Printer,Name.printer,Researcher,Name.researcher,Statement of Responsibility,References,AdminNote,Description.adminnote,Note.admin,Format,Related Items,Rights.statementLocal,Related Records,Edition,History,External item record,View Record,Archival Collection Title,Archival Collection Number,Box,Folder
12 changes: 12 additions & 0 deletions app/assets/markdown/importer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@
- [Type.typeOfResource](#typetypeofresource)
- [viewingHint (for Festerize only)](#viewinghint-for-festerize-only)
- [Visibility](#visibility)
- [Archival Collection Title](#archival-collection-title)
- [Archival Collection Number](#archive-collection-number)
- [Box](#box)
- [Folder](#folder)
<!-- TOC END -->

## Required Fields
Expand Down Expand Up @@ -552,3 +556,11 @@ If there is no column with the header "Visibility", then the importer will look
"Completed with minimal metadata", or (by default) if the column cannot be found or is blank for a row.

"Item Status" is _only_ used if "Visiblity" is completely omitted from the csv. If the column is included but left blank, then a default of `public` will be applied to a row regardless of any "Item Status" value.

#### Archival Collection Title

#### Archival Collection Number

#### Box

#### Folder
4 changes: 4 additions & 0 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ def self.modified_field
config.add_show_field 'tagline_ssi'
config.add_show_field 'series_tesim'
config.add_show_field 'local_rights_statement_ssm' # This invokes License renderer from hyrax gem
config.add_show_field 'archival_collection_title_ssi'
config.add_show_field 'archival_collection_number_ssi'
config.add_show_field 'archival_collection_box_ssi'
config.add_show_field 'archival_collection_folder_ssi'

# "fielded" search configuration. Used by pulldown among other places.
# For supported keys in hash, see rdoc for Blacklight::SearchFields
Expand Down
10 changes: 9 additions & 1 deletion app/forms/hyrax/californica_collections_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ class CalifornicaCollectionsForm < Hyrax::Forms::CollectionForm
:artist,
:extent,
:architect,
:archival_collection_title,
:archival_collection_number,
:archival_collection_box,
:archival_collection_folder,
:binding_note,
:calligrapher,
:caption,
Expand Down Expand Up @@ -114,6 +118,10 @@ def primary_terms
def secondary_terms
[
:architect,
:archival_collection_title,
:archival_collection_number,
:archival_collection_box,
:archival_collection_folder,
:artist,
:binding_note,
:based_near,
Expand Down Expand Up @@ -208,7 +216,7 @@ def secondary_terms
:thumbnail_link,
:toc,
:translator,
:uniform_title,
:uniform_title
]
end
end
Expand Down
4 changes: 4 additions & 0 deletions app/forms/hyrax/work_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ class WorkForm < Hyrax::Forms::WorkForm
:access_copy,
:alternative_title,
:architect,
:archival_collection_title,
:archival_collection_number,
:archival_collection_box,
:archival_collection_folder,
:ark,
:artist,
:author,
Expand Down
20 changes: 20 additions & 0 deletions app/importers/californica_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class CalifornicaMapper < Darlingtonia::HashMapper
"AltTitle.descriptive",
"Alternate Title.other"],
architect: "Name.architect",
archival_collection_title: "Archival Collection Title",
archival_collection_number: "Archival Collection Number",
archival_collection_box: "Box",
archival_collection_folder: "Folder",
artist: ["Artist", "Name.artist"],
ark: "Item ARK",
author: "Author",
Expand Down Expand Up @@ -211,6 +215,22 @@ def access_copy
map_field(:access_copy).to_a.first
end

def archival_collection_title
map_field(:archival_collection_title).to_a.first
end

def archival_collection_number
map_field(:archival_collection_number).to_a.first
end

def archival_collection_box
map_field(:archival_collection_box).to_a.first
end

def archival_collection_folder
map_field(:archival_collection_folder).to_a.first
end

def ark
item_ark = Ark.ensure_prefix(map_field(:ark).to_a.first)
return if item_ark.blank?
Expand Down
7 changes: 7 additions & 0 deletions app/indexers/work_indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def generate_solr_document
solr_doc['ursus_id_ssi'] = Californica::IdGenerator.blacklight_id_from_ark(object.ark)
solr_doc['year_isim'] = years
solr_doc['human_readable_related_record_title_ssm'] = find_related_records_titles_by_ark
solr_doc['archival_collection_tesi'] = archival_collection
end
end

Expand Down Expand Up @@ -163,4 +164,10 @@ def solr_dates
Rails.logger.error "event: metadata_error : Invalid date string encountered in normalized date field: #{dates}: #{e}"
nil
end

def archival_collection
if object.archival_collection_title && object.archival_collection_number && object.archival_collection_box && object.archival_collection_folder
"#{object.archival_collection_title} (#{object.archival_collection_number}), #{object.archival_collection_box}, #{object.archival_collection_folder}"
end
end
end
16 changes: 16 additions & 0 deletions app/models/solr_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,22 @@ def uniform_title
self[Solrizer.solr_name('uniform_title')]
end

def archival_collection_title
self[:archival_collection_title_ssi]
end

def archival_collection_number
self[:archival_collection_number_ssi]
end

def archival_collection_box
self[:archival_collection_box_ssi]
end

def archival_collection_folder
self[:archival_collection_folder_ssi]
end

# Override this method from hyrax gem to allow
# Californica to use "sinai" visibility.
# app/models/concerns/hyrax/solr_document_behavior.rb
Expand Down
29 changes: 29 additions & 0 deletions app/models/ucla_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,41 @@ def self.single_valued_stored
property :local_rights_statement, predicate: ::RDF::URI.intern('http://id.loc.gov/ontologies/bibframe/UsePolicy') do |index|
index.as :displayable
end

property :archival_collection_title, predicate: ::RDF::URI.intern('https://bibfra.me/view/archive/lite/Archive'), multiple: false do |index|
index.as :stored_sortable
end

property :archival_collection_number, predicate: ::RDF::URI.intern('http://id.loc.gov/ontologies/bibframe/AccessionNumber'), multiple: false do |index|
index.as :stored_sortable
end

property :archival_collection_box, predicate: ::RDF::URI.intern('https://bibfra.me/view/archive/archive/Box'), multiple: false do |index|
index.as :stored_sortable
end

property :archival_collection_folder, predicate: ::RDF::URI.intern('https://bibfra.me/view/archive/archive/Folder'), multiple: false do |index|
index.as :stored_sortable
end
end
end

# https://www.rubydoc.info/gems/solrizer/3.4.0/Solrizer/DefaultDescriptors#simple-class_method
# displayable: https://www.rubydoc.info/gems/solrizer/3.4.0/Solrizer%2FDefaultDescriptors.displayable
# Produces _ssm suffix

# stored_searchable https://www.rubydoc.info/gems/solrizer/3.4.0/Solrizer%2FDefaultDescriptors.stored_searchable
# The suffix produced depends on the type parameter
# produces suffixes:
# _tesim - for strings or text fields
# _dtsim - for dates
# _isim - for integers

# stored_sortable https://www.rubydoc.info/gems/solrizer/3.4.0/Solrizer%2FDefaultDescriptors.stored_sortable
# Fields that are both stored and sortable
# Produces _ssi suffix if field_type is string
# Produces _dtsi suffix if field_type is date

# :facetable - combined with adding field-name_sim to the config.add_show_field in app/controllers/catalog_controler.rb
# Produces _sim suffix
# in Ursus this creates a link on the item/show page of Ursus that links to a search for all fields of this name
4 changes: 4 additions & 0 deletions app/presenters/hyrax/californica_collection_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ def self.terms
[
:alternative_title,
:architect,
:archival_collection_title,
:archival_collection_number,
:archival_collection_box,
:archival_collection_folder,
:ark,
:artist,
:author,
Expand Down
4 changes: 4 additions & 0 deletions app/presenters/hyrax/work_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ class WorkPresenter < Hyrax::WorkShowPresenter
:access_copy,
:alternative_title,
:architect,
:archival_collection_title,
:archival_collection_number,
:archival_collection_box,
:archival_collection_folder,
:ark,
:artist,
:author,
Expand Down
4 changes: 4 additions & 0 deletions app/views/hyrax/base/_attribute_rows.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<%= presenter.attribute_to_html(:note_admin, html_dl: true, label: 'AdminNote') %>
<%= presenter.attribute_to_html(:alternative_title, html_dl: true) %>
<%= presenter.attribute_to_html(:architect, html_dl: true) %>
<%= presenter.attribute_to_html(:archival_collection_title, html_dl: true) %>
<%= presenter.attribute_to_html(:archival_collection_number, html_dl: true) %>
<%= presenter.attribute_to_html(:archival_collection_box, html_dl: true) %>
<%= presenter.attribute_to_html(:archival_collection_folder, html_dl: true) %>
<%= presenter.attribute_to_html(:artist, html_dl: true) %>
<%= presenter.attribute_to_html(:ark, html_dl: true) %>
<%= presenter.attribute_to_html(:author, html_dl: true) %>
Expand Down
Loading

0 comments on commit 09732c9

Please # to comment.