Browse Source

Added fix for AGL past days, and added more setup documentation

spficklin 12 years ago
parent
commit
2c6dba20b8

+ 2 - 10
tripal_pub/includes/importers/AGL.inc

@@ -1,15 +1,8 @@
 <?php
 /**
- * Installation:
- * 1) Install the yaz libraries: sudo apt-get install yaz libyaz3 libyaz3-dev
- * 2) Install the PHP module: sudo pecl install yaz
- * 3) Add "extension=yaz.so" to php.ini
- * 4) Restart apache
- * 
  *  
  */
 
-
 /**
  *
  */
@@ -65,9 +58,8 @@ function tripal_pub_remote_search_AGL($search_array, $num_to_retrieve, $pager_id
     // get the date of the day suggested
     $past_timestamp = time() - ($days * 86400);
     $past_date = getdate($past_timestamp); 
-    $ccl .= " and (date>=" . sprintf("%04d%02d%02d", $past_date['year'], $past_date['mon'], $past_date['mday']) . ")";
+    $ccl .= " and (date>=" . sprintf("%04d%02d%02d.0", $past_date['year'], $past_date['mon'], $past_date['mday']) . ")";
   }
-  //$ccl = "(date=20110805220826.0)";
 
   // yaz_connect() prepares for a connection to a Z39.50 server. This function is non-blocking 
   // and does not attempt to establish a connection - it merely prepares a connect to be 
@@ -92,7 +84,7 @@ function tripal_pub_remote_search_AGL($search_array, $num_to_retrieve, $pager_id
     "author"   => "u=1003",
     "abstract" => "u=62",
     "id"       => "u=12",
-    "date"     => "u=1012 r=o p=3 s=100 ", 
+    "date"     => "u=1011 r=o p=3 s=100 ", 
   );
   yaz_ccl_conf($yazc, $fields);
   

+ 2 - 2
tripal_pub/includes/pub_importers.inc

@@ -260,8 +260,8 @@ function tripal_pub_importer_setup_form(&$form_state = NULL, $pub_import_id = NU
   
   $form['days'] = array(
     '#type'          => 'textfield',
-    '#title'         => t('Days'),
-    '#description'   => t('Limit the search to include pubs that have been added to the database this many days before today.'),
+    '#title'         => t('Days since record modified'),
+    '#description'   => t('Limit the search to include pubs that have been added no more than this many days before today.'),
     '#default_value' => $days,
     '#size'          => 5,
   );

+ 17 - 5
tripal_pub/theme/tripal_pub_admin.tpl.php

@@ -28,10 +28,22 @@ been added to Chado database.
     to "sync" them with Drupal.  Use the <?php print l('sync publications', 'admin/tripal/tripal_pub/sync') ?>
     page to sync all publications.</p></li>
   <li><p><b>Configure the Search Behavior</b>: Before allowing site visitors to search for publications 
-   visit the <?php print l('configuration page', 'admin/tripal/tripal_pub/configuration') ?> to disable or enable
-   fields for searching.  Tripal uses its own ontology for storing publication information in Chado, and all 
-   child terms of the "Publication Details" are made available for searching. However, some of these
-   may not be desired for searching and can be disabled.</p></li>
+    visit the <?php print l('configuration page', 'admin/tripal/tripal_pub/configuration') ?> to disable or enable
+    fields for searching.  Tripal uses its own ontology for storing publication information in Chado, and all 
+    child terms of the "Publication Details" are made available for searching. However, some of these
+    may not be desired for searching and can be disabled.</p></li>
+  <li><p><b>AGL Importer</b>: Initially, the Tripal publication module supports creating publication 
+    importers using PubMed and the USDA National Agricultural Library (AGL).  The AGL database uses 
+    a Z39.50 protocol for querying and therefore Tripal requires the 'YAZ' library to connect.  Before
+    you can query AGL you must install the YAZ library and the PHP YAZ library.  The following steps can
+    be used on an Ubuntu 12.04 server to intall the necessary pre-requisites:
+    <ol>
+      <li>Install the YAZ libraries: sudo apt-get install yaz libyaz4-dev</li>
+      <li>Install the PHP YAZ extension: sudo pecl install yaz</li>
+      <li>Add the text 'extesion=yaz.so' to the appropriate php.ini file (e.g. /etc/php5/apache2filter/php.ini)</li>
+      <li>Restart the webserver</li>
+    </ol>
+    </p></li>
 </ol>
 <h3>Features of this Module:</h3>
 <ul>
@@ -39,7 +51,7 @@ been added to Chado database.
     Once added, publications can be modified or deleted by clicking the Edit tab at the top of a publication page.</p></li>
   
   <li><p><b>Publication Search Tool</b>: A <?php print l('search tool','find/publications') ?> is provided for 
-    finding publications. Unlike most default search tools for Tripal, this tool does not relies on Drupal Views</p></li>
+    finding publications. Unlike most default search tools for Tripal, this tool does not rely on Drupal Views</p></li>
     
   <li><p><b>Bulk Import of Publications</b>: Site administrators can  <?php print l('add a new publication importer', 'admin/tripal/tripal_pub/import/new') ?> 
     which provides a set of search terms for querying a remote publication database (e.g. PubMed). Publications