Module: Bulkrax

Extended by:
Bulkrax, Forwardable
Included in:
Bulkrax
Defined in:
lib/bulkrax.rb,
lib/bulkrax/engine.rb,
lib/bulkrax/version.rb,
app/models/bulkrax/entry.rb,
app/models/bulkrax/status.rb,
app/jobs/bulkrax/delete_job.rb,
app/jobs/bulkrax/import_job.rb,
app/models/bulkrax/exporter.rb,
app/models/bulkrax/importer.rb,
app/models/bulkrax/csv_entry.rb,
app/models/bulkrax/oai_entry.rb,
app/models/bulkrax/rdf_entry.rb,
app/models/bulkrax/xml_entry.rb,
app/jobs/bulkrax/exporter_job.rb,
app/jobs/bulkrax/importer_job.rb,
lib/bulkrax/entry_spec_helper.rb,
app/parsers/bulkrax/csv_parser.rb,
app/parsers/bulkrax/xml_parser.rb,
app/models/bulkrax/exporter_run.rb,
app/models/bulkrax/importer_run.rb,
app/models/bulkrax/oai_dc_entry.rb,
app/jobs/bulkrax/application_job.rb,
app/jobs/bulkrax/delete_work_job.rb,
app/jobs/bulkrax/export_work_job.rb,
app/jobs/bulkrax/import_work_job.rb,
app/matchers/bulkrax/csv_matcher.rb,
app/matchers/bulkrax/oai_matcher.rb,
app/models/bulkrax/import_failed.rb,
app/models/bulkrax/oai_set_entry.rb,
app/parsers/bulkrax/bagit_parser.rb,
app/parsers/bulkrax/oai_dc_parser.rb,
app/matchers/bulkrax/bagit_matcher.rb,
app/controllers/concerns/bulkrax/api.rb,
app/factories/bulkrax/object_factory.rb,
app/helpers/bulkrax/exporters_helper.rb,
app/helpers/bulkrax/importers_helper.rb,
app/jobs/bulkrax/delete_file_set_job.rb,
app/jobs/bulkrax/import_file_set_job.rb,
app/helpers/bulkrax/validation_helper.rb,
app/models/bulkrax/application_record.rb,
app/models/bulkrax/csv_file_set_entry.rb,
app/models/bulkrax/rdf_file_set_entry.rb,
app/helpers/bulkrax/application_helper.rb,
app/jobs/bulkrax/delete_and_import_job.rb,
app/jobs/bulkrax/delete_collection_job.rb,
app/jobs/bulkrax/import_collection_job.rb,
app/mailers/bulkrax/application_mailer.rb,
app/parsers/bulkrax/application_parser.rb,
app/models/bulkrax/csv_collection_entry.rb,
app/models/bulkrax/pending_relationship.rb,
app/models/bulkrax/rdf_collection_entry.rb,
app/models/concerns/bulkrax/status_info.rb,
app/jobs/bulkrax/download_cloud_file_job.rb,
app/matchers/bulkrax/application_matcher.rb,
app/models/concerns/bulkrax/file_factory.rb,
app/models/concerns/bulkrax/has_matchers.rb,
app/jobs/bulkrax/create_relationships_job.rb,
app/models/bulkrax/oai_qualified_dc_entry.rb,
app/services/bulkrax/factory_class_finder.rb,
app/controllers/bulkrax/entries_controller.rb,
app/jobs/bulkrax/delete_and_import_work_job.rb,
app/jobs/bulkrax/schedule_relationships_job.rb,
app/models/concerns/bulkrax/errored_entries.rb,
app/models/concerns/bulkrax/export_behavior.rb,
app/models/concerns/bulkrax/import_behavior.rb,
app/parsers/bulkrax/oai_qualified_dc_parser.rb,
app/controllers/bulkrax/exporters_controller.rb,
app/controllers/bulkrax/importers_controller.rb,
app/parsers/bulkrax/parser_export_record_set.rb,
app/factories/bulkrax/valkyrie_object_factory.rb,
app/controllers/bulkrax/application_controller.rb,
app/factories/bulkrax/object_factory_interface.rb,
app/jobs/bulkrax/delete_and_import_file_set_job.rb,
app/models/concerns/bulkrax/has_local_processing.rb,
app/jobs/bulkrax/delete_and_import_collection_job.rb,
app/models/concerns/bulkrax/dynamic_record_lookup.rb,
app/controllers/concerns/bulkrax/download_behavior.rb,
app/models/concerns/bulkrax/file_set_entry_behavior.rb,
app/controllers/concerns/bulkrax/datatables_behavior.rb,
app/models/concerns/bulkrax/importer_exporter_behavior.rb,
app/services/bulkrax/remove_relationships_for_importer.rb

Overview

rubocop:disable Metrics/ModuleLength

Defined Under Namespace

Modules: API, ApplicationHelper, DatatablesBehavior, DownloadBehavior, DynamicRecordLookup, EntrySpecHelper, ErroredEntries, ExportBehavior, ExportersHelper, FileFactory, FileSetEntryBehavior, HasLocalProcessing, HasMatchers, ImportBehavior, ImporterExporterBehavior, ImportersHelper, ParserExportRecordSet, StatusInfo, ValidationHelper Classes: ApplicationController, ApplicationJob, ApplicationMailer, ApplicationMatcher, ApplicationParser, ApplicationRecord, BagitMatcher, BagitParser, CollectionsCreatedError, Configuration, CreateRelationshipsJob, CsvCollectionEntry, CsvEntry, CsvFileSetEntry, CsvMatcher, CsvParser, DeleteAndImportCollectionJob, DeleteAndImportFileSetJob, DeleteAndImportJob, DeleteAndImportWorkJob, DeleteCollectionJob, DeleteFileSetJob, DeleteJob, DeleteWorkJob, DownloadCloudFileJob, Engine, EntriesController, Entry, ExportWorkJob, Exporter, ExporterJob, ExporterRun, ExportersController, FactoryClassFinder, ImportCollectionJob, ImportFailed, ImportFileSetJob, ImportJob, ImportWorkJob, Importer, ImporterJob, ImporterRun, ImportersController, InstallGenerator, MissingParentError, NormalizedJson, OAIError, OaiDcEntry, OaiDcParser, OaiEntry, OaiMatcher, OaiQualifiedDcEntry, OaiQualifiedDcParser, OaiSetEntry, ObjectFactory, ObjectFactoryInterface, PendingRelationship, RdfCollectionEntry, RdfEntry, RdfFileSetEntry, RemoveRelationshipsForImporter, ScheduleRelationshipsJob, Status, ValkyrieObjectFactory, XmlEntry, XmlParser

Constant Summary collapse

DEFAULT_MULTI_VALUE_ELEMENT_JOIN_ON =
' | '
DEFAULT_MULTI_VALUE_ELEMENT_SPLIT_ON =
/\s*[:;|]\s*/.freeze
VERSION =
'8.1.0'

Instance Method Summary collapse

Instance Method Details

#api_definitionObject



317
318
319
320
321
322
323
324
325
# File 'lib/bulkrax.rb', line 317

def api_definition
  @api_definition ||= ActiveSupport::HashWithIndifferentAccess.new(
    YAML.safe_load(
      ERB.new(
        File.read(Rails.root.join('config', 'bulkrax_api.yml'))
      ).result
    )
  )
end

#config {|@config| ... } ⇒ Object Also known as: setup

Yields:



143
144
145
146
147
# File 'lib/bulkrax.rb', line 143

def config
  @config ||= Configuration.new
  yield @config if block_given?
  @config
end

#fallback_user_for_importer_exporter_processingObject



361
362
363
364
365
# File 'lib/bulkrax.rb', line 361

def fallback_user_for_importer_exporter_processing
  return User.batch_user if defined?(Hyrax) && User.respond_to?(:batch_user)

  raise "We have no fallback user available for Bulkrax.fallback_user_for_importer_exporter_processing"
end

#multi_value_element_join_onObject

Note:

the specific delimiter should likely be present in the multi_value_element_split_on expression.

Specify the delimiter for joining an attribute’s multi-value array into a string.



332
333
334
# File 'lib/bulkrax.rb', line 332

def multi_value_element_join_on
  @multi_value_element_join_on ||= DEFAULT_MULTI_VALUE_ELEMENT_JOIN_ON
end

#multi_value_element_split_onRegexClass

Note:

The “true” value is to preserve backwards compatibility.

‘true` use the DEFAULT_MULTI_VALUE_ELEMENT_JOIN_ON.

Returns:

  • (RegexClass)

    the regular express to use to “split” an attribute’s values. If set to

See Also:



342
343
344
345
346
347
348
# File 'lib/bulkrax.rb', line 342

def multi_value_element_split_on
  if @multi_value_element_join_on.is_a?(TrueClass)
    DEFAULT_MULTI_VALUE_ELEMENT_SPLIT_ON
  else
    @multi_value_element_split_on ||= DEFAULT_MULTI_VALUE_ELEMENT_SPLIT_ON
  end
end

#normalize_string(value) ⇒ String

Responsible for stripping hidden characters from the given string.

Parameters:

  • value (#to_s)

Returns:

  • (String)

    with hidden characters removed

See Also:



356
357
358
359
# File 'lib/bulkrax.rb', line 356

def normalize_string(value)
  # Removing [Byte Order Mark (BOM)](https://en.wikipedia.org/wiki/Byte_order_mark)
  value.to_s.delete("\xEF\xBB\xBF")
end