Skip to content

Commit

Permalink
CAL-929-930-931-933 Add metadata fields (#835)
Browse files Browse the repository at this point in the history
* CAL-929
Add metadata field for "Illustrator"

Connected to[CAL-929](https://jira.library.ucla.edu/browse/CAL-929)

---

1. `app/controllers/catalog_controller.rb`
1. `app/forms/hyrax/californica_collections_form.rb`
1. `app/forms/hyrax/work_form.rb`
1. `app/importers/californica_mapper.rb`
1. `app/models/solr_document.rb`
1. `app/models/ucla_metadata.rb`
1. `app/presenters/hyrax/californica_collection_presenter.rb`
1. `app/presenters/hyrax/work_presenter.rb`
1. `app/views/hyrax/base/_attribute_rows.html.erb`
1. `solr/config/solrconfig.xml`
1. `spec/fixtures/coordinates_example.csv`
1. `spec/fixtures/coordinates_example_update.csv`
1. `spec/fixtures/csv_import/good/all_fields.csv`
1. `spec/fixtures/example.csv`
1. `spec/fixtures/simple_example.csv`
1. `spec/forms/hyrax/work_form_spec.rb`
1. `spec/importers/californica_csv_parser_spec.rb`
1. `spec/importers/californica_mapper_spec.rb`
1. `spec/system/edit_collection_spec.rb`
1. `spec/system/edit_work_spec.rb`
1. `spec/system/import_and_show_work_spec.rb`
1. `spec/system/show_collection_spec.rb`
1. `spec/uploaders/csv_manifest_validator_spec.rb`
1. `spec/views/hyrax/base/_attribute_rows.html.erb_spec.rb`

* Fix edit_work_spec

* Update coordinates_example csv

* Update expectation import_and_show_work_spec

* Add metadata fields CAL 929 930 931 933

Changes to be committed:
modified:   app/assets/csv/import_manifest.csv
modified:   app/assets/markdown/importer_guide.md
modified:   app/controllers/catalog_controller.rb
modified:   app/forms/hyrax/californica_collections_form.rb
modified:   app/forms/hyrax/work_form.rb
modified:   app/importers/californica_mapper.rb
modified:   app/models/solr_document.rb
modified:   app/models/ucla_metadata.rb
modified:   app/presenters/hyrax/californica_collection_presenter.rb
modified:   app/presenters/hyrax/work_presenter.rb
modified:   app/views/hyrax/base/_attribute_rows.html.erb
modified:   spec/fixtures/coordinates_example.csv
modified:   spec/fixtures/coordinates_example_update.csv
modified:   spec/fixtures/csv_import/good/all_fields.csv
modified:   spec/fixtures/example.csv
modified:   spec/fixtures/simple_example.csv
modified:   spec/forms/hyrax/work_form_spec.rb
modified:   spec/importers/californica_csv_parser_spec.rb
modified:   spec/importers/californica_mapper_spec.rb
modified:   spec/system/edit_collection_spec.rb
modified:   spec/system/edit_work_spec.rb
modified:   spec/system/import_and_show_work_spec.rb
modified:   spec/system/show_collection_spec.rb
modified:   spec/uploaders/csv_manifest_validator_spec.rb
modified:   spec/views/hyrax/base/_attribute_rows.html.erb_spec.rb

* Fix csv errors

* Fix edit_collection

* Fix edit_work_spec

* Fix edit_work_spec2

* Fix rubocop offenses

* Fix all_fields csv

Co-authored-by: parinita <[email protected]>
  • Loading branch information
jendiamond and pghorpade authored Aug 6, 2020
1 parent 4c57e71 commit 66c58a3
Show file tree
Hide file tree
Showing 25 changed files with 318 additions and 118 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,Rights.statementLocal,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
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,Rights.statementLocal,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
23 changes: 23 additions & 0 deletions app/assets/markdown/importer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [AltTitle.uniform](#alttitle.uniform)
- [Author](#author)
- [Binding note](#binding_note)
- [Calligrapher](# calligrapher)
- [Collation](#collation)
- [Colophon](#colophon)
- [Commentator](#commentator)
Expand All @@ -26,6 +27,8 @@
- [Description.latitude](#description.latitude)
- [Description.longitude](#description.longitude)
- [Description.note](#description.note)
- [Editor](# editor)
- [Engraver](# engraver)
- [Foliation](#foliation)
- [Featured image](#featured_image)
- [Finding Aid Url](#finding-aid-url)creator
Expand All @@ -50,8 +53,10 @@
- [Name.repository](#name.repository)
- [Name.scribe](#name.scribe)
- [Name.subject](#name.subject)
- [Note](#note)
- [Opac url](#opac_url)
- [Page layout](#page-layout)
- [Printmaker](# printmaker)
- [Project Name](#project-name)
- [Place of origin](#place-of-origin)
- [Provenance](#provenance)
Expand Down Expand Up @@ -175,6 +180,10 @@ Also accepts: `AltTitle.translated`, `AltTitle.descriptive`

Also accepts: `Description.binding`

### Calligrapher

Also accepts Name.calligrapher

### Collation

### Colophon
Expand Down Expand Up @@ -205,6 +214,14 @@ Also accepts: `Description.condition`

### Description.note

### Editor

Also accepts Name.editor

### Engraver

Also accepts Name.engraver

### Featured image

### Finding Aid URL
Expand Down Expand Up @@ -259,6 +276,8 @@ accepts ""Illustrator", "Name.illustrator"

### Name.photographer

### Note

### Repository

Also accepts: `Name.repository`
Expand All @@ -273,6 +292,10 @@ Also accepts: `Description.opac`

### Place of origin

### Printmaker

Also accepts Name.printmaker

### Project Name

### Provenance
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def self.modified_field
config.add_show_field 'alternative_title_tesim'
config.add_show_field 'architect_tesim'
config.add_show_field 'author_tesim'
config.add_show_field 'calligrapher_tesim'
config.add_show_field 'caption_tesim'
config.add_show_field 'collation_ssi'
config.add_show_field 'colophon_tesim'
Expand All @@ -113,6 +114,8 @@ def self.modified_field
config.add_show_field 'condition_note_ssi'
config.add_show_field 'binding_note_ssi'
config.add_show_field 'dimensions_tesim'
config.add_show_field 'editor_tesim'
config.add_show_field 'engraver_tesim'
config.add_show_field 'extent_tesim'
config.add_show_field 'finding_aid_url_ssm'
config.add_show_field 'foliation_ssi', label: 'Foliation note'
Expand All @@ -131,11 +134,13 @@ def self.modified_field
config.add_show_field 'medium_tesim'
config.add_show_field 'named_subject_tesim'
config.add_show_field 'normalized_date_tesim'
config.add_show_field 'note_tesim'
config.add_show_field 'opac_url_ssi'
config.add_show_field 'page_layout_ssim'
config.add_show_field 'photographer_tesim'
config.add_show_field 'place_of_origin_tesim'
config.add_show_field 'preservation_copy_ssi'
config.add_show_field 'printmaker_tesim'
config.add_show_field 'provenance_tesim'
config.add_show_field 'repository_tesim'
config.add_show_field 'rights_country_tesim'
Expand Down
10 changes: 10 additions & 0 deletions app/forms/hyrax/californica_collections_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ class CalifornicaCollectionsForm < Hyrax::Forms::CollectionForm
:extent,
:architect,
:binding_note,
:calligrapher,
:caption,
:collation,
:colophon,
:commentator,
:composer,
:condition_note,
:dimensions,
:editor,
:engraver,
:featured_image,
:finding_aid_url,
:foliation,
Expand All @@ -35,10 +38,12 @@ class CalifornicaCollectionsForm < Hyrax::Forms::CollectionForm
:medium,
:named_subject,
:normalized_date,
:note,
:opac_url,
:page_layout,
:photographer,
:place_of_origin,
:printmaker,
:provenance,
:repository,
:representative_image,
Expand Down Expand Up @@ -81,6 +86,7 @@ def secondary_terms
:architect,
:binding_note,
:based_near,
:calligrapher,
:caption,
:colophon,
:commentator,
Expand All @@ -89,6 +95,8 @@ def secondary_terms
:creator,
:date_created,
:dimensions,
:editor,
:engraver,
:extent,
:finding_aid_url,
:funding_note,
Expand All @@ -107,10 +115,12 @@ def secondary_terms
:medium,
:named_subject,
:normalized_date,
:note,
:opac_url,
:page_layout,
:photographer,
:place_of_origin,
:printmaker,
:provenance,
:publisher,
:repository,
Expand Down
5 changes: 5 additions & 0 deletions app/forms/hyrax/work_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ class WorkForm < Hyrax::Forms::WorkForm
:ark,
:binding_note,
:author,
:calligrapher,
:caption,
:collation,
:colophon,
:composer,
:commentator,
:condition_note,
:dimensions,
:editor,
:engraver,
:extent,
:featured_image,
:finding_aid_url,
Expand All @@ -41,11 +44,13 @@ class WorkForm < Hyrax::Forms::WorkForm
:medium,
:named_subject,
:normalized_date,
:note,
:opac_url,
:page_layout,
:photographer,
:place_of_origin,
:preservation_copy,
:printmaker,
:representative_image,
:provenance,
:repository,
Expand Down
5 changes: 5 additions & 0 deletions app/importers/californica_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class CalifornicaMapper < Darlingtonia::HashMapper
ark: "Item ARK",
binding_note: ["Binding note", "Description.binding"],
author: "Author",
calligrapher: ["Calligrapher", "Name.calligrapher"],
caption: "Description.caption",
collation: "Collation",
colophon: ["Colophon", "Description.colophon"],
Expand All @@ -28,6 +29,8 @@ class CalifornicaMapper < Darlingtonia::HashMapper
description: "Description.note",
dimensions: "Format.dimensions",
dlcs_collection_name: "Relation.isPartOf",
editor: ["Editor", "Name.editor"],
engraver: ["Engraver", "Name.engraver"],
extent: "Format.extent",
finding_aid_url: ["Finding Aid URL", "Alt ID.url"],
foliation: ["Foliation note", "Foliation"],
Expand Down Expand Up @@ -61,13 +64,15 @@ class CalifornicaMapper < Darlingtonia::HashMapper
"Subject.personalName",
"Subject name"],
normalized_date: "Date.normalized",
note: ["Note"],
opac_url: ["Opac url", "Description.opac"],
page_layout: "Page layout",
photographer: ["Name.photographer",
"Personal or Corporate Name.photographer"],
place_of_origin: ["Place of origin",
"Publisher.placeOfOrigin"],
preservation_copy: "File Name",
printmaker: ["Printmaker", "Name.printmaker"],
provenance: ["Provenance", "Description.history"],
publisher: "Publisher.publisherName",
repository: ["Repository", "repository", "Name.repository",
Expand Down
64 changes: 42 additions & 22 deletions app/models/solr_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ def binding_note
self[:binding_note_ssi]
end

def calligrapher
self[:calligrapher_tesim]
end

def caption
self[:caption_tesim]
end
Expand Down Expand Up @@ -86,10 +90,22 @@ def dlcs_collection_name
self[:dlcs_collection_name_ssm]
end

def editor
self[:editor_tesim]
end

def engraver
self[:engraver_tesim]
end

def extent
self[:extent_tesim]
end

def featured_image
self[:featured_image_ssi]
end

def foliation
self[:foliation_ssi]
end
Expand Down Expand Up @@ -118,6 +134,14 @@ def iiif_range
self[:iiif_range_ssi]
end

def iiif_text_direction
self[:iiif_text_direction_ssi]
end

def iiif_viewing_hint
self[:iiif_viewing_hint_ssi]
end

def illuminator
self[:illuminator_tesim]
end
Expand Down Expand Up @@ -154,22 +178,6 @@ def masthead_parameters
self[:masthead_parameters_ssi]
end

def opac_url
self[:opac_url_ssi]
end

def representative_image
self[:representative_image_ssi]
end

def featured_image
self[:featured_image_ssi]
end

def tagline
self[:tagline_ssi]
end

def medium
self[:medium_tesim]
end
Expand All @@ -182,6 +190,14 @@ def normalized_date
self[:normalized_date_tesim]
end

def note
self[:note_tesim]
end

def opac_url
self[:opac_url_ssi]
end

def page_layout
self[:page_layout_ssim]
end
Expand All @@ -194,6 +210,10 @@ def place_of_origin
self[:place_of_origin_tesim]
end

def printmaker
self[:printmaker_tesim]
end

def preservation_copy
self['preservation_copy_ssi']
end
Expand All @@ -206,6 +226,10 @@ def repository
self[:repository_tesim]
end

def representative_image
self[:representative_image_ssi]
end

def rights_country
self[:rights_country_tesim]
end
Expand Down Expand Up @@ -251,12 +275,8 @@ def support
self[:support_tesim]
end

def iiif_text_direction
self[:iiif_text_direction_ssi]
end

def iiif_viewing_hint
self[:iiif_viewing_hint_ssi]
def tagline
self[:tagline_ssi]
end

def translator
Expand Down
Loading

0 comments on commit 66c58a3

Please sign in to comment.