function tripal_get_remote_pubs

2.x tripal_pub.pub_importers.inc tripal_get_remote_pubs($remote_db, $search_array, $num_to_retrieve, $page = 0)
3.x tripal_chado.pub_importers.inc tripal_get_remote_pubs($remote_db, $search_array, $num_to_retrieve, $page = 0)

Retrieves a list of publications as an associated array where keys correspond directly with Tripal Pub CV terms.

Parameters

remote_db: The name of the remote publication database to query. These names should match the name of the databases in the Chado 'db' table. Currently supported databass include 'PMID': PubMed

search_array: An associate array containing the search criteria. The following key are expected 'remote_db': Specifies the name of the remote publication database 'num_criteria': Specifies the number of criteria present in the search array 'days': The number of days to include in the search starting from today 'criteria': An associate array containing the search critiera. There should be no less than 'num_criteria' elements in this array.

The following keys are expected in the 'criteria' array 'search_terms': A list of terms to search on, separated by spaces. 'scope': The fields to search in the remote database. Valid values include: 'title', 'abstract', 'author' and 'any' 'operation': The logical operation to use for this criteria. Valid values include: 'AND', 'OR' and 'NOT'.

$num_to_retrieve: The number of records to retrieve. In cases with large numbers of records to retrieve, the remote database may limit the size of each retrieval.

$page: Optional. If this function is called where the page for the pager cannot be set using the $_GET variable, use this argument to specify the page to retrieve.

Return value

Returns an array of pubs where each element is an associative array where the keys are Tripal Pub CV terms.

Related topics

7 calls to tripal_get_remote_pubs()
tripal_execute_active_pub_importers in tripal_pub/includes/tripal_pub.pub_importers.inc
Imports all publications for all active import setups.
tripal_execute_pub_importer in tripal_pub/includes/tripal_pub.pub_importers.inc
Imports all publications for a given publication import setup.
tripal_get_remote_pub in tripal_pub/includes/tripal_pub.pub_importers.inc
This function is used to perfom a query using one of the supported databases and return the raw query results. This may be XML or some other format as provided by the database.
tripal_import_pub_by_dbxref in tripal_pub/includes/tripal_pub.pub_importers.inc
Imports a singe publication specified by a remote database cross reference.
tripal_pub_get_remote_search_results in tripal_pub/api/tripal_pub.DEPRECATED.inc

... See full list

1 string reference to 'tripal_get_remote_pubs'

File

tripal_pub/includes/tripal_pub.pub_importers.inc, line 1714
Management of importers

Code

function tripal_get_remote_pubs($remote_db, $search_array, $num_to_retrieve, $page = 0) {

  // now call the callback function to get the results
  $callback = "tripal_pub_remote_search_$remote_db";
  $pubs = array(
    'total_records' => 0,
    'search_str' => '',
    'pubs' => array(),
  );
  if (function_exists($callback)) {
    $pubs = call_user_func($callback, $search_array, $num_to_retrieve, $page);
  }
  return $pubs;
}