From 01fbe0298e4ed283447a2071f500cbb8ed82f560 Mon Sep 17 00:00:00 2001 From: Eric O Date: Sat, 7 Oct 2023 15:00:09 -0400 Subject: [PATCH] WIP: Solr 8 update --- .ruby-version | 2 +- Gemfile | 4 +- Gemfile.lock | 24 +- Rakefile | 2 + app/models/project.rb | 17 +- config/environments/development.rb | 2 +- config/initializers/backtrace_silencers.rb | 2 +- .../20161130002750_create_core_objects.rb | 195 +-------- docker/fedora/Dockerfile | 9 +- docker/fedora/setup-and-start.sh | 14 + docker/solr/Dockerfile | 17 +- docker/solr/setup-and-start.sh | 21 + .../conf/_rest_managed.json | 3 + .../conf/admin-extra.html | 31 ++ .../hyacinth-hydra-solr-8/conf/elevate.xml | 36 ++ .../conf/mapping-ISOLatin1Accent.txt | 246 +++++++++++ .../hyacinth-hydra-solr-8/conf/protwords.txt | 21 + .../hyacinth-hydra-solr-8/conf/schema.xml | 398 ++++++++++++++++++ .../hyacinth-hydra-solr-8/conf/scripts.conf | 24 ++ .../hyacinth-hydra-solr-8/conf/solrconfig.xml | 318 ++++++++++++++ .../hyacinth-hydra-solr-8/conf/spellings.txt | 2 + .../hyacinth-hydra-solr-8/conf/stopwords.txt | 58 +++ .../conf/stopwords_en.txt | 58 +++ .../hyacinth-hydra-solr-8/conf/synonyms.txt | 31 ++ .../conf/xslt/example.xsl | 132 ++++++ .../conf/xslt/example_atom.xsl | 67 +++ .../conf/xslt/example_rss.xsl | 66 +++ .../hyacinth-hydra-solr-8/conf/xslt/luke.xsl | 337 +++++++++++++++ .../hyacinth-solr-8/conf/_rest_managed.json | 3 + .../hyacinth-solr-8/conf/admin-extra.html | 31 ++ .../hyacinth-solr-8/conf/elevate.xml | 36 ++ .../conf/mapping-ISOLatin1Accent.txt | 246 +++++++++++ .../hyacinth-solr-8/conf/protwords.txt | 21 + .../hyacinth-solr-8/conf/schema.xml | 398 ++++++++++++++++++ .../hyacinth-solr-8/conf/scripts.conf | 24 ++ .../hyacinth-solr-8/conf/solrconfig.xml | 318 ++++++++++++++ .../hyacinth-solr-8/conf/spellings.txt | 2 + .../hyacinth-solr-8/conf/stopwords.txt | 58 +++ .../hyacinth-solr-8/conf/stopwords_en.txt | 58 +++ .../hyacinth-solr-8/conf/synonyms.txt | 31 ++ .../hyacinth-solr-8/conf/xslt/example.xsl | 132 ++++++ .../conf/xslt/example_atom.xsl | 67 +++ .../hyacinth-solr-8/conf/xslt/example_rss.xsl | 66 +++ .../hyacinth-solr-8/conf/xslt/luke.xsl | 337 +++++++++++++++ .../conf/_rest_managed.json | 3 + .../uri-service-solr-8/conf/admin-extra.html | 31 ++ .../uri-service-solr-8/conf/elevate.xml | 36 ++ .../conf/mapping-ISOLatin1Accent.txt | 246 +++++++++++ .../uri-service-solr-8/conf/protwords.txt | 21 + .../uri-service-solr-8/conf/schema.xml | 398 ++++++++++++++++++ .../uri-service-solr-8/conf/scripts.conf | 24 ++ .../uri-service-solr-8/conf/solrconfig.xml | 318 ++++++++++++++ .../uri-service-solr-8/conf/spellings.txt | 2 + .../uri-service-solr-8/conf/stopwords.txt | 58 +++ .../uri-service-solr-8/conf/stopwords_en.txt | 58 +++ .../uri-service-solr-8/conf/synonyms.txt | 31 ++ .../uri-service-solr-8/conf/xslt/example.xsl | 132 ++++++ .../conf/xslt/example_atom.xsl | 67 +++ .../conf/xslt/example_rss.xsl | 66 +++ .../uri-service-solr-8/conf/xslt/luke.xsl | 337 +++++++++++++++ docker/solr/start.sh | 15 - lib/tasks/hyacinth/ci.rake | 21 +- lib/tasks/hyacinth/development.rake | 14 +- lib/tasks/hyacinth/docker.rake | 36 +- lib/tasks/hyacinth/setup.rake | 200 +++++++++ spec/models/digital_object/base_spec.rb | 3 +- 66 files changed, 5826 insertions(+), 256 deletions(-) create mode 100644 docker/fedora/setup-and-start.sh create mode 100644 docker/solr/setup-and-start.sh create mode 100644 docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/_rest_managed.json create mode 100644 docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/admin-extra.html create mode 100644 docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/elevate.xml create mode 100644 docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/mapping-ISOLatin1Accent.txt create mode 100644 docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/protwords.txt create mode 100644 docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/schema.xml create mode 100644 docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/scripts.conf create mode 100644 docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/solrconfig.xml create mode 100644 docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/spellings.txt create mode 100644 docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/stopwords.txt create mode 100644 docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/stopwords_en.txt create mode 100644 docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/synonyms.txt create mode 100644 docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/xslt/example.xsl create mode 100644 docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/xslt/example_atom.xsl create mode 100644 docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/xslt/example_rss.xsl create mode 100644 docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/xslt/luke.xsl create mode 100644 docker/solr/solr_cores/hyacinth-solr-8/conf/_rest_managed.json create mode 100644 docker/solr/solr_cores/hyacinth-solr-8/conf/admin-extra.html create mode 100644 docker/solr/solr_cores/hyacinth-solr-8/conf/elevate.xml create mode 100644 docker/solr/solr_cores/hyacinth-solr-8/conf/mapping-ISOLatin1Accent.txt create mode 100644 docker/solr/solr_cores/hyacinth-solr-8/conf/protwords.txt create mode 100644 docker/solr/solr_cores/hyacinth-solr-8/conf/schema.xml create mode 100644 docker/solr/solr_cores/hyacinth-solr-8/conf/scripts.conf create mode 100644 docker/solr/solr_cores/hyacinth-solr-8/conf/solrconfig.xml create mode 100644 docker/solr/solr_cores/hyacinth-solr-8/conf/spellings.txt create mode 100644 docker/solr/solr_cores/hyacinth-solr-8/conf/stopwords.txt create mode 100644 docker/solr/solr_cores/hyacinth-solr-8/conf/stopwords_en.txt create mode 100644 docker/solr/solr_cores/hyacinth-solr-8/conf/synonyms.txt create mode 100644 docker/solr/solr_cores/hyacinth-solr-8/conf/xslt/example.xsl create mode 100644 docker/solr/solr_cores/hyacinth-solr-8/conf/xslt/example_atom.xsl create mode 100644 docker/solr/solr_cores/hyacinth-solr-8/conf/xslt/example_rss.xsl create mode 100644 docker/solr/solr_cores/hyacinth-solr-8/conf/xslt/luke.xsl create mode 100644 docker/solr/solr_cores/uri-service-solr-8/conf/_rest_managed.json create mode 100644 docker/solr/solr_cores/uri-service-solr-8/conf/admin-extra.html create mode 100644 docker/solr/solr_cores/uri-service-solr-8/conf/elevate.xml create mode 100644 docker/solr/solr_cores/uri-service-solr-8/conf/mapping-ISOLatin1Accent.txt create mode 100644 docker/solr/solr_cores/uri-service-solr-8/conf/protwords.txt create mode 100644 docker/solr/solr_cores/uri-service-solr-8/conf/schema.xml create mode 100644 docker/solr/solr_cores/uri-service-solr-8/conf/scripts.conf create mode 100644 docker/solr/solr_cores/uri-service-solr-8/conf/solrconfig.xml create mode 100644 docker/solr/solr_cores/uri-service-solr-8/conf/spellings.txt create mode 100644 docker/solr/solr_cores/uri-service-solr-8/conf/stopwords.txt create mode 100644 docker/solr/solr_cores/uri-service-solr-8/conf/stopwords_en.txt create mode 100644 docker/solr/solr_cores/uri-service-solr-8/conf/synonyms.txt create mode 100644 docker/solr/solr_cores/uri-service-solr-8/conf/xslt/example.xsl create mode 100644 docker/solr/solr_cores/uri-service-solr-8/conf/xslt/example_atom.xsl create mode 100644 docker/solr/solr_cores/uri-service-solr-8/conf/xslt/example_rss.xsl create mode 100644 docker/solr/solr_cores/uri-service-solr-8/conf/xslt/luke.xsl delete mode 100644 docker/solr/start.sh diff --git a/.ruby-version b/.ruby-version index 7213b446a..a04abec91 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.6.10 +2.6.10 diff --git a/Gemfile b/Gemfile index 397febd08..50ad19562 100644 --- a/Gemfile +++ b/Gemfile @@ -98,9 +98,11 @@ gem 'nokogiri', '~> 1.10.10' # can't update to 1.11 because our server version # For authentication gem 'devise', '>= 3.4.1' +gem 'childprocess', '~> 2.0' # CUL Fedora Dependencies and Content Models -gem 'cul_hydra', '~> 1.5.0' +gem 'cul_hydra', '~> 1.8.0' +# gem 'cul_hydra', path: '../cul_hydra' gem 'rubydora', git: 'https://github.com/elohanlon/rubydora', branch: 'datastream_dissemination_with_headers' # gem 'cul_hydra', path: '../cul_hydra' # Temporarily use specific commit because new version of gem hasn't been released yet. Latest is 1.1.3. diff --git a/Gemfile.lock b/Gemfile.lock index 3becf9bda..932ff8d23 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -114,7 +114,7 @@ GEM sass (>= 3.3.4) builder (3.2.4) byebug (9.0.6) - cancancan (1.12.0) + cancancan (3.5.0) capistrano (3.5.0) airbrussh (>= 1.0.0) capistrano-harrow @@ -142,7 +142,8 @@ GEM regexp_parser (~> 1.5) xpath (~> 3.2) charlock_holmes (0.7.6) - childprocess (4.1.0) + childprocess (2.0.0) + rake (< 13.0) chosen-rails (1.5.2) coffee-rails (>= 3.2) railties (>= 3.0) @@ -158,14 +159,13 @@ GEM concurrent-ruby (1.1.7) connection_pool (2.2.1) crass (1.0.6) - cul_hydra (1.5.0) - active-fedora (~> 7.0) + cul_hydra (1.8.0) + active-fedora (>= 7.3.1) active-triples (~> 0.2.2) active_fedora_finders (>= 0.5.0) active_fedora_relsint (~> 0.4) - autoprefixer-rails (<= 6.1.1) blacklight - cancancan (~> 1.12.0) + bootstrap-sass (~> 3.3.7) cul_image_props httpclient hydra-head (~> 7) @@ -174,7 +174,8 @@ GEM rake (<= 11.3) rdf (>= 1.1.5) rubydora (~> 2.0.0) - sparql (= 1.1.4) + sparql + sprockets (~> 3.0) thread cul_image_props (0.3.6) nokogiri @@ -195,8 +196,8 @@ GEM ebnf (0.3.9) rdf (~> 1.1) sxp (~> 0.1, >= 0.1.3) - edtf (3.0.4) - activesupport (>= 3.0, < 6.0) + edtf (3.1.1) + activesupport (>= 3.0, < 8.0) encryptor (1.3.0) equivalent-xml (0.6.0) nokogiri (>= 1.4.3) @@ -241,7 +242,7 @@ GEM rails (>= 3.2.6) i18n (0.9.5) concurrent-ruby (~> 1.0) - iso-639 (0.2.8) + iso-639 (0.3.6) jaro_winkler (1.5.1) jbuilder (1.5.3) activesupport (>= 3.0.0) @@ -588,10 +589,11 @@ DEPENDENCIES capistrano-rvm (~> 0.1) capybara (~> 3.32) charlock_holmes + childprocess (~> 2.0) chosen-rails coderay coffee-rails - cul_hydra (~> 1.5.0) + cul_hydra (~> 1.8.0) devise (>= 3.4.1) diffy (~> 3.1) equivalent-xml diff --git a/Rakefile b/Rakefile index debcd8ab8..ddc2d2956 100644 --- a/Rakefile +++ b/Rakefile @@ -4,6 +4,8 @@ # Un-comment this for full stack traces in Rake tasks # Rake.application.options.trace = true +Rake.application.options.trace = true + require File.expand_path('../config/application', __FILE__) Hyacinth::Application.load_tasks diff --git a/app/models/project.rb b/app/models/project.rb index 9b6568bcb..89ea30e92 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -35,15 +35,29 @@ def create_associated_fedora_object! pid = next_pid concept = Concept.new(pid: pid) @fedora_object = concept + puts "Creating Fedora object with pid: #{@fedora_object.pid}" self.pid = @fedora_object.pid end def update_fedora_object! + puts 'got here 1' fedora_object.datastreams["DC"].dc_identifier = [pid] + puts 'got here 2' fedora_object.datastreams["DC"].dc_type = 'Project' + puts 'got here 3' fedora_object.datastreams["DC"].dc_title = display_label + puts 'got here 4' fedora_object.label = Hyacinth::Utils::StringUtils.escape_four_byte_utf8_characters_as_html_entities(display_label) - fedora_object.save(update_index: false) + puts 'got here 5' + begin + fedora_object.save(update_index: false) + rescue => e + puts "Problem during fobj save: #{e.message}" + puts "Problem during fobj save: #{e.backtrace}" + # raise e + end + puts 'got here 6' + fedora_object end def mark_fedora_object_as_deleted! @@ -69,6 +83,7 @@ def asset_directory end def ensure_that_title_fields_are_enabled_and_required + puts 'got here too 1' changes_require_save = false # For all DigitalObjectTypes that contain ANY enabled dynamic fields, ensure that the title fields are always enabled (and that title_non_sort_portion is always required) diff --git a/config/environments/development.rb b/config/environments/development.rb index 200e67b84..37eec4d8f 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,7 +1,7 @@ Hyacinth::Application.configure do # Settings specified here will take precedence over those in config/application.rb. - config.log_level = :error + config.log_level = :debug # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb index 59385cdf3..56ddc8da8 100644 --- a/config/initializers/backtrace_silencers.rb +++ b/config/initializers/backtrace_silencers.rb @@ -4,4 +4,4 @@ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! +Rails.backtrace_cleaner.remove_silencers! diff --git a/db/migrate/20161130002750_create_core_objects.rb b/db/migrate/20161130002750_create_core_objects.rb index 2cc07ef41..e52477a7e 100644 --- a/db/migrate/20161130002750_create_core_objects.rb +++ b/db/migrate/20161130002750_create_core_objects.rb @@ -1,198 +1,5 @@ class CreateCoreObjects < ActiveRecord::Migration def change - - # If there are no DigitalObjectTypes the system, run the setup code below. - # This conditional is here to accommodate existing Hyacinth installations - # that ran seeds.rb before the code below was removed from there and put - # into this migration instead. - if DigitalObjectType.count == 0 - # Create default PidGenerator - puts 'Creating default PidGenerator...' - PidGenerator.create!(namespace: HYACINTH['default_pid_generator_namespace']) - - puts 'Creating default DigitalObjectTypes...' - # Create DigitalObjectTypes - DigitalObjectType.create!(string_key: 'item', display_label: 'Item', sort_order: 0) - DigitalObjectType.create!(string_key: 'group', display_label: 'Group', sort_order: 1) - DigitalObjectType.create!(string_key: 'asset', display_label: 'Asset', sort_order: 2) - DigitalObjectType.create!(string_key: 'file_system', display_label: 'FileSystem', sort_order: 3) - - # Create default user accounts - puts 'Creating default user accounts...' - YAML.load_file('config/default_user_accounts.yml').each {|service_user_entry, service_user_info| - User.create!( - :email => service_user_info['email'], - :password => service_user_info['password'], - :password_confirmation => service_user_info['password'], - :first_name => service_user_info['first_name'], - :last_name => service_user_info['last_name'], - :is_admin => service_user_info['is_admin'] - ) - } - - puts 'Creating default XmlDatastream...' - # Create XmlDatastreams - XmlDatastream.create(string_key: 'descMetadata', display_label: 'descMetadata', - xml_translation: { - "element" => "mods:mods", - "attrs" => { - "xmlns:xlink" => "http://www.w3.org/1999/xlink", - "version" => "3.5", - "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance", - "xmlns:mods" => "http://www.loc.gov/mods/v3", - "xsi:schemaLocation" => "http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-5.xsd" - }, - "content" => [ - { - "yield" => "title" - }, - { - "yield" => "name" - }, - { - "element" => "mods:originInfo" - } - ] - }.to_json - ) - - # Create DynamicFieldGroupCategories - puts 'Creating default DynamicFieldGroupCategories...' - dfc_descriptive_metadata = DynamicFieldGroupCategory.create!(display_label: 'Descriptive Metadata') - dfc_identifiers = DynamicFieldGroupCategory.create!(display_label: 'Identifiers') - dfc_physical_information = DynamicFieldGroupCategory.create!(display_label: 'Physical Information') - dfc_location_and_holdings = DynamicFieldGroupCategory.create!(display_label: 'Location and Holdings') - dfc_subject_data = DynamicFieldGroupCategory.create!(display_label: 'Subject Data') - dfc_geographic_data = DynamicFieldGroupCategory.create!(display_label: 'Geographic Data') - dfc_notes = DynamicFieldGroupCategory.create!(display_label: 'Notes') - dfc_digitization = DynamicFieldGroupCategory.create!(display_label: 'Digitization') - dfc_contextual_data = DynamicFieldGroupCategory.create!(display_label: 'Contextual Data') - dfc_record_info = DynamicFieldGroupCategory.create!(display_label: 'Record Information') - dfc_other = DynamicFieldGroupCategory.create!(display_label: 'Other') - dfc_asset_data = DynamicFieldGroupCategory.create!(display_label: 'Asset Data') - - puts 'Creating default DynamicFieldGroups, DynamicFields and controlled vocabularies...' - # Create core DynamicFieldGroups and DynamicFields - title = DynamicFieldGroup.create!(string_key: 'title', display_label: 'Title', dynamic_field_group_category: dfc_descriptive_metadata, is_repeatable: false, - dynamic_fields: [ - DynamicField.new(string_key: 'title_non_sort_portion', display_label: 'Non-Sort Portion', dynamic_field_type: DynamicField::Type::STRING), - DynamicField.new(string_key: 'title_sort_portion', display_label: 'Sort Portion', dynamic_field_type: DynamicField::Type::STRING, is_keyword_searchable: true, is_searchable_title_field: true) - ], - xml_translation: { - "element" => "mods:titleInfo", - "content" => [ - { - "element" => "mods:nonSort", - "content" => "{{title_non_sort_portion}}" - }, - { - "element" => "mods:title", - "content" => "{{title_sort_portion}}" - } - ] - }.to_json - ) - - # Create various controlled vocabularies if they don't already exist - { - 'collection' => 'Collection', - 'form' => 'Form', - 'genre' => 'Genre', - 'language' => 'Language', - 'location' => 'Location', - 'name' => 'Name', - 'name_role' => 'Name Role', - 'subject_geographic' => 'Subject Geographic', - 'subject_name' => 'Subject Name', - 'subject_temporal' => 'Subject Temporal', - 'subject_title' => 'Subject Title', - 'subject_topic' => 'Subject Topic' - }.each do |string_key, display_label| - if UriService.client.find_vocabulary(string_key).nil? - @controlled_vocabulary = ControlledVocabulary.new - @controlled_vocabulary.string_key = string_key - @controlled_vocabulary.display_label = display_label - @controlled_vocabulary.save - end - end - - #collection - collection = DynamicFieldGroup.create!(string_key: 'collection', display_label: 'Collection', dynamic_field_group_category: dfc_descriptive_metadata, - dynamic_fields: [ - DynamicField.new(string_key: 'collection_term', display_label: 'Value', dynamic_field_type: DynamicField::Type::CONTROLLED_TERM, controlled_vocabulary_string_key: 'collection', is_facet_field: true, is_single_field_searchable: true, standalone_field_label: 'Collection'), - #DynamicField.new(string_key: 'collection_preferred_label', display_label: 'Preferred Label', dynamic_field_type: DynamicField::Type::STRING), - ] - ) - - #form - form = DynamicFieldGroup.create!(string_key: 'form', display_label: 'Form', dynamic_field_group_category: dfc_physical_information, is_repeatable: true, - dynamic_fields: [ - DynamicField.new(string_key: 'form_term', display_label: 'Value', dynamic_field_type: DynamicField::Type::CONTROLLED_TERM, controlled_vocabulary_string_key: 'form', is_facet_field: true, standalone_field_label: 'Format'), - #DynamicField.new(string_key: 'form_preferred_label', display_label: 'Preferred Label', dynamic_field_type: DynamicField::Type::STRING), - ] - ) - - #location - location = DynamicFieldGroup.create!(string_key: 'location', display_label: 'Location', dynamic_field_group_category: dfc_location_and_holdings, is_repeatable: true, - dynamic_fields: [ - DynamicField.new(string_key: 'location_term', display_label: 'Value', dynamic_field_type: DynamicField::Type::CONTROLLED_TERM, controlled_vocabulary_string_key: 'location', is_facet_field: true, standalone_field_label: 'Location'), - #DynamicField.new(string_key: 'location_preferred_label', display_label: 'Preferred Label', dynamic_field_type: DynamicField::Type::STRING), - ] - ) - - #name - name = DynamicFieldGroup.create!(string_key: 'name', display_label: 'Name', dynamic_field_group_category: dfc_descriptive_metadata, is_repeatable: true, - dynamic_fields: [ - DynamicField.new(string_key: 'name_term', display_label: 'Value', dynamic_field_type: DynamicField::Type::CONTROLLED_TERM, controlled_vocabulary_string_key: 'name', is_facet_field: true, standalone_field_label: 'Name'), - #DynamicField.new(string_key: 'name_preferred_label', display_label: 'Preferred Label', dynamic_field_type: DynamicField::Type::STRING), - ], - xml_translation: { - "element" => "mods:name", - "attrs" => { - "valueUri" => "{{name_term.uri}}" - }, - "content" => [ - { - "element" => "mods:namePart", - "content" => "{{name_term.value}}" - }, - { - "yield" => "name_role" - } - ] - }.to_json - ) - # --> Child DynamicFieldGroups for name - DynamicFieldGroup.create!(string_key: 'name_role', display_label: 'Role', is_repeatable: true, parent_dynamic_field_group: name, - dynamic_fields: [ - DynamicField.new(string_key: 'name_role_term', display_label: 'Value', dynamic_field_type: DynamicField::Type::CONTROLLED_TERM, controlled_vocabulary_string_key: 'name_role') - ], - xml_translation: { - "element" => "mods:role", - "content" => [ - { - "element" => "mods:roleTerm", - "attrs" => { - "valueUri" => "{{name_role_term.uri}}" - }, - "content" => "{{name_role_term.value}}" - } - ] - }.to_json - ) - end - - if DigitalObjectType.find_by(string_key: 'publish_target').nil? - puts 'Creating default publish targets...' - DigitalObjectType.create!(string_key: 'publish_target', display_label: 'Publish Target', sort_order: 4) - publish_targets_project = Project.create!(string_key: 'publish_targets', display_label: 'Publish Targets', pid_generator: PidGenerator.default_pid_generator) - - # Enable title field for publish targets - dot_publish_target = DigitalObjectType.find_by(string_key: 'publish_target') - # Enable title fields for Items, Groups and Assets - (DynamicFieldGroup.find_by(string_key: 'title').dynamic_fields).each do |dynamic_field| - publish_targets_project.enabled_dynamic_fields << EnabledDynamicField.new(dynamic_field: dynamic_field, digital_object_type: dot_publish_target) - end - end + # This no longer does anything. The logic here has been moved into a rake task. end end diff --git a/docker/fedora/Dockerfile b/docker/fedora/Dockerfile index 1ce4ff5b7..fbeb338bf 100644 --- a/docker/fedora/Dockerfile +++ b/docker/fedora/Dockerfile @@ -12,12 +12,9 @@ ENV FEDORA_HOME /opt/fedora ENV CATALINA_HOME /opt/fedora/tomcat ENV PATH $CATALINA_HOME/bin:$PATH -RUN curl -L https://github.com/fcrepo3/fcrepo/releases/download/v3.8.1/fcrepo-installer-3.8.1.jar -o /opt/fcrepo-installer.jar +WORKDIR /opt COPY ./install.properties /opt/install.properties -RUN java -jar /opt/fcrepo-installer.jar /opt/install.properties +COPY ./setup-and-start.sh /opt/setup-and-start.sh -EXPOSE 8080 -WORKDIR $FEDORA_HOME - -CMD ["catalina.sh", "run"] +CMD /bin/bash ./setup-and-start.sh diff --git a/docker/fedora/setup-and-start.sh b/docker/fedora/setup-and-start.sh new file mode 100644 index 000000000..8680ab7c3 --- /dev/null +++ b/docker/fedora/setup-and-start.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# Set up fedora installation if it doesn't already exist. The conditional checks ensure that this +# only runs if the volume is re-created. + +if [ ! -f /opt/fcrepo-installer.jar ]; then + echo 'Downloading installer...' + curl -L https://github.com/fcrepo3/fcrepo/releases/download/v3.8.1/fcrepo-installer-3.8.1.jar -o /opt/fcrepo-installer.jar + echo 'Running installer jar...' + java -jar /opt/fcrepo-installer.jar /opt/install.properties + echo 'Done running installer jar...' +fi + +/opt/fedora/tomcat/bin/catalina.sh run diff --git a/docker/solr/Dockerfile b/docker/solr/Dockerfile index 3887f43e1..34659bcbc 100644 --- a/docker/solr/Dockerfile +++ b/docker/solr/Dockerfile @@ -1,21 +1,16 @@ -FROM solr:6.3.0 +FROM solr:8.11.2 WORKDIR /data -# Set up template cores in image +COPY ./setup-and-start.sh . -COPY ./start.sh . - -COPY --chown=solr:solr './solr_cores/hyacinth-solr-6-3' /template-cores/hyacinth +COPY --chown=solr:solr './solr_cores/hyacinth-solr-8' /template-cores/hyacinth RUN echo 'name=hyacinth' > /template-cores/hyacinth/core.properties -COPY --chown=solr:solr './solr_cores/hyacinth-hydra-solr-6-3' /template-cores/hyacinth_hydra +COPY --chown=solr:solr './solr_cores/hyacinth-hydra-solr-8' /template-cores/hyacinth_hydra RUN echo 'name=hyacinth_hydra' > /template-cores/hyacinth_hydra/core.properties -COPY --chown=solr:solr './solr_cores/uri-service-solr-6-3' /template-cores/uri_service +COPY --chown=solr:solr './solr_cores/uri-service-solr-8' /template-cores/uri_service RUN echo 'name=uri_service' > /template-cores/uri_service/core.properties -# When image runs, the command below will copy template cores to final location (on mounted docker -# volume) if they don't already exist, and then will start solr. - -CMD /bin/bash ./start.sh +CMD /bin/bash ./setup-and-start.sh diff --git a/docker/solr/setup-and-start.sh b/docker/solr/setup-and-start.sh new file mode 100644 index 000000000..119ca7fdd --- /dev/null +++ b/docker/solr/setup-and-start.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Set up symlinks if they don't exist. The conditional checks ensure that this only runs if +# the volume is re-created. +[ ! -L /var/solr/hyacinth ] && ln -s /data/hyacinth /var/solr/hyacinth +[ ! -L /var/solr/hyacinth_hydra ] && ln -s /data/hyacinth_hydra /var/solr/hyacinth_hydra +[ ! -L /var/solr/uri_service ] && ln -s /data/uri_service /var/solr/uri_service + +# Copy cores if they don't exist. The conditional checks ensure that this only runs if +# the volume is re-created. +#[ ! -d /data/hyacinth ] && cp -pr /template-cores/hyacinth /data/hyacinth +#[ ! -d /data/hyacinth_hydra ] && cp -pr /template-cores/hyacinth_hydra /data/hyacinth_hydra +#[ ! -d /data/uri_service ] && cp -pr /template-cores/uri_service /data/uri_service + +precreate-core hyacinth /template-cores/hyacinth +precreate-core hyacinth_hydra /template-cores/hyacinth_hydra +precreate-core uri_service /template-cores/uri_service + +# Start solr + +solr-foreground diff --git a/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/_rest_managed.json b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/_rest_managed.json new file mode 100644 index 000000000..e7ada3f6e --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/_rest_managed.json @@ -0,0 +1,3 @@ +{ + "initArgs":{}, + "managedList":[]} \ No newline at end of file diff --git a/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/admin-extra.html b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/admin-extra.html new file mode 100644 index 000000000..aa739da86 --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/admin-extra.html @@ -0,0 +1,31 @@ + + + diff --git a/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/elevate.xml b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/elevate.xml new file mode 100644 index 000000000..7630ebe20 --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/elevate.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + diff --git a/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/mapping-ISOLatin1Accent.txt b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/mapping-ISOLatin1Accent.txt new file mode 100644 index 000000000..725b62c45 --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/mapping-ISOLatin1Accent.txt @@ -0,0 +1,246 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Syntax: +# "source" => "target" +# "source".length() > 0 (source cannot be empty.) +# "target".length() >= 0 (target can be empty.) + +# example: +# "??" => "A" +# "\u00C0" => "A" +# "\u00C0" => "\u0041" +# "??" => "ss" +# "\t" => " " +# "\n" => "" + +# ?? => A +"\u00C0" => "A" + +# ?? => A +"\u00C1" => "A" + +# ?? => A +"\u00C2" => "A" + +# ?? => A +"\u00C3" => "A" + +# ?? => A +"\u00C4" => "A" + +# ?? => A +"\u00C5" => "A" + +# ?? => AE +"\u00C6" => "AE" + +# ?? => C +"\u00C7" => "C" + +# ?? => E +"\u00C8" => "E" + +# ?? => E +"\u00C9" => "E" + +# ?? => E +"\u00CA" => "E" + +# ?? => E +"\u00CB" => "E" + +# ?? => I +"\u00CC" => "I" + +# ?? => I +"\u00CD" => "I" + +# ?? => I +"\u00CE" => "I" + +# ?? => I +"\u00CF" => "I" + +# ?? => IJ +"\u0132" => "IJ" + +# ?? => D +"\u00D0" => "D" + +# ?? => N +"\u00D1" => "N" + +# ?? => O +"\u00D2" => "O" + +# ?? => O +"\u00D3" => "O" + +# ?? => O +"\u00D4" => "O" + +# ?? => O +"\u00D5" => "O" + +# ?? => O +"\u00D6" => "O" + +# ?? => O +"\u00D8" => "O" + +# ?? => OE +"\u0152" => "OE" + +# ?? +"\u00DE" => "TH" + +# ?? => U +"\u00D9" => "U" + +# ?? => U +"\u00DA" => "U" + +# ?? => U +"\u00DB" => "U" + +# ?? => U +"\u00DC" => "U" + +# ?? => Y +"\u00DD" => "Y" + +# ?? => Y +"\u0178" => "Y" + +# ?? => a +"\u00E0" => "a" + +# ?? => a +"\u00E1" => "a" + +# ?? => a +"\u00E2" => "a" + +# ?? => a +"\u00E3" => "a" + +# ?? => a +"\u00E4" => "a" + +# ?? => a +"\u00E5" => "a" + +# ?? => ae +"\u00E6" => "ae" + +# ?? => c +"\u00E7" => "c" + +# ?? => e +"\u00E8" => "e" + +# ?? => e +"\u00E9" => "e" + +# ?? => e +"\u00EA" => "e" + +# ?? => e +"\u00EB" => "e" + +# ?? => i +"\u00EC" => "i" + +# ?? => i +"\u00ED" => "i" + +# ?? => i +"\u00EE" => "i" + +# ?? => i +"\u00EF" => "i" + +# ?? => ij +"\u0133" => "ij" + +# ?? => d +"\u00F0" => "d" + +# ?? => n +"\u00F1" => "n" + +# ?? => o +"\u00F2" => "o" + +# ?? => o +"\u00F3" => "o" + +# ?? => o +"\u00F4" => "o" + +# ?? => o +"\u00F5" => "o" + +# ?? => o +"\u00F6" => "o" + +# ?? => o +"\u00F8" => "o" + +# ?? => oe +"\u0153" => "oe" + +# ?? => ss +"\u00DF" => "ss" + +# ?? => th +"\u00FE" => "th" + +# ?? => u +"\u00F9" => "u" + +# ?? => u +"\u00FA" => "u" + +# ?? => u +"\u00FB" => "u" + +# ?? => u +"\u00FC" => "u" + +# ?? => y +"\u00FD" => "y" + +# ?? => y +"\u00FF" => "y" + +# ??? => ff +"\uFB00" => "ff" + +# ??? => fi +"\uFB01" => "fi" + +# ??? => fl +"\uFB02" => "fl" + +# ??? => ffi +"\uFB03" => "ffi" + +# ??? => ffl +"\uFB04" => "ffl" + +# ??? => ft +"\uFB05" => "ft" + +# ??? => st +"\uFB06" => "st" diff --git a/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/protwords.txt b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/protwords.txt new file mode 100644 index 000000000..1dfc0abec --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/protwords.txt @@ -0,0 +1,21 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# Use a protected word file to protect against the stemmer reducing two +# unrelated words to the same base word. + +# Some non-words that normally won't be encountered, +# just to test that they won't be stemmed. +dontstems +zwhacky + diff --git a/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/schema.xml b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/schema.xml new file mode 100644 index 000000000..ff628cce2 --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/schema.xml @@ -0,0 +1,398 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/scripts.conf b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/scripts.conf new file mode 100644 index 000000000..f58b262ae --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/scripts.conf @@ -0,0 +1,24 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +user= +solr_hostname=localhost +solr_port=8983 +rsyncd_port=18983 +data_dir= +webapp_name=solr +master_host= +master_data_dir= +master_status_dir= diff --git a/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/solrconfig.xml b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/solrconfig.xml new file mode 100644 index 000000000..52c5653fa --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/solrconfig.xml @@ -0,0 +1,318 @@ + + + + + + + + 8.2.0 + + + + + + + + + + + + + + ${solr.data.dir:} + + + + + + + + + + *:* + + + + + + + edismax + explicit + 10 + + *:* + 2<-1 5<-2 6<90% + + text + + + + + + + + spellcheck + + + + + + + all + * + 1 + {!term f=id v=$id} + + + + + + + textSpell + + + + + + default + spell + ./spell + true + + + author + author_spell + ./spell_author + 0.7 + true + + + subject + subject_spell + ./spell_subject + 0.7 + true + + + title + title_spell + ./spell_title + 0.7 + true + + + + + + + + + + + + + + + mySuggester + AnalyzingInfixLookupFactory + suggester_infix_dir + false + text + false + false + suggest + + + + + + true + 5 + mySuggester + + + suggest + + + + diff --git a/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/spellings.txt b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/spellings.txt new file mode 100644 index 000000000..162a044d5 --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/spellings.txt @@ -0,0 +1,2 @@ +pizza +history diff --git a/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/stopwords.txt b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/stopwords.txt new file mode 100644 index 000000000..b5824da32 --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/stopwords.txt @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# a couple of test stopwords to test that the words are really being +# configured from this file: +stopworda +stopwordb + +#Standard english stop words taken from Lucene's StopAnalyzer +a +an +and +are +as +at +be +but +by +for +if +in +into +is +it +no +not +of +on +or +s +such +t +that +the +their +then +there +these +they +this +to +was +will +with + diff --git a/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/stopwords_en.txt b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/stopwords_en.txt new file mode 100644 index 000000000..b5824da32 --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/stopwords_en.txt @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# a couple of test stopwords to test that the words are really being +# configured from this file: +stopworda +stopwordb + +#Standard english stop words taken from Lucene's StopAnalyzer +a +an +and +are +as +at +be +but +by +for +if +in +into +is +it +no +not +of +on +or +s +such +t +that +the +their +then +there +these +they +this +to +was +will +with + diff --git a/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/synonyms.txt b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/synonyms.txt new file mode 100644 index 000000000..b0e31cb7e --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/synonyms.txt @@ -0,0 +1,31 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +#some test synonym mappings unlikely to appear in real input text +aaa => aaaa +bbb => bbbb1 bbbb2 +ccc => cccc1,cccc2 +a\=>a => b\=>b +a\,a => b\,b +fooaaa,baraaa,bazaaa + +# Some synonym groups specific to this example +GB,gib,gigabyte,gigabytes +MB,mib,megabyte,megabytes +Television, Televisions, TV, TVs +#notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming +#after us won't split it into two words. + +# Synonym mappings can be used for spelling correction too +pixima => pixma + diff --git a/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/xslt/example.xsl b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/xslt/example.xsl new file mode 100644 index 000000000..6832a1d4c --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/xslt/example.xsl @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + <xsl:value-of select="$title"/> + + + +

+
+ This has been formatted by the sample "example.xsl" transform - + use your own XSLT to get a nicer page +
+ + + +
+ + + +
+ + + + +
+
+
+ + + + + + + + + + + + + + javascript:toggle("");? +
+ + exp + + + + + +
+ + +
+ + + + + + + +
    + +
  • +
    +
+ + +
+ + + + + + + + + + + + + + + + + + + + +
diff --git a/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/xslt/example_atom.xsl b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/xslt/example_atom.xsl new file mode 100644 index 000000000..e1c7d5a2a --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/xslt/example_atom.xsl @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + Example Solr Atom 1.0 Feed + + This has been formatted by the sample "example_atom.xsl" transform - + use your own XSLT to get a nicer Atom feed. + + + Apache Solr + solr-user@lucene.apache.org + + + + + + tag:localhost,2007:example + + + + + + + + + <xsl:value-of select="str[@name='name']"/> + + tag:localhost,2007: + + + + + + diff --git a/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/xslt/example_rss.xsl b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/xslt/example_rss.xsl new file mode 100644 index 000000000..3e09e654d --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/xslt/example_rss.xsl @@ -0,0 +1,66 @@ + + + + + + + + + + + + + Example Solr RSS 2.0 Feed + http://localhost:8983/solr + + This has been formatted by the sample "example_rss.xsl" transform - + use your own XSLT to get a nicer RSS feed. + + en-us + http://localhost:8983/solr + + + + + + + + + + + <xsl:value-of select="str[@name='name']"/> + + http://localhost:8983/solr/select?q=id: + + + + + + + http://localhost:8983/solr/select?q=id: + + + + diff --git a/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/xslt/luke.xsl b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/xslt/luke.xsl new file mode 100644 index 000000000..6e9a064d7 --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-hydra-solr-8/conf/xslt/luke.xsl @@ -0,0 +1,337 @@ + + + + + + + + + Solr Luke Request Handler Response + + + + + + + + + <xsl:value-of select="$title"/> + + + + + +

+ +

+
+ +
+ +

Index Statistics

+ +
+ +

Field Statistics

+ + + +

Document statistics

+ + + + +
+ + + + + +
+ +
+ + +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + +
+

+ +

+ +
+ +
+
+
+ + +
+ + 50 + 800 + 160 + blue + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ background-color: ; width: px; height: px; +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
  • + +
  • +
    +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + + + + + + + + + + + + + + + + +
diff --git a/docker/solr/solr_cores/hyacinth-solr-8/conf/_rest_managed.json b/docker/solr/solr_cores/hyacinth-solr-8/conf/_rest_managed.json new file mode 100644 index 000000000..e7ada3f6e --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-solr-8/conf/_rest_managed.json @@ -0,0 +1,3 @@ +{ + "initArgs":{}, + "managedList":[]} \ No newline at end of file diff --git a/docker/solr/solr_cores/hyacinth-solr-8/conf/admin-extra.html b/docker/solr/solr_cores/hyacinth-solr-8/conf/admin-extra.html new file mode 100644 index 000000000..aa739da86 --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-solr-8/conf/admin-extra.html @@ -0,0 +1,31 @@ + + + diff --git a/docker/solr/solr_cores/hyacinth-solr-8/conf/elevate.xml b/docker/solr/solr_cores/hyacinth-solr-8/conf/elevate.xml new file mode 100644 index 000000000..7630ebe20 --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-solr-8/conf/elevate.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + diff --git a/docker/solr/solr_cores/hyacinth-solr-8/conf/mapping-ISOLatin1Accent.txt b/docker/solr/solr_cores/hyacinth-solr-8/conf/mapping-ISOLatin1Accent.txt new file mode 100644 index 000000000..725b62c45 --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-solr-8/conf/mapping-ISOLatin1Accent.txt @@ -0,0 +1,246 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Syntax: +# "source" => "target" +# "source".length() > 0 (source cannot be empty.) +# "target".length() >= 0 (target can be empty.) + +# example: +# "??" => "A" +# "\u00C0" => "A" +# "\u00C0" => "\u0041" +# "??" => "ss" +# "\t" => " " +# "\n" => "" + +# ?? => A +"\u00C0" => "A" + +# ?? => A +"\u00C1" => "A" + +# ?? => A +"\u00C2" => "A" + +# ?? => A +"\u00C3" => "A" + +# ?? => A +"\u00C4" => "A" + +# ?? => A +"\u00C5" => "A" + +# ?? => AE +"\u00C6" => "AE" + +# ?? => C +"\u00C7" => "C" + +# ?? => E +"\u00C8" => "E" + +# ?? => E +"\u00C9" => "E" + +# ?? => E +"\u00CA" => "E" + +# ?? => E +"\u00CB" => "E" + +# ?? => I +"\u00CC" => "I" + +# ?? => I +"\u00CD" => "I" + +# ?? => I +"\u00CE" => "I" + +# ?? => I +"\u00CF" => "I" + +# ?? => IJ +"\u0132" => "IJ" + +# ?? => D +"\u00D0" => "D" + +# ?? => N +"\u00D1" => "N" + +# ?? => O +"\u00D2" => "O" + +# ?? => O +"\u00D3" => "O" + +# ?? => O +"\u00D4" => "O" + +# ?? => O +"\u00D5" => "O" + +# ?? => O +"\u00D6" => "O" + +# ?? => O +"\u00D8" => "O" + +# ?? => OE +"\u0152" => "OE" + +# ?? +"\u00DE" => "TH" + +# ?? => U +"\u00D9" => "U" + +# ?? => U +"\u00DA" => "U" + +# ?? => U +"\u00DB" => "U" + +# ?? => U +"\u00DC" => "U" + +# ?? => Y +"\u00DD" => "Y" + +# ?? => Y +"\u0178" => "Y" + +# ?? => a +"\u00E0" => "a" + +# ?? => a +"\u00E1" => "a" + +# ?? => a +"\u00E2" => "a" + +# ?? => a +"\u00E3" => "a" + +# ?? => a +"\u00E4" => "a" + +# ?? => a +"\u00E5" => "a" + +# ?? => ae +"\u00E6" => "ae" + +# ?? => c +"\u00E7" => "c" + +# ?? => e +"\u00E8" => "e" + +# ?? => e +"\u00E9" => "e" + +# ?? => e +"\u00EA" => "e" + +# ?? => e +"\u00EB" => "e" + +# ?? => i +"\u00EC" => "i" + +# ?? => i +"\u00ED" => "i" + +# ?? => i +"\u00EE" => "i" + +# ?? => i +"\u00EF" => "i" + +# ?? => ij +"\u0133" => "ij" + +# ?? => d +"\u00F0" => "d" + +# ?? => n +"\u00F1" => "n" + +# ?? => o +"\u00F2" => "o" + +# ?? => o +"\u00F3" => "o" + +# ?? => o +"\u00F4" => "o" + +# ?? => o +"\u00F5" => "o" + +# ?? => o +"\u00F6" => "o" + +# ?? => o +"\u00F8" => "o" + +# ?? => oe +"\u0153" => "oe" + +# ?? => ss +"\u00DF" => "ss" + +# ?? => th +"\u00FE" => "th" + +# ?? => u +"\u00F9" => "u" + +# ?? => u +"\u00FA" => "u" + +# ?? => u +"\u00FB" => "u" + +# ?? => u +"\u00FC" => "u" + +# ?? => y +"\u00FD" => "y" + +# ?? => y +"\u00FF" => "y" + +# ??? => ff +"\uFB00" => "ff" + +# ??? => fi +"\uFB01" => "fi" + +# ??? => fl +"\uFB02" => "fl" + +# ??? => ffi +"\uFB03" => "ffi" + +# ??? => ffl +"\uFB04" => "ffl" + +# ??? => ft +"\uFB05" => "ft" + +# ??? => st +"\uFB06" => "st" diff --git a/docker/solr/solr_cores/hyacinth-solr-8/conf/protwords.txt b/docker/solr/solr_cores/hyacinth-solr-8/conf/protwords.txt new file mode 100644 index 000000000..1dfc0abec --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-solr-8/conf/protwords.txt @@ -0,0 +1,21 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# Use a protected word file to protect against the stemmer reducing two +# unrelated words to the same base word. + +# Some non-words that normally won't be encountered, +# just to test that they won't be stemmed. +dontstems +zwhacky + diff --git a/docker/solr/solr_cores/hyacinth-solr-8/conf/schema.xml b/docker/solr/solr_cores/hyacinth-solr-8/conf/schema.xml new file mode 100644 index 000000000..9a448ed76 --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-solr-8/conf/schema.xml @@ -0,0 +1,398 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docker/solr/solr_cores/hyacinth-solr-8/conf/scripts.conf b/docker/solr/solr_cores/hyacinth-solr-8/conf/scripts.conf new file mode 100644 index 000000000..f58b262ae --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-solr-8/conf/scripts.conf @@ -0,0 +1,24 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +user= +solr_hostname=localhost +solr_port=8983 +rsyncd_port=18983 +data_dir= +webapp_name=solr +master_host= +master_data_dir= +master_status_dir= diff --git a/docker/solr/solr_cores/hyacinth-solr-8/conf/solrconfig.xml b/docker/solr/solr_cores/hyacinth-solr-8/conf/solrconfig.xml new file mode 100644 index 000000000..52c5653fa --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-solr-8/conf/solrconfig.xml @@ -0,0 +1,318 @@ + + + + + + + + 8.2.0 + + + + + + + + + + + + + + ${solr.data.dir:} + + + + + + + + + + *:* + + + + + + + edismax + explicit + 10 + + *:* + 2<-1 5<-2 6<90% + + text + + + + + + + + spellcheck + + + + + + + all + * + 1 + {!term f=id v=$id} + + + + + + + textSpell + + + + + + default + spell + ./spell + true + + + author + author_spell + ./spell_author + 0.7 + true + + + subject + subject_spell + ./spell_subject + 0.7 + true + + + title + title_spell + ./spell_title + 0.7 + true + + + + + + + + + + + + + + + mySuggester + AnalyzingInfixLookupFactory + suggester_infix_dir + false + text + false + false + suggest + + + + + + true + 5 + mySuggester + + + suggest + + + + diff --git a/docker/solr/solr_cores/hyacinth-solr-8/conf/spellings.txt b/docker/solr/solr_cores/hyacinth-solr-8/conf/spellings.txt new file mode 100644 index 000000000..162a044d5 --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-solr-8/conf/spellings.txt @@ -0,0 +1,2 @@ +pizza +history diff --git a/docker/solr/solr_cores/hyacinth-solr-8/conf/stopwords.txt b/docker/solr/solr_cores/hyacinth-solr-8/conf/stopwords.txt new file mode 100644 index 000000000..b5824da32 --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-solr-8/conf/stopwords.txt @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# a couple of test stopwords to test that the words are really being +# configured from this file: +stopworda +stopwordb + +#Standard english stop words taken from Lucene's StopAnalyzer +a +an +and +are +as +at +be +but +by +for +if +in +into +is +it +no +not +of +on +or +s +such +t +that +the +their +then +there +these +they +this +to +was +will +with + diff --git a/docker/solr/solr_cores/hyacinth-solr-8/conf/stopwords_en.txt b/docker/solr/solr_cores/hyacinth-solr-8/conf/stopwords_en.txt new file mode 100644 index 000000000..b5824da32 --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-solr-8/conf/stopwords_en.txt @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# a couple of test stopwords to test that the words are really being +# configured from this file: +stopworda +stopwordb + +#Standard english stop words taken from Lucene's StopAnalyzer +a +an +and +are +as +at +be +but +by +for +if +in +into +is +it +no +not +of +on +or +s +such +t +that +the +their +then +there +these +they +this +to +was +will +with + diff --git a/docker/solr/solr_cores/hyacinth-solr-8/conf/synonyms.txt b/docker/solr/solr_cores/hyacinth-solr-8/conf/synonyms.txt new file mode 100644 index 000000000..b0e31cb7e --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-solr-8/conf/synonyms.txt @@ -0,0 +1,31 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +#some test synonym mappings unlikely to appear in real input text +aaa => aaaa +bbb => bbbb1 bbbb2 +ccc => cccc1,cccc2 +a\=>a => b\=>b +a\,a => b\,b +fooaaa,baraaa,bazaaa + +# Some synonym groups specific to this example +GB,gib,gigabyte,gigabytes +MB,mib,megabyte,megabytes +Television, Televisions, TV, TVs +#notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming +#after us won't split it into two words. + +# Synonym mappings can be used for spelling correction too +pixima => pixma + diff --git a/docker/solr/solr_cores/hyacinth-solr-8/conf/xslt/example.xsl b/docker/solr/solr_cores/hyacinth-solr-8/conf/xslt/example.xsl new file mode 100644 index 000000000..6832a1d4c --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-solr-8/conf/xslt/example.xsl @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + <xsl:value-of select="$title"/> + + + +

+
+ This has been formatted by the sample "example.xsl" transform - + use your own XSLT to get a nicer page +
+ + + +
+ + + +
+ + + + +
+
+
+ + + + + + + + + + + + + + javascript:toggle("");? +
+ + exp + + + + + +
+ + +
+ + + + + + + +
    + +
  • +
    +
+ + +
+ + + + + + + + + + + + + + + + + + + + +
diff --git a/docker/solr/solr_cores/hyacinth-solr-8/conf/xslt/example_atom.xsl b/docker/solr/solr_cores/hyacinth-solr-8/conf/xslt/example_atom.xsl new file mode 100644 index 000000000..e1c7d5a2a --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-solr-8/conf/xslt/example_atom.xsl @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + Example Solr Atom 1.0 Feed + + This has been formatted by the sample "example_atom.xsl" transform - + use your own XSLT to get a nicer Atom feed. + + + Apache Solr + solr-user@lucene.apache.org + + + + + + tag:localhost,2007:example + + + + + + + + + <xsl:value-of select="str[@name='name']"/> + + tag:localhost,2007: + + + + + + diff --git a/docker/solr/solr_cores/hyacinth-solr-8/conf/xslt/example_rss.xsl b/docker/solr/solr_cores/hyacinth-solr-8/conf/xslt/example_rss.xsl new file mode 100644 index 000000000..3e09e654d --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-solr-8/conf/xslt/example_rss.xsl @@ -0,0 +1,66 @@ + + + + + + + + + + + + + Example Solr RSS 2.0 Feed + http://localhost:8983/solr + + This has been formatted by the sample "example_rss.xsl" transform - + use your own XSLT to get a nicer RSS feed. + + en-us + http://localhost:8983/solr + + + + + + + + + + + <xsl:value-of select="str[@name='name']"/> + + http://localhost:8983/solr/select?q=id: + + + + + + + http://localhost:8983/solr/select?q=id: + + + + diff --git a/docker/solr/solr_cores/hyacinth-solr-8/conf/xslt/luke.xsl b/docker/solr/solr_cores/hyacinth-solr-8/conf/xslt/luke.xsl new file mode 100644 index 000000000..6e9a064d7 --- /dev/null +++ b/docker/solr/solr_cores/hyacinth-solr-8/conf/xslt/luke.xsl @@ -0,0 +1,337 @@ + + + + + + + + + Solr Luke Request Handler Response + + + + + + + + + <xsl:value-of select="$title"/> + + + + + +

+ +

+
+ +
+ +

Index Statistics

+ +
+ +

Field Statistics

+ + + +

Document statistics

+ + + + + + + + + + +
+ +
+ + +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + +
+

+ +

+ +
+ +
+
+
+ + +
+ + 50 + 800 + 160 + blue + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ background-color: ; width: px; height: px; +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
  • + +
  • +
    +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + + + + + + + + + + + + + + + + + diff --git a/docker/solr/solr_cores/uri-service-solr-8/conf/_rest_managed.json b/docker/solr/solr_cores/uri-service-solr-8/conf/_rest_managed.json new file mode 100644 index 000000000..e7ada3f6e --- /dev/null +++ b/docker/solr/solr_cores/uri-service-solr-8/conf/_rest_managed.json @@ -0,0 +1,3 @@ +{ + "initArgs":{}, + "managedList":[]} \ No newline at end of file diff --git a/docker/solr/solr_cores/uri-service-solr-8/conf/admin-extra.html b/docker/solr/solr_cores/uri-service-solr-8/conf/admin-extra.html new file mode 100644 index 000000000..aa739da86 --- /dev/null +++ b/docker/solr/solr_cores/uri-service-solr-8/conf/admin-extra.html @@ -0,0 +1,31 @@ + + + diff --git a/docker/solr/solr_cores/uri-service-solr-8/conf/elevate.xml b/docker/solr/solr_cores/uri-service-solr-8/conf/elevate.xml new file mode 100644 index 000000000..7630ebe20 --- /dev/null +++ b/docker/solr/solr_cores/uri-service-solr-8/conf/elevate.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + diff --git a/docker/solr/solr_cores/uri-service-solr-8/conf/mapping-ISOLatin1Accent.txt b/docker/solr/solr_cores/uri-service-solr-8/conf/mapping-ISOLatin1Accent.txt new file mode 100644 index 000000000..725b62c45 --- /dev/null +++ b/docker/solr/solr_cores/uri-service-solr-8/conf/mapping-ISOLatin1Accent.txt @@ -0,0 +1,246 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Syntax: +# "source" => "target" +# "source".length() > 0 (source cannot be empty.) +# "target".length() >= 0 (target can be empty.) + +# example: +# "??" => "A" +# "\u00C0" => "A" +# "\u00C0" => "\u0041" +# "??" => "ss" +# "\t" => " " +# "\n" => "" + +# ?? => A +"\u00C0" => "A" + +# ?? => A +"\u00C1" => "A" + +# ?? => A +"\u00C2" => "A" + +# ?? => A +"\u00C3" => "A" + +# ?? => A +"\u00C4" => "A" + +# ?? => A +"\u00C5" => "A" + +# ?? => AE +"\u00C6" => "AE" + +# ?? => C +"\u00C7" => "C" + +# ?? => E +"\u00C8" => "E" + +# ?? => E +"\u00C9" => "E" + +# ?? => E +"\u00CA" => "E" + +# ?? => E +"\u00CB" => "E" + +# ?? => I +"\u00CC" => "I" + +# ?? => I +"\u00CD" => "I" + +# ?? => I +"\u00CE" => "I" + +# ?? => I +"\u00CF" => "I" + +# ?? => IJ +"\u0132" => "IJ" + +# ?? => D +"\u00D0" => "D" + +# ?? => N +"\u00D1" => "N" + +# ?? => O +"\u00D2" => "O" + +# ?? => O +"\u00D3" => "O" + +# ?? => O +"\u00D4" => "O" + +# ?? => O +"\u00D5" => "O" + +# ?? => O +"\u00D6" => "O" + +# ?? => O +"\u00D8" => "O" + +# ?? => OE +"\u0152" => "OE" + +# ?? +"\u00DE" => "TH" + +# ?? => U +"\u00D9" => "U" + +# ?? => U +"\u00DA" => "U" + +# ?? => U +"\u00DB" => "U" + +# ?? => U +"\u00DC" => "U" + +# ?? => Y +"\u00DD" => "Y" + +# ?? => Y +"\u0178" => "Y" + +# ?? => a +"\u00E0" => "a" + +# ?? => a +"\u00E1" => "a" + +# ?? => a +"\u00E2" => "a" + +# ?? => a +"\u00E3" => "a" + +# ?? => a +"\u00E4" => "a" + +# ?? => a +"\u00E5" => "a" + +# ?? => ae +"\u00E6" => "ae" + +# ?? => c +"\u00E7" => "c" + +# ?? => e +"\u00E8" => "e" + +# ?? => e +"\u00E9" => "e" + +# ?? => e +"\u00EA" => "e" + +# ?? => e +"\u00EB" => "e" + +# ?? => i +"\u00EC" => "i" + +# ?? => i +"\u00ED" => "i" + +# ?? => i +"\u00EE" => "i" + +# ?? => i +"\u00EF" => "i" + +# ?? => ij +"\u0133" => "ij" + +# ?? => d +"\u00F0" => "d" + +# ?? => n +"\u00F1" => "n" + +# ?? => o +"\u00F2" => "o" + +# ?? => o +"\u00F3" => "o" + +# ?? => o +"\u00F4" => "o" + +# ?? => o +"\u00F5" => "o" + +# ?? => o +"\u00F6" => "o" + +# ?? => o +"\u00F8" => "o" + +# ?? => oe +"\u0153" => "oe" + +# ?? => ss +"\u00DF" => "ss" + +# ?? => th +"\u00FE" => "th" + +# ?? => u +"\u00F9" => "u" + +# ?? => u +"\u00FA" => "u" + +# ?? => u +"\u00FB" => "u" + +# ?? => u +"\u00FC" => "u" + +# ?? => y +"\u00FD" => "y" + +# ?? => y +"\u00FF" => "y" + +# ??? => ff +"\uFB00" => "ff" + +# ??? => fi +"\uFB01" => "fi" + +# ??? => fl +"\uFB02" => "fl" + +# ??? => ffi +"\uFB03" => "ffi" + +# ??? => ffl +"\uFB04" => "ffl" + +# ??? => ft +"\uFB05" => "ft" + +# ??? => st +"\uFB06" => "st" diff --git a/docker/solr/solr_cores/uri-service-solr-8/conf/protwords.txt b/docker/solr/solr_cores/uri-service-solr-8/conf/protwords.txt new file mode 100644 index 000000000..1dfc0abec --- /dev/null +++ b/docker/solr/solr_cores/uri-service-solr-8/conf/protwords.txt @@ -0,0 +1,21 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# Use a protected word file to protect against the stemmer reducing two +# unrelated words to the same base word. + +# Some non-words that normally won't be encountered, +# just to test that they won't be stemmed. +dontstems +zwhacky + diff --git a/docker/solr/solr_cores/uri-service-solr-8/conf/schema.xml b/docker/solr/solr_cores/uri-service-solr-8/conf/schema.xml new file mode 100644 index 000000000..7f8dcf711 --- /dev/null +++ b/docker/solr/solr_cores/uri-service-solr-8/conf/schema.xml @@ -0,0 +1,398 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docker/solr/solr_cores/uri-service-solr-8/conf/scripts.conf b/docker/solr/solr_cores/uri-service-solr-8/conf/scripts.conf new file mode 100644 index 000000000..f58b262ae --- /dev/null +++ b/docker/solr/solr_cores/uri-service-solr-8/conf/scripts.conf @@ -0,0 +1,24 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +user= +solr_hostname=localhost +solr_port=8983 +rsyncd_port=18983 +data_dir= +webapp_name=solr +master_host= +master_data_dir= +master_status_dir= diff --git a/docker/solr/solr_cores/uri-service-solr-8/conf/solrconfig.xml b/docker/solr/solr_cores/uri-service-solr-8/conf/solrconfig.xml new file mode 100644 index 000000000..52c5653fa --- /dev/null +++ b/docker/solr/solr_cores/uri-service-solr-8/conf/solrconfig.xml @@ -0,0 +1,318 @@ + + + + + + + + 8.2.0 + + + + + + + + + + + + + + ${solr.data.dir:} + + + + + + + + + + *:* + + + + + + + edismax + explicit + 10 + + *:* + 2<-1 5<-2 6<90% + + text + + + + + + + + spellcheck + + + + + + + all + * + 1 + {!term f=id v=$id} + + + + + + + textSpell + + + + + + default + spell + ./spell + true + + + author + author_spell + ./spell_author + 0.7 + true + + + subject + subject_spell + ./spell_subject + 0.7 + true + + + title + title_spell + ./spell_title + 0.7 + true + + + + + + + + + + + + + + + mySuggester + AnalyzingInfixLookupFactory + suggester_infix_dir + false + text + false + false + suggest + + + + + + true + 5 + mySuggester + + + suggest + + + + diff --git a/docker/solr/solr_cores/uri-service-solr-8/conf/spellings.txt b/docker/solr/solr_cores/uri-service-solr-8/conf/spellings.txt new file mode 100644 index 000000000..162a044d5 --- /dev/null +++ b/docker/solr/solr_cores/uri-service-solr-8/conf/spellings.txt @@ -0,0 +1,2 @@ +pizza +history diff --git a/docker/solr/solr_cores/uri-service-solr-8/conf/stopwords.txt b/docker/solr/solr_cores/uri-service-solr-8/conf/stopwords.txt new file mode 100644 index 000000000..b5824da32 --- /dev/null +++ b/docker/solr/solr_cores/uri-service-solr-8/conf/stopwords.txt @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# a couple of test stopwords to test that the words are really being +# configured from this file: +stopworda +stopwordb + +#Standard english stop words taken from Lucene's StopAnalyzer +a +an +and +are +as +at +be +but +by +for +if +in +into +is +it +no +not +of +on +or +s +such +t +that +the +their +then +there +these +they +this +to +was +will +with + diff --git a/docker/solr/solr_cores/uri-service-solr-8/conf/stopwords_en.txt b/docker/solr/solr_cores/uri-service-solr-8/conf/stopwords_en.txt new file mode 100644 index 000000000..b5824da32 --- /dev/null +++ b/docker/solr/solr_cores/uri-service-solr-8/conf/stopwords_en.txt @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# a couple of test stopwords to test that the words are really being +# configured from this file: +stopworda +stopwordb + +#Standard english stop words taken from Lucene's StopAnalyzer +a +an +and +are +as +at +be +but +by +for +if +in +into +is +it +no +not +of +on +or +s +such +t +that +the +their +then +there +these +they +this +to +was +will +with + diff --git a/docker/solr/solr_cores/uri-service-solr-8/conf/synonyms.txt b/docker/solr/solr_cores/uri-service-solr-8/conf/synonyms.txt new file mode 100644 index 000000000..b0e31cb7e --- /dev/null +++ b/docker/solr/solr_cores/uri-service-solr-8/conf/synonyms.txt @@ -0,0 +1,31 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +#some test synonym mappings unlikely to appear in real input text +aaa => aaaa +bbb => bbbb1 bbbb2 +ccc => cccc1,cccc2 +a\=>a => b\=>b +a\,a => b\,b +fooaaa,baraaa,bazaaa + +# Some synonym groups specific to this example +GB,gib,gigabyte,gigabytes +MB,mib,megabyte,megabytes +Television, Televisions, TV, TVs +#notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming +#after us won't split it into two words. + +# Synonym mappings can be used for spelling correction too +pixima => pixma + diff --git a/docker/solr/solr_cores/uri-service-solr-8/conf/xslt/example.xsl b/docker/solr/solr_cores/uri-service-solr-8/conf/xslt/example.xsl new file mode 100644 index 000000000..6832a1d4c --- /dev/null +++ b/docker/solr/solr_cores/uri-service-solr-8/conf/xslt/example.xsl @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + <xsl:value-of select="$title"/> + + + +

+
+ This has been formatted by the sample "example.xsl" transform - + use your own XSLT to get a nicer page +
+ + + +
+ + + +
+ + + + +
+
+
+ + + + + + + + + + + + + + javascript:toggle("");? +
+ + exp + + + + + +
+ + +
+ + + + + + + +
    + +
  • +
    +
+ + +
+ + + + + + + + + + + + + + + + + + + + +
diff --git a/docker/solr/solr_cores/uri-service-solr-8/conf/xslt/example_atom.xsl b/docker/solr/solr_cores/uri-service-solr-8/conf/xslt/example_atom.xsl new file mode 100644 index 000000000..e1c7d5a2a --- /dev/null +++ b/docker/solr/solr_cores/uri-service-solr-8/conf/xslt/example_atom.xsl @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + Example Solr Atom 1.0 Feed + + This has been formatted by the sample "example_atom.xsl" transform - + use your own XSLT to get a nicer Atom feed. + + + Apache Solr + solr-user@lucene.apache.org + + + + + + tag:localhost,2007:example + + + + + + + + + <xsl:value-of select="str[@name='name']"/> + + tag:localhost,2007: + + + + + + diff --git a/docker/solr/solr_cores/uri-service-solr-8/conf/xslt/example_rss.xsl b/docker/solr/solr_cores/uri-service-solr-8/conf/xslt/example_rss.xsl new file mode 100644 index 000000000..3e09e654d --- /dev/null +++ b/docker/solr/solr_cores/uri-service-solr-8/conf/xslt/example_rss.xsl @@ -0,0 +1,66 @@ + + + + + + + + + + + + + Example Solr RSS 2.0 Feed + http://localhost:8983/solr + + This has been formatted by the sample "example_rss.xsl" transform - + use your own XSLT to get a nicer RSS feed. + + en-us + http://localhost:8983/solr + + + + + + + + + + + <xsl:value-of select="str[@name='name']"/> + + http://localhost:8983/solr/select?q=id: + + + + + + + http://localhost:8983/solr/select?q=id: + + + + diff --git a/docker/solr/solr_cores/uri-service-solr-8/conf/xslt/luke.xsl b/docker/solr/solr_cores/uri-service-solr-8/conf/xslt/luke.xsl new file mode 100644 index 000000000..6e9a064d7 --- /dev/null +++ b/docker/solr/solr_cores/uri-service-solr-8/conf/xslt/luke.xsl @@ -0,0 +1,337 @@ + + + + + + + + + Solr Luke Request Handler Response + + + + + + + + + <xsl:value-of select="$title"/> + + + + + +

+ +

+
+ +
+ +

Index Statistics

+ +
+ +

Field Statistics

+ + + +

Document statistics

+ + + + + + + + + + +
+ +
+ + +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + +
+

+ +

+ +
+ +
+
+
+ + +
+ + 50 + 800 + 160 + blue + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ background-color: ; width: px; height: px; +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
  • + +
  • +
    +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + + + + + + + + + + + + + + + + + diff --git a/docker/solr/start.sh b/docker/solr/start.sh deleted file mode 100644 index 20f315b30..000000000 --- a/docker/solr/start.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# Set up symlinks if they don't exist. Runs whenever the container image is rebuilt. -[ ! -L /opt/solr/server/solr/hyacinth ] && ln -s /data/hyacinth /opt/solr/server/solr/hyacinth -[ ! -L /opt/solr/server/solr/hyacinth_hydra ] && ln -s /data/hyacinth_hydra /opt/solr/server/solr/hyacinth_hydra -[ ! -L /opt/solr/server/solr/uri_service ] && ln -s /data/uri_service /opt/solr/server/solr/uri_service - -# Copy cores if they don't exist. Runs whenever the volume is re-created. -[ ! -d /data/hyacinth ] && cp -pr /template-cores/hyacinth /data/hyacinth -[ ! -d /data/hyacinth_hydra ] && cp -pr /template-cores/hyacinth_hydra /data/hyacinth_hydra -[ ! -d /data/uri_service ] && cp -pr /template-cores/uri_service /data/uri_service - -# Start solr - -solr-foreground diff --git a/lib/tasks/hyacinth/ci.rake b/lib/tasks/hyacinth/ci.rake index ba866e5e4..445fbbc5c 100644 --- a/lib/tasks/hyacinth/ci.rake +++ b/lib/tasks/hyacinth/ci.rake @@ -41,21 +41,35 @@ if ['development', 'test'].include?(Rails.env) docker_wrapper do duration = Benchmark.realtime do + puts 'got here 0' Rake::Task["hyacinth:fedora:reload_cmodels"].invoke + puts 'got here 1' Rake::Task["uri_service:db:drop_tables_and_clear_solr"].invoke + puts 'got here 2' Rake::Task["hyacinth:test:clear_default_asset_home_content"].invoke + puts 'got here 3' Rake::Task["hyacinth:test:clear_default_service_copy_home_content"].invoke + puts 'got here 4' Rake::Task["hyacinth:test:clear_access_copy_content"].invoke + puts 'got here 5' Rake::Task["uri_service:db:setup"].invoke + puts 'got here 6' Rake::Task["db:drop"].invoke + puts 'got here 7' Rake::Task["db:create"].invoke + puts 'got here 8' Rake::Task["db:migrate"].invoke - Rake::Task["db:seed"].invoke + puts 'got here 9' + Rake::Task["hyacinth:setup:core_records"].invoke + puts 'got here 10' ENV['CLEAR'] = 'true' # Set ENV variable for reindex task Rake::Task['hyacinth:index:reindex'].invoke + puts 'got here 11' ENV['CLEAR'] = nil # Clear ENV variable because we're done with it Rake::Task['hyacinth:test:setup_test_project'].invoke + puts 'got here 12' Rake::Task['hyacinth:rspec'].invoke + puts 'got here 13' end puts "\nCI run finished in #{duration} seconds." end @@ -77,6 +91,11 @@ if ['development', 'test'].include?(Rails.env) Rake::Task['hyacinth:docker:start'].invoke begin block.call + rescue => e + puts "-> This is the exception: #{e.inspect}" + puts "-> Exception class is: #{e.class.name}" + puts "-> Exception message is: #{e.message}" + puts "-> Exception backtrace is: #{e.backtrace.inspect}" ensure Rake::Task['hyacinth:docker:stop'].invoke end diff --git a/lib/tasks/hyacinth/development.rake b/lib/tasks/hyacinth/development.rake index 6a4714430..8e54b58fb 100644 --- a/lib/tasks/hyacinth/development.rake +++ b/lib/tasks/hyacinth/development.rake @@ -1,31 +1,31 @@ namespace :hyacinth do namespace :development do - + task :reset => :environment do - + unless Rails.env == 'development' puts 'This task is only meant for the development environment.' next end - + ENV['RAILS_ENV'] = Rails.env - + # Clear UriService data and set up required tables Rake::Task["uri_service:db:drop_tables_and_clear_solr"].invoke Rake::Task["uri_service:db:setup"].invoke - + # Reset Hyacinth stuff Rake::Task["db:drop"].invoke Rake::Task["db:create"].invoke Rake::Task["db:migrate"].invoke - Rake::Task["db:seed"].invoke + Rake::Task["hyacinth:setup:core_records"].invoke ENV['CLEAR'] = 'true' # Set ENV variable for reindex task Rake::Task['hyacinth:index:reindex'].invoke ENV['CLEAR'] = nil # Clear ENV variable because we're done with it Rake::Task['hyacinth:test:setup_test_project'].invoke end - + end end diff --git a/lib/tasks/hyacinth/docker.rake b/lib/tasks/hyacinth/docker.rake index 6888acb9a..cb890e7a9 100644 --- a/lib/tasks/hyacinth/docker.rake +++ b/lib/tasks/hyacinth/docker.rake @@ -11,14 +11,39 @@ namespace :hyacinth do end def wait_for_solr_cores_to_load + puts 'Waiting for Solr to become available...' expected_port = docker_compose_config['services']['solr']['ports'][0].split(':')[0] Timeout.timeout(10, Timeout::Error, 'Timed out during solr startup check.') do loop do - sleep 0.25 - status_code = Net::HTTP.get_response(URI("http://localhost:#{expected_port}/solr/hyacinth/update?wt=json")).code - break if status_code != '503' - rescue EOFError, Errno::ECONNRESET - next + begin + sleep 0.25 + status_code = Net::HTTP.get_response(URI("http://localhost:#{expected_port}/solr/hyacinth/update?wt=json")).code + if status_code != '503' + puts 'Solr is available.' + break + end + rescue EOFError, Errno::ECONNRESET + next + end + end + end + end + + def wait_for_fedora_to_load + puts 'Waiting for Fedora to become available...' + expected_port = docker_compose_config['services']['fedora']['ports'][0].split(':')[0] + Timeout.timeout(30, Timeout::Error, 'Timed out during solr startup check.') do + loop do + begin + sleep 0.25 + status_code = Net::HTTP.get_response(URI("http://localhost:#{expected_port}/fedora/describe")).code + if status_code == '401' + puts 'Fedora is available.' + break + end + rescue EOFError, Errno::ECONNRESET + next + end end end end @@ -54,6 +79,7 @@ namespace :hyacinth do # hasn't changed since the last build. `docker compose -f #{docker_compose_file_path} up --build --detach --wait` wait_for_solr_cores_to_load + wait_for_fedora_to_load puts "\nStarted." end end diff --git a/lib/tasks/hyacinth/setup.rake b/lib/tasks/hyacinth/setup.rake index c2b4a4fee..e217bb6c6 100644 --- a/lib/tasks/hyacinth/setup.rake +++ b/lib/tasks/hyacinth/setup.rake @@ -27,6 +27,206 @@ namespace :hyacinth do end end + desc "Set up hyacinth core records (DigitalObjectType, User, XmlDatastream, etc.) " + task :core_records do + # If there are no DigitalObjectTypes the system, run the setup code below. + # This check is in place to ensure that this task is never run for an environment that + # already ran the core record setup (because running it twice would be bad!). + if DigitalObjectType.count == 0 + # Create default PidGenerator + puts 'Creating default PidGenerator...' + PidGenerator.create!(namespace: HYACINTH['default_pid_generator_namespace']) + + puts 'Creating default DigitalObjectTypes...' + # Create DigitalObjectTypes + DigitalObjectType.create!(string_key: 'item', display_label: 'Item', sort_order: 0) + DigitalObjectType.create!(string_key: 'group', display_label: 'Group', sort_order: 1) + DigitalObjectType.create!(string_key: 'asset', display_label: 'Asset', sort_order: 2) + DigitalObjectType.create!(string_key: 'file_system', display_label: 'FileSystem', sort_order: 3) + + # Create default user accounts + puts 'Creating default user accounts...' + YAML.load_file('config/default_user_accounts.yml').each {|service_user_entry, service_user_info| + User.create!( + :email => service_user_info['email'], + :password => service_user_info['password'], + :password_confirmation => service_user_info['password'], + :first_name => service_user_info['first_name'], + :last_name => service_user_info['last_name'], + :is_admin => service_user_info['is_admin'] + ) + } + + puts 'Creating default XmlDatastream...' + # Create XmlDatastreams + XmlDatastream.create(string_key: 'descMetadata', display_label: 'descMetadata', + xml_translation: { + "element" => "mods:mods", + "attrs" => { + "xmlns:xlink" => "http://www.w3.org/1999/xlink", + "version" => "3.5", + "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance", + "xmlns:mods" => "http://www.loc.gov/mods/v3", + "xsi:schemaLocation" => "http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-5.xsd" + }, + "content" => [ + { + "yield" => "title" + }, + { + "yield" => "name" + }, + { + "element" => "mods:originInfo" + } + ] + }.to_json + ) + + # Create DynamicFieldGroupCategories + puts 'Creating default DynamicFieldGroupCategories...' + dfc_descriptive_metadata = DynamicFieldGroupCategory.create!(display_label: 'Descriptive Metadata') + dfc_identifiers = DynamicFieldGroupCategory.create!(display_label: 'Identifiers') + dfc_physical_information = DynamicFieldGroupCategory.create!(display_label: 'Physical Information') + dfc_location_and_holdings = DynamicFieldGroupCategory.create!(display_label: 'Location and Holdings') + dfc_subject_data = DynamicFieldGroupCategory.create!(display_label: 'Subject Data') + dfc_geographic_data = DynamicFieldGroupCategory.create!(display_label: 'Geographic Data') + dfc_notes = DynamicFieldGroupCategory.create!(display_label: 'Notes') + dfc_digitization = DynamicFieldGroupCategory.create!(display_label: 'Digitization') + dfc_contextual_data = DynamicFieldGroupCategory.create!(display_label: 'Contextual Data') + dfc_record_info = DynamicFieldGroupCategory.create!(display_label: 'Record Information') + dfc_other = DynamicFieldGroupCategory.create!(display_label: 'Other') + dfc_asset_data = DynamicFieldGroupCategory.create!(display_label: 'Asset Data') + + puts 'Creating default DynamicFieldGroups, DynamicFields and controlled vocabularies...' + # Create core DynamicFieldGroups and DynamicFields + title = DynamicFieldGroup.create!(string_key: 'title', display_label: 'Title', dynamic_field_group_category: dfc_descriptive_metadata, is_repeatable: false, + dynamic_fields: [ + DynamicField.new(string_key: 'title_non_sort_portion', display_label: 'Non-Sort Portion', dynamic_field_type: DynamicField::Type::STRING), + DynamicField.new(string_key: 'title_sort_portion', display_label: 'Sort Portion', dynamic_field_type: DynamicField::Type::STRING, is_keyword_searchable: true, is_searchable_title_field: true) + ], + xml_translation: { + "element" => "mods:titleInfo", + "content" => [ + { + "element" => "mods:nonSort", + "content" => "{{title_non_sort_portion}}" + }, + { + "element" => "mods:title", + "content" => "{{title_sort_portion}}" + } + ] + }.to_json + ) + + # Create various controlled vocabularies if they don't already exist + { + 'collection' => 'Collection', + 'form' => 'Form', + 'genre' => 'Genre', + 'language' => 'Language', + 'location' => 'Location', + 'name' => 'Name', + 'name_role' => 'Name Role', + 'subject_geographic' => 'Subject Geographic', + 'subject_name' => 'Subject Name', + 'subject_temporal' => 'Subject Temporal', + 'subject_title' => 'Subject Title', + 'subject_topic' => 'Subject Topic' + }.each do |string_key, display_label| + if UriService.client.find_vocabulary(string_key).nil? + @controlled_vocabulary = ControlledVocabulary.new + @controlled_vocabulary.string_key = string_key + @controlled_vocabulary.display_label = display_label + @controlled_vocabulary.save + end + end + + #collection + collection = DynamicFieldGroup.create!(string_key: 'collection', display_label: 'Collection', dynamic_field_group_category: dfc_descriptive_metadata, + dynamic_fields: [ + DynamicField.new(string_key: 'collection_term', display_label: 'Value', dynamic_field_type: DynamicField::Type::CONTROLLED_TERM, controlled_vocabulary_string_key: 'collection', is_facet_field: true, is_single_field_searchable: true, standalone_field_label: 'Collection'), + #DynamicField.new(string_key: 'collection_preferred_label', display_label: 'Preferred Label', dynamic_field_type: DynamicField::Type::STRING), + ] + ) + + #form + form = DynamicFieldGroup.create!(string_key: 'form', display_label: 'Form', dynamic_field_group_category: dfc_physical_information, is_repeatable: true, + dynamic_fields: [ + DynamicField.new(string_key: 'form_term', display_label: 'Value', dynamic_field_type: DynamicField::Type::CONTROLLED_TERM, controlled_vocabulary_string_key: 'form', is_facet_field: true, standalone_field_label: 'Format'), + #DynamicField.new(string_key: 'form_preferred_label', display_label: 'Preferred Label', dynamic_field_type: DynamicField::Type::STRING), + ] + ) + + #location + location = DynamicFieldGroup.create!(string_key: 'location', display_label: 'Location', dynamic_field_group_category: dfc_location_and_holdings, is_repeatable: true, + dynamic_fields: [ + DynamicField.new(string_key: 'location_term', display_label: 'Value', dynamic_field_type: DynamicField::Type::CONTROLLED_TERM, controlled_vocabulary_string_key: 'location', is_facet_field: true, standalone_field_label: 'Location'), + #DynamicField.new(string_key: 'location_preferred_label', display_label: 'Preferred Label', dynamic_field_type: DynamicField::Type::STRING), + ] + ) + + #name + name = DynamicFieldGroup.create!(string_key: 'name', display_label: 'Name', dynamic_field_group_category: dfc_descriptive_metadata, is_repeatable: true, + dynamic_fields: [ + DynamicField.new(string_key: 'name_term', display_label: 'Value', dynamic_field_type: DynamicField::Type::CONTROLLED_TERM, controlled_vocabulary_string_key: 'name', is_facet_field: true, standalone_field_label: 'Name'), + #DynamicField.new(string_key: 'name_preferred_label', display_label: 'Preferred Label', dynamic_field_type: DynamicField::Type::STRING), + ], + xml_translation: { + "element" => "mods:name", + "attrs" => { + "valueUri" => "{{name_term.uri}}" + }, + "content" => [ + { + "element" => "mods:namePart", + "content" => "{{name_term.value}}" + }, + { + "yield" => "name_role" + } + ] + }.to_json + ) + # --> Child DynamicFieldGroups for name + DynamicFieldGroup.create!(string_key: 'name_role', display_label: 'Role', is_repeatable: true, parent_dynamic_field_group: name, + dynamic_fields: [ + DynamicField.new(string_key: 'name_role_term', display_label: 'Value', dynamic_field_type: DynamicField::Type::CONTROLLED_TERM, controlled_vocabulary_string_key: 'name_role') + ], + xml_translation: { + "element" => "mods:role", + "content" => [ + { + "element" => "mods:roleTerm", + "attrs" => { + "valueUri" => "{{name_role_term.uri}}" + }, + "content" => "{{name_role_term.value}}" + } + ] + }.to_json + ) + end + + if DigitalObjectType.find_by(string_key: 'publish_target').nil? + puts 'Creating default publish targets...' + DigitalObjectType.create!(string_key: 'publish_target', display_label: 'Publish Target', sort_order: 4) + puts '---> 1' + publish_targets_project = Project.new(string_key: 'publish_targets', display_label: 'Publish Targets', pid_generator: PidGenerator.default_pid_generator) + publish_targets_project.save + # puts '---> 2' + # # Enable title field for publish targets + # dot_publish_target = DigitalObjectType.find_by(string_key: 'publish_target') + # puts '---> 3' + # # Enable title fields for Items, Groups and Assets + # (DynamicFieldGroup.find_by(string_key: 'title').dynamic_fields).each do |dynamic_field| + # publish_targets_project.enabled_dynamic_fields << EnabledDynamicField.new(dynamic_field: dynamic_field, digital_object_type: dot_publish_target) + # end + puts '---> 4' + end + end + def generate_new_secrets_yml_content secrets_yml_content = {} ['development', 'test'].each do |env_name| diff --git a/spec/models/digital_object/base_spec.rb b/spec/models/digital_object/base_spec.rb index eec959958..c52c0b026 100644 --- a/spec/models/digital_object/base_spec.rb +++ b/spec/models/digital_object/base_spec.rb @@ -131,7 +131,8 @@ end context "raises an exception for prohibited temp term field data" do - # this controlled vocabulary and dynamic field groupis set up in the create_core_objects db migration + # These tests assume that these controlled vocabulary and dynamic field groups were + # already set up by the hyacinth:setup:core_records rake task. let(:controlled_vocabulary) { ControlledVocabulary.find_by(string_key: 'collection') } before do if controlled_vocabulary