Class: Bulkrax::CsvCollectionEntry

Inherits:
CsvEntry show all
Defined in:
app/models/bulkrax/csv_collection_entry.rb

Instance Attribute Summary

Attributes inherited from Entry

#all_attrs

Instance Method Summary collapse

Methods inherited from CsvEntry

#add_file, #add_ingested_metadata, #add_metadata_for_model, #build_export_metadata, #build_files_metadata, #build_mapping_metadata, #build_metadata, #build_object, #build_relationship_metadata, #build_system_metadata, #build_thumbnail_files, #build_value, #collection_identifiers, #collections_created?, data_for_entry, #establish_factory_class, fields_from_data, #find_collection_ids, #handle_join_on_export, #key_for_export, matcher_class, #object_metadata, #path_to_file, #prepare_export_data, #prepare_export_data_with_join, read_data, #record, #validate_record

Methods inherited from Entry

#build, data_for_entry, #exporter?, #fetch_field_mapping, fields_from_data, #find_collection, #importer?, #last_run, parent_field, read_data, #source_identifier, #work_identifier

Methods included from HasLocalProcessing

#add_local

Methods included from StatusInfo

#current_status, #failed?, #last_error, #set_status_info, #skipped?, #status, #status_at, #succeeded?

Methods included from ExportBehavior

#build_export_metadata, #build_for_exporter, #filename, #hyrax_record

Methods included from ImportBehavior

#active_id_for_authority?, #add_admin_set_id, #add_collections, #add_rights_statement, #add_user_to_permission_templates!, #add_visibility, #build_for_importer, #build_metadata, #child_jobs, #collections_created?, #factory, #factory_class, #find_collection_ids, #override_rights_statement, #parent_jobs, #rights_statement, #sanitize_controlled_uri_value, #sanitize_controlled_uri_values!, #validate_value

Methods included from HasMatchers

#add_metadata, #excluded?, #field_supported?, #field_to, #fields_that_are_always_multiple, #fields_that_are_always_singular, #get_object_name, #matched_metadata, #multiple?, #multiple_metadata, #schema_form_definitions, #set_parsed_data, #set_parsed_object_data, #single_metadata, #supported_bulkrax_fields

Instance Method Details

#add_collection_type_gidObject



13
14
15
16
17
# File 'app/models/bulkrax/csv_collection_entry.rb', line 13

def add_collection_type_gid
  return if self.['collection_type_gid'].present?

  self.['collection_type_gid'] = ::Hyrax::CollectionType.find_or_create_default_collection_type.to_global_id.to_s
end

#add_identifierObject

Use identifier set by CsvParser#unique_collection_identifier, which falls back on the Collection’s first title if record is not present



9
10
11
# File 'app/models/bulkrax/csv_collection_entry.rb', line 9

def add_identifier
  self.[work_identifier] = [self.identifier].flatten
end