Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to bulkrax 5.2 #1939

Merged
merged 12 commits into from
Apr 25, 2023
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ GEM
signet (~> 0.8)
typhoeus
builder (3.2.4)
bulkrax (5.1.0)
bulkrax (5.2.1)
bagit (~> 0.4)
coderay
iso8601 (~> 0.9.0)
Expand Down
26 changes: 25 additions & 1 deletion config/initializers/bulkrax.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

if ENV.fetch('HYKU_BULKRAX_ENABLED', 'true') == 'true'

Bulkrax.setup do |config|
# Add local parsers
# config.parsers += [
Expand Down Expand Up @@ -54,6 +53,31 @@
# e.g. to exclude date
# config.field_mappings["Bulkrax::OaiDcParser"]["date"] = { from: ["date"], excluded: true }

default_field_mapping = {
'parents' => { from: ['parents'], related_parents_field_mapping: true },
'children' => { from: ['children'], related_children_field_mapping: true }
}

config.field_mappings["Bulkrax::BagitParser"] = default_field_mapping.merge({
# add or remove custom mappings for this parser here
})

config.field_mappings["Bulkrax::CsvParser"] = default_field_mapping.merge({
# add or remove custom mappings for this parser here
})

config.field_mappings["Bulkrax::OaiDcParser"] = default_field_mapping.merge({
# add or remove custom mappings for this parser here
})

config.field_mappings["Bulkrax::OaiQualifiedDcParser"] = default_field_mapping.merge({
# add or remove custom mappings for this parser here
})

config.field_mappings["Bulkrax::XmlParser"] = default_field_mapping.merge({
# add or remove custom mappings for this parser here
})

# To duplicate a set of mappings from one parser to another
# config.field_mappings["Bulkrax::OaiOmekaParser"] = {}
# config.field_mappings["Bulkrax::OaiDcParser"].each {|key,value| config.field_mappings["Bulkrax::OaiOmekaParser"][key] = value }
Expand Down