Tripal
|
Public Member Functions | |
__construct (array $configuration, $plugin_id, $plugin_definition) | |
describeUploadFileFormat () | |
setJob ($job) | |
createImportJob ($run_args, $file_details=[]) | |
load ($import_id) | |
submitJob () | |
prepareFiles () | |
cleanFile () | |
getArguments () | |
![]() | |
form ($form, &$form_state) | |
formSubmit ($form, &$form_state) | |
formValidate ($form, &$form_state) | |
run () | |
postRun () | |
addAnalysis ($form, &$form_state) | |
Protected Member Functions | |
setTotalItems ($total_items) | |
addItemsHandled ($num_handled) | |
setItemsHandled ($total_handled) | |
setInterval ($interval) | |
Protected Attributes | |
$job | |
$logger | |
$arguments | |
$import_id | |
$is_prepared | |
$messenger = NULL | |
$reported | |
$plugin_id | |
$plugin_definition | |
Defines an interface for tripal impoerter plugins.
Drupal\tripal\TripalImporter\TripalImporterBase::__construct | ( | array | $configuration, |
$plugin_id, | |||
$plugin_definition | |||
) |
{}
|
protected |
Adds to the count of the total number of items that have been handled.
int | $num_handled |
Drupal\tripal\TripalImporter\TripalImporterBase::cleanFile | ( | ) |
Cleans up any temporary files that were created by the prepareFile().
This function should be called after a run() to remove any temporary files and keep them from building up on the server.
Drupal\tripal\TripalImporter\TripalImporterBase::createImportJob | ( | $run_args, | |
$file_details = [] |
|||
) |
Creates a new importer record.
array | $run_args | An associative array of the arguments needed to run the importer. Each importer will have its own defined set of arguments. |
array | $file_details | An associative array with one of the following keys: -fid: provides the Drupal managed File ID for the file. -file_local: provides the full path to the file on the server. -file_remote: provides the remote URL for the file. This argument is optional if the loader does not use the built-in file loader. |
Drupal\tripal\TripalImporter\TripalImporterBase::describeUploadFileFormat | ( | ) |
Provide more informative description than is ideal in the annotation alone.
NOTE: Supports full HTML.
Drupal\tripal\TripalImporter\TripalImporterBase::getArguments | ( | ) |
Retrieves the list of arguments that were provided to the importer.
Drupal\tripal\TripalImporter\TripalImporterBase::load | ( | $import_id | ) |
Loads an existing import record into this object.
int | $import_id | The ID of the import record. |
Drupal\tripal\TripalImporter\TripalImporterBase::prepareFiles | ( | ) |
Prepares the importer files for execution.
This function must be run prior to the run() function to ensure that the import file is ready to go.
|
protected |
Updates the percent interval when the job progress is updated.
Updating the job progress incurrs a database write which takes time and if it occurs to frequently can slow down the loader. This should be a value between 0 and 100 to indicate a percent interval (e.g. 1 means update the progress every time the num_handled increases by 1%).
int | $interval | A number between 0 and 100. |
|
protected |
Sets the number of items that have been processed.
This should be called anytime the loader wants to indicate how many items have been processed. The amount of progress will be calculated using this number. If the amount of items handled exceeds the interval specified then the progress is reported to the user. If this loader is associated with a job then the job progress is also updated.
int | $total_handled | The total number of items that have been processed. |
Drupal\tripal\TripalImporter\TripalImporterBase::setJob | ( | $job | ) |
Associate this importer with the Tripal job that is running it.
Associating an import with a job will allow the importer to log messages to the job log.
\Drupal\tripal\Services\TripalJob | $job | An instance of a TripalJob. |
|
protected |
Sets the total number if items to be processed.
This should typically be called near the beginning of the loading process to indicate the number of items that must be processed.
int | $total_items | The total number of items to process. |
Drupal\tripal\TripalImporter\TripalImporterBase::submitJob | ( | ) |
Submits the importer for execution as a job.
|
protected |
The arguments needed for the importer. This is a list of key/value pairs in an associative array.
|
protected |
The ID for this import record.
|
protected |
Prior to running an importer it must be prepared to make sure the file is available. Preparing the importer will download all the necessary files. This value is set to TRUE after the importer is prepared for funning.
|
protected |
The job that this importer is associated with. This is needed for updating the status of the job.
|
protected |
The drupal logger for tripal. This allows any of the importers to send log messages.