Class: Item
- Inherits:
-
Ddr::Models::Base
- Object
- ActiveFedora::Base
- Ddr::Models::Base
- Item
- Includes:
- Ddr::Models::HasChildren
- Defined in:
- app/models/item.rb
Overview
An Item is a member of a Collection – i.e., a “work” – the principal describable resource.
Examples: photograph, book, article, sound recording, video, etc.
Constant Summary
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::HasChildren
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
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
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
#children_by_file_use ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/models/item.rb', line 23 def children_by_file_use file_uses = {} sort_key = "#{Ddr::IndexFields::FILE_USE} ASC, #{Ddr::IndexFields::ORDER} ASC" results = ActiveFedora::SolrService.query(association_query(:children), rows: 999999, sort: sort_key) objs = ActiveFedora::SolrService.lazy_reify_solr_results(results) objs.each do |obj| file_uses[obj.file_use] ||= [] file_uses[obj.file_use] << obj end file_uses end |