Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class CatalogController < ApplicationController
config.add_facet_field 'date_ingested_ssim', label: 'Date Ingested', limit: 5, suggest: true, if: Proc.new {|context, config, opts| context.current_ability.can?(:read, :administrative_facets)}, group: "workflow"
config.add_facet_field 'has_captions_bsi', label: 'Has Captions', if: Proc.new {|context, config, opts| context.current_ability.can?(:read, :administrative_facets)}, group: "workflow", helper_method: :display_has_caption_or_transcript
config.add_facet_field 'has_transcripts_bsi', label: 'Has Transcripts', if: Proc.new {|context, config, opts| context.current_ability.can?(:read, :administrative_facets)}, group: "workflow", helper_method: :display_has_caption_or_transcript
config.add_facet_field 'physical_format_ssim', label: 'Physical Format', limit: 5, if: proc { |context, config, opts| context.current_ability.can?(:read, :administrative_facets) }, group:"workflow", helper_method: :physical_format_facet_display

config.add_facet_field 'subject_ssim', label: 'Subject', if: false
config.add_facet_field 'donor_ssim', label: 'Donors', if: false
Expand Down
4 changes: 4 additions & 0 deletions app/helpers/blacklight/local_blacklight_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ def rights_statement_facet_display arg
ModsDocument::RIGHTS_STATEMENTS[arg]
end

def physical_format_facet_display arg
ModsDocument::PHYSICAL_FORMATS[arg]
end

def alternative_title_index_display args
field = args[:document][args[:field]]
field.first(3).map { |f| truncate(f, length: 32) }.join("; ")
Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/media_object_intercom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def to_ingest_api_hash(include_structure = true, remove_identifiers: false, publ
terms_of_use: terms_of_use,
table_of_contents: table_of_contents,
physical_description: physical_description,
physical_format: physical_format,
series: series,
record_identifier: record_identifier,
comment: comment.to_a,
Expand Down
9 changes: 9 additions & 0 deletions app/models/concerns/media_object_mods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,15 @@ def physical_description=(value)
Array(value).each { |val| descMetadata.add_physical_description(val) if val.present? }
end

# has_attributes :physical_format, datastream: :descMetadata, at: [:physical_format], multiple: true
def physical_format
descMetadata.physical_format
end
def physical_format=(value)
delete_all_values(:physical_format)
Array(value).each { |val| descMetadata.add_physical_format(val) if val.present? }
end

# has_attributes :related_item_url, datastream: :descMetadata, at: [:related_item_url], multiple: true
def related_item_url
descMetadata.related_item_url.zip(descMetadata.related_item_label).map{|a|{url: a[0].strip, label: a[1]}}
Expand Down
11 changes: 11 additions & 0 deletions app/models/iiif_manifest_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,16 @@ def display_rights_statement(media_object)
"<a href='#{media_object.rights_statement}'>#{label}</a>"
end

def display_physical_format(media_object)
return nil unless media_object.physical_format.present?

media_object.physical_format.collect do |desc|
label = ModsDocument::PHYSICAL_FORMATS[desc]
next if label.blank?
"<a href='#{desc}'>#{label}</a>"
end
end

def display_summary(media_object)
return nil unless media_object.abstract.present?
media_object.abstract
Expand Down Expand Up @@ -211,6 +221,7 @@ def iiif_metadata_fields
metadata_field('Rights Statement', display_rights_statement(media_object)),
metadata_field('Terms of Use', media_object.terms_of_use),
metadata_field('Physical Description', media_object.physical_description),
metadata_field('Physical Format', display_physical_format(media_object)),
metadata_field('Series', display_series(media_object)),
metadata_field('Related Item', display_related_item(media_object)),
metadata_field('Access Restrictions', media_object.access_text),
Expand Down
1 change: 1 addition & 0 deletions app/models/media_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ def to_solr(include_child_fields: false)
all_text_values << solr_doc["genre_ssim"]
all_text_values << solr_doc["language_ssim"]
all_text_values << solr_doc["physical_description_ssim"]
all_text_values << solr_doc["physical_format_ssim"]
all_text_values << solr_doc["series_ssim"]
all_text_values << solr_doc["date_sim"]
all_text_values << solr_doc["notes_sim"]
Expand Down
1 change: 1 addition & 0 deletions app/models/mods_behaviors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def to_solr(solr_doc = Hash.new, opts = {})
solr_doc['language_ssim'] = gather_terms(self.find_by_terms(:language_text))
solr_doc['language_code_ssim'] = gather_terms(self.find_by_terms(:language_code))
solr_doc['physical_description_ssim'] = gather_terms(self.find_by_terms(:physical_description))
solr_doc['physical_format_ssim'] = gather_terms(self.find_by_terms(:physical_format))
solr_doc['related_item_url_sim'] = gather_terms(self.find_by_terms(:related_item_url))
solr_doc['related_item_label_sim'] = gather_terms(self.find_by_terms(:related_item_label))
solr_doc['terms_of_use_ssi'] = (self.find_by_terms(:terms_of_use) - self.find_by_terms(:rights_statement)).text
Expand Down
5 changes: 4 additions & 1 deletion app/models/mods_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class ModsDocument < ActiveFedora::OmDatastream
IDENTIFIER_TYPES = Avalon::ControlledVocabulary.find_by_name(:identifier_types) || {"other" => "Local"}
NOTE_TYPES = Avalon::ControlledVocabulary.find_by_name(:note_types) || {"local" => "Local Note"}
RIGHTS_STATEMENTS = Avalon::ControlledVocabulary.find_by_name(:rights_statements)
PHYSICAL_FORMATS = Avalon::ControlledVocabulary.find_by_name(:physical_formats)

set_terminology do |t|
t.root(:path=>'mods',
Expand Down Expand Up @@ -95,17 +96,19 @@ class ModsDocument < ActiveFedora::OmDatastream
t.language_code(:proxy => [:language, :code])
t.language_text(:proxy => [:language, :text])

# Physical Description
# Physical Description & Physical Format
t.mime_physical_description(:path => 'mods/oxns:physicalDescription') do
t.internet_media_type(:path => 'internetMediaType')
end
t.media_type(:proxy => [:mime_physical_description, :internet_media_type])

t.original_related_item(:path => 'relatedItem', :attributes => { :type => 'original'}) do
t.physical_description(:path => 'physicalDescription') { t.extent }
t.physical_format(:path => 'physicalDescription') { t.form }
t.other_identifier(:path => 'identifier') { t.type_(:path => '@type', :namespace_prefix => nil) }
end
t.physical_description(:proxy => [:original_related_item, :physical_description, :extent])
t.physical_format(:proxy => [:original_related_item, :physical_format, :form])
t.other_identifier(:proxy => [:original_related_item, :other_identifier])

# Summary and Notes
Expand Down
12 changes: 12 additions & 0 deletions app/models/mods_templates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,18 @@ def add_physical_description(value, opts={})
add_child_node(get_original_related_item, :_original_physical_description, value)
end

define_template :_original_physical_format do |xml, text|
xml.physicalDescription {
xml.form {
xml.text(text)
}
}
end

def add_physical_format(value, opts = {})
add_child_node(get_original_related_item, :_original_physical_format, value)
end

define_template :_other_identifier do |xml,text,type|
type = ModsDocument::IDENTIFIER_TYPES.keys.first if type.empty?
xml.identifier(:type => type) {
Expand Down
2 changes: 1 addition & 1 deletion app/views/media_objects/_dropdown_field.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ Unless required by applicable law or agreed to in writing, software distributed
<% count.times do |i| %>
<% value = values[i] %>
<% option_hash = (options[:dropdown_options].values).zip(options[:dropdown_options].keys) %>
<%= select_tag fieldname.to_s, options_for_select(option_hash, value), class: "form-control" %>
<%= select_tag fieldname.to_s, options_for_select(option_hash, value), class: "form-control", include_blank: options[:include_blank] %>
<% end %>
</div>
11 changes: 9 additions & 2 deletions app/views/media_objects/_resource_description.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Unless required by applicable law or agreed to in writing, software distributed
specific language governing permissions and limitations under the License.
--- END LICENSE_HEADER BLOCK ---
%>
<% unless ModsDocument::IDENTIFIER_TYPES && ModsDocument::NOTE_TYPES && ModsDocument::RIGHTS_STATEMENTS %>
<% raise Avalon::VocabularyNotFound.new "Rights statements, Identifier types, or Note types vocabulary not found." %>
<% unless ModsDocument::IDENTIFIER_TYPES && ModsDocument::NOTE_TYPES && ModsDocument::RIGHTS_STATEMENTS && ModsDocument::PHYSICAL_FORMATS %>
<% raise Avalon::VocabularyNotFound.new "Physical Format, Rights statements, Identifier types, or Note types vocabulary not found." %>
<% end %>

<div id="resource_description_content">
Expand Down Expand Up @@ -77,6 +77,13 @@ Unless required by applicable law or agreed to in writing, software distributed
options: {display_label: "Physical Description",
multivalued: true}} %>

<%= render partial: 'dropdown_field',
locals: {form: form, field: :physical_format,
options: {display_label: 'Physical Format',
dropdown_options: ModsDocument::PHYSICAL_FORMATS,
multivalued: true,
include_blank: true }} %>

<%= render partial: 'text_field',
locals: {form: form, field: :series,
options: {display_label: "Series",
Expand Down
80 changes: 80 additions & 0 deletions config/controlled_vocabulary.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,83 @@ rights_statements:
http://rightsstatements.org/vocab/CNE/1.0/: Copyright Not Evaluated
http://rightsstatements.org/vocab/UND/1.0/: Copyright Undetermined
http://rightsstatements.org/vocab/NKC/1.0/: No Known Copyright
physical_formats:
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#1InchAudioTape: 1 inch audio tape
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#1InchVideotape: 1 inch videotape
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#HalfInchAudioTape: 1/2 inch audio tape
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#HalfInchVideotape: 1/2 inch videotape
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#QuarterInchAudioCassette: 1/4 inch audio cassette
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#QuarterInchAudioTape: 1/4 inch audio tape
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#QuarterInchVideotape: 1/4 inch videotape
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-film-vocabulary/#16mmFilm: 16mm film
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#2InchAudioTape: 2 inch audio tape
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#2InchVideotape: 2 inch videotape
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-film-vocabulary/#22mmFilm: 22mm film
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-film-vocabulary/#28mmFilm: 28mm film
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-film-vocabulary/#35mmFilm: 35mm film
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-film-vocabulary/#70mmFilm: 70mm film
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#8Track: 8-track
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-film-vocabulary/#8mmFilm: 8mm film
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-film-vocabulary/#9andaHalfmmFilm: 9.5mm film
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#AluminumDisc: Aluminum disc
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#AudioCD: Audio CD
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#AudioCassette: Audio cassette
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#Betacam: Betacam
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#BetacamSX: Betacam SX
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#Betamax: Betamax
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#BluRayDisc: Blu-ray disc
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#Catrivision: Catrivision
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#D1: D1
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#D2: D2
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#D3: D3
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#D5: D5
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#D6: D6
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#D9: D9
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#DAT: DAT
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#DCT: DCT
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#DDS: DDS
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#DTRS: DTRS
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#DV: DV
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#DVCAM: DVCAM
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#DVCPRO: DVCPRO
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#DVD: DVD
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#DigitalBetacam: Digital Betacam
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#Digital8: Digital8
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#EIAJ: EIAJ
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#EVD: EVD
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-film-vocabulary/#Film: Film
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#FlexiDisc: Flexi Disc
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#GroovedDictabelt: Grooved Dictabelt
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#GroovedAnalogDisc: Grooved analog disc
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#HDCAM: HDCAM
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#HDV: HDV
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#Hi8: Hi8
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#LacquerDisc: Lacquer disc
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#LaserDisc: LaserDisc
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#MII: MII
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#MagneticDictabelt: Magnetic Dictabelt
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#MiniCassette: Mini-cassette
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#MiniDV: MiniDV
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#OpenReelAudiotape: Open reel audiotape
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#OpenReelVideoTape: Open reel videotape
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#OpticalVideoDisc: Optical video disc
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#PCMBetamax: PCM Betamax
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#PCMUmatic: PCM U-matic
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#PCMVHS: PCM VHS
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#PianoRoll: Piano roll
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#PlasticCylinder: Plastic cylinder
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#ShellacDisc: Shellac disc
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-film-vocabulary/#Super16mmFilm: Super 16mm film
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-film-vocabulary/#Super8mmFilm: Super 8mm film
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#SuperAudioCD: Super Audio CD
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#SuperVideoCD: Super Video CD
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#Umatic: U-matic
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#UniversalMediaDisc: Universal Media Disc
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#Vcord: V-Cord
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#VHS: VHS
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#VX: VX
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#Video8: Video8
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-video-vocabulary/#Videocassette: Videocassette
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#VinylRecording: Vinyl recording
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#WaxCylinder: Wax cylinder
https://pbcore.org/pbcore-controlled-vocabularies/instantiationphysical-audio-vocabulary/#WireRecording: Wire recording
2 changes: 2 additions & 0 deletions config/initializers/presenter_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
width: nil,
height: nil,
physical_description: nil,
physical_format: nil,
file_size: nil,
date_digitized: nil,
file_checksum: nil,
Expand Down Expand Up @@ -46,6 +47,7 @@
language_code: [],
terms_of_use: nil,
physical_description: [],
physical_format: [],
related_item_url: [],
note: [],
other_identifier: [],
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ en:
Terms of Use describes the conditions under which content may be used. This is an optional field.
physical_description: |
Physical Description is an optional field that will display information about the original resource being described.
physical_format: |
Physical Format is an optional field that will display information about the physical form of the original resource being described.
rights_statement: |
Rights Statement is used to communicate the copyright and re-use status of digital objects using a set of standardized rights statements provided by <a href="https://rightsstatements.org" target="_blank">RightsStatements.org</a>
related_item_url: |
Expand Down
Loading