Skip to content

Commit

Permalink
Create resources (#702)
Browse files Browse the repository at this point in the history
# Story

Creates remaining resources for existing models. (Conference item was
already created)

Refs

- #687
  • Loading branch information
laritakr authored Jul 23, 2024
2 parents 11c9798 + 96df5ba commit f564e5c
Show file tree
Hide file tree
Showing 56 changed files with 781 additions and 71 deletions.
40 changes: 18 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ GIT
aws-sdk-sqs (~> 1)
rails (>= 4.2)

GIT
remote: https://github.com/samvera-labs/hyku_knapsack.git
revision: c3826a8734999b771d3202fa34f299c66aab2ada
branch: required_for_knapsack_instances
specs:
hyku_knapsack (0.0.1)
rails (>= 5.2.0)
sentry-rails
sentry-ruby
sentry-sidekiq

GIT
remote: https://github.com/samvera-labs/hyrax-doi.git
revision: 9b7ab7f8054a14385b838de1118f55ad2e0f5da8
Expand Down Expand Up @@ -125,18 +136,6 @@ GIT
public_suffix (>= 2)
rack (>= 1.3.6)

GIT
remote: https://github.com/scientist-softserv/iiif_print.git
revision: 55ed8d31624d51db202c043d4010baf6fdb2b399
branch: temp-branch-for-adventist-knapsack
specs:
iiif_print (3.0.1)
blacklight_iiif_search (>= 1.0, < 3.0)
derivative-rodeo (~> 0.5)
hyrax (>= 2.5, < 6)
nokogiri (>= 1.13.2)
rdf-vocab (~> 3.0)

GIT
remote: https://github.com/scientist-softserv/willow_sword.git
revision: 38a0906647fae2020e8b0b08e296f85c457fcb34
Expand All @@ -157,15 +156,6 @@ GIT
nokogiri (~> 1.5)
omniauth (>= 1.2, < 3)

PATH
remote: .
specs:
hyku_knapsack (0.0.1)
rails (>= 5.2.0)
sentry-rails
sentry-ruby
sentry-sidekiq

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -741,6 +731,12 @@ GEM
json
iiif_manifest (1.3.1)
activesupport (>= 4)
iiif_print (3.0.1)
blacklight_iiif_search (>= 1.0, < 3.0)
derivative-rodeo (~> 0.5)
hyrax (>= 2.5, < 6)
nokogiri (>= 1.13.2)
rdf-vocab (~> 3.0)
iso-639 (0.3.6)
iso8601 (0.9.1)
jaro_winkler (1.5.6)
Expand Down Expand Up @@ -1509,7 +1505,7 @@ DEPENDENCIES
hyrax-iiif_av!
i18n-debug
i18n-tasks
iiif_print!
iiif_print
jbuilder (~> 2.5)
jquery-rails
json-canonicalization (~> 0.3.3)
Expand Down
7 changes: 6 additions & 1 deletion app/controllers/hyrax/datasets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ module Hyrax
class DatasetsController < ApplicationController
# Adds Hyrax behaviors to the controller.
include Hyrax::WorksControllerBehavior
include Hyku::WorksControllerBehavior
include Hyrax::BreadcrumbsForWorks
self.curation_concern_type = ::Dataset
self.curation_concern_type = ::DatasetResource

# Use a Valkyrie aware form service to generate Valkyrie::ChangeSet style
# forms.
self.work_form_service = Hyrax::FormFactory.new

# Use this line if you want to use a custom presenter
self.show_presenter = Hyrax::DatasetPresenter
Expand Down
7 changes: 6 additions & 1 deletion app/controllers/hyrax/exam_papers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ module Hyrax
class ExamPapersController < ApplicationController
# Adds Hyrax behaviors to the controller.
include Hyrax::WorksControllerBehavior
include Hyku::WorksControllerBehavior
include Hyrax::BreadcrumbsForWorks
self.curation_concern_type = ::ExamPaper
self.curation_concern_type = ::ExamPaperResource

# Use a Valkyrie aware form service to generate Valkyrie::ChangeSet style
# forms.
self.work_form_service = Hyrax::FormFactory.new

# Use this line if you want to use a custom presenter
self.show_presenter = Hyrax::ExamPaperPresenter
Expand Down
7 changes: 6 additions & 1 deletion app/controllers/hyrax/journal_articles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ module Hyrax
class JournalArticlesController < ApplicationController
# Adds Hyrax behaviors to the controller.
include Hyrax::WorksControllerBehavior
include Hyku::WorksControllerBehavior
include Hyrax::BreadcrumbsForWorks
self.curation_concern_type = ::JournalArticle
self.curation_concern_type = ::JournalArticleResource

# Use a Valkyrie aware form service to generate Valkyrie::ChangeSet style
# forms.
self.work_form_service = Hyrax::FormFactory.new

# Use this line if you want to use a custom presenter
self.show_presenter = Hyrax::JournalArticlePresenter
Expand Down
7 changes: 6 additions & 1 deletion app/controllers/hyrax/published_works_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ module Hyrax
class PublishedWorksController < ApplicationController
# Adds Hyrax behaviors to the controller.
include Hyrax::WorksControllerBehavior
include Hyku::WorksControllerBehavior
include Hyrax::BreadcrumbsForWorks
self.curation_concern_type = ::PublishedWork
self.curation_concern_type = ::PublishedWorkResource

# Use a Valkyrie aware form service to generate Valkyrie::ChangeSet style
# forms.
self.work_form_service = Hyrax::FormFactory.new

# Use this line if you want to use a custom presenter
self.show_presenter = Hyrax::PublishedWorkPresenter
Expand Down
7 changes: 6 additions & 1 deletion app/controllers/hyrax/theses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ module Hyrax
class ThesesController < ApplicationController
# Adds Hyrax behaviors to the controller.
include Hyrax::WorksControllerBehavior
include Hyku::WorksControllerBehavior
include Hyrax::BreadcrumbsForWorks
self.curation_concern_type = ::Thesis
self.curation_concern_type = ::ThesisResource

# Use a Valkyrie aware form service to generate Valkyrie::ChangeSet style
# forms.
self.work_form_service = Hyrax::FormFactory.new

# Use this line if you want to use a custom presenter
self.show_presenter = Hyrax::ThesisPresenter
Expand Down
1 change: 1 addition & 0 deletions app/forms/conference_item_resource_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
class ConferenceItemResourceForm < Hyrax::Forms::ResourceForm(ConferenceItemResource)
include Hyrax::FormFields(:basic_metadata)
include Hyrax::FormFields(:conference_item_resource)
include Hyrax::FormFields(:with_pdf_viewer)
include Hyrax::FormFields(:with_video_embed)

# Define custom form fields using the Valkyrie::ChangeSet interface
Expand Down
22 changes: 22 additions & 0 deletions app/forms/dataset_resource_form.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

# Generated via
# `rails generate hyrax:work_resource DatasetResource`
#
# @see https://github.com/samvera/hyrax/wiki/Hyrax-Valkyrie-Usage-Guide#forms
# @see https://github.com/samvera/valkyrie/wiki/ChangeSets-and-Dirty-Tracking
class DatasetResourceForm < Hyrax::Forms::ResourceForm(DatasetResource)
include Hyrax::FormFields(:basic_metadata)
include Hyrax::FormFields(:dataset_resource)
include Hyrax::FormFields(:with_pdf_viewer)
include Hyrax::FormFields(:with_video_embed)

# Define custom form fields using the Valkyrie::ChangeSet interface
#
# property :my_custom_form_field

# if you want a field in the form, but it doesn't have a directly corresponding
# model attribute, make it virtual
#
# property :user_input_not_destined_for_the_model, virtual: true
end
22 changes: 22 additions & 0 deletions app/forms/exam_paper_resource_form.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

# Generated via
# `rails generate hyrax:work_resource ExamPaperResource`
#
# @see https://github.com/samvera/hyrax/wiki/Hyrax-Valkyrie-Usage-Guide#forms
# @see https://github.com/samvera/valkyrie/wiki/ChangeSets-and-Dirty-Tracking
class ExamPaperResourceForm < Hyrax::Forms::ResourceForm(ExamPaperResource)
include Hyrax::FormFields(:basic_metadata)
include Hyrax::FormFields(:exam_paper_resource)
include Hyrax::FormFields(:with_pdf_viewer)
include Hyrax::FormFields(:with_video_embed)

# Define custom form fields using the Valkyrie::ChangeSet interface
#
# property :my_custom_form_field

# if you want a field in the form, but it doesn't have a directly corresponding
# model attribute, make it virtual
#
# property :user_input_not_destined_for_the_model, virtual: true
end
22 changes: 22 additions & 0 deletions app/forms/journal_article_resource_form.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

# Generated via
# `rails generate hyrax:work_resource JournalArticleResource`
#
# @see https://github.com/samvera/hyrax/wiki/Hyrax-Valkyrie-Usage-Guide#forms
# @see https://github.com/samvera/valkyrie/wiki/ChangeSets-and-Dirty-Tracking
class JournalArticleResourceForm < Hyrax::Forms::ResourceForm(JournalArticleResource)
include Hyrax::FormFields(:basic_metadata)
include Hyrax::FormFields(:journal_article_resource)
include Hyrax::FormFields(:with_pdf_viewer)
include Hyrax::FormFields(:with_video_embed)

# Define custom form fields using the Valkyrie::ChangeSet interface
#
# property :my_custom_form_field

# if you want a field in the form, but it doesn't have a directly corresponding
# model attribute, make it virtual
#
# property :user_input_not_destined_for_the_model, virtual: true
end
22 changes: 22 additions & 0 deletions app/forms/published_work_resource_form.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

# Generated via
# `rails generate hyrax:work_resource PublishedWorkResource`
#
# @see https://github.com/samvera/hyrax/wiki/Hyrax-Valkyrie-Usage-Guide#forms
# @see https://github.com/samvera/valkyrie/wiki/ChangeSets-and-Dirty-Tracking
class PublishedWorkResourceForm < Hyrax::Forms::ResourceForm(PublishedWorkResource)
include Hyrax::FormFields(:basic_metadata)
include Hyrax::FormFields(:published_work_resource)
include Hyrax::FormFields(:with_pdf_viewer)
include Hyrax::FormFields(:with_video_embed)

# Define custom form fields using the Valkyrie::ChangeSet interface
#
# property :my_custom_form_field

# if you want a field in the form, but it doesn't have a directly corresponding
# model attribute, make it virtual
#
# property :user_input_not_destined_for_the_model, virtual: true
end
22 changes: 22 additions & 0 deletions app/forms/thesis_resource_form.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

# Generated via
# `rails generate hyrax:work_resource ThesisResource`
#
# @see https://github.com/samvera/hyrax/wiki/Hyrax-Valkyrie-Usage-Guide#forms
# @see https://github.com/samvera/valkyrie/wiki/ChangeSets-and-Dirty-Tracking
class ThesisResourceForm < Hyrax::Forms::ResourceForm(ThesisResource)
include Hyrax::FormFields(:basic_metadata)
include Hyrax::FormFields(:thesis_resource)
include Hyrax::FormFields(:with_pdf_viewer)
include Hyrax::FormFields(:with_video_embed)

# Define custom form fields using the Valkyrie::ChangeSet interface
#
# property :my_custom_form_field

# if you want a field in the form, but it doesn't have a directly corresponding
# model attribute, make it virtual
#
# property :user_input_not_destined_for_the_model, virtual: true
end
2 changes: 2 additions & 0 deletions app/indexers/conference_item_resource_indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
class ConferenceItemResourceIndexer < Hyrax::ValkyrieWorkIndexer
include Hyrax::Indexer(:basic_metadata)
include Hyrax::Indexer(:conference_item_resource)
include Hyrax::Indexer(:with_pdf_viewer)
include Hyrax::Indexer(:with_video_embed)

include HykuIndexing

Expand Down
20 changes: 20 additions & 0 deletions app/indexers/dataset_resource_indexer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

# Generated via
# `rails generate hyrax:work_resource DatasetResource`
class DatasetResourceIndexer < Hyrax::ValkyrieWorkIndexer
include Hyrax::Indexer(:basic_metadata)
include Hyrax::Indexer(:dataset_resource)
include Hyrax::Indexer(:with_pdf_viewer)
include Hyrax::Indexer(:with_video_embed)

include HykuIndexing

# Uncomment this block if you want to add custom indexing behavior:
# def to_solr
# super.tap do |index_document|
# index_document[:my_field_tesim] = resource.my_field.map(&:to_s)
# index_document[:other_field_ssim] = resource.other_field
# end
# end
end
20 changes: 20 additions & 0 deletions app/indexers/exam_paper_resource_indexer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

# Generated via
# `rails generate hyrax:work_resource ExamPaperResource`
class ExamPaperResourceIndexer < Hyrax::ValkyrieWorkIndexer
include Hyrax::Indexer(:basic_metadata)
include Hyrax::Indexer(:exam_paper_resource)
include Hyrax::Indexer(:with_pdf_viewer)
include Hyrax::Indexer(:with_video_embed)

include HykuIndexing

# Uncomment this block if you want to add custom indexing behavior:
# def to_solr
# super.tap do |index_document|
# index_document[:my_field_tesim] = resource.my_field.map(&:to_s)
# index_document[:other_field_ssim] = resource.other_field
# end
# end
end
20 changes: 20 additions & 0 deletions app/indexers/journal_article_resource_indexer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

# Generated via
# `rails generate hyrax:work_resource JournalArticleResource`
class JournalArticleResourceIndexer < Hyrax::ValkyrieWorkIndexer
include Hyrax::Indexer(:basic_metadata)
include Hyrax::Indexer(:journal_article_resource)
include Hyrax::Indexer(:with_pdf_viewer)
include Hyrax::Indexer(:with_video_embed)

include HykuIndexing

# Uncomment this block if you want to add custom indexing behavior:
# def to_solr
# super.tap do |index_document|
# index_document[:my_field_tesim] = resource.my_field.map(&:to_s)
# index_document[:other_field_ssim] = resource.other_field
# end
# end
end
20 changes: 20 additions & 0 deletions app/indexers/published_work_resource_indexer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

# Generated via
# `rails generate hyrax:work_resource PublishedWorkResource`
class PublishedWorkResourceIndexer < Hyrax::ValkyrieWorkIndexer
include Hyrax::Indexer(:basic_metadata)
include Hyrax::Indexer(:published_work_resource)
include Hyrax::Indexer(:with_pdf_viewer)
include Hyrax::Indexer(:with_video_embed)

include HykuIndexing

# Uncomment this block if you want to add custom indexing behavior:
# def to_solr
# super.tap do |index_document|
# index_document[:my_field_tesim] = resource.my_field.map(&:to_s)
# index_document[:other_field_ssim] = resource.other_field
# end
# end
end
20 changes: 20 additions & 0 deletions app/indexers/thesis_resource_indexer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

# Generated via
# `rails generate hyrax:work_resource ThesisResource`
class ThesisResourceIndexer < Hyrax::ValkyrieWorkIndexer
include Hyrax::Indexer(:basic_metadata)
include Hyrax::Indexer(:thesis_resource)
include Hyrax::Indexer(:with_pdf_viewer)
include Hyrax::Indexer(:with_video_embed)

include HykuIndexing

# Uncomment this block if you want to add custom indexing behavior:
# def to_solr
# super.tap do |index_document|
# index_document[:my_field_tesim] = resource.my_field.map(&:to_s)
# index_document[:other_field_ssim] = resource.other_field
# end
# end
end
Loading

0 comments on commit f564e5c

Please sign in to comment.