Tripal
|
Functions | |
tripal_pub_remote_alter_form_AGL ($form, $form_state, $num_criteria=1) | |
tripal_pub_remote_validate_form_AGL ($form, $form_state) | |
tripal_pub_remote_search_AGL ($search_array, $num_to_retrieve, $page) | |
tripal_pub_AGL_range ($yazc, $search_str, $start, $num_to_retrieve, $total_records, $startyear, $endyear) | |
tripal_pub_AGL_count ($yazc, $search_str) | |
tripal_pub_AGL_decode ($text) | |
tripal_pub_AGL_parse_pubxml ($pub_xml) | |
tripal_pub_remote_search_AGL_get_subfield ($xml) | |
tripal_pub_remote_search_AGL_get_author ($xml, $ind1) | |
This file provides support for importing and parsing of results from the USDA National Agricultural Library (AGL) database. The functions here are used by both the publication importer setup form and the publication importer. The USDA AGL database uses a YAZ protocol for querying and retrieving records.
tripal_pub_AGL_count | ( | $yazc, | |
$search_str | |||
) |
Retrieves the total number of publications that match the search string.
$yazc | The YAZC connection object. |
$search_str | The search string to use for searching. |
tripal_pub_AGL_decode | ( | $text | ) |
Decode the unusal text encoding returned from our call to yaz_record(..., 'xml; charset=marc-8,utf-8') Some characters are in UTF-8, some are encoded as HTML entities, and some HTML entities are double-encoded, for example ‘ A straight call to mb_convert_encoding() will corrupt any UTF-8 characters, so only convert what appears to be an HTML entity
$text | The string to be decoded to "pure" UTF-8 |
tripal_pub_AGL_parse_pubxml | ( | $pub_xml | ) |
Parse publication XML for a single publication
Description of XML format: http://www.loc.gov/marc/bibliographic/bdsummary.html
$pub_xml | A string containing the XML for a single publications |
tripal_pub_AGL_range | ( | $yazc, | |
$search_str, | |||
$start, | |||
$num_to_retrieve, | |||
$total_records, | |||
$startyear, | |||
$endyear | |||
) |
Retrieves a range of publications from AGL
$yazc | The YAZC connection object. |
$search_str | The search string to use for searching. |
$start | The start of the range |
$num_to_retrieve | The number of publications to retrieve |
$total_records | The total number of records in the dataset. This value should have been retrieved by tripal_pub_AGL_count() function. |
tripal_pub_remote_alter_form_AGL | ( | $form, | |
$form_state, | |||
$num_criteria = 1 |
|||
) |
A hook for altering the publication importer form. It Changes the 'Days' element to 'Year' and removes the 'Journal Name' filter.
$form | The Drupal form array |
$form_state | The form state array |
$num_criteria | The number of criteria the user currently has added to the form |
tripal_pub_remote_search_AGL | ( | $search_array, | |
$num_to_retrieve, | |||
$page | |||
) |
A hook for performing the search on the AGL database.
$search_array | An array containing the search criteria for the search |
$num_to_retrieve | Indicates the maximum number of publications to retrieve from the remote database |
$page | Indicates the page to retrieve. This corresponds to a paged table, where each page has $num_to_retrieve publications. |
tripal_pub_remote_search_AGL_get_author | ( | $xml, | |
$ind1 | |||
) |
Used for parsing of the XML results to get details about an author
$xml | The XML object to read |
$ind1 | Indicates how an author record is stored; 0 means given name is first 1 means surname is first, 3 means a family name is given |
tripal_pub_remote_search_AGL_get_subfield | ( | $xml | ) |
Used for parsing of the XML results to get a set of subfields
$xml | The XMl object to read |
tripal_pub_remote_validate_form_AGL | ( | $form, | |
$form_state | |||
) |
A hook for providing additional validation of importer setup form.
$form | The Drupal form array |
$form_state | The form state array |