-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from scientist-softserv/create-a-work
🧹 Get works created
- Loading branch information
Showing
20 changed files
with
478 additions
and
487 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
# OVERRIDE Hyrax 2.9 to add in import flag | ||
module Hyrax | ||
module Actors | ||
class Environment | ||
# @param [ActiveFedora::Base] curation_concern work to operate on | ||
# @param [Ability] current_ability the authorizations of the acting user | ||
# @param [ActionController::Parameters] attributes user provided form attributes | ||
def initialize(curation_concern, current_ability, attributes, importing = false) | ||
@curation_concern = curation_concern | ||
@current_ability = current_ability | ||
@attributes = attributes.to_h.with_indifferent_access | ||
@importing = importing | ||
end | ||
|
||
attr_accessor :curation_concern, :current_ability, :attributes, :importing | ||
|
||
# @return [User] the user from the current_ability | ||
def user | ||
current_ability.current_user | ||
end | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,29 +1,37 @@ | ||
# frozen_string_literal: true | ||
|
||
module GenericWorkDecorator | ||
extend ActiveSupport::Concern | ||
|
||
include VideoEmbedViewer | ||
include ::Hyrax::WorkBehavior | ||
include DogBiscuits::Abstract | ||
include DogBiscuits::BibliographicCitation | ||
include DogBiscuits::DateIssued | ||
include DogBiscuits::Geo | ||
include DogBiscuits::PartOf | ||
include DogBiscuits::PlaceOfPublication | ||
include SlugBug | ||
include IiifPrint.model_configuration( | ||
pdf_split_child_model: self, | ||
pdf_splitter_service: IiifPrint::SplitPdfs::AdventistPagesToJpgsSplitter, | ||
derivative_service_plugins: [ | ||
IiifPrint::TextExtractionDerivativeService | ||
] | ||
) | ||
end | ||
|
||
GenericWork.prepend(GenericWorkDecorator) | ||
GenericWork.include(VideoEmbedViewer) | ||
GenericWork.include(::Hyrax::WorkBehavior) | ||
GenericWork.include(DogBiscuits::Abstract) | ||
GenericWork.include(DogBiscuits::BibliographicCitation) | ||
GenericWork.include(DogBiscuits::DateIssued) | ||
GenericWork.include(DogBiscuits::Geo) | ||
GenericWork.include(DogBiscuits::PartOf) | ||
GenericWork.include(DogBiscuits::PlaceOfPublication) | ||
GenericWork.include(SlugBug) | ||
GenericWork.include(IiifPrint.model_configuration( | ||
pdf_split_child_model: self, | ||
pdf_splitter_service: IiifPrint::SplitPdfs::AdventistPagesToJpgsSplitter, | ||
derivative_service_plugins: [ | ||
IiifPrint::TextExtractionDerivativeService | ||
] | ||
)) | ||
|
||
# This must come after the properties because it finalizes the metadata | ||
# schema (by adding accepts_nested_attributes) | ||
GenericWork.include SlugMetadata | ||
GenericWork.include AdventistMetadata | ||
|
||
GenericWork.instance_variable_set(:@generated_resource_class, nil) | ||
GenericWork.resource_class | ||
|
||
GenericWork.resource_class.send(:include, SlugMetadata) | ||
GenericWork.resource_class.send(:include, AdventistMetadata) | ||
GenericWork.resource_class.send(:include, VideoEmbedViewer) | ||
GenericWork.resource_class.send(:include, DogBiscuits::Abstract) | ||
GenericWork.resource_class.send(:include, DogBiscuits::BibliographicCitation) | ||
GenericWork.resource_class.send(:include, DogBiscuits::DateIssued) | ||
GenericWork.resource_class.send(:include, DogBiscuits::Geo) | ||
GenericWork.resource_class.send(:include, DogBiscuits::PartOf) | ||
GenericWork.resource_class.send(:include, DogBiscuits::PlaceOfPublication) | ||
GenericWork.resource_class.send(:include, SlugBug) |
Oops, something went wrong.