<<

NAME

ImportKBARTFile - Create new eHoldings titles from a KBART file

This is a subclass of Koha::BackgroundJob.

API

Class methods

job_type

Define the job type of this job.

process

Process the import.

enqueue

Enqueue the new job

format_title

Formats a title to fit the names of the database fields in Koha

Kbart field "title_id" = "external_id" in Koha Kbart field "coverage_notes" = "notes" in Koha

read_file

Reads a file to provide report headers and lines to be processed

create_title_hash_from_line_data

Takes a line and creates a hash of the values mapped to the column headings Only accepts fields that are in the list of permitted KBART fields, other fields are ignored (This is identified to the user on the background job status page)

check_for_matching_title

Checks whether this title already exists to avoid duplicates

create_linked_resource

Creates a resource for a newly stored title.

get_first_and_last_issue_dates

Gets and formats a date for storing on the resource. Dates can come from files in YYYY, YYYY-MM or YYYY-MM-DD format

get_valid_headers

Returns a list of permitted headers in a KBART phase II file

calculate_chunked_params_size

Calculates average line size to work out how many lines to chunk a large file into Uses only 75% of the max_allowed_packet as an upper limit

is_file_too_large

Calculates the final size of the background job object that will need storing to check if we exceed the max_allowed_packet

rescue_EBSCO_files

EBSCO have an incorrect spelling for "preceding_publication_title_id" in all of their KBART files (preceding is spelled with a double 'e'). This means all of their KBART files fail to import using the current methodology. There is no simple way of finding out who the vendor is before importing so all KBART files from any vendor are going to have to be checked for this spelling and corrected.

<<