Skip to content

Commit

Permalink
Moving FileSet and NewspaperIssue definition to specs
Browse files Browse the repository at this point in the history
Before this commit, these files were something that all applications
would load into their production code.  Ideally, we don't want to do
that for the two reasons:

- First, not everyone wants a NewspaperIssue model in their application

- Second the file_set, as implemented, directly inherits from
  `ActiveFedora::Base`.  If a downstream FileSet were to not inherit
  from `ActiveFedora:Base` we would have a mismatch error.

With this commit, we're saying that the IIIF print gem will require a
FileSet that conforms to the PCDM expectations.  But we won't dictate
its implementation details in the downstream application.  We instead
dictate those implementation details in the test application.

Also we will not force downstream Hyrax implementations to include a
NewspaperIssue model.

Related to:

- #101
  • Loading branch information
jeremyf committed Feb 6, 2023
1 parent f729884 commit ac4d3e1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
10 changes: 0 additions & 10 deletions app/models/file_set.rb

This file was deleted.

9 changes: 0 additions & 9 deletions app/models/newspaper_issue.rb

This file was deleted.

24 changes: 24 additions & 0 deletions spec/support/iiif_print_models.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
# frozen_string_literal: true
###################################################################################################
#
# The purpose of this file is to define the models we'll use in our spec application. Some of these
# models are echoes of what downstream apps will define (e.g. FileSet). Other are for internal
# modeling purposes only.
#
####################################################################################################

##
# iiif_print requires a file set model that is compatible with Hyrax assumptions. We do not want to
# add this to app/models because those are loaded in the downstream application; which can create
class FileSet < ActiveFedora::Base
include ::Hyrax::FileSetBehavior
end

# Newspaper Issue
class NewspaperIssue < ActiveFedora::Base
# WorkBehavior mixes in minimal ::Hyrax::CoreMetadata fields of
# depositor, title, date_uploaded, and date_modified.
# https://samvera.github.io/customize-metadata-model.html#core-metadata
include ::Hyrax::WorkBehavior
# BasicMetadata must be included last
include ::Hyrax::BasicMetadata
end

# TODO: merge this in with whatever is needed from misc_shared.rb
class WorkWithIiifPrintConfig < ActiveFedora::Base
Expand Down

0 comments on commit ac4d3e1

Please sign in to comment.