Class: Component

Inherits:
Ddr::Models::Base show all
Includes:
Ddr::Models::HasContent, Ddr::Models::HasMultiresImage, Ddr::Models::HasStructMetadata
Defined in:
app/models/component.rb

Overview

A Component is a part of an Item; the principal content-bearing repository resource.

Examples: Page of a book, track of a recording, etc.

Constant Summary

Constants included from Ddr::Models::HasStructMetadata

Ddr::Models::HasStructMetadata::FILE_USE_MASTER, Ddr::Models::HasStructMetadata::FILE_USE_REFERENCE

Constants included from Ddr::Models::HasContent

Ddr::Models::HasContent::MASTER_FILE_TYPES

Constants included from Ddr::Auth::LegacyRoles

Ddr::Auth::LegacyRoles::LEGACY_ROLES

Constants included from Ddr::IndexFields

Ddr::IndexFields::ACTIVE_FEDORA_MODEL, Ddr::IndexFields::COLLECTION_URI, Ddr::IndexFields::CONTENT_CONTROL_GROUP, Ddr::IndexFields::CONTENT_SIZE, Ddr::IndexFields::CONTENT_SIZE_HUMAN, Ddr::IndexFields::DEFAULT_LICENSE_DESCRIPTION, Ddr::IndexFields::DEFAULT_LICENSE_TITLE, Ddr::IndexFields::DEFAULT_LICENSE_URL, Ddr::IndexFields::FILE_GROUP, Ddr::IndexFields::FILE_USE, Ddr::IndexFields::HAS_MODEL, Ddr::IndexFields::IDENTIFIER, Ddr::IndexFields::INTERNAL_URI, Ddr::IndexFields::IS_ATTACHED_TO, Ddr::IndexFields::IS_EXTERNAL_TARGET_FOR, Ddr::IndexFields::IS_GOVERNED_BY, Ddr::IndexFields::IS_MEMBER_OF, Ddr::IndexFields::IS_MEMBER_OF_COLLECTION, Ddr::IndexFields::IS_PART_OF, Ddr::IndexFields::LAST_FIXITY_CHECK_ON, Ddr::IndexFields::LAST_FIXITY_CHECK_OUTCOME, Ddr::IndexFields::LAST_VIRUS_CHECK_ON, Ddr::IndexFields::LAST_VIRUS_CHECK_OUTCOME, Ddr::IndexFields::LICENSE_DESCRIPTION, Ddr::IndexFields::LICENSE_TITLE, Ddr::IndexFields::LICENSE_URL, Ddr::IndexFields::LOCAL_ID, Ddr::IndexFields::MEDIA_MAJOR_TYPE, Ddr::IndexFields::MEDIA_SUB_TYPE, Ddr::IndexFields::MEDIA_TYPE, Ddr::IndexFields::OBJECT_CREATE_DATE, Ddr::IndexFields::OBJECT_MODIFIED_DATE, Ddr::IndexFields::OBJECT_PROFILE, Ddr::IndexFields::OBJECT_STATE, Ddr::IndexFields::ORDER, Ddr::IndexFields::PERMANENT_ID, Ddr::IndexFields::PERMANENT_URL, Ddr::IndexFields::TITLE, Ddr::IndexFields::WORKFLOW_STATE

Constants included from Ddr::Models::FileManagement

Ddr::Models::FileManagement::EXTERNAL_FILE_PERMISSIONS

Instance Method Summary collapse

Methods included from Ddr::Models::HasStructMetadata

#assign_struct_metadata!

Methods included from Ddr::Models::HasContent

#content_changed?, #content_human_size, #content_major_type, #content_size, #content_sub_type, #content_type, #content_type=, #derivatives, #image?, #master_file?, #pdf?, #upload, #upload!, #virus_checks

Methods inherited from Ddr::Models::Base

#association_query, #copy_admin_policy_or_permissions_from, #model_pid

Methods included from Ddr::Models::HasAdminMetadata

#assign_permanent_id!, #permanent_id_manager, #roles, #workflow

Methods included from Ddr::Auth::LegacyRoles

#legacy_downloader_to_resource_roles, #principal_has_role?, #principals

Methods included from Ddr::Models::Indexing

#identifier_sort, #index_fields, #title_display, #to_solr

Methods included from Ddr::IndexFields

solr_name

Methods included from Ddr::Models::FileManagement

#add_external_datastream, #add_external_file, #add_file, #create_external_file_path!, #external_datastream_file_paths, #external_datastreams, #generate_external_file_path

Methods included from Ddr::Models::FixityCheckable

#datastreams_to_validate, #fixity_check, #fixity_checks

Methods included from Ddr::Models::EventLoggable

#events, #has_events?, #notify_event, #update_events

Methods included from Ddr::Models::HasThumbnail

#copy_thumbnail_from, #thumbnail_changed?

Methods included from Ddr::Models::Licensable

#license, #license=

Methods included from Ddr::Models::AccessControllable

#copy_permissions_from, #set_initial_permissions

Methods included from Ddr::Models::Governable

#copy_admin_policy_from, #inherited_license, #inherited_permissions, #inherited_rights

Methods included from Ddr::Models::Describable

#desc_metadata_attributes, #desc_metadata_terms, #desc_metadata_values, #desc_metadata_vocabs, #has_desc_metadata?, #set_desc_metadata, #set_desc_metadata_values

Instance Method Details

#collectionObject



18
19
20
# File 'app/models/component.rb', line 18

def collection
  self.parent.parent rescue nil
end

#collection_uriObject



22
23
24
# File 'app/models/component.rb', line 22

def collection_uri
  self.collection.internal_uri rescue nil
end