Tripal
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Drupal\tripal_chado\TripalImporter\ChadoImporterBase Class Reference
Inheritance diagram for Drupal\tripal_chado\TripalImporter\ChadoImporterBase:
Inheritance graph
[legend]
Collaboration diagram for Drupal\tripal_chado\TripalImporter\ChadoImporterBase:
Collaboration graph
[legend]

Public Member Functions

 __construct (array $configuration, $plugin_id, $plugin_definition, ChadoConnection $connection, ?Messenger $messenger=NULL, ?TripalLogger $logger=NULL, ?TripalFileRetriever $fileretriever=NULL, ?TripalBackendPublishManager $publish_manager=NULL,)
 
 getChadoConnection ()
 
 startTransactions ()
 
 form ($form, &$form_state)
 
 addAnalysis ($form, &$form_state)
 
 postRun ()
 
- Public Member Functions inherited from Drupal\tripal\TripalImporter\TripalImporterBase
 __construct (array $configuration, $plugin_id, $plugin_definition, ?Messenger $messenger=NULL, ?TripalLogger $logger=NULL, ?TripalFileRetriever $fileretriever=NULL, ?TripalBackendPublishManager $publish_manager=NULL,)
 
 describeUploadFileFormat ()
 
 setJob ($job)
 
 rollbackTransaction (string $stage)
 
 createImportJob ($run_args, $file_details=[])
 
 load ($import_id)
 
 submitJob ()
 
 prepareFiles ()
 
 cleanFile ()
 
 setArguments (array $arguments)
 
 getArguments ()
 
- Public Member Functions inherited from Drupal\tripal\TripalImporter\Interfaces\TripalImporterInterface
 formSubmit ($form, &$form_state)
 
 formValidate ($form, &$form_state)
 
 run ()
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition,)
 

Protected Member Functions

 addBundleTypeProperty (string $pkey, int $record_id, string $property_table, string $termIdSpace, string $termAccession, string $value='', ?int $rank=NULL)
 
- Protected Member Functions inherited from Drupal\tripal\TripalImporter\TripalImporterBase
 setTotalItems ($total_items)
 
 addItemsHandled ($num_handled)
 
 setItemsHandled ($total_handled)
 
 setInterval ($interval)
 
 xmlIsValid (string $xml)
 

Protected Attributes

 $chado_schema_main
 
 $messenger = NULL
 
 $connection
 
array $bundle_type_id = []
 
- Protected Attributes inherited from Drupal\tripal\TripalImporter\TripalImporterBase
 $messenger = NULL
 
 $logger = NULL
 
 $fileretriever = NULL
 
 $publish_manager = NULL
 
 $job
 
 $arguments
 
 $import_id
 
 $is_prepared
 
 $reported
 
 $plugin_id
 
 $plugin_definition
 

Detailed Description

Defines an interface for tripal importer plugins.

Constructor & Destructor Documentation

◆ __construct()

Drupal\tripal_chado\TripalImporter\ChadoImporterBase::__construct ( array  $configuration,
  $plugin_id,
  $plugin_definition,
ChadoConnection  $connection,
?Messenger  $messenger = NULL,
?TripalLogger  $logger = NULL,
?TripalFileRetriever  $fileretriever = NULL,
?TripalBackendPublishManager  $publish_manager = NULL 
)

Constructs a TripalImporterBase object.

Parameters
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
Drupal\tripal_chado\Database\ChadoConnection$connectionA connection to the Chado database.
Drupal\Core\Messenger\Messenger$messengerThe Drupal messenger service.
Drupal\tripal\Services\TripalLogger$loggerThe Tripal logger service.
Drupal\tripal\Services\TripalFileRetriever$fileretrieverThe Tripal file retrieval service.
Drupal\tripal\TripalBackendPublish\PluginManager\TripalBackendPublishManager$publish_managerThe Tripal publish manager service.

Member Function Documentation

◆ addAnalysis()

Drupal\tripal_chado\TripalImporter\ChadoImporterBase::addAnalysis (   $form,
$form_state 
)

{Adds the form elements necessary for selecting an analaysis to the form.While every Importer must implement this function, Ideally it should be implomented by a child abstract Base class for each data store (e.g. Chado) and each importer should extend the new Base class to inherit the function. This will allow for consistency in the way the analysi form element is presented for all Importers working on the same data store.

Parameters
array$formThe form array definition.
\Drupal\Core\Form\FormStateInterface$form_stateThe form state object.
Returns
array An arrya definition containing the form elements for selecting an analysis.
}

Implements Drupal\tripal\TripalImporter\Interfaces\TripalImporterInterface.

◆ addBundleTypeProperty()

Drupal\tripal_chado\TripalImporter\ChadoImporterBase::addBundleTypeProperty ( string  $pkey,
int  $record_id,
string  $property_table,
string  $termIdSpace,
string  $termAccession,
string  $value = '',
?int  $rank = NULL 
)
protected

Adds the bundle type property to a record

Parameters
string$pkeyThe primary key column name
int$record_idThe pkey value for the record
string$property_tableThe name of the property table
string$termIdSpaceThe name in the chado.db table
string$termAccessionThe accession in the chado.dbxref table
string$value= '' Property value, can be empty string
?int$rank = NULL Optional rank

◆ create()

static Drupal\tripal_chado\TripalImporter\ChadoImporterBase::create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)
static

Implements ContainerFactoryPluginInterface->create().

Parameters
Symfony\Component\DependencyInjection\ContainerInterface$containerThe container.
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
Returns
static

Reimplemented from Drupal\tripal\TripalImporter\TripalImporterBase.

Reimplemented in Drupal\tripal_chado\Plugin\TripalImporter\GFF3Importer, Drupal\tripal_chado\Plugin\TripalImporter\OBOImporter, Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter, and Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter.

◆ form()

Drupal\tripal_chado\TripalImporter\ChadoImporterBase::form (   $form,
$form_state 
)

{Provides form elements to be added to the loader form.These form elements are added after the file uploader section that is automaticaly provided by the TripalImporter.

Parameters
array$formThe form array definition.
\Drupal\Core\Form\FormStateInterface$form_stateThe form state object.
Returns
array A new form array definition.
}

Implements Drupal\tripal\TripalImporter\Interfaces\TripalImporterInterface.

Reimplemented in Drupal\tripal_chado\Plugin\TripalImporter\FASTAImporter, Drupal\tripal_chado\Plugin\TripalImporter\GFF3Importer, Drupal\tripal_chado\Plugin\TripalImporter\NewickImporter, Drupal\tripal_chado\Plugin\TripalImporter\OBOImporter, Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter, Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter, and Drupal\tripal_chado\Plugin\TripalImporter\TreeGenerator.

◆ getChadoConnection()

Drupal\tripal_chado\TripalImporter\ChadoImporterBase::getChadoConnection ( )

Gets a chado database connection set to the correct schema.

Requires you to call the parent::form in your form.

◆ postRun()

Drupal\tripal_chado\TripalImporter\ChadoImporterBase::postRun ( )

Performs tasks after the importer has completed.

If the importer form specified one or more bundles to be published, these will be listed under the 'publish' key in the run arguments.

Returns
void No return value.

Reimplemented from Drupal\tripal\TripalImporter\TripalImporterBase.

Reimplemented in Drupal\tripal_chado\Plugin\TripalImporter\OBOImporter.

◆ startTransactions()

Drupal\tripal_chado\TripalImporter\ChadoImporterBase::startTransactions ( )

Creates a database transaction in the specific schema(s) this importer will be importing data into.

Returns
array An array of Drupal DatabaseTransaction objects. These are usually obtained by calling the startTransaction() method on the database connection object.

Reimplemented from Drupal\tripal\TripalImporter\TripalImporterBase.

Member Data Documentation

◆ $bundle_type_id

array Drupal\tripal_chado\TripalImporter\ChadoImporterBase::$bundle_type_id = []
protected

The type_id for the bundle(s)

Key is DB:accession, value is cvterm_id


The documentation for this class was generated from the following file: