diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed9419723..242de7090 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,9 +6,6 @@ on: pull_request: branches: [ main ] -# env: -# COMPOSE_FILE: docker-compose-ci.yml - jobs: rubocop: runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index c499c3490..fe3674e97 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,5 @@ public/branding/ .DS_Store .vscode/ +.devcontainer/ diff --git a/.ruby-version b/.ruby-version index 4fd0fe3cd..a5c51e136 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.5.1 \ No newline at end of file +2.5.8 \ No newline at end of file diff --git a/app/assets/markdown/importer_guide.md b/app/assets/markdown/importer_guide.md index 57d781ffc..c2b4e44bc 100644 --- a/app/assets/markdown/importer_guide.md +++ b/app/assets/markdown/importer_guide.md @@ -78,6 +78,7 @@ - [Tagline](#tagline) - [IIIF Text direction](#iiif_text_direction) - [Table of Contents](#table-of-contents) +- [Thumbnail](#thumbnail) - [Translator](#translator) - [Type.genre](#type.genre) - [Type.typeOfResource](#type.typeofresource) @@ -256,7 +257,7 @@ The URL of a IIIF resource that can be used to view the image. This is populated ### Illuminator -Also aaccepts: `Name.illuminator` +Also accepts: `Name.illuminator` ### Illustrations note @@ -354,6 +355,14 @@ Also accepts: `Description.tableOfContents` ### Tagline +### Thumbnail + +URL for an image to be used as the thumbnail. Must be the stem of a IIIF Image API resource of the form `{scheme}://{server}{/prefix}/{identifier}`, omitting all other Image API parameters. For example: `https://iiif.library.ucla.edu/iiif/2/ark%3A%2F21198%2Fz1k667gp`. + +For simple images the value will be identical to [`IIIF Access URL`](#iiif-access-url), however for other content types such as multi-image or audiovisual works the two values wil differ. + +This is populated by processing the CSV via [bucketeer](https://bucketeer.library.ucla.edu/upload/csv) + ### Translator Also accepts: `Name.translator` diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 2ecbebff8..9d3885a77 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -161,6 +161,7 @@ def self.modified_field config.add_show_field 'summary_tesim' config.add_show_field 'iiif_text_direction_ssi' config.add_show_field 'toc_tesim' + config.add_show_field 'thumbnail_link_ssi' config.add_show_field 'translator_tesim' config.add_show_field 'uniform_title_tesim' config.add_show_field 'representative_image_ssi' diff --git a/app/forms/hyrax/californica_collections_form.rb b/app/forms/hyrax/californica_collections_form.rb index 5646b31a0..7ccd27e17 100644 --- a/app/forms/hyrax/californica_collections_form.rb +++ b/app/forms/hyrax/californica_collections_form.rb @@ -59,6 +59,7 @@ class CalifornicaCollectionsForm < Hyrax::Forms::CollectionForm :subject_temporal, :subject_topic, :tagline, + :thumbnail_link, :summary, :toc, :translator, @@ -140,6 +141,7 @@ def secondary_terms :subject_topic, :summary, :toc, + :thumbnail_link, :translator, :iiif_text_direction, :uniform_title, diff --git a/app/forms/hyrax/work_form.rb b/app/forms/hyrax/work_form.rb index 11c3c6863..6c265f561 100644 --- a/app/forms/hyrax/work_form.rb +++ b/app/forms/hyrax/work_form.rb @@ -68,6 +68,7 @@ class WorkForm < Hyrax::Forms::WorkForm :support, :tagline, :toc, + :thumbnail_link, :translator, :iiif_text_direction, :uniform_title @@ -81,7 +82,7 @@ class WorkForm < Hyrax::Forms::WorkForm # # @return [Enumerable] symbols representing each primary term def primary_terms - primary = required_fields + [:access_copy, :preservation_copy] + primary = required_fields + [:access_copy, :preservation_copy, :thumbnail_link] primary = (primary & terms) (required_fields - primary).each do |missing| diff --git a/app/importers/californica_mapper.rb b/app/importers/californica_mapper.rb index fc586a051..f1cf64f17 100644 --- a/app/importers/californica_mapper.rb +++ b/app/importers/californica_mapper.rb @@ -4,7 +4,7 @@ class CalifornicaMapper < Darlingtonia::HashMapper attr_reader :row_number CALIFORNICA_TERMS_MAP = { - access_copy: ["IIIF Access URL", "access_copy", "Thumbnail"], + access_copy: ["IIIF Access URL", "access_copy"], alternative_title: ["AltTitle.other", "AltTitle.parallel", "AltTitle.translated", @@ -96,6 +96,7 @@ class CalifornicaMapper < Darlingtonia::HashMapper "Subject place"], subject_temporal: "Subject temporal", iiif_text_direction: "Text direction", + thumbnail_link: ["Thumbnail"], translator: ["Translator", "Name.translator"], title: "Title", toc: ["Table of Contents", "Description.tableOfContents"], @@ -409,4 +410,8 @@ def in_works_ids record_page_sequence [parent_work.id] end + + def thumbnail_link + map_field(:thumbnail_link).to_a.first + end end diff --git a/app/indexers/collection_indexer.rb b/app/indexers/collection_indexer.rb index 72ecad0a5..5ac5fe82e 100644 --- a/app/indexers/collection_indexer.rb +++ b/app/indexers/collection_indexer.rb @@ -31,21 +31,31 @@ def solr_during_indexing end def thumbnail_url - iiif_url_base = Californica::ManifestBuilderService.new(curation_concern: object).iiif_url + thumbnail = object.thumbnail_link || thumbnail_from_access_copy + if thumbnail.to_s.include?('/iiif/2/') + "#{thumbnail}/full/!200,200/0/default.jpg" + elsif ['.svg', '.png', '.jpg'].include? File.extname(thumbnail.to_s) + thumbnail + else + return nil + end + end + + def thumbnail_from_access_copy + iiif_resource = Californica::ManifestBuilderService.new(curation_concern: object).iiif_url children = Array.wrap(object.members).clone - until iiif_url_base || children.empty? + until iiif_resource || children.empty? child = children.shift - iiif_url_base = Californica::ManifestBuilderService.new(curation_concern: child).iiif_url + iiif_resource = Californica::ManifestBuilderService.new(curation_concern: child).iiif_url grandchildren = Array.wrap(child.members).clone - until iiif_url_base || grandchildren.empty? + until iiif_resource || grandchildren.empty? grandchild = grandchildren.shift - iiif_url_base = Californica::ManifestBuilderService.new(curation_concern: grandchild).iiif_url + iiif_resource = Californica::ManifestBuilderService.new(curation_concern: grandchild).iiif_url end end - return nil unless iiif_url_base - "#{iiif_url_base}/full/!200,200/0/default.jpg" + iiif_resource end end diff --git a/app/indexers/work_indexer.rb b/app/indexers/work_indexer.rb index 70625a9a6..e0d34f864 100644 --- a/app/indexers/work_indexer.rb +++ b/app/indexers/work_indexer.rb @@ -88,16 +88,25 @@ def human_readable_rights_statement end def thumbnail_url + thumbnail = object.thumbnail_link || thumbnail_from_access_copy + if thumbnail.to_s.include?('/iiif/2/') + "#{thumbnail}/full/!200,200/0/default.jpg" + elsif ['.svg', '.png', '.jpg'].include? File.extname(thumbnail.to_s) + thumbnail + else + return nil + end + end + + def thumbnail_from_access_copy # this record has an image path attached - iiif_url_base = Californica::ManifestBuilderService.new(curation_concern: object).iiif_url + iiif_resource = Californica::ManifestBuilderService.new(curation_concern: object).iiif_url children = Array.wrap(object.members).clone - until iiif_url_base || children.empty? + until iiif_resource || children.empty? child = children.shift - iiif_url_base = Californica::ManifestBuilderService.new(curation_concern: child).iiif_url + iiif_resource = Californica::ManifestBuilderService.new(curation_concern: child).iiif_url end - - return nil unless iiif_url_base - "#{iiif_url_base}/full/!200,200/0/default.jpg" + iiif_resource end # The 'to_a' is needed to force ActiveTriples::Relation to resolve into the String value(s), else you get an error trying to parse the date. diff --git a/app/models/solr_document.rb b/app/models/solr_document.rb index b27cad092..db8abb8c3 100644 --- a/app/models/solr_document.rb +++ b/app/models/solr_document.rb @@ -279,6 +279,14 @@ def tagline self[:tagline_ssi] end + def thumbnail_link + self[:thumbnail_link_ssi] + end + + def thumbnail_url + self[:thumbnail_url_ss] + end + def translator self[:translator_tesim] end diff --git a/app/models/ucla_metadata.rb b/app/models/ucla_metadata.rb index 3a616b0bc..956789cf8 100644 --- a/app/models/ucla_metadata.rb +++ b/app/models/ucla_metadata.rb @@ -274,6 +274,10 @@ module UclaMetadata property :tagline, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/fr/frbr/frbrer/P3081'), multiple: false do |index| index.as :stored_sortable end + + property :thumbnail_link, predicate: ::RDF::URI.intern('http://pcdm.org/use#ThumbnailImage'), multiple: false do |index| + index.as :stored_sortable + end end end diff --git a/app/presenters/hyrax/californica_collection_presenter.rb b/app/presenters/hyrax/californica_collection_presenter.rb index 6253c47fe..b0853967a 100644 --- a/app/presenters/hyrax/californica_collection_presenter.rb +++ b/app/presenters/hyrax/californica_collection_presenter.rb @@ -76,6 +76,7 @@ def self.terms :support, :summary, :tagline, + :thumbnail_link, :iiif_text_direction, :translator, :toc, diff --git a/app/presenters/hyrax/work_presenter.rb b/app/presenters/hyrax/work_presenter.rb index f43adf244..11daa8fd0 100644 --- a/app/presenters/hyrax/work_presenter.rb +++ b/app/presenters/hyrax/work_presenter.rb @@ -65,6 +65,7 @@ class WorkPresenter < Hyrax::WorkShowPresenter :summary, :support, :tagline, + :thumbnail_link, :translator, :toc, :iiif_text_direction, diff --git a/app/uploaders/csv_manifest_validator.rb b/app/uploaders/csv_manifest_validator.rb index d59172f34..bbb840f6d 100644 --- a/app/uploaders/csv_manifest_validator.rb +++ b/app/uploaders/csv_manifest_validator.rb @@ -22,13 +22,14 @@ ].freeze REQUIRED_VALUES = [ - ['Item ARK', ['Collection', 'Work', 'ChildWork', 'Manuscript', 'Page']], - ['Title', ['Collection', 'Work', 'Manuscript']], - ['IIIF Manifest URL', ['Collection', 'Work']], + ['Item ARK', ['Collection', 'Work', 'ChildWork', 'Manuscript', 'Page'], :error], + ['Title', ['Collection', 'Work', 'Manuscript'], :error], + ['IIIF Manifest URL', ['Collection', 'Work'], :error], # ['Object Type', ['Collection', 'Work']], # hard-coded - ['Parent ARK', ['Work', 'ChildWork', 'Manuscript', 'Page']], - ['Rights.copyrightStatus', ['Work', 'ChildWork', 'Manuscript', 'Page']], - ['File Name', ['Work', 'ChildWork', 'Page']] + ['Parent ARK', ['Work', 'ChildWork', 'Manuscript', 'Page'], :warning], + ['Rights.copyrightStatus', ['Work', 'ChildWork', 'Manuscript', 'Page'], :warning], + ['File Name', ['Work', 'ChildWork', 'Page'], :warning], + ['Thumbnail', ['Work', 'ChildWork', 'Manuscript', 'Page'], :warning] ].freeze MAPPED_HEADERS = CalifornicaMapper.californica_terms_map.values.map { |v| Array.wrap(v) }.flatten.freeze @@ -132,7 +133,7 @@ def duplicate_headers end def validate_records - required_column_numbers = REQUIRED_VALUES.map { |header, _object_types| @headers.find_index(header) }.compact + required_column_numbers = REQUIRED_VALUES.map { |header, _object_types, _message_type| @headers.find_index(header) }.compact controlled_column_numbers = CONTROLLED_VOCABULARIES.keys.map { |header| @headers.find_index(header) }.compact object_type_column = @headers.find_index('Object Type') row_warnings = Hash.new { |hash, key| hash[key] = [] } @@ -168,19 +169,16 @@ def validate_records # Row missing reqired field values required_column_numbers.each_with_index do |column_number, j| - field_label, types_that_require = REQUIRED_VALUES[j] - next this_row_errors << "Rows missing required value for \"#{REQUIRED_VALUES[j][0]}\". Your spreadsheet must have this value." if field_label == 'Title' && row[column_number].blank? - next this_row_errors << "Rows missing required value for \"#{REQUIRED_VALUES[j][0]}\". Your spreadsheet must have this value." if field_label == 'Item ARK' && row[column_number].blank? - next this_row_errors << "Rows missing required value for \"#{REQUIRED_VALUES[j][0]}\". Your spreadsheet must have this value." if field_label == 'IIIF Manifest URL' && !object_type.include?("Page") && row[column_number].blank? - next unless types_that_require.include?(object_type) - next unless row[column_number].blank? - this_row_warnings << if field_label == 'Rights.copyrightStatus' - 'Rows missing "Rights.copyrightStatus" will have the value set to "unknown".' - elsif field_label == 'File Name' - 'Rows missing "File Name" will import metadata-only.' - elsif field_label != 'Title' || field_label != 'Item ARK' || field_label != 'IIIF Manifest URL' - "Rows missing \"#{REQUIRED_VALUES[j][0]}\" cannot be imported." # Debug details #{REQUIRED_VALUES.map { |header, _object_types| header }} #{required_column_numbers} - end + field_label, types_that_require, message_type = REQUIRED_VALUES[j] + next unless row[column_number].blank? && types_that_require.include?(object_type) + case message_type + when :error + this_row_errors << "Rows missing required value for \"#{REQUIRED_VALUES[j][0]}\". Your spreadsheet must have this value." + when :warning + this_row_warnings << "Rows missing recommended value for \"#{REQUIRED_VALUES[j][0]}\". Please add this value or continue to import without." + else + raise "CsvManifestValidator::REQUIRED_VALUES contains unknown message_type #{message_type} for #{field_label}." + end end # Row has invalid value in a controlled-vocabulary field diff --git a/app/views/hyrax/base/_attribute_rows.html.erb b/app/views/hyrax/base/_attribute_rows.html.erb index caf67f5f9..fbc206301 100644 --- a/app/views/hyrax/base/_attribute_rows.html.erb +++ b/app/views/hyrax/base/_attribute_rows.html.erb @@ -62,8 +62,7 @@ <%= presenter.attribute_to_html(:rights_holder, html_dl: true) %> <%= presenter.attribute_to_html(:rights_statement, render_as: :rights_statement, html_dl: true) %> <%= presenter.attribute_to_html(:rubricator, html_dl: true) %> -# This invokes License renderer from hyrax gem -<%#= presenter.attribute_to_html(:local_rights_statement, render_as: :local_rights_statement, html_dl: true) %> +<%#= presenter.attribute_to_html(:local_rights_statement, render_as: :local_rights_statement, html_dl: true) # This invokes License renderer from hyrax gem %> <%= presenter.attribute_to_html(:scribe, html_dl: true) %> <%= presenter.attribute_to_html(:source, html_dl: true) %> <%= presenter.attribute_to_html(:subject, render_as: :faceted, html_dl: true) %> @@ -73,6 +72,7 @@ <%= presenter.attribute_to_html(:summary, html_dl: true) %> <%= presenter.attribute_to_html(:support, html_dl: true) %> <%= presenter.attribute_to_html(:tagline, html_dl: true) %> +<%= presenter.attribute_to_html(:thumbnail_link, html_dl: true) %> <%= presenter.attribute_to_html(:translator, html_dl: true) %> <%= presenter.attribute_to_html(:toc, html_dl: true) %> <%= presenter.attribute_to_html(:uniform_title, html_dl: true) %> diff --git a/docker-compose-ci.yml b/docker-compose-ci.yml deleted file mode 100644 index 643de8fb0..000000000 --- a/docker-compose-ci.yml +++ /dev/null @@ -1,121 +0,0 @@ -version: '2' - -services: - web: - image: uclalibrary/californica:latest - depends_on: - - db - - fedora - - redis - - solr - - fedora_test - - solr_test - env_file: - - ./default.env # must come first to be overloaded - - ./docker.env # must come last to overload default - stdin_open: true - tty: true - ports: - - '127.0.0.1:3000:3000' - volumes: - - .:/californica - - ./data:/opt/data - - bundle_dir:/usr/local/bundle - - californica_tmp:/californica/tmp - - derivatives:/opt/derivatives - - californica_log:/californica/log - - tmp:/tmp - - uploads:/opt/uploads - working_dir: /californica - - sidekiq: - image: uclalibrary/californica:latest - command: ['bundle', 'exec', 'sidekiq', '-c', '2'] - depends_on: - - db - - fedora - - redis - - solr - - fedora_test - - solr_test - env_file: - - ./default.env # must come first to be overloaded - - ./docker.env # must come last to overload default - volumes: - - .:/californica - - ./data:/opt/data - - bundle_dir:/usr/local/bundle - - californica_log:/californica/log - - californica_tmp:/californica/tmp - - derivatives:/opt/derivatives - - tmp:/tmp - - uploads:/opt/uploads - working_dir: /californica - - fedora: - image: nulib/fcrepo4:4.7.5 - ports: - - '127.0.0.1:8984:8080' - volumes: - - fcrepo_data:/data - environment: - JAVA_OPTIONS: '-Xmx512m' - - fedora_test: - image: nulib/fcrepo4:4.7.5 - ports: - - '127.0.0.1:8986:8080' - environment: - JAVA_OPTIONS: '-Xmx512m' - - db: - image: mysql:5.6 - volumes: - - ./docker/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d - - ./docker/conf.d:/etc/mysql/conf.d - - mysql_data:/var/lib/mysql - environment: - MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' - - redis: - image: redis:4 - volumes: - - redis_data:/data - ports: - - '127.0.0.1:6379:6379' - - solr: - build: - context: . - dockerfile: docker/Dockerfile.solr - volumes: - - solr_data:/opt/solr/server/solr/mycores/californica/data - - solr_test: - build: - context: . - dockerfile: docker/Dockerfile.solr - - # iiif: - # image: uclalibrary/cantaloupe - # environment: - # DELEGATE_SCRIPT.ENABLED: "true" - # DELEGATE_SCRIPT.PATHNAME: /docker/delegates.rb - # ENDPOINT.ADMIN.ENABLED: "true" - # ENDPOINT.ADMIN.SECRET: cobweb123 - # ports: - # - 8182:8182 - # volumes: - # - ./cantaloupe-delegate/lib:/delegate - -volumes: - bundle_dir: - californica_log: - californica_tmp: - derivatives: - fcrepo_data: - mysql_data: - redis_data: - solr_data: - tmp: - uploads: diff --git a/spec/fixtures/coordinates_example.csv b/spec/fixtures/coordinates_example.csv index 783a312b3..2511da0d5 100644 --- a/spec/fixtures/coordinates_example.csv +++ b/spec/fixtures/coordinates_example.csv @@ -1,2 +1,2 @@ -Project Name,Object Type,Parent ARK,Item ARK,Item Status,Subject,Type.typeOfResource,Rights.copyrightStatus,Type.genre,Name.subject,Coverage.geographic,Relation.isPartOf,Publisher.publisherName,Rights.countryCreation,Rights.rightsHolderContact,Name.architect,Name.photographer,Name.repository,Date.normalized,AltIdentifier.local,Title,Date.creation,Format.extent,Format.medium,Format.dimensions,Description.note,Description.fundingNote,Description.longitude,Description.latitude,Description.caption,File Name,AltTitle.other,AltTitle.translated,Place of origin,AltTitle.Uniform,Support,Author,Summary,Page layout,Text direction,Binding note,viewingHint,IIIF Range,Illustrations note,Illustrator,Name.illustrator,Description.history,Table of Contents,Subject.conceptTopic,Subject.descriptiveTopic,Collation,Foliation note, Foliation,Illuminator,Name.illuminator,Name.lyricist,Name.composer,Scribe,Name.scribe,Condition note,Rights.statement,Masthead,Representative image,Featured image,Tagline,Commentator,Name.commentator,Translator,Name.translator,Subject temporal,Opac url,Subject geographic,Colophon,Description.colophon,Finding Aid URL,Alt ID.url,Rubricator,Name.rubricator,Name.creator,Calligrapher,Name.calligrapher,Editor,Name.editor,Engraver,Name.engraver,Note,Printmaker,Name.printmaker,Contents note,Description.contents -Los Angeles Daily News Negatives,Work,111/222,13030/hb338nb26f,Completed with minimal metadata,"Altars|~|Mass|~|Communion table|~|Mexican American Catholics|~|Festivals|~|Guadalupe, Our Lady of|~|Historic buildings $z California $z Los Angeles|~|Churches $z California $z Los Angeles|~|Religion|~|Catholic churches $z California $z Los Angeles ",still image,copyrighted,news photographs,"Plaza Church (Los Angeles, Calif.)",Los Angeles (Calif.)|~|Los Angeles (Calif.),"Los Angeles Daily News Negatives. Department of Special Collections, Charles E. Young Research Library, University of California at Los Angeles.",Los Angeles Daily News,US,"UCLA Charles E. Young Research Library Department of Special Collections, A1713 Young Research Library, Box 951575, Los Angeles, CA 90095-1575. E-mail: spec-coll@library.ucla.edu. Phone: (310)825-4988",Imhotep,Famous Photographer,,1942/1952,uclamss_1387_b112_40911-1,"Communion at Plaza Church, Los Angeles, 1942-1952",[between 1942-1947],Fake Extent,Fake Medium,200x200,"A woman takes Communion during a Plaza Church mass for the fiesta of Nuestra Senora de Guadalupe.|~|Our Lady Queen of Los Angeles Catholic Church, (aka La Iglesia de Nuestra Señora la Reina de Los Ángeles, and The Church of Our Lady the Queen of the Angels), was built in 1822 and is the oldest church in Los Angeles.",Fake Funding Note,-118.239577,34.05707,Fake Caption,clusc_1_1_00010432a.tif,Communion table,Mesa de Comunión,Los Angeles,Mexican American Catholics,UCLA,Famous Author,Mexican American Catholics,images,left-to-right,Green,paged,iiif-range,illustration-note,Illustrator-1,Illustrator-P2,history-description,table of contents,concept-topic,descriptive-topic,collated,follated,also follated,illuminated,also illuminated,la la la,Schubert,Amat-Mamu,Sin-liqe-unninni,condition_note,local_statement,local_masthead,local_representative_image,local_featured_image,local_tagline,commentator_1,commentator_2,translator_1,translator_2,subject_temporal_1,https://www.library.ucla.edu,subject_geographic_1,colophon_text,colophon_text_2,finding_aid_url_1,finding_aid_url_2,rubricator_1,rubricator_2,name_creator,Calligrapher-1,Name-calligrapher,Editor-1,Name-editor,Engraver-1,Name-engraver,Note-1,Printmaker-1,Name-printmaker,contents_note-1,Description-contents +Project Name,Object Type,Parent ARK,Item ARK,Item Status,Subject,Type.typeOfResource,Rights.copyrightStatus,Type.genre,Name.subject,Coverage.geographic,Relation.isPartOf,Publisher.publisherName,Rights.countryCreation,Rights.rightsHolderContact,Name.architect,Name.photographer,Name.repository,Date.normalized,AltIdentifier.local,Title,Date.creation,Format.extent,Format.medium,Format.dimensions,Description.note,Description.fundingNote,Description.longitude,Description.latitude,Description.caption,File Name,AltTitle.other,AltTitle.translated,Place of origin,AltTitle.Uniform,Support,Author,Summary,Page layout,Text direction,Binding note,viewingHint,IIIF Range,Illustrations note,Illustrator,Name.illustrator,Description.history,Table of Contents,Subject.conceptTopic,Subject.descriptiveTopic,Collation,Foliation note, Foliation,Illuminator,Name.illuminator,Name.lyricist,Name.composer,Scribe,Name.scribe,Condition note,Rights.statement,Masthead,Representative image,Featured image,Tagline,Commentator,Name.commentator,Translator,Name.translator,Subject temporal,Opac url,Subject geographic,Colophon,Description.colophon,Finding Aid URL,Alt ID.url,Rubricator,Name.rubricator,Name.creator,Calligrapher,Name.calligrapher,Editor,Name.editor,Engraver,Name.engraver,Note,Printmaker,Name.printmaker,Contents note,Description.contents,Thumbnail +Los Angeles Daily News Negatives,Work,111/222,13030/hb338nb26f,Completed with minimal metadata,"Altars|~|Mass|~|Communion table|~|Mexican American Catholics|~|Festivals|~|Guadalupe, Our Lady of|~|Historic buildings $z California $z Los Angeles|~|Churches $z California $z Los Angeles|~|Religion|~|Catholic churches $z California $z Los Angeles ",still image,copyrighted,news photographs,"Plaza Church (Los Angeles, Calif.)",Los Angeles (Calif.)|~|Los Angeles (Calif.),"Los Angeles Daily News Negatives. Department of Special Collections, Charles E. Young Research Library, University of California at Los Angeles.",Los Angeles Daily News,US,"UCLA Charles E. Young Research Library Department of Special Collections, A1713 Young Research Library, Box 951575, Los Angeles, CA 90095-1575. E-mail: spec-coll@library.ucla.edu. Phone: (310)825-4988",Imhotep,Famous Photographer,,1942/1952,uclamss_1387_b112_40911-1,"Communion at Plaza Church, Los Angeles, 1942-1952",[between 1942-1947],Fake Extent,Fake Medium,200x200,"A woman takes Communion during a Plaza Church mass for the fiesta of Nuestra Senora de Guadalupe.|~|Our Lady Queen of Los Angeles Catholic Church, (aka La Iglesia de Nuestra Señora la Reina de Los Ángeles, and The Church of Our Lady the Queen of the Angels), was built in 1822 and is the oldest church in Los Angeles.",Fake Funding Note,-118.239577,34.05707,Fake Caption,clusc_1_1_00010432a.tif,Communion table,Mesa de Comunión,Los Angeles,Mexican American Catholics,UCLA,Famous Author,Mexican American Catholics,images,left-to-right,Green,paged,iiif-range,illustration-note,Illustrator-1,Illustrator-P2,history-description,table of contents,concept-topic,descriptive-topic,collated,follated,also follated,illuminated,also illuminated,la la la,Schubert,Amat-Mamu,Sin-liqe-unninni,condition_note,local_statement,local_masthead,local_representative_image,local_featured_image,local_tagline,commentator_1,commentator_2,translator_1,translator_2,subject_temporal_1,https://www.library.ucla.edu,subject_geographic_1,colophon_text,colophon_text_2,finding_aid_url_1,finding_aid_url_2,rubricator_1,rubricator_2,name_creator,Calligrapher-1,Name-calligrapher,Editor-1,Name-editor,Engraver-1,Name-engraver,Note-1,Printmaker-1,Name-printmaker,contents_note-1,Description-contents,https://fake.url/iiif/ark%3A%2F13030%2Fhb338nb26f diff --git a/spec/fixtures/coordinates_example_update.csv b/spec/fixtures/coordinates_example_update.csv index c2ae3a1fc..dfbd65226 100644 --- a/spec/fixtures/coordinates_example_update.csv +++ b/spec/fixtures/coordinates_example_update.csv @@ -1,2 +1,2 @@ -Project Name,Object Type,Parent ARK,Item ARK,Subject,Type.typeOfResource,Rights.copyrightStatus,Type.genre,Name.subject,Coverage.geographic,Relation.isPartOf,Publisher.publisherName,Rights.countryCreation,Rights.rightsHolderContact,Name.photographer,Name.repository,Date.normalized,AltIdentifier.local,Title,Date.creation,Format.extent,Format.medium,Format.dimensions,Description.note,Description.fundingNote,Description.longitude,Description.latitude,Description.caption,File Name,Author,Page layout,Text direction,Binding note,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,Condition note,Rights.statementLocal,Masthead,Representative image,Featured image,Tagline,Commentator,Name.commentator,Translator,Name.translator,Subject temporal,Opac url,Subject geographic,Colophon,Description.colophon,Finding Aid URL,Alt ID.url,Rubricator,Name.rubricator,Name.creator,Illustrator,Name.illustrator,Calligrapher,Name.calligrapher,Editor,Name.editor,Engraver,Name.engraver,Note,Printmaker,Name.printmaker,Contents note,Description.contents -Los Angeles Daily News Negatives,Work,111/222,13030/hb338nb26f,"Altars|~|Mass|~|Communion table|~|Mexican American Catholics|~|Festivals|~|Guadalupe, Our Lady of|~|Historic buildings $z California $z Los Angeles|~|Churches $z California $z Los Angeles|~|Religion|~|Catholic churches $z California $z Los Angeles ",still image,copyrighted,news photographs,"Plaza Church (Los Angeles, Calif.)",Los Angeles (Calif.)|~|Los Angeles (Calif.),"Los Angeles Daily News Negatives. Department of Special Collections, Charles E. Young Research Library, University of California at Los Angeles.",Los Angeles Daily News,US,"UCLA Charles E. Young Research Library Department of Special Collections, A1713 Young Research Library, Box 951575, Los Angeles, CA 90095-1575. E-mail: spec-coll@library.ucla.edu. Phone: (310)825-4988",Famous Photographer,,1942/1952,uclamss_1387_b112_40911-1,"Communion at Plaza Church, Los Angeles, 1942-1952",[between 1942-1947],Better Extent,,200x200,"A woman takes Communion during a Plaza Church mass for the fiesta of Nuestra Senora de Guadalupe.|~|Our Lady Queen of Los Angeles Catholic Church, (aka La Iglesia de Nuestra Señora la Reina de Los Ángeles, and The Church of Our Lady the Queen of the Angels), was built in 1822 and is the oldest church in Los Angeles.",Better Funding Note,-118.239577,34.05707,Better Caption,clusc_1_1_00010432a.tif, Famous Author,images,left-to-right,Green,paged,iiif-range,illustration-note,history-description,table of contents,concept-topic,descriptive-topic,collated,follated,illuminated,also illuminated,la la la,Schubert,Amat-Mamu,Sin-liqe-unninni,condition_note,local_statement,local_masthead,local_representative_image,local_featured_image,local_tagline,commentator_1,commentator_2,translator_1,translator_2,subject_temporal_1,https://www.linrary.ucla.edu,subject_geographic_1,colophon_text,colophon_text_2,finding_aid_url_1,finding_aid_url_2,rubricator_1,rubricator_2,name_creator,Illustrator-1,Illustrator-PersonName,Calligrapher-1,Name-calligrapher,Editor-1,Name-editor,Engraver-1,Name-engraver,Note-1,Printmaker-1,Name-printmaker,contents_note-1,Description-contents +Project Name,Object Type,Parent ARK,Item ARK,Subject,Type.typeOfResource,Rights.copyrightStatus,Type.genre,Name.subject,Coverage.geographic,Relation.isPartOf,Publisher.publisherName,Rights.countryCreation,Rights.rightsHolderContact,Name.photographer,Name.repository,Date.normalized,AltIdentifier.local,Title,Date.creation,Format.extent,Format.medium,Format.dimensions,Description.note,Description.fundingNote,Description.longitude,Description.latitude,Description.caption,File Name,Author,Page layout,Text direction,Binding note,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,Condition note,Rights.statementLocal,Masthead,Representative image,Featured image,Tagline,Commentator,Name.commentator,Translator,Name.translator,Subject temporal,Opac url,Subject geographic,Colophon,Description.colophon,Finding Aid URL,Alt ID.url,Rubricator,Name.rubricator,Name.creator,Illustrator,Name.illustrator,Calligrapher,Name.calligrapher,Editor,Name.editor,Engraver,Name.engraver,Note,Printmaker,Name.printmaker,Contents note,Description.contents,Thumbnail +Los Angeles Daily News Negatives,Work,111/222,13030/hb338nb26f,"Altars|~|Mass|~|Communion table|~|Mexican American Catholics|~|Festivals|~|Guadalupe, Our Lady of|~|Historic buildings $z California $z Los Angeles|~|Churches $z California $z Los Angeles|~|Religion|~|Catholic churches $z California $z Los Angeles ",still image,copyrighted,news photographs,"Plaza Church (Los Angeles, Calif.)",Los Angeles (Calif.)|~|Los Angeles (Calif.),"Los Angeles Daily News Negatives. Department of Special Collections, Charles E. Young Research Library, University of California at Los Angeles.",Los Angeles Daily News,US,"UCLA Charles E. Young Research Library Department of Special Collections, A1713 Young Research Library, Box 951575, Los Angeles, CA 90095-1575. E-mail: spec-coll@library.ucla.edu. Phone: (310)825-4988",Famous Photographer,,1942/1952,uclamss_1387_b112_40911-1,"Communion at Plaza Church, Los Angeles, 1942-1952",[between 1942-1947],Better Extent,,200x200,"A woman takes Communion during a Plaza Church mass for the fiesta of Nuestra Senora de Guadalupe.|~|Our Lady Queen of Los Angeles Catholic Church, (aka La Iglesia de Nuestra Señora la Reina de Los Ángeles, and The Church of Our Lady the Queen of the Angels), was built in 1822 and is the oldest church in Los Angeles.",Better Funding Note,-118.239577,34.05707,Better Caption,clusc_1_1_00010432a.tif, Famous Author,images,left-to-right,Green,paged,iiif-range,illustration-note,history-description,table of contents,concept-topic,descriptive-topic,collated,follated,illuminated,also illuminated,la la la,Schubert,Amat-Mamu,Sin-liqe-unninni,condition_note,local_statement,local_masthead,local_representative_image,local_featured_image,local_tagline,commentator_1,commentator_2,translator_1,translator_2,subject_temporal_1,https://www.linrary.ucla.edu,subject_geographic_1,colophon_text,colophon_text_2,finding_aid_url_1,finding_aid_url_2,rubricator_1,rubricator_2,name_creator,Illustrator-1,Illustrator-PersonName,Calligrapher-1,Name-calligrapher,Editor-1,Name-editor,Engraver-1,Name-engraver,Note-1,Printmaker-1,Name-printmaker,contents_note-1,Description-contents,https://fake.url/iiif/ark%3A%2F13030%2Fhb338nb26f diff --git a/spec/fixtures/csv_import/csv_files_with_problems/missing_values.csv b/spec/fixtures/csv_import/csv_files_with_problems/missing_values.csv index 742a11270..d47cd15d3 100644 --- a/spec/fixtures/csv_import/csv_files_with_problems/missing_values.csv +++ b/spec/fixtures/csv_import/csv_files_with_problems/missing_values.csv @@ -1,8 +1,9 @@ -Object Type,Title,Item ARK,Parent ARK,Rights.copyrightStatus,File Name,IIIF Manifest URL -Collection,Apple,ark:/123/abc,,copyrighted,clusc_1_1_00010432a.tif,manifest_url -Work,Missing Item ARK,,ark:/123/abc,copyrighted,clusc_1_1_00010432a.tif,http://iiif.library.ucla.edu/ark%3A%2F21198%2Fz1sr03rq/manifest -Work,,ark:/123/def,ark:/123/abc,copyrighted,clusc_1_1_00010432a.tif, -,Missing Object Type,ark:/123/def,ark:/123/abc,copyrighted,clusc_1_1_00010432a.tif -Work,Missing Parent ARK,ark:/123/def,,copyrighted,clusc_1_1_00010432a.tif -Work,Missing Rights.copyrightStatus,ark:/123/def,ark:/123/abc,,clusc_1_1_00010432a.tif -Work,Missing File Name,ark:/123/def,ark:/123/abc,copyrighted, +Object Type,Title,Item ARK,Parent ARK,Rights.copyrightStatus,File Name,IIIF Manifest URL,Thumbnail +Collection,Apple,ark:/123/abc,,copyrighted,clusc_1_1_00010432a.tif,manifest_url, +Work,Missing Item ARK,,ark:/123/abc,copyrighted,clusc_1_1_00010432a.tif,manifest_url,thumbnail +Work,,ark:/123/def,ark:/123/abc,copyrighted,clusc_1_1_00010432a.tif,,thumbnail +,Missing Object Type,ark:/123/def,ark:/123/abc,copyrighted,clusc_1_1_00010432a.tif,,thumbnail +Work,Missing Parent ARK,ark:/123/def,,copyrighted,clusc_1_1_00010432a.tif,,thumbnail +Work,Missing Rights.copyrightStatus,ark:/123/def,ark:/123/abc,,clusc_1_1_00010432a.tif,,thumbnail +Work,Missing File Name,ark:/123/def,ark:/123/abc,copyrighted,,,thumbnail +Work,Missing Thumbnail,ark:/123/def,ark:/123/abc,copyrighted,clusc_1_1_00010432a.tif,manifest_url, diff --git a/spec/fixtures/csv_import/good/all_fields.csv b/spec/fixtures/csv_import/good/all_fields.csv index da455e537..1335c8ad8 100644 --- a/spec/fixtures/csv_import/good/all_fields.csv +++ b/spec/fixtures/csv_import/good/all_fields.csv @@ -1,3 +1,3 @@ -Object Type,Title,Item ARK,Parent ARK,Rights.copyrightStatus,File Name,AltIdentifier.local,Coverage.geographic,Date.creation,Date.normalized,Description.caption,Description.fundingNote,Description.latitude,Description.longitude,Description.note,Format.dimensions,Format.extent,Format.medium,Language,Name.photographer,Name.repository,Name.subject,Project Name,Publisher.publisherName,Relation.isPartOf,Rights.countryCreation,Rights.rightsHolderContact,Rights.servicesContact,Subject,Type.genre,Type.typeOfResource,Name.architect,AltTitle.other,AltTitle.translated,Place of origin,AltTitle.uniform,Support,Author,Summary,Page layout,Text direction,Binding note,viewingHint,IIIF Range,Illustrations note,Provenance,Table of Contents,Subject.conceptTopic,Subject.descriptiveTopic,Collation,Foliation note,Foliation,Illuminator,Name.illuminator,Name.lyricist,Name.composer,Scribe,Name.scribe,Condition note,Rights.statementLocal,Masthead,Representative image,Featured image,Tagline,Commentator,Name.commentator,Translator,Name.translator,Subject temporal,IIIF Manifest URL,Opac url,Subject geographic,Colophon,Description.colophon,Finding Aid URL,Alt ID.url,Rubricator,Name.rubricator,Name.creator,License,Illustrator,Name.illustrator-2,Calligrapher,Name.calligrapher,Editor,Name.editor,Engraver,Name.engraver,Note,Printmaker,Name.printmaker,Contents note,Description.contents -Collection,"Bennett (Walter E.) Photographic Collection, 1937-1983 (bulk 1952-1982)",21198/zz00011f8m,,copyrighted,,Collection 686,,1937-1983,1937/1983,,,,,"Walter E. Bennett (1921-1995) was the first salaried photographer for Time, where he worked from 1952 to 1982. The collection consists of photographic materials such as prints, negatives and slides. It also includes miscellaneous manuscripts and ephemera related to Bennett's life and career.",,,,,"Bennett, Walter E. (Walter Edward), 1921-1995","University of California, Los Angeles. $b Library Special Collections",,,,,,,"UCLA Charles E. Young Research Library Department of Special Collections, A1713 Young Research Library, Box 951575, Los Angeles, CA 90095-1575. E-mail: spec-coll@library.ucla.edu. Phone: (310)825-4988",,,,,,,Los Angeles,"Bennett (Walter E.) Photographic Collection, 1937-1983 (bulk 1952-1982)",UCLA,A collection of photos by Walter Bennett,summary_1,images,left-to-right,Green,paged,iiif-range,illustration-note,history-description,table of contents,concept-topic,descriptive-topic,collated,follated,also follated,illuminated,also illuminated,la la la,Schubert,Amat-Mamu,Sin-liqe-unninni,condition_note,local_statement,local_masthead,local_representative_image,local_featured_image,local_tagline,commentator_1,commentator_2,translator_1,translator_2,subject_temporal_1,manifest_url_1,example_opac_url,subject_geographic_1,colophon_text,colophon_text_2,finding_aid_url_1,finding_aid_url_2,rubricator_1,rubricator_2,name_creator,http://creativecommons.org/publicdomain/zero/1.0/,Illustrator-1,Illustrator-2,Calligrapher-1,Calligrapher-2,Editor-1,Editor-2,Engraver-1,Engraver-2,Note,Printmaker-1,Printmaker-2,contents_note-1,contents_note-2 -Work,Anti-war demonstrators attend the 1971 May Day Protest in Washington D.C.,21198/zz0001q2jd,21198/zz00011f8m,copyrighted,food.tif,uclamss_686_b4_f16_1,,"May 3, 1971",1971-05-03,,,,,,35 mm,,1 photograph|~|color slide,,"Bennett, Walter E. (Walter Edward), 1921-1995","University of California, Los Angeles. $b Library Special Collections",,,,,,,,"Demonstrations--Washington (D.C.)|~|Vietnamese Conflict, 1961-1975--Protest movements--Washington (D.C)",news photographs,still image,Imhotep,"Walter Bennett Collection","Walter Bennett Colección",California,Anti-war demonstrators attend the 1971 May Day Protest in Washington D.C.,UCLA,Famous Author,May Day protest in 1971,images,left-to-right,Green,paged,iiif-range,illustration-note,history-description,table of contents,concept-topic,descriptive-topic,collated,follated,also follated,illuminated,also illuminated,la la la,Schubert,Amat-Mamu,Sin-liqe-unninni,condition_note,local_statement,local_masthead,local_representative_image,local_featured_image,local_tagline,commentator_1,commentator_2,translator_1,translator_2,subject_temporal_1,manifest_url_2,example_opac_url,subject_geographic_1,colophon_text,colophon_text_2,finding_aid_url_1,finding_aid_url_2,rubricator_1,rubricator_2,name_creator,http://creativecommons.org/publicdomain/zero/1.0/,Illustrator-1,Illustrator-2,Calligrapher-1,Name-calligrapher,Editor-1,Name-editor,Engraver-1,Name-engraver,Note-1,Printmaker-1,Name-printmaker,contents_note-1,Description-contents +Object Type,Title,Item ARK,Parent ARK,Rights.copyrightStatus,File Name,AltIdentifier.local,Coverage.geographic,Date.creation,Date.normalized,Description.caption,Description.fundingNote,Description.latitude,Description.longitude,Description.note,Format.dimensions,Format.extent,Format.medium,Language,Name.photographer,Name.repository,Name.subject,Project Name,Publisher.publisherName,Relation.isPartOf,Rights.countryCreation,Rights.rightsHolderContact,Rights.servicesContact,Subject,Type.genre,Type.typeOfResource,Name.architect,AltTitle.other,AltTitle.translated,Place of origin,AltTitle.uniform,Support,Author,Summary,Page layout,Text direction,Binding note,viewingHint,IIIF Range,Illustrations note,Provenance,Table of Contents,Subject.conceptTopic,Subject.descriptiveTopic,Collation,Foliation note,Foliation,Illuminator,Name.illuminator,Name.lyricist,Name.composer,Scribe,Name.scribe,Condition note,Rights.statementLocal,Masthead,Representative image,Featured image,Tagline,Commentator,Name.commentator,Translator,Name.translator,Subject temporal,IIIF Manifest URL,Opac url,Subject geographic,Colophon,Description.colophon,Finding Aid URL,Alt ID.url,Rubricator,Name.rubricator,Name.creator,License,Illustrator,Name.illustrator-2,Calligrapher,Name.calligrapher,Editor,Name.editor,Engraver,Name.engraver,Note,Printmaker,Name.printmaker,Contents note,Description.contents,Thumbnail +Collection,"Bennett (Walter E.) Photographic Collection, 1937-1983 (bulk 1952-1982)",21198/zz00011f8m,,copyrighted,,Collection 686,,1937-1983,1937/1983,,,,,"Walter E. Bennett (1921-1995) was the first salaried photographer for Time, where he worked from 1952 to 1982. The collection consists of photographic materials such as prints, negatives and slides. It also includes miscellaneous manuscripts and ephemera related to Bennett's life and career.",,,,,"Bennett, Walter E. (Walter Edward), 1921-1995","University of California, Los Angeles. $b Library Special Collections",,,,,,,"UCLA Charles E. Young Research Library Department of Special Collections, A1713 Young Research Library, Box 951575, Los Angeles, CA 90095-1575. E-mail: spec-coll@library.ucla.edu. Phone: (310)825-4988",,,,,,,Los Angeles,"Bennett (Walter E.) Photographic Collection, 1937-1983 (bulk 1952-1982)",UCLA,A collection of photos by Walter Bennett,summary_1,images,left-to-right,Green,paged,iiif-range,illustration-note,history-description,table of contents,concept-topic,descriptive-topic,collated,follated,also follated,illuminated,also illuminated,la la la,Schubert,Amat-Mamu,Sin-liqe-unninni,condition_note,local_statement,local_masthead,local_representative_image,local_featured_image,local_tagline,commentator_1,commentator_2,translator_1,translator_2,subject_temporal_1,manifest_url_1,example_opac_url,subject_geographic_1,colophon_text,colophon_text_2,finding_aid_url_1,finding_aid_url_2,rubricator_1,rubricator_2,name_creator,http://creativecommons.org/publicdomain/zero/1.0/,Illustrator-1,Illustrator-2,Calligrapher-1,Calligrapher-2,Editor-1,Editor-2,Engraver-1,Engraver-2,Note,Printmaker-1,Printmaker-2,contents_note-1,contents_note-2,https://fake.url/iiif/ark%3A%2F13030%2Fzz00011f8m +Work,Anti-war demonstrators attend the 1971 May Day Protest in Washington D.C.,21198/zz0001q2jd,21198/zz00011f8m,copyrighted,food.tif,uclamss_686_b4_f16_1,,"May 3, 1971",1971-05-03,,,,,,35 mm,,1 photograph|~|color slide,,"Bennett, Walter E. (Walter Edward), 1921-1995","University of California, Los Angeles. $b Library Special Collections",,,,,,,,"Demonstrations--Washington (D.C.)|~|Vietnamese Conflict, 1961-1975--Protest movements--Washington (D.C)",news photographs,still image,Imhotep,"Walter Bennett Collection","Walter Bennett Colección",California,Anti-war demonstrators attend the 1971 May Day Protest in Washington D.C.,UCLA,Famous Author,May Day protest in 1971,images,left-to-right,Green,paged,iiif-range,illustration-note,history-description,table of contents,concept-topic,descriptive-topic,collated,follated,also follated,illuminated,also illuminated,la la la,Schubert,Amat-Mamu,Sin-liqe-unninni,condition_note,local_statement,local_masthead,local_representative_image,local_featured_image,local_tagline,commentator_1,commentator_2,translator_1,translator_2,subject_temporal_1,manifest_url_2,example_opac_url,subject_geographic_1,colophon_text,colophon_text_2,finding_aid_url_1,finding_aid_url_2,rubricator_1,rubricator_2,name_creator,http://creativecommons.org/publicdomain/zero/1.0/,Illustrator-1,Illustrator-2,Calligrapher-1,Name-calligrapher,Editor-1,Name-editor,Engraver-1,Name-engraver,Note-1,Printmaker-1,Name-printmaker,contents_note-1,Description-contents,https://fake.url/iiif/ark%3A%2F13030%2Fzz0001q2jd diff --git a/spec/fixtures/example-missing_thumbnail.csv b/spec/fixtures/example-missing_thumbnail.csv new file mode 100644 index 000000000..a4909fc85 --- /dev/null +++ b/spec/fixtures/example-missing_thumbnail.csv @@ -0,0 +1,2 @@ +Object Type,Project Name,Parent ARK,Item ARK,Subject,Type.typeOfResource,Rights.copyrightStatus,Type.genre,Name.subject,Coverage.geographic,Relation.isPartOf,Publisher.publisherName,Rights.countryCreation,Rights.rightsHolderContact,Name.architect,Name.photographer,Name.repository,Date.normalized,AltIdentifier.local,Title,Date.creation,Format.extent,Format.medium,Format.dimensions,Description.note,Description.fundingNote,Description.longitude,Description.latitude,Description.caption,File Name,AltTitle.other,AltTitle.translated,Place of origin,AltTitle.uniform,Support,Author,Summary,Page layout,Text direction,Binding note,viewingHint,IIIF Range,Illustrations note,Provenance,Table of Contents,Subject.conceptTopic,Subject.descriptiveTopic,Collation,Foliation note,Foliation,Illuminator,Name.illuminator,Name.lyricist,Name.composer,Scribe,Name.scribe,Condition note,Rights.statementLocal,Masthead,Representative image,Featured image,Tagline,Commentator,Name.commentator,Translator,Name.translator,Subject temporal,Opac url,Subject geographic,Colophon,Description.colophon,Finding Aid URL,Alt ID.url,Rubricator,Name.rubricator,Name.creator,License,Illustrator,Name.illustrator,Calligrapher,Name.calligrapher,Editor,Name.editor,Engraver,Name.engraver,Note,Printmaker,Name.printmaker,Contents note,Description.contents,Thumbnail +Work,Los Angeles Daily News Negatives,21198/zz00294nz8,21198/zz0002nq4w,Eminent domain--California--Los Angeles|~|Demonstrations--California--Los Angeles County|~|Express highways--California--Los Angeles County--Design and construction|~|Government|~|Transportation|~|Activism|~|Interstate 10,still image,copyrighted,news photographs,Los Angeles County (Calif.). $b Board of Supervisors,Los Angeles (Calif.),"Los Angeles Daily News Negatives. Department of Special Collections, Charles E. Young Research Library, University of California at Los Angeles.",Los Angeles Daily News,US,"UCLA Charles E. Young Research Library Department of Special Collections, A1713 Young Research Library, Box 951575, Los Angeles, CA 90095-1575. E-mail: spec-coll@library.ucla.edu. Phone: (310)825-4988",,,,1947-09-17,uclalat_1387_b107_40098,"Protesters with signs in gallery of Los Angeles County Supervisors hearing over eminent domain for construction of Harbor Freeway, Calif., 1947","September 17, 1947",1 photograph,b&w negative,10 x 12.5 cm.,"At the Hall of Records, 220 N. Broadway.|~|Description 2",Info about funding,-118.243865,34.054133,This example does not have a caption.,clusc_1_1_00010432a.tif,"Protesters with signs"," manifestante n común",Los Angeles,Los Angeles Daily News Negatives,UCLA,Famous Author,Protesters with signs,images,left-to-right,Green,paged,iiif-range,illustration-note,history-description,table of contents,concept-topic,descriptive-topic,collated,follated,also follated,illuminated,also illuminated,la la la,Schubert,Amat-Mamu,Sin-liqe-unninni,condition_note,local_statement,local_masthead,local_representative_image,local_featured_image,local_tagline,commentator_1,commentator_2,translator_1,translator_2,subject_temporal_1,example_opac_url,subject_geographic_1,colophon_text,colophon_text_2,finding_aid_url_1,finding_aid_url_2,rubricator_1,rubricator_2,name_creator,http://creativecommons.org/publicdomain/zero/1.0/,Illustrator-1,Illustrator-2,Calligrapher-1,Name-calligrapher,Editor-1,Name-editor,Engraver-1,Name-engraver,Note-1,Printmaker-1,Name-printmaker,contents_note-1,Description-contents, \ No newline at end of file diff --git a/spec/fixtures/example.csv b/spec/fixtures/example.csv index 2e6ead868..4b211dd2c 100644 --- a/spec/fixtures/example.csv +++ b/spec/fixtures/example.csv @@ -1,2 +1,2 @@ -Object Type,Project Name,Parent ARK,Item ARK,Subject,Type.typeOfResource,Rights.copyrightStatus,Type.genre,Name.subject,Coverage.geographic,Relation.isPartOf,Publisher.publisherName,Rights.countryCreation,Rights.rightsHolderContact,Name.architect,Name.photographer,Name.repository,Date.normalized,AltIdentifier.local,Title,Date.creation,Format.extent,Format.medium,Format.dimensions,Description.note,Description.fundingNote,Description.longitude,Description.latitude,Description.caption,File Name,AltTitle.other,AltTitle.translated,Place of origin,AltTitle.uniform,Support,Author,Summary,Page layout,Text direction,Binding note,viewingHint,IIIF Range,Illustrations note,Provenance,Table of Contents,Subject.conceptTopic,Subject.descriptiveTopic,Collation,Foliation note,Foliation,Illuminator,Name.illuminator,Name.lyricist,Name.composer,Scribe,Name.scribe,Condition note,Rights.statementLocal,Masthead,Representative image,Featured image,Tagline,Commentator,Name.commentator,Translator,Name.translator,Subject temporal,Opac url,Subject geographic,Colophon,Description.colophon,Finding Aid URL,Alt ID.url,Rubricator,Name.rubricator,Name.creator,License,Illustrator,Name.illustrator,Calligrapher,Name.calligrapher,Editor,Name.editor,Engraver,Name.engraver,Note,Printmaker,Name.printmaker,Contents note,Description.contents -Work,Los Angeles Daily News Negatives,21198/zz00294nz8,21198/zz0002nq4w,Eminent domain--California--Los Angeles|~|Demonstrations--California--Los Angeles County|~|Express highways--California--Los Angeles County--Design and construction|~|Government|~|Transportation|~|Activism|~|Interstate 10,still image,copyrighted,news photographs,Los Angeles County (Calif.). $b Board of Supervisors,Los Angeles (Calif.),"Los Angeles Daily News Negatives. Department of Special Collections, Charles E. Young Research Library, University of California at Los Angeles.",Los Angeles Daily News,US,"UCLA Charles E. Young Research Library Department of Special Collections, A1713 Young Research Library, Box 951575, Los Angeles, CA 90095-1575. E-mail: spec-coll@library.ucla.edu. Phone: (310)825-4988",,,,1947-09-17,uclalat_1387_b107_40098,"Protesters with signs in gallery of Los Angeles County Supervisors hearing over eminent domain for construction of Harbor Freeway, Calif., 1947","September 17, 1947",1 photograph,b&w negative,10 x 12.5 cm.,"At the Hall of Records, 220 N. Broadway.|~|Description 2",Info about funding,-118.243865,34.054133,This example does not have a caption.,clusc_1_1_00010432a.tif,"Protesters with signs"," manifestante n común",Los Angeles,Los Angeles Daily News Negatives,UCLA,Famous Author,Protesters with signs,images,left-to-right,Green,paged,iiif-range,illustration-note,history-description,table of contents,concept-topic,descriptive-topic,collated,follated,also follated,illuminated,also illuminated,la la la,Schubert,Amat-Mamu,Sin-liqe-unninni,condition_note,local_statement,local_masthead,local_representative_image,local_featured_image,local_tagline,commentator_1,commentator_2,translator_1,translator_2,subject_temporal_1,example_opac_url,subject_geographic_1,colophon_text,colophon_text_2,finding_aid_url_1,finding_aid_url_2,rubricator_1,rubricator_2,name_creator,http://creativecommons.org/publicdomain/zero/1.0/,Illustrator-1,Illustrator-2,Calligrapher-1,Name-calligrapher,Editor-1,Name-editor,Engraver-1,Name-engraver,Note-1,Printmaker-1,Name-printmaker,contents_note-1,Description-contents +Object Type,Project Name,Parent ARK,Item ARK,Subject,Type.typeOfResource,Rights.copyrightStatus,Type.genre,Name.subject,Coverage.geographic,Relation.isPartOf,Publisher.publisherName,Rights.countryCreation,Rights.rightsHolderContact,Name.architect,Name.photographer,Name.repository,Date.normalized,AltIdentifier.local,Title,Date.creation,Format.extent,Format.medium,Format.dimensions,Description.note,Description.fundingNote,Description.longitude,Description.latitude,Description.caption,File Name,AltTitle.other,AltTitle.translated,Place of origin,AltTitle.uniform,Support,Author,Summary,Page layout,Text direction,Binding note,viewingHint,IIIF Range,Illustrations note,Provenance,Table of Contents,Subject.conceptTopic,Subject.descriptiveTopic,Collation,Foliation note,Foliation,Illuminator,Name.illuminator,Name.lyricist,Name.composer,Scribe,Name.scribe,Condition note,Rights.statementLocal,Masthead,Representative image,Featured image,Tagline,Commentator,Name.commentator,Translator,Name.translator,Subject temporal,Opac url,Subject geographic,Colophon,Description.colophon,Finding Aid URL,Alt ID.url,Rubricator,Name.rubricator,Name.creator,License,Illustrator,Name.illustrator,Calligrapher,Name.calligrapher,Editor,Name.editor,Engraver,Name.engraver,Note,Printmaker,Name.printmaker,Contents note,Description.contents,Thumbnail +Work,Los Angeles Daily News Negatives,21198/zz00294nz8,21198/zz0002nq4w,Eminent domain--California--Los Angeles|~|Demonstrations--California--Los Angeles County|~|Express highways--California--Los Angeles County--Design and construction|~|Government|~|Transportation|~|Activism|~|Interstate 10,still image,copyrighted,news photographs,Los Angeles County (Calif.). $b Board of Supervisors,Los Angeles (Calif.),"Los Angeles Daily News Negatives. Department of Special Collections, Charles E. Young Research Library, University of California at Los Angeles.",Los Angeles Daily News,US,"UCLA Charles E. Young Research Library Department of Special Collections, A1713 Young Research Library, Box 951575, Los Angeles, CA 90095-1575. E-mail: spec-coll@library.ucla.edu. Phone: (310)825-4988",,,,1947-09-17,uclalat_1387_b107_40098,"Protesters with signs in gallery of Los Angeles County Supervisors hearing over eminent domain for construction of Harbor Freeway, Calif., 1947","September 17, 1947",1 photograph,b&w negative,10 x 12.5 cm.,"At the Hall of Records, 220 N. Broadway.|~|Description 2",Info about funding,-118.243865,34.054133,This example does not have a caption.,clusc_1_1_00010432a.tif,"Protesters with signs"," manifestante n común",Los Angeles,Los Angeles Daily News Negatives,UCLA,Famous Author,Protesters with signs,images,left-to-right,Green,paged,iiif-range,illustration-note,history-description,table of contents,concept-topic,descriptive-topic,collated,follated,also follated,illuminated,also illuminated,la la la,Schubert,Amat-Mamu,Sin-liqe-unninni,condition_note,local_statement,local_masthead,local_representative_image,local_featured_image,local_tagline,commentator_1,commentator_2,translator_1,translator_2,subject_temporal_1,example_opac_url,subject_geographic_1,colophon_text,colophon_text_2,finding_aid_url_1,finding_aid_url_2,rubricator_1,rubricator_2,name_creator,http://creativecommons.org/publicdomain/zero/1.0/,Illustrator-1,Illustrator-2,Calligrapher-1,Name-calligrapher,Editor-1,Name-editor,Engraver-1,Name-engraver,Note-1,Printmaker-1,Name-printmaker,contents_note-1,Description-contents,https://fake.url/iiif/ark%3A%2F21198%2Fzz0002nq4w \ No newline at end of file diff --git a/spec/fixtures/simple_example.csv b/spec/fixtures/simple_example.csv index 79a0e13ff..8cd039f61 100644 --- a/spec/fixtures/simple_example.csv +++ b/spec/fixtures/simple_example.csv @@ -1,2 +1,2 @@ -License,Project Name,Object Type,Parent ARK,Item ARK,Item Status,Subject,Type.typeOfResource,Rights.copyrightStatus,Type.genre,Name.subject,Coverage.geographic,Relation.isPartOf,Publisher.publisherName,Rights.countryCreation,Rights.rightsHolderContact,Name.architect,Name.photographer,Name.repository,Date.normalized,AltIdentifier.local,Title,Date.creation,Format.extent,Format.medium,Format.dimensions,Description.note,Description.fundingNote,Description.longitude,Description.latitude,Description.caption,File Name,AltTitle.other,AltTitle.translated,Place of origin,AltTitle.uniform,Support,Author,Summary,Page layout,Text direction,Binding note,viewingHint,IIIF Range,Illustrations note,Description.history,Table of Contents,Subject.conceptTopic,Subject.descriptiveTopic,Collation,Foliation note, Foliation,Illuminator,Name.illuminator,Name.lyricist,Name.composer,Scribe,Name.scribe,Condition note,Rights.statement,Masthead,Representative image,Featured image,Tagline,Commentator,Name.commentator,Translator,Name.translator,Subject temporal,Opac url,Subject geographic,Colophon,Description.colophon,Finding Aid URL,Alt ID.url,Rubricator,Name.rubricator,Name.creator,Illustrator,Name.illustrator,Calligrapher,Name.calligrapher,Editor,Name.editor,Engraver,Name.engraver,Note,Printmaker,Name.printmaker,Contents note,Description.contents -http://creativecommons.org/publicdomain/mark/1.0/,Project-Name,Work,111/222,13030/hb338nb26f,Completed,Subject,still image,copyrighted,news photos,Name-subject,Coverage-geographic,Relation-isPartOf,Publisher-Name,Rights-Creation,Rights-HolderContact,Architect,Photographer,Repositor-Name,2-14-2020,AltIdentifier,Title,Date-creation,Format-extent,Format-medium,Dimensions,Description-note,FundingNote,Longitude,Latitude,Caption,File-Name,AltTitle-other,AltTitle-translated,Place of origin,AltTitle-Uniform,Support,Author,Summary,Page layout,Text direction,Binding note,viewingHint,IIIF Range,Illustrations note,Hhistory,Table of Contents,SubjectConceptTopic,Subject-DescriptiveTopic,Collation,Foliation note, Foliation,Illuminator,Iilluminator,Lyricist,Composer,Scribe,Name-Scribe,Condition note,Rights-Statement,Masthead,Representative image,Featured image,Tagline,Commentator,Name-Commentator,Translator,Translator,Subject temporal,Opac url,Subject geographic,Colophon,Description-Colophon,Finding Aid URL,Alt ID-Url,Rubricator,Name-Rubricator,Name-Creator,Illustrator-1,Illustrator-2,Calligrapher-1,Name-calligrapher,Editor-1,Name-editor,Engraver-1,Name-engraver,Note-1,Printmaker-1,Name-printmaker,contents_note-1,Description-contents +License,Project Name,Object Type,Parent ARK,Item ARK,Item Status,Subject,Type.typeOfResource,Rights.copyrightStatus,Type.genre,Name.subject,Coverage.geographic,Relation.isPartOf,Publisher.publisherName,Rights.countryCreation,Rights.rightsHolderContact,Name.architect,Name.photographer,Name.repository,Date.normalized,AltIdentifier.local,Title,Date.creation,Format.extent,Format.medium,Format.dimensions,Description.note,Description.fundingNote,Description.longitude,Description.latitude,Description.caption,File Name,AltTitle.other,AltTitle.translated,Place of origin,AltTitle.uniform,Support,Author,Summary,Page layout,Text direction,Binding note,viewingHint,IIIF Range,Illustrations note,Description.history,Table of Contents,Subject.conceptTopic,Subject.descriptiveTopic,Collation,Foliation note, Foliation,Illuminator,Name.illuminator,Name.lyricist,Name.composer,Scribe,Name.scribe,Condition note,Rights.statement,Masthead,Representative image,Featured image,Tagline,Commentator,Name.commentator,Translator,Name.translator,Subject temporal,Opac url,Subject geographic,Colophon,Description.colophon,Finding Aid URL,Alt ID.url,Rubricator,Name.rubricator,Name.creator,Illustrator,Name.illustrator,Calligrapher,Name.calligrapher,Editor,Name.editor,Engraver,Name.engraver,Note,Printmaker,Name.printmaker,Contents note,Description.contents,Thumbnail +http://creativecommons.org/publicdomain/mark/1.0/,Project-Name,Work,111/222,13030/hb338nb26f,Completed,Subject,still image,copyrighted,news photos,Name-subject,Coverage-geographic,Relation-isPartOf,Publisher-Name,Rights-Creation,Rights-HolderContact,Architect,Photographer,Repositor-Name,2-14-2020,AltIdentifier,Title,Date-creation,Format-extent,Format-medium,Dimensions,Description-note,FundingNote,Longitude,Latitude,Caption,File-Name,AltTitle-other,AltTitle-translated,Place of origin,AltTitle-Uniform,Support,Author,Summary,Page layout,Text direction,Binding note,viewingHint,IIIF Range,Illustrations note,Hhistory,Table of Contents,SubjectConceptTopic,Subject-DescriptiveTopic,Collation,Foliation note, Foliation,Illuminator,Iilluminator,Lyricist,Composer,Scribe,Name-Scribe,Condition note,Rights-Statement,Masthead,Representative image,Featured image,Tagline,Commentator,Name-Commentator,Translator,Translator,Subject temporal,Opac url,Subject geographic,Colophon,Description-Colophon,Finding Aid URL,Alt ID-Url,Rubricator,Name-Rubricator,Name-Creator,Illustrator-1,Illustrator-2,Calligrapher-1,Name-calligrapher,Editor-1,Name-editor,Engraver-1,Name-engraver,Note-1,Printmaker-1,Name-printmaker,contents_note-1,Description-contents,https://fake.url/iiif/ark%3A%2F13030%2Fhb338nb26f diff --git a/spec/forms/hyrax/child_work_form_spec.rb b/spec/forms/hyrax/child_work_form_spec.rb index c9e5c74f4..fffd4f45a 100644 --- a/spec/forms/hyrax/child_work_form_spec.rb +++ b/spec/forms/hyrax/child_work_form_spec.rb @@ -42,7 +42,8 @@ :ark, :rights_statement, :access_copy, - :preservation_copy + :preservation_copy, + :thumbnail_link ] end end diff --git a/spec/forms/hyrax/work_form_spec.rb b/spec/forms/hyrax/work_form_spec.rb index beb9d9b5c..d40a97283 100644 --- a/spec/forms/hyrax/work_form_spec.rb +++ b/spec/forms/hyrax/work_form_spec.rb @@ -66,6 +66,7 @@ :summary, :support, :tagline, + :thumbnail_link, :toc, :translator, :iiif_text_direction, @@ -83,7 +84,8 @@ :ark, :rights_statement, :access_copy, - :preservation_copy + :preservation_copy, + :thumbnail_link ] end end diff --git a/spec/importers/californica_csv_parser_spec.rb b/spec/importers/californica_csv_parser_spec.rb index 807d9e1ca..1fc261af3 100644 --- a/spec/importers/californica_csv_parser_spec.rb +++ b/spec/importers/californica_csv_parser_spec.rb @@ -136,7 +136,8 @@ 'Printmaker', 'Name.printmaker', 'Contents note', - 'Description.contents'] + 'Description.contents', + 'Thumbnail'] end it 'knows the headers for this CSV file' do diff --git a/spec/importers/californica_mapper_spec.rb b/spec/importers/californica_mapper_spec.rb index cc6649c80..152d9a77b 100644 --- a/spec/importers/californica_mapper_spec.rb +++ b/spec/importers/californica_mapper_spec.rb @@ -122,7 +122,8 @@ "Printmaker" => "Printmaker-1", # printmaker "Name.printmaker" => "Name-printmaker", # printmaker "Contents note" => "contents_note-1", # contents_note - "Description.contents" => "Description-contents" # contents_note + "Description.contents" => "Description-contents", # contents_note + "Thumbnail" => "https://fake.url/iiif/ark%3A%2F21198%2Fzz0002nq4w" # thumbnail_link } end @@ -220,6 +221,7 @@ :summary, :support, :toc, + :thumbnail_link, :translator, :iiif_text_direction, :title, @@ -589,6 +591,14 @@ end end + describe '#thumbnail_link' do + subject { mapper.thumbnail_link } + + it 'maps as a single-valued field' do + expect(mapper.thumbnail_link).to eq('https://fake.url/iiif/ark%3A%2F21198%2Fzz0002nq4w') + end + end + describe '#visibility' do subject { mapper.visibility } diff --git a/spec/indexers/collection_indexer_spec.rb b/spec/indexers/collection_indexer_spec.rb index a821115b0..f2a5c730e 100644 --- a/spec/indexers/collection_indexer_spec.rb +++ b/spec/indexers/collection_indexer_spec.rb @@ -33,19 +33,72 @@ end describe '#thumbnail_url' do - let(:expected_url) { "#{ENV['IIIF_SERVER_URL']}master%2Ffile%2Fpath.jpg/full/!200,200/0/default.jpg" } + let(:attributes) do + { + ark: 'ark:/123/456', + access_copy: access_copy, + recalculate_size: true, + thumbnail_link: thumbnail_link + } + end + let(:access_copy) { nil } + let(:thumbnail_link) { nil } + + context 'when thumbnail_link is a iiif resource' do + let(:thumbnail_link) { 'https://fake.url/iiif/2/id' } + + it 'adds iiif parameters' do + expect(solr_document['thumbnail_url_ss']).to eq 'https://fake.url/iiif/2/id/full/!200,200/0/default.jpg' + end + end + + context 'when thumbnail_link is an image url' do + let(:thumbnail_link) { 'https://fake.url/id.svg' } + + it 'is indexed as is' do + expect(solr_document['thumbnail_url_ss']).to eq 'https://fake.url/id.svg' + end + end + + context 'when thumbnail_link is empty' do + context 'when a iiif resource can be derived from an access copy' do + let(:access_copy) { 'https://fake.url/iiif/2/id' } + + it 'adds iiif parameters' do + expect(solr_document['thumbnail_url_ss']).to eq 'https://fake.url/iiif/2/id/full/!200,200/0/default.jpg' + end + end + + context 'when access_copy is not a iiif resource' do + let(:access_copy) { 'https://fake.url/media_stream/id' } + + it 'returns nil' do + expect(solr_document['thumbnail_url_ss']).to be_nil + end + end + + context 'when access_copy is nil' do + it 'returns nil' do + expect(solr_document['thumbnail_url_ss']).to be_nil + end + end + end + end + + describe '#thumbnail_from_access_copy' do + let(:expected_url) { 'http://fake.server/iiif/2/id' } context 'when the thumnail is coming from the collection' do let(:attributes) do { ark: 'ark:/123/456', - access_copy: 'master/file/path.jpg', + access_copy: expected_url, recalculate_size: true } end it 'uses that image' do - expect(solr_document['thumbnail_url_ss']).to eq expected_url + expect(indexer.thumbnail_from_access_copy).to eq expected_url end end @@ -58,9 +111,9 @@ end it 'uses the thumbnail image from the Work' do - work = Work.new(ark: 'ark:/abc/xyz', access_copy: 'master/file/path.jpg') + work = Work.new(ark: 'ark:/abc/xyz', access_copy: expected_url) allow(collection).to receive(:members).and_return([work]) - expect(solr_document['thumbnail_url_ss']).to eq expected_url + expect(indexer.thumbnail_from_access_copy).to eq expected_url end end @@ -74,10 +127,10 @@ it 'uses the thumbnail image from the ChildWork' do work = Work.new(ark: 'ark:/abc/xyz') - child_work = ChildWork.new(ark: 'ark:/abc/xyz', access_copy: 'master/file/path.jpg') + child_work = ChildWork.new(ark: 'ark:/abc/xyz', access_copy: expected_url) allow(collection).to receive(:members).and_return([work]) allow(work).to receive(:members).and_return([child_work]) - expect(solr_document['thumbnail_url_ss']).to eq expected_url + expect(indexer.thumbnail_from_access_copy).to eq expected_url end end @@ -90,7 +143,7 @@ end it 'returns nil' do - expect(solr_document['thumbnail_url_ss']).to eq nil + expect(indexer.thumbnail_from_access_copy).to be_nil end end end diff --git a/spec/indexers/work_indexer_spec.rb b/spec/indexers/work_indexer_spec.rb index 9fe503822..002e66ce8 100644 --- a/spec/indexers/work_indexer_spec.rb +++ b/spec/indexers/work_indexer_spec.rb @@ -380,14 +380,66 @@ let(:attributes) do { ark: 'ark:/123/456', - access_copy: 'master/file/path.jpg' + access_copy: access_copy, + thumbnail_link: thumbnail_link } end - let(:expected_url) { "#{ENV['IIIF_SERVER_URL']}master%2Ffile%2Fpath.jpg/full/!200,200/0/default.jpg" } + let(:access_copy) { nil } + let(:thumbnail_link) { nil } + + context 'when thumbnail_link is a iiif resource' do + let(:thumbnail_link) { 'https://fake.url/iiif/2/id' } + + it 'adds iiif parameters' do + expect(solr_document['thumbnail_url_ss']).to eq 'https://fake.url/iiif/2/id/full/!200,200/0/default.jpg' + end + end + + context 'when thumbnail_link is an image url' do + let(:thumbnail_link) { 'https://fake.url/id.svg' } + + it 'is indexed as is' do + expect(solr_document['thumbnail_url_ss']).to eq 'https://fake.url/id.svg' + end + end + + context 'when thumbnail_link is empty' do + context 'when a iiif resource can be derived from an access copy' do + let(:access_copy) { 'https://fake.url/iiif/2/id' } + + it 'adds iiif parameters' do + expect(solr_document['thumbnail_url_ss']).to eq 'https://fake.url/iiif/2/id/full/!200,200/0/default.jpg' + end + end + + context 'when access_copy is not a iiif resource' do + let(:access_copy) { 'https://fake.url/media_stream/id' } + + it 'returns nil' do + expect(solr_document['thumbnail_url_ss']).to be_nil + end + end + + context 'when access_copy is nil' do + it 'returns nil' do + expect(solr_document['thumbnail_url_ss']).to be_nil + end + end + end + end + + describe '#thumbnail_from_access_copy' do + let(:attributes) do + { + ark: 'ark:/123/456', + access_copy: expected_url + } + end + let(:expected_url) { 'http://fake.server/iiif/2/id' } context 'when the work has an image path' do it 'uses that image' do - expect(solr_document['thumbnail_url_ss']).to eq expected_url + expect(indexer.thumbnail_from_access_copy).to eq expected_url end end @@ -399,9 +451,9 @@ end it 'asks the document\'s children' do - child_work = ChildWork.new(ark: 'ark:/abc/xyz', access_copy: 'master/file/path.jpg') + child_work = ChildWork.new(ark: 'ark:/abc/xyz', access_copy: expected_url) allow(work).to receive(:members).and_return([child_work]) - expect(solr_document['thumbnail_url_ss']).to eq expected_url + expect(indexer.thumbnail_from_access_copy).to eq expected_url end end @@ -413,7 +465,7 @@ end it 'returns nil' do - expect(solr_document['thumbnail_url_ss']).to eq nil + expect(indexer.thumbnail_from_access_copy).to eq nil end end end diff --git a/spec/system/edit_work_spec.rb b/spec/system/edit_work_spec.rb index 729563ff3..ec801c09d 100644 --- a/spec/system/edit_work_spec.rb +++ b/spec/system/edit_work_spec.rb @@ -80,7 +80,8 @@ colophon: ['Old Colophon'], finding_aid_url: ['Old Finding aid url'], rubricator: ['Old rubricator'], - license: ['http://creativecommons.org/publicdomain/zero/1.0/'] + license: ['http://creativecommons.org/publicdomain/zero/1.0/'], + thumbnail_link: 'https://fake.url/iiif/ark%3A%2Fabc%2F3456' # local_rights_statement: ['Old Rights statement local'] # This invokes License renderer from hyrax gem } end @@ -156,6 +157,7 @@ expect(find_field('Finding aid url').value).to eq 'Old Finding aid url' expect(find_field('Rubricator').value).to eq 'Old rubricator' expect(find_field('Creator').value).to eq 'Old Creator' + expect(find_field('Thumbnail link').value).to eq 'https://fake.url/iiif/ark%3A%2Fabc%2F3456' expect(page).to have_select('License', selected: 'Creative Commons CC0 1.0 Universal', multiple: false) expect(find_field('Contents note').value).to eq 'Old Contents note' # expect(find_field('Local rights statement').value).to eq 'Old Rights statement local' @@ -164,6 +166,7 @@ fill_in 'Title', with: 'New Title' fill_in 'Dimensions', with: 'New Dim' fill_in 'Ark', with: 'ark:/not/myark' # This field is read-only and an attempt to change it should not result in a change + fill_in 'Thumbnail link', with: 'https://new.url/iiif/ark%3A%2Fabc%2F3456' click_on 'Additional fields' # Submit the form. When the page reloads, it should be on the show page. click_on 'Save changes' @@ -176,6 +179,8 @@ expect(page).to_not have_content 'Old Dim' expect(page).to have_content 'ark:/abc/3456' expect(page).to_not have_content 'ark:/not/myark' + expect(page).to have_content 'https://new.url/iiif/ark%3A%2Fabc%2F3456' + expect(page).to_not have_content 'https://fake.url/iiif/ark%3A%2Fabc%2F3456' end end end diff --git a/spec/system/import_and_show_work_spec.rb b/spec/system/import_and_show_work_spec.rb index 2cc4d2592..a4c3a1fec 100644 --- a/spec/system/import_and_show_work_spec.rb +++ b/spec/system/import_and_show_work_spec.rb @@ -98,6 +98,7 @@ expect(page).to have_content "commentator_2" # commentator expect(page).to have_content "translator_1" # translator expect(page).to have_content "translator_2" # translator + expect(page).to have_content "https://fake.url/iiif/ark%3A%2F13030%2Fhb338nb26f" # thumbnail_link expect(page).to have_content "subject_geographic_1" # subject_geographic expect(page).to have_content "subject_temporal_1" # subject_temporal expect(page).to have_content "colophon_text" # colophon diff --git a/spec/uploaders/csv_manifest_validator_spec.rb b/spec/uploaders/csv_manifest_validator_spec.rb index 984fcaef5..d6be044ff 100644 --- a/spec/uploaders/csv_manifest_validator_spec.rb +++ b/spec/uploaders/csv_manifest_validator_spec.rb @@ -70,28 +70,23 @@ end end - context 'a CSV that is missing required values' do + context 'a CSV that is missing required/recommended values' do let(:csv_file) { File.join(fixture_path, 'csv_import', 'csv_files_with_problems', 'missing_values.csv') } - it 'has warnings' do - validator.validate - expect(validator.warnings).to contain_exactly( - # 'Row 3: Rows missing "Item ARK" cannot be imported.', - # 'Row 4: Rows missing "Title" cannot be imported.', - 'Row 5: Rows missing "Object Type" cannot be imported.', - 'Row 6: Rows missing "Parent ARK" cannot be imported.', - 'Row 7: Rows missing "Rights.copyrightStatus" will have the value set to "unknown".', - 'Row 8: Rows missing "File Name" will import metadata-only.' - ) - end - - it 'has errors' do + it 'has warnings and errors' do validator.validate expect(validator.errors).to contain_exactly( 'Row 3: Rows missing required value for "Item ARK". Your spreadsheet must have this value.', 'Row 4: Rows missing required value for "Title". Your spreadsheet must have this value.', 'Row 4, 5, 6, 7, 8: Rows missing required value for "IIIF Manifest URL". Your spreadsheet must have this value.' ) + expect(validator.warnings).to contain_exactly( + 'Row 5: Rows missing "Object Type" cannot be imported.', + 'Row 6: Rows missing recommended value for "Parent ARK". Please add this value or continue to import without.', + 'Row 7: Rows missing recommended value for "Rights.copyrightStatus". Please add this value or continue to import without.', + 'Row 8: Rows missing recommended value for "File Name". Please add this value or continue to import without.', + 'Row 9: Rows missing recommended value for "Thumbnail". Please add this value or continue to import without.' + ) end end diff --git a/spec/views/hyrax/base/_attribute_rows.html.erb_spec.rb b/spec/views/hyrax/base/_attribute_rows.html.erb_spec.rb index cccdd7a09..15b0a75c6 100644 --- a/spec/views/hyrax/base/_attribute_rows.html.erb_spec.rb +++ b/spec/views/hyrax/base/_attribute_rows.html.erb_spec.rb @@ -55,6 +55,7 @@ subject_topic: ['subject_topic'], summary: ['summary'], support: ['support'], + thumbnail_link: 'https://fake.url/iiif/ark%3A%2Fabcde%2F1234567', title: ['title'], translator: ['Old Translator'], uniform_title: ['Old Uniform title'])