<<

NAME

C4::ImportBatch - manage batches of imported MARC records

SYNOPSIS

use C4::ImportBatch;

FUNCTIONS

GetZ3950BatchId

my $batchid = GetZ3950BatchId($z3950server);

Retrieves the ID of the import batch for the Z39.50 reservoir for the given target. If necessary, creates the import batch.

GetImportRecordMarc

my ($marcblob, $encoding) = GetImportRecordMarc($import_record_id);

AddImportBatch

my $batch_id = AddImportBatch($overlay_action, $import_status, $type, $file_name, $comments);

GetImportBatch

my $row = GetImportBatch($batch_id);

Retrieve a hashref of an import_batches row.

AddBiblioToBatch

my $import_record_id = AddBiblioToBatch($batch_id, $record_sequence, $marc_record, $encoding, $z3950random, $update_counts);

ModBiblioInBatch

ModBiblioInBatch($import_record_id, $marc_record);

BatchStageMarcRecords

($batch_id, $num_records, $num_items, @invalid_records) = BatchStageMarcRecords($marc_flavor, $marc_records, $file_name, $comments, $branch_code, $parse_items, $leave_as_staging, $progress_interval, $progress_callback);

AddItemsToImportBiblio

my @import_items_ids = AddItemsToImportBiblio($batch_id, $import_record_id, $marc_record, $update_counts);

BatchFindBibDuplicates

my $num_with_matches = BatchFindBibDuplicates($batch_id, $matcher, $max_matches, $progress_interval, $progress_callback);

Goes through the records loaded in the batch and attempts to find duplicates for each one. Sets the matching status of each record to "no_match" or "auto_match" as appropriate.

The $max_matches parameter is optional; if it is not supplied, it defaults to 10.

The $progress_interval and $progress_callback parameters are optional; if both are supplied, the sub referred to by $progress_callback will be invoked every $progress_interval records using the number of records processed as the singular argument.

BatchCommitBibRecords

my ($num_added, $num_updated, $num_items_added, $num_items_errored, $num_ignored) = BatchCommitBibRecords($batch_id, $progress_interval, $progress_callback);

BatchCommitItems

($num_items_added, $num_items_errored) = BatchCommitItems($import_record_id, $biblionumber);

BatchRevertBibRecords

my ($num_deleted, $num_errors, $num_reverted, $num_items_deleted, $num_ignored) = BatchRevertBibRecords($batch_id);

BatchRevertItems

my $num_items_deleted = BatchRevertItems($import_record_id, $biblionumber);

GetAllImportBatches

my $results = GetAllImportBatches();

Returns a references to an array of hash references corresponding to all import_batches rows (of batch_type 'batch'), sorted in ascending order by import_batch_id.

GetImportBatchRangeDesc

my $results = GetImportBatchRangeDesc($offset, $results_per_group);

Returns a reference to an array of hash references corresponding to import_batches rows (sorted in descending order by import_batch_id) start at the given offset.

GetItemNumbersFromImportBatch

GetNumberOfImportBatches

my $count = GetNumberOfImportBatches();

GetImportBibliosRange

my $results = GetImportBibliosRange($batch_id, $offset, $results_per_group);

Returns a reference to an array of hash references corresponding to import_biblios/import_records rows for a given batch starting at the given offset.

GetBestRecordMatch

my $record_id = GetBestRecordMatch($import_record_id);

GetImportBatchStatus

my $status = GetImportBatchStatus($batch_id);

SetImportBatchStatus

SetImportBatchStatus($batch_id, $new_status);

GetImportBatchOverlayAction

my $overlay_action = GetImportBatchOverlayAction($batch_id);

SetImportBatchOverlayAction

SetImportBatchOverlayAction($batch_id, $new_overlay_action);

GetImportBatchNoMatchAction

my $nomatch_action = GetImportBatchNoMatchAction($batch_id);

SetImportBatchNoMatchAction

SetImportBatchNoMatchAction($batch_id, $new_nomatch_action);

GetImportBatchItemAction

my $item_action = GetImportBatchItemAction($batch_id);

SetImportBatchItemAction

SetImportBatchItemAction($batch_id, $new_item_action);

GetImportBatchMatcher

my $matcher_id = GetImportBatchMatcher($batch_id);

SetImportBatchMatcher

SetImportBatchMatcher($batch_id, $new_matcher_id);

GetImportRecordOverlayStatus

my $overlay_status = GetImportRecordOverlayStatus($import_record_id);

SetImportRecordOverlayStatus

SetImportRecordOverlayStatus($import_record_id, $new_overlay_status);

GetImportRecordStatus

my $overlay_status = GetImportRecordStatus($import_record_id);

SetImportRecordStatus

SetImportRecordStatus($import_record_id, $new_overlay_status);

GetImportRecordMatches

my $results = GetImportRecordMatches($import_record_id, $best_only);

SetImportRecordMatches

SetImportRecordMatches($import_record_id, @matches);

AUTHOR

Koha Development Team <info@koha.org>

Galen Charlton <galen.charlton@liblime.com>

<<