Class: MarcXMLAuthAgentConverter

Inherits:
Converter show all
Extended by:
MarcXMLAuthAgentBaseMap
Includes:
ASpaceImport::XML::DOM
Defined in:
backend/app/converters/marcxml_auth_agent_converter.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from MarcXMLAuthAgentBaseMap

BASE_RECORD_MAP, agent_corporate_entity_base, agent_corporate_entity_name_components_map, agent_corporate_entity_name_map, agent_family_base, agent_family_name_components_map, agent_family_name_map, agent_function_map, agent_gender_map, agent_occupation_map, agent_person_base, agent_person_name_components_map, agent_person_name_map, agent_record_control_map, agent_record_identifiers_base_map, agent_sources_map, agent_topic_map, associated_country_map, bioghist_note_map, convention_declaration_map, dates_map, expression_date_for, find_relationship, maintenance_history_map, other_associated_place_map, place_of_birth_map, place_of_death_map, place_of_residence_map, related_agent_map, set_auth_id, set_maintenance_status, set_primary_identifier, set_record_language, shared_subrecord_map, structured_date_for, subject_map, subject_terms_map, trim, used_language_map

Methods included from ASpaceImport::XML::DOM

#config, included, #object, #process_field, #run

Methods inherited from Converter

for, #get_output_path, inherited, #initialize, list_import_types, register_converter, #remove_files, #run

Constructor Details

This class inherits a constructor from Converter

Class Method Details

.for_agents_only(input_file) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'backend/app/converters/marcxml_auth_agent_converter.rb', line 20

def self.for_agents_only(input_file)
  new(input_file).instance_eval do
    @batch.record_filter = ->(record) {
      AgentManager.known_agent_type?(record.class.record_type)
    }

    self
  end
end

.import_types(show_hidden = false) ⇒ Object



34
35
36
37
38
39
40
41
# File 'backend/app/converters/marcxml_auth_agent_converter.rb', line 34

def self.import_types(show_hidden = false)
  [
   {
     :name => "marcxml_auth_agent",
     :description => "Import agent records from a MARCXML authority file"
   }
  ]
end

.instance_for(type, input_file) ⇒ Object



12
13
14
15
16
17
18
# File 'backend/app/converters/marcxml_auth_agent_converter.rb', line 12

def self.instance_for(type, input_file)
  if type == "marcxml_auth_agent"
    self.new(input_file)
  else
    nil
  end
end

Instance Method Details

#set_import_options(opts) ⇒ Object



30
31
32
# File 'backend/app/converters/marcxml_auth_agent_converter.rb', line 30

def set_import_options(opts)
  config.init_map(MarcXMLAuthAgentConverter.BASE_RECORD_MAP(opts))
end