Class: Hyrax::FileSet

Inherits:
Resource
  • Object
show all
Defined in:
app/models/hyrax/file_set.rb,
app/models/concerns/hyrax/file_set/indexing.rb,
app/models/concerns/hyrax/file_set/querying.rb,
app/models/concerns/hyrax/file_set/derivatives.rb,
app/models/concerns/hyrax/file_set/belongs_to_works.rb,
app/models/concerns/hyrax/file_set/characterization.rb

Overview

TODO:

The description in Hydra::Works Shared Modeling is out of date and uses terminology to describe the relationships that is no longer used in code. Update the model and link to it. This can be a simple relationship diagram with a link to the original Works Shared Modeling for historical perspective.

Valkyrie model for `FileSet` domain objects in the Hydra Works model.

## Relationships

### File Set and Work

  • Defined: The relationship is defined by the inverse relationship stored in the work's `:member_ids` attribute.

  • Tested: The work tests the relationship.

  • File Set to Work: (1..1) A file set must be in one and only one work.

  • Work to File Set: (0..m) A work can have many file sets.

    • See Hyrax::Work for code to get and set file sets for the work.

### File Set and File (TBD)

Defined Under Namespace

Modules: BelongsToWorks, Characterization, Derivatives, Indexing, Querying

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#collection?, #file?, human_readable_type, #permission_manager, #visibility, #visibility=, #work?

Methods included from WithEvents

#event_class, #events, #log_event, #stream

Class Method Details

.model_name(name_class: Hyrax::Name) ⇒ Object


36
37
38
# File 'app/models/hyrax/file_set.rb', line 36

def self.model_name(name_class: Hyrax::Name)
  @_model_name ||= name_class.new(self, nil, 'FileSet')
end

Instance Method Details

#file_set?Boolean

Returns true.

Returns:

  • (Boolean)

    true


70
71
72
# File 'app/models/hyrax/file_set.rb', line 70

def file_set?
  true
end

#pcdm_object?Boolean

Returns true.

Returns:

  • (Boolean)

    true


64
65
66
# File 'app/models/hyrax/file_set.rb', line 64

def pcdm_object?
  true
end

#representative_idValkyrie::ID

Returns:

  • (Valkyrie::ID)

50
51
52
# File 'app/models/hyrax/file_set.rb', line 50

def representative_id
  id
end

#thumbnail_idValkyrie::ID

If one is set then return it, otherwise use self as the ID to allow for derivative generators to find the on-disk path for the thumbnail.

Returns:

  • (Valkyrie::ID)

58
59
60
# File 'app/models/hyrax/file_set.rb', line 58

def thumbnail_id
  self.[](:thumbnail_id) || id
end