app/actors/hyrax/actors/create_with_remote_files_actor.rb
# We created a temporary Hyrax::UploadedFile for each browse_everything
# file at the time of form submission (see etds_controller.rb).
# Go find that object, and apply its metadata to the FileSet that just got
# created. This duplicates for browse_everything objects the same behavior
# that happens for local uploads in AttachFilesToWorkJob.
# TODO: Should we delete this temporary ::Hyrax::UploadedFile object when we're
# done with it? Is there ever a cleanup job?
# @param [FileSet] fs
# @param [Work] curation_concern
We created a temporary Hyrax::UploadedFile for each browse_everything
file at the time of form submission .
Go find that object, and apply its metadata to the FileSet that just got
created. This duplicates for browse_everything objects the same behavior
that happens for local uploads in AttachFilesToWorkJob.
We created a temporary Hyrax :: UploadedFile for each browse_everything file at the time of form submission . Go find that object and apply its metadata to the FileSet that just got created . This duplicates for browse_everything objects the same behavior that happens for local uploads in AttachFilesToWorkJob .
def apply_saved_metadata(fs, curation_concern)
          uf = ::Hyrax::UploadedFile.find_by(browse_everything_url: fs.import_url)
          if uf&.pcdm_use == ::FileSet::PRIMARY
            fs.pcdm_use = ::FileSet::PRIMARY
            fs.title = curation_concern.title
          else
            fs.pcdm_use = ::FileSet::SUPPLEMENTAL
            fs.title = Array.wrap(uf&.title)
            fs.description = Array.wrap(uf&.description)
            fs.file_type = uf&.file_type
          end
        end
def apply_saved_metadata ( fs , curation_concern ) uf = :: Hyrax :: UploadedFile . find_by ( browse_everything_url : fs . import_url ) if uf &. pcdm_use == :: FileSet :: PRIMARY fs . pcdm_use = :: FileSet :: PRIMARY fs . title = curation_concern . title else fs . pcdm_use = :: FileSet :: SUPPLEMENTAL fs . title = Array . wrap ( uf &. title ) fs . description = Array . wrap ( uf &. description ) fs . file_type = uf &. file_type end end
We created a temporary Hyrax::UploadedFile for each browse_everything
file at the time of form submission (see etds_controller.rb).
We created a temporary Hyrax :: UploadedFile for each browse_everything file at the time of form submission ( see etds_controller . rb ) .
fs
<not_specific>
curation_concern
<not_specific>
<not_specific>
None