Hyrax v2.0 ( branch: 2.0-stable )
Documentation for Versions:
  1. I’m on the form to create a new work and I click the Save button.
  2. The data is submitted to the controller for the correct work type. This controller was generated when you did bin/rails generate hyrax:work <type>. For example the app/controllers/hyrax/generic_works_controller.rb if you generated a work type of GenericWork.
  3. This generated controller includes Hyrax::WorksControllerBehavior, which defines the create method that is run when saving.
  4. The create method initializes the actor and calls create on it.
  5. The actor is a stack built of functions that take parts of the form data and act upon them. The actor is customizable in your local application with the default steps of the pipeline defined by Hyrax::DefaultMiddlewareStack’s build_stack method.
  6. When create is called, each frame of this stack is called, and passed a Hyrax::Environment object which contains the new work, the current user and the data from the HTML form.
  7. One of the frames in the stack is the Hyrax::Actors::ModelActor.rb. It calls the generated actor specific for the work type we’re making. In this case app/actors/hyrax/actors/generic_work_actor.rb. This generated actor extends Hyrax::Actors::BaseActor, which is responsible for persisting the object by calling the ActiveFedora::Base#save method.
  8. Another frame in the stack is the Hyrax::Actors::InitializeWorkflowActor. This actor creates a workflow entity proxy for the object. This proxy tracks where the work is in the workflow.
  9. If this object was deposited to an AdminSet that uses the default workflow, then the object is immediately available to be discovered in the search (given the searching user has appropriate on access controls)
  10. If this object was deposited to an AdminSet that uses the one-step mediated deposit workflow, then the object is marked as suppressed in solr and it’s not available for discovery. The approvers for the admin set were notified that they must take action to review this work.