Tripal
Functions
Data Importing

Functions

 hook_handle_uploaded_file ($file, $type)
 
 tripal_run_importer ($import_id, TripalJob $job=NULL)
 
 tripal_run_importer_run ($loader, $logger)
 
 tripal_run_importer_post_run ($loader, $logger)
 

Detailed Description

Provides an application programming interface (API) for working with data file importers using the TripalImporter class into a chado database.

Function Documentation

◆ hook_handle_uploaded_file()

hook_handle_uploaded_file (   $file,
  $type 
)

Implements hook_handle_uploaded_file().

This is a Tripal hook that allows the module to set the proper parameters for a file uploaded via the Tripal HTML5 uploader.

Parameters
object$fileThe Drupal file object of the newly uploaded file.
string$typeThe category or type of file.
Returns
int A Drupal managed file ID.

◆ tripal_run_importer()

tripal_run_importer (   $import_id,
TripalJob  $job = NULL 
)

Imports data into the database.

Tripal provides the TripalImporter class to allow site developers to create their own data loaders. Site users can then use any data loader implemented for the site by submitting the form that comes with the TripalImporter implementation. This function runs the importer using the arguments provided by the user.

Parameters
int$import_idThe ID of the import record.
\Drupal\tripal\Services\TripalJob$jobAn optional Job object.
Exceptions
Exception

◆ tripal_run_importer_post_run()

tripal_run_importer_post_run (   $loader,
  $logger 
)

Second step of the tripal_run_importer.

Parameters
Drupal\tripal\TripalImporter\TripalImporterBase$loaderThe TripalImporter object.
Drupal\tripal\Services\TripalLogger$loggerThe TripalLogger object.

◆ tripal_run_importer_run()

tripal_run_importer_run (   $loader,
  $logger 
)

First step of the tripal_run_importer.

Parameters
Drupal\tripal\TripalImporter\TripalImporterBase$loaderThe TripalImporter object.
Drupal\tripal\Services\TripalLogger$loggerThe TripalLogger object.
Exceptions
Exception