|
| | __construct (array $configuration, $plugin_id, $plugin_definition, TripalPubLibraryManager $pub_library_manager, Connection $public, ChadoConnection $connection, Messenger $messenger, TripalLogger $logger, TripalFileRetriever $fileretriever, TripalBackendPublishManager $publish_manager,) |
| |
| | form ($form, &$form_state) |
| |
| | formValidate ($form, &$form_state) |
| |
| | formSubmit ($form, &$form_state) |
| |
| | findExistingPublications (array $publications) |
| |
| | run () |
| |
| | __construct (array $configuration, $plugin_id, $plugin_definition, ChadoConnection $connection, ?Messenger $messenger=NULL, ?TripalLogger $logger=NULL, ?TripalFileRetriever $fileretriever=NULL, ?TripalBackendPublishManager $publish_manager=NULL,) |
| |
| | getChadoConnection () |
| |
| | startTransactions () |
| |
| | addAnalysis ($form, &$form_state) |
| |
| | postRun () |
| |
| | __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 () |
| |
|
| static | create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) |
| |
|
static | test_click_on_change (array &$form, $form_state) |
| |
|
static | database_on_change (array &$form, $form_state) |
| |
|
| | formQueryIdNotSet (&$form, $form_state) |
| |
| | getRemoteDbId (string $db_name) |
| |
| | cachePublicationCvterms () |
| |
| | insertMissingPublicationsDbxref (array $publications) |
| |
| | getNewPublicationAccessions (array $publications) |
| |
| | insertPublications (array &$publications) |
| |
| | getPublicationTypeId (array &$publications, int $index) |
| |
| | insertPubDbxrefs () |
| |
| | insertPubProps (array $publications) |
| |
| | specialCaseProps (&$publications) |
| |
| | checkIfSupportedProperty (string $key, string|array $value, array &$missing_cvterms) |
| |
| | insertContacts (array $publications, bool $do_contact) |
| |
| | addAuthors (string $accession, array $publication, bool $do_contact=FALSE) |
| |
| | getContact (string $contact_name, string $type) |
| |
| | getContactType (string $type_name) |
| |
| | run_init () |
| |
| | addBundleTypeProperty (string $pkey, int $record_id, string $property_table, string $termIdSpace, string $termAccession, string $value='', ?int $rank=NULL) |
| |
| | setTotalItems ($total_items) |
| |
| | addItemsHandled ($num_handled) |
| |
| | setItemsHandled ($total_handled) |
| |
| | setInterval ($interval) |
| |
| | xmlIsValid (string $xml) |
| |
◆ __construct()
◆ addAuthors()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::addAuthors |
( |
string |
$accession, |
|
|
array |
$publication, |
|
|
bool |
$do_contact = FALSE |
|
) |
| |
|
protected |
Add one or more authors to a publication through the pubauthor table, and optionally the pubauthor_contact and contact tables
- Parameters
-
| string | $accession | The external database accession for this publication |
| array | $publication | A single publication query result. |
| bool | $do_contact | If TRUE, then create and link an entry in the chado.contact table |
- Returns
- int A count of the number of records added Example PMID with a suffix: 38266644 Example PMID that is a collective: 12773082
◆ cachePublicationCvterms()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::cachePublicationCvterms |
( |
| ) |
|
|
protected |
Caches cvterm_id values for all cvterms in the "tripal_pub" vocabulary, saving them in the class variable $this->cvterm_lookups
◆ checkIfSupportedProperty()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::checkIfSupportedProperty |
( |
string |
$key, |
|
|
string|array |
$value, |
|
|
array & |
$missing_cvterms |
|
) |
| |
|
protected |
Helper function for insertPubProps to determine if the property CV term is supported.
- Parameters
-
| string | $key | The property key, which is a CV term. |
| string | array | $value | The property value or values. |
| array | &$missing_cvterms | Array keys define a list of non-supported CV terms. |
- Returns
- array An array of values to be saved, or NULL if the $key is not supported.
◆ create()
| static Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::create |
( |
ContainerInterface |
$container, |
|
|
array |
$configuration, |
|
|
|
$plugin_id, |
|
|
|
$plugin_definition |
|
) |
| |
|
static |
Implements ContainerFactoryPluginInterface->create().
We are injecting an additional dependency here, the TripalPubLibraryManager.
Since we have implemented the ContainerFactoryPluginInterface this static function will be called behind the scenes when a Plugin Manager uses createInstance(). Specifically this method is used to determine the parameters to pass to the constructor.
- Parameters
-
| Symfony\Component\DependencyInjection\ContainerInterface | $container | The container. |
| array | $configuration | A configuration array containing information about the plugin instance. |
| string | $plugin_id | The plugin ID for the plugin instance. |
| mixed | $plugin_definition | The plugin implementation definition. |
- Returns
- static
Reimplemented from Drupal\tripal_chado\TripalImporter\ChadoImporterBase.
◆ findExistingPublications()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::findExistingPublications |
( |
array |
$publications | ) |
|
Finds publication accessions that already are stored in Chado.
Results are stored in $this->pub_index
- Parameters
-
| array | $publications | Publications loaded from the external database |
- Returns
- int The number of publications not currently stored in Chado
◆ form()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::form |
( |
|
$form, |
|
|
& |
$form_state |
|
) |
| |
◆ formQueryIdNotSet()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::formQueryIdNotSet |
( |
& |
$form, |
|
|
|
$form_state |
|
) |
| |
|
protected |
Helper function for form(), code to handle the case where the query ID is not yet set.
- Parameters
-
| array | &$form | The form array definition. |
| \Drupal\Core\Form\FormStateInterface | $form_state | The form state object. |
◆ formSubmit()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::formSubmit |
( |
|
$form, |
|
|
& |
$form_state |
|
) |
| |
{Handles submission of the form elements.The form elements provided in the implementation of the form() function can be used for special submit if needed.
- Parameters
-
| array | $form | The form array definition. |
| \Drupal\Core\Form\FormStateInterface | $form_state | The form state object. |
}
Implements Drupal\tripal\TripalImporter\Interfaces\TripalImporterInterface.
◆ formValidate()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::formValidate |
( |
|
$form, |
|
|
& |
$form_state |
|
) |
| |
◆ getContact()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::getContact |
( |
string |
$contact_name, |
|
|
string |
$type |
|
) |
| |
|
protected |
Gets the contact_id of a person, will create the contact if it does not already exist
- Parameters
-
| string | $contact_name | The name of a contact |
| string | $type | The type of contact in the tripal_contact ontology, most commonly 'Person' |
- Returns
- int The contact_id value
◆ getContactType()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::getContactType |
( |
string |
$type_name | ) |
|
|
protected |
Gets a cvterm_id from the tripal_contact ontology.
- Parameters
-
| string | $type_name | Corresponds to the 'name' column of the cvterm table |
- Returns
- int Corresponds to the 'cvterm_id' column of the cvterm table.
◆ getNewPublicationAccessions()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::getNewPublicationAccessions |
( |
array |
$publications | ) |
|
|
protected |
Extract a list of new publication accessions that need to be imported
- Parameters
-
| array | $publications | The publications returned from the external database |
- Returns
- void The list is stored at $this->new_accessions
◆ getPublicationTypeId()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::getPublicationTypeId |
( |
array & |
$publications, |
|
|
int |
$index |
|
) |
| |
|
protected |
Get the cvterm_id for the publication type
- Parameters
-
| array | &$publications | Array of publication records returned by the external database. |
| int | $index | Array key for the publication of interest. |
- Returns
- int The corresponding cvterm_id value
- Exceptions
-
Exception If type is not defined in the publication, or if the type is not available in the tripal_pub ontology
◆ getRemoteDbId()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::getRemoteDbId |
( |
string |
$db_name | ) |
|
|
protected |
Retrieves the pkey value from the chado.db table of the specified databse
- Parameters
-
| string | $db_name | The name of the remote database |
- Returns
- void Stores the returned value in $this->db_id
- Exceptions
-
Exception Exception if the database name does not exist
◆ insertContacts()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::insertContacts |
( |
array |
$publications, |
|
|
bool |
$do_contact |
|
) |
| |
|
protected |
Add authors to all specified publications
- Parameters
-
| array | $publications | Results from the publication external database query |
| bool | $do_contact | If TRUE, then create and link an entry in the chado.contact table |
- Returns
- int Count of number of contacts added
◆ insertMissingPublicationsDbxref()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::insertMissingPublicationsDbxref |
( |
array |
$publications | ) |
|
|
protected |
Inserts new publication accessions into the dbxref table.
- Parameters
-
| array | $publications | All publications returned by the external database |
- Returns
- int A count of the number of records inserted Inserted dbxref_id pkey values are stored in $this->pub_index
◆ insertPubDbxrefs()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::insertPubDbxrefs |
( |
| ) |
|
|
protected |
Link publications to the database accessions through pub_dbxref table
◆ insertPublications()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::insertPublications |
( |
array & |
$publications | ) |
|
|
protected |
Inserts new publications into the pub table
- Parameters
-
| array | &$publications | All publications returned by the external database |
- Returns
- int A count of the number of publications inserted
◆ insertPubProps()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::insertPubProps |
( |
array |
$publications | ) |
|
|
protected |
Add publication properties to the chado.pubprop table
- Parameters
-
| array | $publications | All publications returned by the external database |
- Returns
- int A count of the number of properties inserted
◆ run()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::run |
( |
| ) |
|
◆ run_init()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::run_init |
( |
| ) |
|
|
protected |
Handles initialization for the run() function
- Returns
- array|NULL The criteria array, or NULL if an error occurred
◆ specialCaseProps()
| Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::specialCaseProps |
( |
& |
$publications | ) |
|
|
protected |
Special case handling for specific properties
- Parameters
-
| array | &$publications | The array of publications being imported |
◆ $batch_size
| int Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::$batch_size = 100 |
|
protected |
Stores the maximum size of database query batches
◆ $contact_lookups
| array Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::$contact_lookups = [] |
|
protected |
Stores a few cached cvterm_id values for the tripal_contact ontology
Key is CV name, value is cvterm_id
◆ $cvterm_lookups
| array Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::$cvterm_lookups = NULL |
|
protected |
Stores all of the cvterm_id values for the tripal_pub ontology
Key is CV name, value is cvterm_id
◆ $db_id
| int Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::$db_id = NULL |
|
protected |
db_id value from the chado.db table for the external database
◆ $new_accessions
| array Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::$new_accessions = [] |
|
protected |
Stores accessions of new publications not already stored in chado
◆ $pub_index
| array Drupal\tripal_chado\Plugin\TripalImporter\PubSearchQueryImporter::$pub_index = [] |
|
protected |
Stores information for retrieved publications keyed by the accession
First key is accession, second level keys implemented are:
- 'index' - int, the $publications array index
- 'pub_id' - int, the pkey of the chado.pub table
- 'is_new' - boolean, if TRUE we need to insert this as a new publication
- 'dbxref_id' - int, the pkey of the chado.dbxref table
The documentation for this class was generated from the following file:
- tripal_chado/src/Plugin/TripalImporter/PubSearchQueryImporter.php