function tripal_pub_AGL_range

2.x tripal_pub.AGL.inc tripal_pub_AGL_range($yazc, $search_str, $start, $num_to_retrieve, $total_records)
3.x tripal_chado.pub_importer_AGL.inc tripal_pub_AGL_range($yazc, $search_str, $start, $num_to_retrieve, $total_records)
1.x AGL.inc tripal_pub_AGL_range($search_array, $start = 0, $limit = 10)
1 string reference to 'tripal_pub_AGL_range'
tripal_pub_remote_search_AGL in tripal_pub/includes/importers/AGL.inc

File

tripal_pub/includes/importers/AGL.inc, line 405

Code

function tripal_pub_AGL_range($search_array, $start = 0, $limit = 10) {
  $pubs = array();

  $search_str = $search_array['search_string'];
  $days = $search_array['days'];
  $limit = $search_array['limit'];

  $yazc = $_SESSION['tripal_pub_AGL_query'][$search_str]['yaz_connection'];
  $count = $_SESSION['tripal_pub_AGL_query'][$search_str]['Count'];
  yaz_range($yazc, 1, $num_pubs);
  if (!yaz_present($yazc)) {
    $error_no = yaz_errno($yazc);
    $error_msg = yaz_error($yazc);
    $additional = yaz_addinfo($yazc);
    if ($additional != $error_msg) {
      $error_msg .= " $additional";
    }
    drupal_set_message("ERROR waiting on search at AGL: ($error_no) $error_msg", "error");
    watchdog('tpub_import', "ERROR waiting on search at AGL: (%error_no) %error_msg", 
    array('%error_no' => $error_no, '%error_msg' => $error_msg), WATCHDOG_ERROR);
    return $pubs;
  }

  if ($start + $limit > $count) {
    $limit = $count - $start;
  }
  for ($i = $start; $i < $start + $limit; $i++) {
    $pub_xml = yaz_record($yazc, $i + 1, 'xml; charset=marc-8,utf-8');
    $pub = tripal_pub_AGL_parse_pubxml($pub_xml);
    $pubs[] = $pub;
  }
  return $pubs;
}