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 $batchid = GetWebserviceBatchId();
Retrieves the ID of the import batch for webservice. If necessary, creates the import batch.
my ($marcblob, $encoding) = GetImportRecordMarc($import_record_id);
my $batch_id = AddImportBatch($params_hash);
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, $update_counts);
my $import_record_id = AddAuthToBatch($batch_id, $record_sequence, $marc_record, $encoding, $update_counts, [$marc_type]);
( $batch_id, $num_records, $num_items, @invalid_records ) = BatchStageMarcRecords( $record_type, $encoding, $marc_records, $file_name, $marc_modification_template, $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 = BatchFindDuplicates($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.
Takes a hashref containing params for committing the batch - optional parameters 'progress_interval' and 'progress_callback' will define code called every X records. my ($num_added, $num_updated, $num_items_added, $num_items_replaced, $num_items_errored, $num_ignored) = BatchCommitRecords({ batch_id => $batch_id, framework => $framework, overlay_framework => $overlay_framework, progress_interval => $progress_interval, progress_callback => $progress_callback, });
($num_items_added, $num_items_errored) = _batchCommitItems($import_record_id, $biblionumber, [$action, $biblioitemnumber]);
Private function for batch committing item changes. We do not trigger a re-index here, that is left to the caller.
my ($num_deleted, $num_errors, $num_reverted, $num_items_deleted, $num_ignored) = BatchRevertRecords($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.
DeleteBatch($batch_id)
Deletes the record from the database. This can only be done once the batch has been cleaned.
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 $batch_ids = GetStagedWebserviceBatches();
Returns a references to an array of batch id's of batch_type 'webservice' that are not imported
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 = GetImportBiblios($importid);
my $results = GetImportRecordsRange($batch_id, $offset, $results_per_group);
Returns a reference to an array of hash references corresponding to import_biblios/import_auths/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);
SetMatchedBiblionumber($import_record_id, $biblionumber);
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 $status = GetImportRecordStatus($import_record_id);
SetImportRecordStatus($import_record_id, $new_status);
my $results = GetImportRecordMatches($import_record_id, $best_only);
SetImportRecordMatches($import_record_id, @matches);
my ($errors, $records) = C4::ImportBatch::RecordsFromISO2709File($input_file, $record_type, $encoding);
Reads ISO2709 binary porridge from the given file and creates MARC::Record-objects out of it.
@PARAM1, String, absolute path to the ISO2709 file. @PARAM2, String, see stage_file.pl @PARAM3, String, should be utf8
Returns two array refs.
my ($errors, $records) = C4::ImportBatch::RecordsFromMARCXMLFile($input_file, $encoding);
Creates MARC::Record-objects out of the given MARCXML-file.
@PARAM1, String, absolute path to the MARCXML file. @PARAM2, String, should be utf8
Returns two array refs.
Converts text of input_file into array of MARC records with to_marc plugin
Koha Development Team <http://koha-community.org/>
Galen Charlton <galen.charlton@liblime.com>