-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I897 Bulkrax readiness for Hyku 6 and Hyrax 4 & 5 (#898)
* 🧹 relocates transactions from inititalizer file Issue: - #897 Co-Authored-By: LaRita Robinson <[email protected]> * 🧹 Add specs for container.rb, relocate files Co-Authored-By: LaRita Robinson <[email protected]> * 🧹 normalize magic strings into constants for referencing later Convert the create_with_bulk_behavior and update_with_bulk_behavior to a constant; that way we can reference it in IiifPrint and document the “magic” string. Co-Authored-By: LaRita Robinson <[email protected]> * 🧹 correct camel case to constant notation for easier referencing Co-Authored-By: LaRita Robinson <[email protected]> * 💄 rubocop fixes Co-Authored-By: LaRita Robinson <[email protected]> * Update app/factories/bulkrax/valkyrie_object_factory.rb * Update spec/bulkrax/transactions/container_spec.rb * 🧹 Move container & steps Match Hyrax convention by using bulkrax/transactions. * restructure org to run specs locally receiving error when trying to run the entire spec suite due to restructuring files but not moving the spec file. * 🚧 WIP: Consolidate HasMatchers with HasMappingExt Remove HasMappingExt and consolidate logic within HasMatchers. HasMatchers should handle both cases, when objects are ActiveFedora vs Valkyrie. * 🧹 Fix Specs & add Valkyrie Specs * 🧹 Fix Rubocop complaint * 🧹 Address Valkyrie's determination of multiple? * 🧹 Address permitted attributes In Valkyrie, we use the schema to identify the permitted attributes. All allowed attributes should be on the schema, so no additional attributes should be required. Also add a fallback for permitted attributes in case an ActiveFedora model class goes through the ValkyrieObjectFactory. This supports the case where we want to always force a Valkyrie resource to be created, regardless of the model name given. * 🧹 Update TODO comment Adjust TODO message because referring to a handler that doesn't exist anywhere is confusing. We may need to register steps for file sets once the behavior is implemented. --------- Co-authored-by: LaRita Robinson <[email protected]> Co-authored-by: Jeremy Friesen <[email protected]> Co-authored-by: LaRita Robinson <[email protected]>
- Loading branch information
1 parent
a2cca06
commit 837ab8a
Showing
12 changed files
with
201 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
require 'bulkrax/transactions/container' | ||
|
||
module Bulkrax | ||
## | ||
# This is a parent module for DRY Transaction classes handling Bulkrax | ||
# processes. Especially: transactions and steps for creating, updating, and | ||
# destroying PCDM Objects are located here. | ||
# | ||
# @since 2.4.0 | ||
# | ||
# @example | ||
# Bulkrax::Transaction::Container['transaction_name'].call(:input) | ||
# | ||
# @see https://dry-rb.org/gems/dry-transaction/ | ||
module Transactions | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# frozen_string_literal: true | ||
require 'dry/container' | ||
|
||
module Bulkrax | ||
module Transactions | ||
class Container | ||
extend Dry::Container::Mixin | ||
|
||
ADD_BULKRAX_FILES = 'add_bulkrax_files' | ||
CREATE_WITH_BULK_BEHAVIOR = 'create_with_bulk_behavior' | ||
CREATE_WITH_BULK_BEHAVIOR_STEPS = begin | ||
steps = Hyrax::Transactions::WorkCreate::DEFAULT_STEPS.dup | ||
steps[steps.index("work_resource.add_file_sets")] = "work_resource.#{Bulkrax::Transactions::Container::ADD_BULKRAX_FILES}" | ||
steps | ||
end.freeze | ||
UPDATE_WITH_BULK_BEHAVIOR = 'update_with_bulk_behavior' | ||
UPDATE_WITH_BULK_BEHAVIOR_STEPS = begin | ||
steps = Hyrax::Transactions::WorkUpdate::DEFAULT_STEPS.dup | ||
steps[steps.index("work_resource.add_file_sets")] = "work_resource.#{Bulkrax::Transactions::Container::ADD_BULKRAX_FILES}" | ||
steps | ||
end.freeze | ||
|
||
namespace "work_resource" do |ops| | ||
ops.register CREATE_WITH_BULK_BEHAVIOR do | ||
Hyrax::Transactions::WorkCreate.new(steps: CREATE_WITH_BULK_BEHAVIOR_STEPS) | ||
end | ||
|
||
ops.register UPDATE_WITH_BULK_BEHAVIOR do | ||
Hyrax::Transactions::WorkUpdate.new(steps: UPDATE_WITH_BULK_BEHAVIOR_STEPS) | ||
end | ||
|
||
# TODO: Need to register step for uploads handler? | ||
# ops.register "add_file_sets" do | ||
# Hyrax::Transactions::Steps::AddFileSets.new | ||
# end | ||
|
||
ops.register ADD_BULKRAX_FILES do | ||
Bulkrax::Transactions::Steps::AddFiles.new | ||
end | ||
end | ||
end | ||
end | ||
end | ||
Hyrax::Transactions::Container.merge(Bulkrax::Transactions::Container) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
class WorkResource < Hyrax::Work | ||
include Hyrax::Schema(:basic_metadata) | ||
include Hyrax::Schema(:work_resource) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
attributes: | ||
source_identifier: | ||
type: string | ||
multiple: false | ||
index_keys: | ||
- "source_identifier_sim" | ||
- "source_identifier_tesim" | ||
form: | ||
required: false | ||
primary: false | ||
multiple: false |
Oops, something went wrong.