C4::ImportBatch - manage batches of imported MARC records
use C4::ImportBatch;
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.
my ($marcblob, $encoding) = GetImportRecordMarc($import_record_id);
my $batch_id = AddImportBatch($overlay_action, $import_status, $type, $file_name, $comments);
my $row = GetImportBatch($batch_id);
Retrieve a hashref of an import_batches row.
my $import_record_id = AddBiblioToBatch($batch_id, $record_sequence, $marc_record, $encoding, $z3950random, $update_counts);
ModBiblioInBatch($import_record_id, $marc_record);
($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);
my @import_items_ids = AddItemsToImportBiblio($batch_id, $import_record_id, $marc_record, $update_counts);
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.
my ($num_added, $num_updated, $num_items_added, $num_items_errored, $num_ignored) = BatchCommitBibRecords($batch_id, $progress_interval, $progress_callback);
($num_items_added, $num_items_errored) = BatchCommitItems($import_record_id, $biblionumber);
my ($num_deleted, $num_errors, $num_reverted, $num_items_deleted, $num_ignored) = BatchRevertBibRecords($batch_id);
my $num_items_deleted = BatchRevertItems($import_record_id, $biblionumber);
CleanBatch($batch_id)
Deletes all staged records from the import batch and sets the status of the batch to 'cleaned'. Note that deleting a stage record does *not* affect any record that has been committed to the database.
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.
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.
my @itemsnos = GetItemNumbersFromImportBatch($batch_id);
my $count = GetNumberOfImportBatches();
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.
my $record_id = GetBestRecordMatch($import_record_id);
my $status = GetImportBatchStatus($batch_id);
SetImportBatchStatus($batch_id, $new_status);
my $overlay_action = GetImportBatchOverlayAction($batch_id);
SetImportBatchOverlayAction($batch_id, $new_overlay_action);
my $nomatch_action = GetImportBatchNoMatchAction($batch_id);
SetImportBatchNoMatchAction($batch_id, $new_nomatch_action);
my $item_action = GetImportBatchItemAction($batch_id);
SetImportBatchItemAction($batch_id, $new_item_action);
my $matcher_id = GetImportBatchMatcher($batch_id);
SetImportBatchMatcher($batch_id, $new_matcher_id);
my $overlay_status = GetImportRecordOverlayStatus($import_record_id);
SetImportRecordOverlayStatus($import_record_id, $new_overlay_status);
my $overlay_status = GetImportRecordStatus($import_record_id);
SetImportRecordStatus($import_record_id, $new_overlay_status);
my $results = GetImportRecordMatches($import_record_id, $best_only);
SetImportRecordMatches($import_record_id, @matches);
Koha Development Team <http://koha-community.org/>
Galen Charlton <galen.charlton@liblime.com>