Browse Source

API: changed names again... hopefully the last time :)

Lacey Sanderson 11 years ago
parent
commit
c6fe145450

+ 48 - 4
tripal_analysis/api/tripal_analysis.DEPRECATED.inc

@@ -4,6 +4,50 @@
  * Wrapper functions to provide backwards compatibility for the tripal analysis api
  */
 
+/**
+ * @deprecated Restructured API to make naming more readable and consistent.
+ * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
+ * This function has been replaced by tripal_register_analysis_child().
+ *
+ * @see tripal_register_analysis_child().
+ */
+function tripal_analysis_register_child($modulename) {
+
+  tripal_report_error(
+    'tripal_deprecated',
+    TRIPAL_NOTICE,
+    "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
+    array(
+      '%old_function'=>'tripal_analysis_register_child',
+      '%new_function' => 'tripal_register_analysis_child'
+    )
+  );
+
+  return tripal_register_analysis_child($modulename);
+}
+
+/**
+ * @deprecated Restructured API to make naming more readable and consistent.
+ * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
+ * This function has been replaced by tripal_unregister_analysis_child().
+ *
+ * @see tripal_unregister_analysis_child().
+ */
+function tripal_analysis_unregister_child($modulename) {
+
+  tripal_report_error(
+    'tripal_deprecated',
+    TRIPAL_NOTICE,
+    "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
+    array(
+      '%old_function'=>'tripal_analysis_unregister_child',
+      '%new_function' => 'tripal_unregister_analysis_child'
+    )
+  );
+
+  return tripal_unregister_analysis_child($modulename);
+}
+
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
@@ -95,9 +139,9 @@ function tripal_analysis_delete_property($analysis_id, $property, $cv_name = 'tr
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_analysis_retrieve().
+ * This function has been replaced by tripal_get_analysis().
  *
- * @see chado_analysis_retrieve().
+ * @see tripal_get_analysis().
  */
 function tripal_analysis_get_node($analysis_id) {
 
@@ -107,9 +151,9 @@ function tripal_analysis_get_node($analysis_id) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_analysis_get_node',
-      '%new_function' => 'chado_analysis_retrieve'
+      '%new_function' => 'tripal_get_analysis'
     )
   );
 
-  return chado_analysis_retrieve(array('analysis_id' => $analysis_id));
+  return tripal_get_analysis(array('analysis_id' => $analysis_id));
 }

+ 5 - 5
tripal_analysis/api/tripal_analysis.api.inc

@@ -22,7 +22,7 @@
  *
  * @ingroup tripal_analysis_api
  */
-function tripal_analysis_register_child($modulename) {
+function tripal_register_analysis_child($modulename) {
   $sql = "SELECT * FROM {tripal_analysis} WHERE modulename = :modname";
   if (!db_query($sql, array(':modname' => $modulename))->fetchField()) {
     $sql = "INSERT INTO {tripal_analysis} (modulename) VALUES (:modname)";
@@ -38,7 +38,7 @@ function tripal_analysis_register_child($modulename) {
  *
  * @ingroup tripal_analysis_api
  */
-function tripal_analysis_unregister_child($modulename) {
+function tripal_unregister_analysis_child($modulename) {
   if (db_table_exists('tripal_analysis')) {
       $sql = "DELETE FROM {tripal_analysis} WHERE modulename = :modname";
       db_query($sql, array(':modname' => $modulename));
@@ -70,7 +70,7 @@ function tripal_analysis_unregister_child($modulename) {
  *
  * @ingroup tripal_analysis_api
  */
-function chado_analysis_retrieve($identifier, $options) {
+function tripal_get_analysis($identifier, $options) {
 
   // Set Defaults
   if (!isset($options['include_fk'])) {
@@ -126,7 +126,7 @@ function chado_analysis_retrieve($identifier, $options) {
     tripal_report_error(
       'tripal_analysis_api',
       TRIPAL_ERROR,
-      "chado_analysis_retrieve: The identifiers you passed in were not unique. You passed in %identifier.",
+      "tripal_get_analysis: The identifiers you passed in were not unique. You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
       )
@@ -138,7 +138,7 @@ function chado_analysis_retrieve($identifier, $options) {
     tripal_report_error(
       'tripal_analysis_api',
       TRIPAL_ERROR,
-      "chado_analysis_retrieve: chado_generate_var() failed to return a analysis based on the identifiers
+      "tripal_get_analysis: chado_generate_var() failed to return a analysis based on the identifiers
         you passed in. You should check that your identifiers are correct, as well as, look
         for a chado_generate_var error for additional clues. You passed in %identifier.",
       array(

+ 4 - 4
tripal_contact/api/tripal_contact.DEPRECATED.inc

@@ -95,9 +95,9 @@ function tripal_contact_delete_property($contact_id, $property) {
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_contact_insert_record().
+ * This function has been replaced by tripal_insert_contact().
  *
- * @see chado_contact_insert_record().
+ * @see tripal_insert_contact().
  */
 function tripal_contact_add_contact($name, $description, $type, $properties) {
 
@@ -107,11 +107,11 @@ function tripal_contact_add_contact($name, $description, $type, $properties) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_contact_add_contact',
-      '%new_function' => 'chado_contact_insert_record'
+      '%new_function' => 'tripal_insert_contact'
     )
   );
 
-  return chado_contact_insert_record(array(
+  return tripal_insert_contact(array(
     'name' => $name,
     'description' => $description,
     'type_name' => $type,

+ 1 - 1
tripal_contact/api/tripal_contact.api.inc

@@ -33,7 +33,7 @@
  *
  * @ingroup tripal_contact_api
  */
-function chado_contact_insert_record($values) {
+function tripal_insert_contact($values) {
 
   $name = $values['name'];
   $description = $values['description'];

+ 52 - 52
tripal_cv/api/tripal_cv.DEPRECATED.inc

@@ -7,9 +7,9 @@
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_cv_retrieve().
+ * This function has been replaced by tripal_get_cv().
  *
- * @see chado_cv_retrieve().
+ * @see tripal_get_cv().
  */
 function tripal_cv_get_cv($select_values) {
 
@@ -19,19 +19,19 @@ function tripal_cv_get_cv($select_values) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_cv_get_cv',
-      '%new_function' => 'chado_cv_retrieve'
+      '%new_function' => 'tripal_get_cv'
     )
   );
 
-  return chado_cv_retrieve($select_values);
+  return tripal_get_cv($select_values);
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_cv_retrieve().
+ * This function has been replaced by tripal_get_cv().
  *
- * @see chado_cv_retrieve().
+ * @see tripal_get_cv().
  */
 function tripal_cv_get_cv_by_name($name) {
 
@@ -41,19 +41,19 @@ function tripal_cv_get_cv_by_name($name) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_cv_get_cv_by_name',
-      '%new_function' => 'chado_cv_retrieve'
+      '%new_function' => 'tripal_get_cv'
     )
   );
 
-  return chado_cv_retrieve(array('name' => $name));
+  return tripal_get_cv(array('name' => $name));
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_cv_retrieve().
+ * This function has been replaced by tripal_get_cv().
  *
- * @see chado_cv_retrieve().
+ * @see tripal_get_cv().
  */
 function tripal_cv_get_cv_by_id($cv_id) {
 
@@ -63,19 +63,19 @@ function tripal_cv_get_cv_by_id($cv_id) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_cv_get_cv_by_id',
-      '%new_function' => 'chado_cv_retrieve'
+      '%new_function' => 'tripal_get_cv'
     )
   );
 
-  return chado_cv_retrieve(array('cv_id' => $id));
+  return tripal_get_cv(array('cv_id' => $id));
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_cv_retrieve().
+ * This function has been replaced by tripal_get_cv().
  *
- * @see chado_cv_retrieve().
+ * @see tripal_get_cv().
  */
 function tripal_cv_get_cv_id($cv_name) {
 
@@ -85,11 +85,11 @@ function tripal_cv_get_cv_id($cv_name) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_cv_get_cv_id',
-      '%new_function' => 'chado_cv_retrieve'
+      '%new_function' => 'tripal_get_cv'
     )
   );
 
-  $cv = chado_cv_retrieve(array('name' => $cv_name));
+  $cv = tripal_get_cv(array('name' => $cv_name));
   if (isset($cv->cv_id)) {
     return $cv->cv_id;
   }
@@ -101,9 +101,9 @@ function tripal_cv_get_cv_id($cv_name) {
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by cv_get_select_options().
+ * This function has been replaced by tripal_get_cv_select_options().
  *
- * @see cv_get_select_options().
+ * @see tripal_get_cv_select_options().
  */
 function tripal_cv_get_cv_options() {
 
@@ -113,19 +113,19 @@ function tripal_cv_get_cv_options() {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_cv_get_cv_options',
-      '%new_function' => 'cv_get_select_options'
+      '%new_function' => 'tripal_get_cv_select_options'
     )
   );
 
-  return cv_get_select_options();
+  return tripal_get_cv_select_options();
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_cvterm_retrieve().
+ * This function has been replaced by tripal_get_cvterm().
  *
- * @see chado_cvterm_retrieve().
+ * @see tripal_get_cvterm().
  */
 function tripal_cv_get_cvterm_by_id($cvterm_id) {
 
@@ -135,19 +135,19 @@ function tripal_cv_get_cvterm_by_id($cvterm_id) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_cv_get_cvterm_by_id',
-      '%new_function' => 'chado_cvterm_retrieve'
+      '%new_function' => 'tripal_get_cvterm'
     )
   );
 
-  return chado_cvterm_retrieve(array('cvterm_id' => $cvterm_id));
+  return tripal_get_cvterm(array('cvterm_id' => $cvterm_id));
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_cvterm_retrieve().
+ * This function has been replaced by tripal_get_cvterm().
  *
- * @see chado_cvterm_retrieve().
+ * @see tripal_get_cvterm().
  */
 function tripal_cv_get_cvterm_by_name($name, $cv_id = NULL, $cv_name = 'tripal') {
 
@@ -157,7 +157,7 @@ function tripal_cv_get_cvterm_by_name($name, $cv_id = NULL, $cv_name = 'tripal')
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_cv_get_cvterm_by_name',
-      '%new_function' => 'chado_cvterm_retrieve'
+      '%new_function' => 'tripal_get_cvterm'
     )
   );
 
@@ -171,15 +171,15 @@ function tripal_cv_get_cvterm_by_name($name, $cv_id = NULL, $cv_name = 'tripal')
     );
   }
 
-  return chado_cvterm_retrieve($identifiers);
+  return tripal_get_cvterm($identifiers);
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_cvterm_retrieve().
+ * This function has been replaced by tripal_get_cvterm().
  *
- * @see chado_cvterm_retrieve().
+ * @see tripal_get_cvterm().
  */
 function tripal_cv_get_cvterm_by_synonym($synonym, $cv_id = NULL, $cv_name = 'tripal') {
 
@@ -189,11 +189,11 @@ function tripal_cv_get_cvterm_by_synonym($synonym, $cv_id = NULL, $cv_name = 'tr
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_cv_get_cvterm_by_synonym',
-      '%new_function' => 'chado_cvterm_retrieve'
+      '%new_function' => 'tripal_get_cvterm'
     )
   );
 
-  return chado_cvterm_retrieve(array(
+  return tripal_get_cvterm(array(
     'synonym' => array(
       'name' => $synonym,
       'cv_id' => $cv_id,
@@ -205,9 +205,9 @@ function tripal_cv_get_cvterm_by_synonym($synonym, $cv_id = NULL, $cv_name = 'tr
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by cvterm_get_select_options().
+ * This function has been replaced by tripal_get_cvterm_select_options().
  *
- * @see cvterm_get_select_options().
+ * @see tripal_get_cvterm_select_options().
  */
 function tripal_cv_get_cvterm_options($cv_id = 0) {
 
@@ -217,19 +217,19 @@ function tripal_cv_get_cvterm_options($cv_id = 0) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_cv_get_cvterm_options',
-      '%new_function' => 'cvterm_get_select_options'
+      '%new_function' => 'tripal_get_cvterm_select_options'
     )
   );
 
-  return cvterm_get_select_options($cv_id);
+  return tripal_get_cvterm_select_options($cv_id);
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_update_cvtermpath().
+ * This function has been replaced by tripal_update_cvtermpath().
  *
- * @see chado_update_cvtermpath().
+ * @see tripal_update_cvtermpath().
  */
 function tripal_cv_update_cvtermpath($cvid, $job_id = NULL) {
 
@@ -239,19 +239,19 @@ function tripal_cv_update_cvtermpath($cvid, $job_id = NULL) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_cv_update_cvtermpath',
-      '%new_function' => 'chado_update_cvtermpath'
+      '%new_function' => 'tripal_update_cvtermpath'
     )
   );
 
-  return chado_update_cvtermpath($cvid, $job_id);
+  return tripal_update_cvtermpath($cvid, $job_id);
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_cv_insert_record().
+ * This function has been replaced by tripal_insert_cv().
  *
- * @see chado_cv_insert_record().
+ * @see tripal_insert_cv().
  */
 function tripal_cv_add_cv($name, $definition) {
 
@@ -261,19 +261,19 @@ function tripal_cv_add_cv($name, $definition) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_cv_add_cv',
-      '%new_function' => 'chado_cv_insert_record'
+      '%new_function' => 'tripal_insert_cv'
     )
   );
 
-  return chado_cv_insert_record($name, $definition);
+  return tripal_insert_cv($name, $definition);
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_cvterm_insert_record().
+ * This function has been replaced by tripal_insert_cvterm().
  *
- * @see chado_cvterm_insert_record().
+ * @see tripal_insert_cvterm().
  */
 function tripal_cv_add_cvterm($term, $defaultcv = '_global', $is_relationship = 0, $update = 1, $dbname = 'internal') {
 
@@ -283,7 +283,7 @@ function tripal_cv_add_cvterm($term, $defaultcv = '_global', $is_relationship =
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_cv_add_cvterm',
-      '%new_function' => 'chado_cvterm_insert_record'
+      '%new_function' => 'tripal_insert_cvterm'
     )
   );
 
@@ -296,7 +296,7 @@ function tripal_cv_add_cvterm($term, $defaultcv = '_global', $is_relationship =
     unset($term['def']);
   }
 
-  return chado_cvterm_insert_record(
+  return tripal_insert_cvterm(
     $term,
     array(
       'update_existing' => $update
@@ -358,9 +358,9 @@ function tripal_cv_add_obo_ref($name, $path) {
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_cvterm_autocomplete().
+ * This function has been replaced by tripal_autocomplete_cvterm().
  *
- * @see chado_cvterm_autocomplete().
+ * @see tripal_autocomplete_cvterm().
  */
 function tripal_cv_cvterm_name_autocomplete($cv_id, $string = '') {
 
@@ -370,9 +370,9 @@ function tripal_cv_cvterm_name_autocomplete($cv_id, $string = '') {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_cv_cvterm_name_autocomplete',
-      '%new_function' => 'chado_cvterm_autocomplete'
+      '%new_function' => 'tripal_autocomplete_cvterm'
     )
   );
 
-  return chado_cvterm_autocomplete($cv_id, $string);
+  return tripal_autocomplete_cvterm($cv_id, $string);
 }

+ 21 - 21
tripal_cv/api/tripal_cv.api.inc

@@ -44,7 +44,7 @@
  *
  * @ingroup tripal_cv_api
  */
-function chado_cv_retrieve($identifiers, $options = array()) {
+function tripal_get_cv($identifiers, $options = array()) {
 
   // Set Defaults
   if (!isset($options['include_fk'])) {
@@ -57,7 +57,7 @@ function chado_cv_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_cv_api',
       TRIPAL_ERROR,
-      "chado_cv_retrieve: The identifier passed in is expected to be an array with the key
+      "tripal_get_cv: The identifier passed in is expected to be an array with the key
         matching a column name in the cv table (ie: cv_id or name). You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
@@ -68,7 +68,7 @@ function chado_cv_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_cv_api',
       TRIPAL_ERROR,
-      "chado_cv_retrieve: You did not pass in anything to identify the cv you want. The identifier
+      "tripal_get_cv: You did not pass in anything to identify the cv you want. The identifier
         is expected to be an array with the key matching a column name in the cv table
         (ie: cv_id or name). You passed in %identifier.",
       array(
@@ -89,7 +89,7 @@ function chado_cv_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_cv_api',
       TRIPAL_ERROR,
-      "chado_cv_retrieve: The identifiers you passed in were not unique. You passed in %identifier.",
+      "tripal_get_cv: The identifiers you passed in were not unique. You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
       )
@@ -101,7 +101,7 @@ function chado_cv_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_cv_api',
       TRIPAL_ERROR,
-      "chado_cv_retrieve: chado_generate_var() failed to return a cv based on the identifiers
+      "tripal_get_cv: chado_generate_var() failed to return a cv based on the identifiers
         you passed in. You should check that your identifiers are correct, as well as, look
         for a chado_generate_var error for additional clues. You passed in %identifier.",
       array(
@@ -125,7 +125,7 @@ function chado_cv_retrieve($identifiers, $options = array()) {
  *
  * @ingroup tripal_cv_api
  */
-function cv_get_select_options() {
+function tripal_get_cv_select_options() {
 
   $results = chado_select_record('cv', array('cv_id', 'name'), array());
 
@@ -168,7 +168,7 @@ function cv_get_select_options() {
  *
  * @ingroup tripal_cv_api
  */
-function chado_cvterm_retrieve($identifiers, $options = array()) {
+function tripal_get_cvterm($identifiers, $options = array()) {
 
   // Set Defaults
   if (!isset($options['include_fk'])) {
@@ -181,7 +181,7 @@ function chado_cvterm_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_cv_api',
       TRIPAL_ERROR,
-      "chado_cvterm_retrieve: The identifier passed in is expected to be an array with the key
+      "tripal_get_cvterm: The identifier passed in is expected to be an array with the key
         matching a column name in the cvterm table (ie: cvterm_id or name). You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
@@ -192,7 +192,7 @@ function chado_cvterm_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_cv_api',
       TRIPAL_ERROR,
-      "chado_cvterm_retrieve: You did not pass in anything to identify the cvterm you want. The identifier
+      "tripal_get_cvterm: You did not pass in anything to identify the cvterm you want. The identifier
         is expected to be an array with the key matching a column name in the cvterm table
         (ie: cvterm_id or name). You passed in %identifier.",
       array(
@@ -257,7 +257,7 @@ function chado_cvterm_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_cv_api',
       TRIPAL_ERROR,
-      "chado_cvterm_retrieve: The identifiers you passed in were not unique. You passed in %identifier.",
+      "tripal_get_cvterm: The identifiers you passed in were not unique. You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
       )
@@ -269,7 +269,7 @@ function chado_cvterm_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_cv_api',
       TRIPAL_ERROR,
-      "chado_cvterm_retrieve: chado_generate_var() failed to return a cvterm based on the identifiers
+      "tripal_get_cvterm: chado_generate_var() failed to return a cvterm based on the identifiers
         you passed in. You should check that your identifiers are correct, as well as, look
         for a chado_generate_var error for additional clues. You passed in %identifier.",
       array(
@@ -298,7 +298,7 @@ function chado_cvterm_retrieve($identifiers, $options = array()) {
  *
  * @ingroup tripal_cv_api
  */
-function cvterm_get_select_options($cv_id = 0) {
+function tripal_get_cvterm_select_options($cv_id = 0) {
 
   if ($cv_id > 0) {
     $results = chado_select_record('cvterm', array('cvterm_id', 'name'), array('cv_id' => $cv_id));
@@ -330,7 +330,7 @@ function cvterm_get_select_options($cv_id = 0) {
  *
  * @ingroup tripal_cv_api
  */
-function chado_update_cvtermpath($cvid, $job_id = NULL) {
+function tripal_update_cvtermpath($cvid, $job_id = NULL) {
   // TODO: need better error checking in this function
 
   // first get the controlled vocabulary name:
@@ -369,7 +369,7 @@ function chado_update_cvtermpath($cvid, $job_id = NULL) {
  *
  * @ingroup tripal_cv_api
  */
-function chado_cv_insert_record($name, $definition) {
+function tripal_insert_cv($name, $definition) {
 
   // insert/update values
   $ins_values = array(
@@ -448,7 +448,7 @@ function chado_cv_insert_record($name, $definition) {
  *
  * @ingroup tripal_cv_api
  */
-function chado_cvterm_insert_record($term, $options) {
+function tripal_insert_cvterm($term, $options) {
 
   // Set Defaults
   if (isset($term['cv_name'])) {
@@ -859,7 +859,7 @@ function tripal_insert_obo($name, $path) {
  *
  * @ingroup tripal_cv_api
  */
-function chado_cvterm_autocomplete($cv_id, $string = '') {
+function tripal_autocomplete_cvterm($cv_id, $string = '') {
   $sql = "
     SELECT cvterm_id, name
     FROM {cvterm}
@@ -893,7 +893,7 @@ function chado_cvterm_autocomplete($cv_id, $string = '') {
  *
  * @ingroup tripal_db_api
  */
-function chado_associate_cvterm($basetable, $record_id, $cvterm) {
+function tripal_associate_cvterm($basetable, $record_id, $cvterm) {
   $linking_table = $basetable . '_cvterm';
   $foreignkey_name = $basetable . '_id';
 
@@ -917,7 +917,7 @@ function chado_associate_cvterm($basetable, $record_id, $cvterm) {
       tripal_report_error(
         'tripal_cv_api',
         TRIPAL_WARNING,
-        "chado_associate_cvterm: The cvterm needs to have either the cv_name or cv_id
+        "tripal_associate_cvterm: The cvterm needs to have either the cv_name or cv_id
           supplied. You were trying to associate a cvterm with the %base %record_id
           and supplied the cvterm values: %cvterm.",
         array('%base' => $basetable, '%record_id' => $record_id, '%cvterm' => print_r($cvterm,TRUE))
@@ -930,7 +930,7 @@ function chado_associate_cvterm($basetable, $record_id, $cvterm) {
     }
     elseif ($options['insert_cvterm']) {
       // Insert the cvterm
-      $insert = chado_cvterm_insert_record($values);
+      $insert = tripal_insert_cvterm($values);
       if (isset($insert->cvterm_id)) {
         $cvterm['cvterm_id'] = $insert->cvterm_id;
       }
@@ -938,7 +938,7 @@ function chado_associate_cvterm($basetable, $record_id, $cvterm) {
         tripal_report_error(
           'tripal_cv_api',
           TRIPAL_WARNING,
-          "chado_associate_cvterm: Unable to insert the cvterm using the cvterm values: %cvterm.",
+          "tripal_associate_cvterm: Unable to insert the cvterm using the cvterm values: %cvterm.",
           array('%cvterm' => print_r($cvterm,TRUE))
         );
         return FALSE;
@@ -948,7 +948,7 @@ function chado_associate_cvterm($basetable, $record_id, $cvterm) {
       tripal_report_error(
         'tripal_api',
         TRIPAL_WARNING,
-        "chado_associate_cvterm: The cvterm doesn't already exist. You supplied the cvterm values: %cvterm.",
+        "tripal_associate_cvterm: The cvterm doesn't already exist. You supplied the cvterm values: %cvterm.",
         array('%cvterm' => print_r($cvterm,TRUE))
       );
       return FALSE;

+ 36 - 36
tripal_db/api/tripal_db.DEPRECATED.inc

@@ -7,9 +7,9 @@
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_db_retrieve().
+ * This function has been replaced by tripal_get_db().
  *
- * @see chado_db_retrieve().
+ * @see tripal_get_db().
  */
 function tripal_db_get_db($select_values) {
 
@@ -19,19 +19,19 @@ function tripal_db_get_db($select_values) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_db_get_db',
-      '%new_function' => 'chado_db_retrieve'
+      '%new_function' => 'tripal_get_db'
     )
   );
 
-  return chado_db_retrieve($select_values);
+  return tripal_get_db($select_values);
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_db_retrieve().
+ * This function has been replaced by tripal_get_db().
  *
- * @see chado_db_retrieve().
+ * @see tripal_get_db().
  */
 function tripal_db_get_db_by_db_id($db_id) {
 
@@ -41,19 +41,19 @@ function tripal_db_get_db_by_db_id($db_id) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_db_get_db_by_db_id',
-      '%new_function' => 'chado_db_retrieve'
+      '%new_function' => 'tripal_get_db'
     )
   );
 
-  return chado_db_retrieve(array('db_id' => $db_id));
+  return tripal_get_db(array('db_id' => $db_id));
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_db_retrieve().
+ * This function has been replaced by tripal_get_db().
  *
- * @see chado_db_retrieve().
+ * @see tripal_get_db().
  */
 function tripal_db_get_db_by_name($name) {
 
@@ -63,19 +63,19 @@ function tripal_db_get_db_by_name($name) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_db_get_db_by_name',
-      '%new_function' => 'chado_db_retrieve'
+      '%new_function' => 'tripal_get_db'
     )
   );
 
-  return chado_db_retrieve(array('name' => $name));
+  return tripal_get_db(array('name' => $name));
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by db_get_select_options().
+ * This function has been replaced by tripal_get_db_select_options().
  *
- * @see db_get_select_options().
+ * @see tripal_get_db_select_options().
  */
 function tripal_db_get_db_options() {
 
@@ -85,19 +85,19 @@ function tripal_db_get_db_options() {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_db_get_db_options',
-      '%new_function' => 'db_get_select_options'
+      '%new_function' => 'tripal_get_db_select_options'
     )
   );
 
-  return db_get_select_options();
+  return tripal_get_db_select_options();
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_db_retrieve().
+ * This function has been replaced by tripal_get_db().
  *
- * @see chado_dbxref_retrieve().
+ * @see tripal_get_dbxref().
  */
 function tripal_db_get_dbxref($select_values) {
 
@@ -107,19 +107,19 @@ function tripal_db_get_dbxref($select_values) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_db_get_dbxref',
-      '%new_function' => 'chado_dbxref_retrieve'
+      '%new_function' => 'tripal_get_dbxref'
     )
   );
 
-  return chado_dbxref_retrieve($select_values);
+  return tripal_get_dbxref($select_values);
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_db_retrieve().
+ * This function has been replaced by tripal_get_db().
  *
- * @see chado_dbxref_retrieve().
+ * @see tripal_get_dbxref().
  */
 function tripal_db_get_dbxref_by_accession($accession, $db_id=0) {
 
@@ -129,7 +129,7 @@ function tripal_db_get_dbxref_by_accession($accession, $db_id=0) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_db_get_dbxref_by_accession',
-      '%new_function' => 'chado_dbxref_retrieve'
+      '%new_function' => 'tripal_get_dbxref'
     )
   );
 
@@ -141,15 +141,15 @@ function tripal_db_get_dbxref_by_accession($accession, $db_id=0) {
       'db_id' => $db_id
     );
   }
-  return chado_dbxref_retrieve($identifiers);
+  return tripal_get_dbxref($identifiers);
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_db_insert_record().
+ * This function has been replaced by tripal_insert_db().
  *
- * @see chado_db_insert_record().
+ * @see tripal_insert_db().
  */
 function tripal_db_add_db($dbname, $description = '', $url = '', $urlprefix = '', $update = 0) {
 
@@ -159,11 +159,11 @@ function tripal_db_add_db($dbname, $description = '', $url = '', $urlprefix = ''
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_db_add_db',
-      '%new_function' => 'chado_db_insert_record'
+      '%new_function' => 'tripal_insert_db'
     )
   );
 
-  return chado_db_insert_record(
+  return tripal_insert_db(
     array(
       'name' => $dbname,
       'description' => $description,
@@ -179,9 +179,9 @@ function tripal_db_add_db($dbname, $description = '', $url = '', $urlprefix = ''
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_dbxref_insert_record().
+ * This function has been replaced by tripal_insert_dbxref().
  *
- * @see chado_dbxref_insert_record().
+ * @see tripal_insert_dbxref().
  */
 function tripal_db_add_dbxref($db_id, $accession, $version = '', $description = '') {
 
@@ -191,11 +191,11 @@ function tripal_db_add_dbxref($db_id, $accession, $version = '', $description =
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_db_add_dbxref',
-      '%new_function' => 'chado_dbxref_insert_record'
+      '%new_function' => 'tripal_insert_dbxref'
     )
   );
 
-  return chado_dbxref_insert_record(array(
+  return tripal_insert_dbxref(array(
     'db_id' => $db_id,
     'accession' => $accession,
     'version' => $version,
@@ -206,9 +206,9 @@ function tripal_db_add_dbxref($db_id, $accession, $version = '', $description =
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_associate_dbxref().
+ * This function has been replaced by tripal_associate_dbxref().
  *
- * @see chado_associate_dbxref().
+ * @see tripal_associate_dbxref().
  */
 function tripal_db_add_dbxref_link($linking_table, $dbxref_id, $foreignkey_name, $foreignkey_id) {
 
@@ -218,14 +218,14 @@ function tripal_db_add_dbxref_link($linking_table, $dbxref_id, $foreignkey_name,
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_db_add_dbxref_link',
-      '%new_function' => 'chado_associate_dbxref'
+      '%new_function' => 'tripal_associate_dbxref'
     )
   );
 
   if (preg_match('/(\w+)_dbxref/',$linking_table,$matches)) {
     $basetable = $matches[1];
 
-    return chado_associate_dbxref($basetable, $foreignkey_id, array('dbxref_id' => $dbxref_id));
+    return tripal_associate_dbxref($basetable, $foreignkey_id, array('dbxref_id' => $dbxref_id));
   }
   else {
     return FALSE;

+ 18 - 18
tripal_db/api/tripal_db.api.inc

@@ -54,7 +54,7 @@
  *
  * @ingroup tripal_db_api
  */
-function chado_db_retrieve($identifiers, $options = array()) {
+function tripal_get_db($identifiers, $options = array()) {
 
   // Set Defaults
   if (!isset($options['include_fk'])) {
@@ -67,7 +67,7 @@ function chado_db_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_db_api',
       TRIPAL_ERROR,
-      "chado_db_retrieve: The identifier passed in is expected to be an array with the key
+      "tripal_get_db: The identifier passed in is expected to be an array with the key
         matching a column name in the db table (ie: db_id or name). You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
@@ -78,7 +78,7 @@ function chado_db_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_db_api',
       TRIPAL_ERROR,
-      "chado_db_retrieve: You did not pass in anything to identify the db you want. The identifier
+      "tripal_get_db: You did not pass in anything to identify the db you want. The identifier
         is expected to be an array with the key matching a column name in the db table
         (ie: db_id or name). You passed in %identifier.",
       array(
@@ -99,7 +99,7 @@ function chado_db_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_db_api',
       TRIPAL_ERROR,
-      "chado_db_retrieve: The identifiers you passed in were not unique. You passed in %identifier.",
+      "tripal_get_db: The identifiers you passed in were not unique. You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
       )
@@ -111,7 +111,7 @@ function chado_db_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_db_api',
       TRIPAL_ERROR,
-      "chado_db_retrieve: chado_generate_var() failed to return a db based on the identifiers
+      "tripal_get_db: chado_generate_var() failed to return a db based on the identifiers
         you passed in. You should check that your identifiers are correct, as well as, look
         for a chado_generate_var error for additional clues. You passed in %identifier.",
       array(
@@ -135,7 +135,7 @@ function chado_db_retrieve($identifiers, $options = array()) {
  *
  * @ingroup tripal_db_api
  */
-function db_get_select_options() {
+function tripal_get_db_select_options() {
 
   $result = chado_query("SELECT db_id, name FROM {db}");
 
@@ -200,7 +200,7 @@ function db_get_select_options() {
  *
  * @ingroup tripal_db_api
  */
-function chado_dbxref_retrieve($identifiers, $options = array()) {
+function tripal_get_dbxref($identifiers, $options = array()) {
 
   // Set Defaults
   if (!isset($options['include_fk'])) {
@@ -213,7 +213,7 @@ function chado_dbxref_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_db_api',
       TRIPAL_ERROR,
-      "chado_dbxref_retrieve: The identifier passed in is expected to be an array with the key
+      "tripal_get_dbxref: The identifier passed in is expected to be an array with the key
         matching a column name in the dbxref table (ie: dbxref_id or name). You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
@@ -224,7 +224,7 @@ function chado_dbxref_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_db_api',
       TRIPAL_ERROR,
-      "chado_dbxref_retrieve: You did not pass in anything to identify the dbxref you want. The identifier
+      "tripal_get_dbxref: You did not pass in anything to identify the dbxref you want. The identifier
         is expected to be an array with the key matching a column name in the dbxref table
         (ie: dbxref_id or name). You passed in %identifier.",
       array(
@@ -254,7 +254,7 @@ function chado_dbxref_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_db_api',
       TRIPAL_ERROR,
-      "chado_dbxref_retrieve: The identifiers you passed in were not unique. You passed in %identifier.",
+      "tripal_get_dbxref: The identifiers you passed in were not unique. You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
       )
@@ -266,7 +266,7 @@ function chado_dbxref_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_db_api',
       TRIPAL_ERROR,
-      "chado_dbxref_retrieve: chado_generate_var() failed to return a dbxref based on the identifiers
+      "tripal_get_dbxref: chado_generate_var() failed to return a dbxref based on the identifiers
         you passed in. You should check that your identifiers are correct, as well as, look
         for a chado_generate_var error for additional clues. You passed in %identifier.",
       array(
@@ -304,7 +304,7 @@ function chado_dbxref_retrieve($identifiers, $options = array()) {
  *
  * @ingroup tripal_db_api
  */
-function chado_db_insert_record($values, $options) {
+function tripal_insert_db($values, $options) {
 
   // Default Values
   $dbname = $values['name'];
@@ -364,7 +364,7 @@ function chado_db_insert_record($values, $options) {
  *
  * @ingroup tripal_db_api
  */
-function chado_dbxref_insert_record($values) {
+function tripal_insert_dbxref($values) {
 
   $db_id = $values['db_id'];
   $accession = $values['accession'];
@@ -422,7 +422,7 @@ function chado_dbxref_insert_record($values) {
  *
  * @ingroup tripal_db_api
  */
-function chado_associate_dbxref($basetable, $record_id, $dbxref, $options = array()) {
+function tripal_associate_dbxref($basetable, $record_id, $dbxref, $options = array()) {
   $linking_table = $basetable . '_dbxref';
   $foreignkey_name = $basetable . '_id';
 
@@ -446,7 +446,7 @@ function chado_associate_dbxref($basetable, $record_id, $dbxref, $options = arra
       tripal_report_error(
         'tripal_db_api',
         TRIPAL_WARNING,
-        "chado_associate_dbxref: The dbxref needs to have either the db_name or db_id
+        "tripal_associate_dbxref: The dbxref needs to have either the db_name or db_id
           supplied. You were trying to associate a dbxref with the %base %record_id
           and supplied the dbxref values: %dbxref.",
         array('%base' => $basetable, '%record_id' => $record_id, '%dbxref' => print_r($dbxref,TRUE))
@@ -459,7 +459,7 @@ function chado_associate_dbxref($basetable, $record_id, $dbxref, $options = arra
     }
     elseif ($options['insert_dbxref']) {
       // Insert the dbxref
-      $insert = chado_dbxref_insert_record($values);
+      $insert = tripal_insert_dbxref($values);
       if (isset($insert->dbxref_id)) {
         $dbxref['dbxref_id'] = $insert->dbxref_id;
       }
@@ -467,7 +467,7 @@ function chado_associate_dbxref($basetable, $record_id, $dbxref, $options = arra
         tripal_report_error(
           'tripal_db_api',
           TRIPAL_WARNING,
-          "chado_associate_dbxref: Unable to insert the dbxref using the dbxref values: %dbxref.",
+          "tripal_associate_dbxref: Unable to insert the dbxref using the dbxref values: %dbxref.",
           array('%dbxref' => print_r($dbxref,TRUE))
         );
         return FALSE;
@@ -477,7 +477,7 @@ function chado_associate_dbxref($basetable, $record_id, $dbxref, $options = arra
       tripal_report_error(
         'tripal_api',
         TRIPAL_WARNING,
-        "chado_associate_dbxref: The dbxref doesn't already exist. You supplied the dbxref values: %dbxref.",
+        "tripal_associate_dbxref: The dbxref doesn't already exist. You supplied the dbxref values: %dbxref.",
         array('%dbxref' => print_r($dbxref,TRUE))
       );
       return FALSE;

+ 20 - 20
tripal_feature/api/tripal_feature.DEPRECATED.inc

@@ -354,9 +354,9 @@ function tripal_feature_delete_property_by_id($featureprop_id) {
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by feature_sequence_reverse_complement().
+ * This function has been replaced by tripal_reverse_compliment_sequence().
  *
- * @see feature_sequence_reverse_complement().
+ * @see tripal_reverse_compliment_sequence().
  */
 function tripal_feature_reverse_complement($sequence) {
 
@@ -366,19 +366,19 @@ function tripal_feature_reverse_complement($sequence) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_feature_reverse_complement',
-      '%new_function' => 'feature_sequence_reverse_complement'
+      '%new_function' => 'tripal_reverse_compliment_sequence'
     )
   );
 
-  return feature_sequence_reverse_complement($sequence);
+  return tripal_reverse_compliment_sequence($sequence);
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by feature_sequence_get_formatted().
+ * This function has been replaced by tripal_format_sequence().
  *
- * @see feature_sequence_get_formatted().
+ * @see tripal_format_sequence().
  */
 function tripal_feature_get_formatted_sequence($feature_id, $feature_name, $num_bases_per_line, $derive_from_parent, $aggregate, $output_format, $upstream, $downstream, $sub_features = array(), $relationship = '', $rel_part = '') {
 
@@ -388,11 +388,11 @@ function tripal_feature_get_formatted_sequence($feature_id, $feature_name, $num_
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_feature_get_formatted_sequence',
-      '%new_function' => 'feature_sequence_get_formatted'
+      '%new_function' => 'tripal_format_sequence'
     )
   );
 
-  return feature_sequence_get_formatted(
+  return tripal_format_sequence(
     // Feature
     array(
       'feature_id' => $feature_id,
@@ -416,9 +416,9 @@ function tripal_feature_get_formatted_sequence($feature_id, $feature_name, $num_
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_associate_dbxref().
+ * This function has been replaced by tripal_associate_dbxref().
  *
- * @see chado_associate_dbxref().
+ * @see tripal_associate_dbxref().
  */
 function tripal_feature_add_dbxref($feature_id, $dbname, $accession) {
 
@@ -428,11 +428,11 @@ function tripal_feature_add_dbxref($feature_id, $dbname, $accession) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_feature_add_dbxref',
-      '%new_function' => 'chado_associate_dbxref'
+      '%new_function' => 'tripal_associate_dbxref'
     )
   );
 
-  return chado_associate_dbxref(
+  return tripal_associate_dbxref(
     'feature',
     $feature_id,
     array(
@@ -445,9 +445,9 @@ function tripal_feature_add_dbxref($feature_id, $dbname, $accession) {
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_associate_cvterm().
+ * This function has been replaced by tripal_associate_cvterm().
  *
- * @see chado_associate_cvterm().
+ * @see tripal_associate_cvterm().
  */
 function tripal_feature_add_cvterm($feature_id, $cvname, $cvterm) {
 
@@ -457,11 +457,11 @@ function tripal_feature_add_cvterm($feature_id, $cvname, $cvterm) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_feature_add_cvterm',
-      '%new_function' => 'chado_associate_cvterm'
+      '%new_function' => 'tripal_associate_cvterm'
     )
   );
 
-  return chado_associate_cvterm(
+  return tripal_associate_cvterm(
     'feature',
     $feature_id,
     array(
@@ -474,9 +474,9 @@ function tripal_feature_add_cvterm($feature_id, $cvname, $cvterm) {
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by feature_sequence_get_fasta().
+ * This function has been replaced by tripal_get_fasta_sequence().
  *
- * @see feature_sequence_get_fasta().
+ * @see tripal_get_fasta_sequence().
  */
 function tripal_feature_return_fasta($feature, $desc) {
 
@@ -486,9 +486,9 @@ function tripal_feature_return_fasta($feature, $desc) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_feature_return_fasta',
-      '%new_function' => 'feature_sequence_get_fasta'
+      '%new_function' => 'tripal_get_fasta_sequence'
     )
   );
 
-  return feature_sequence_get_fasta($feature, $desc);
+  return tripal_get_fasta_sequence($feature, $desc);
 }

+ 3 - 3
tripal_feature/api/tripal_feature.api.inc

@@ -23,7 +23,7 @@
  *
  * @ingroup tripal_feature_api
  */
-function feature_sequence_reverse_complement($sequence) {
+function tripal_reverse_compliment_sequence($sequence) {
 
   $seq = strtoupper($sequence);
   $seq = strrev($seq);
@@ -82,7 +82,7 @@ function feature_sequence_reverse_complement($sequence) {
  *
  * @ingroup tripal_feature_api
  */
-function feature_sequence_get_formatted($feature, $options) {
+function tripal_format_sequence($feature, $options) {
 
   // Default Values
   $feature_id = $feature['feature_id'];
@@ -458,7 +458,7 @@ function feature_sequence_get_formatted($feature, $options) {
  *
  * @ingroup tripal_feature_api
  */
-function feature_sequence_get_fasta($feature, $desc) {
+function tripal_get_fasta_sequence($feature, $desc) {
 
   $fasta  = ">" . variable_get('chado_feature_accession_prefix', 'FID') . "$feature->feature_id|$feature->name";
   $fasta .= " $desc\n";

+ 16 - 16
tripal_organism/api/tripal_organism.DEPRECATED.inc

@@ -7,9 +7,9 @@
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_organism_retrieve().
+ * This function has been replaced by tripal_get_organism().
  *
- * @see chado_organism_retrieve().
+ * @see tripal_get_organism().
  */
 function tripal_organism_get_organism_by_nid($nid) {
 
@@ -19,19 +19,19 @@ function tripal_organism_get_organism_by_nid($nid) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_organism_get_organism_by_nid',
-      '%new_function' => 'chado_organism_retrieve'
+      '%new_function' => 'tripal_get_organism'
     )
   );
 
-  return chado_organism_retrieve(array('nid' => $nid));
+  return tripal_get_organism(array('nid' => $nid));
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_organism_retrieve().
+ * This function has been replaced by tripal_get_organism().
  *
- * @see chado_organism_retrieve().
+ * @see tripal_get_organism().
  */
 function tripal_organism_get_organism_by_organism_id($organism_id) {
 
@@ -41,19 +41,19 @@ function tripal_organism_get_organism_by_organism_id($organism_id) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_organism_get_organism_by_organism_id',
-      '%new_function' => 'chado_organism_retrieve'
+      '%new_function' => 'tripal_get_organism'
     )
   );
 
-  return chado_organism_retrieve(array('organism_id' => $organism_id));
+  return tripal_get_organism(array('organism_id' => $organism_id));
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by organism_get_select_options().
+ * This function has been replaced by tripal_get_organism_select_options().
  *
- * @see organism_get_select_options().
+ * @see tripal_get_organism_select_options().
  */
 function tripal_organism_get_synced() {
 
@@ -63,19 +63,19 @@ function tripal_organism_get_synced() {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_organism_get_synced',
-      '%new_function' => 'organism_get_select_options'
+      '%new_function' => 'tripal_get_organism_select_options'
     )
   );
 
-  return organism_get_select_options();
+  return tripal_get_organism_select_options();
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by organism_get_image().
+ * This function has been replaced by tripal_get_organism_image().
  *
- * @see organism_get_image().
+ * @see tripal_get_organism_image().
  */
 function tripal_organism_get_image_url($organism, $nid = NULL) {
 
@@ -85,9 +85,9 @@ function tripal_organism_get_image_url($organism, $nid = NULL) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_organism_get_image_url',
-      '%new_function' => 'organism_get_image'
+      '%new_function' => 'tripal_get_organism_image'
     )
   );
 
-  return organism_get_image($organism, $nid);
+  return tripal_get_organism_image($organism, $nid);
 }

+ 7 - 7
tripal_organism/api/tripal_organism.api.inc

@@ -39,7 +39,7 @@
  *
  * @ingroup tripal_organism_api
  */
-function chado_organism_retrieve($identifiers, $options = array()) {
+function tripal_get_organism($identifiers, $options = array()) {
 
   // Set Defaults
   if (!isset($options['include_fk'])) {
@@ -52,7 +52,7 @@ function chado_organism_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_organism_api',
       TRIPAL_ERROR,
-      "chado_organism_retrieve: The identifier passed in is expected to be an array with the key
+      "tripal_get_organism: The identifier passed in is expected to be an array with the key
         matching a column name in the organism table (ie: organism_id or name). You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
@@ -63,7 +63,7 @@ function chado_organism_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_organism_api',
       TRIPAL_ERROR,
-      "chado_organism_retrieve: You did not pass in anything to identify the organism you want. The identifier
+      "tripal_get_organism: You did not pass in anything to identify the organism you want. The identifier
         is expected to be an array with the key matching a column name in the organism table
         (ie: organism_id or name). You passed in %identifier.",
       array(
@@ -95,7 +95,7 @@ function chado_organism_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_organism_api',
       TRIPAL_ERROR,
-      "chado_organism_retrieve: The identifiers you passed in were not unique. You passed in %identifier.",
+      "tripal_get_organism: The identifiers you passed in were not unique. You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
       )
@@ -107,7 +107,7 @@ function chado_organism_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_organism_api',
       TRIPAL_ERROR,
-      "chado_organism_retrieve: chado_generate_var() failed to return a organism based on the identifiers
+      "tripal_get_organism: chado_generate_var() failed to return a organism based on the identifiers
         you passed in. You should check that your identifiers are correct, as well as, look
         for a chado_generate_var error for additional clues. You passed in %identifier.",
       array(
@@ -134,7 +134,7 @@ function chado_organism_retrieve($identifiers, $options = array()) {
  *
  * @ingroup tripal_organism_api
  */
-function organism_get_select_options($syncd_only = TRUE) {
+function tripal_get_organism_select_options($syncd_only = TRUE) {
 
   if ($syncd_only) {
     // use this SQL for getting synced organisms
@@ -180,7 +180,7 @@ function organism_get_select_options($syncd_only = TRUE) {
  * @return
  *   The fully qualified url to the image
  */
-function organism_get_image($organism, $nid = NULL) {
+function tripal_get_organism_image($organism, $nid = NULL) {
   $url = '';
 
   // first look for an image with the genus/species name.  This is old-style tripal

+ 111 - 23
tripal_pub/api/tripal_pub.DEPRECATED.inc

@@ -4,6 +4,94 @@
  * Wrapper functions to provide backwards compatibility for the tripal analysis api
  */
 
+/**
+ * @deprecated Restructured API to make naming more readable and consistent.
+ * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
+ * This function has been replaced by tripal_search_publications().
+ *
+ * @see tripal_search_publications().
+ */
+function pub_search($search_array, $offset, $limit, &$total_records) {
+
+  tripal_report_error(
+    'tripal_deprecated',
+    TRIPAL_NOTICE,
+    "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
+    array(
+      '%old_function'=>'pub_search',
+      '%new_function' => 'tripal_search_pubs'
+    )
+  );
+
+  return tripal_search_publications($search_array, $offset, $limit, $total_records);
+}
+
+/**
+ * @deprecated Restructured API to make naming more readable and consistent.
+ * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
+ * This function has been replaced by tripal_get_publication().
+ *
+ * @see tripal_get_publication().
+ */
+function chado_get_publication($identifiers, $options = array()) {
+
+  tripal_report_error(
+    'tripal_deprecated',
+    TRIPAL_NOTICE,
+    "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
+    array(
+      '%old_function'=>'chado_get_publication',
+      '%new_function' => 'tripal_get_publication'
+    )
+  );
+
+  return tripal_get_publication($identifiers, $options);
+}
+
+/**
+ * @deprecated Restructured API to make naming more readable and consistent.
+ * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
+ * This function has been replaced by tripal_publication_exists().
+ *
+ * @see tripal_publication_exists().
+ */
+function chado_does_pub_exist($pub_details) {
+
+  tripal_report_error(
+    'tripal_deprecated',
+    TRIPAL_NOTICE,
+    "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
+    array(
+      '%old_function'=>'chado_does_pub_exist',
+      '%new_function' => 'tripal_publication_exists'
+    )
+  );
+
+  return tripal_publication_exists($pub_details);
+}
+
+/**
+ * @deprecated Restructured API to make naming more readable and consistent.
+ * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
+ * This function has been replaced by tripal_reimport_publications().
+ *
+ * @see tripal_reimport_publications().
+ */
+function chado_reimport_publications($do_contact = FALSE, $dbxref = NULL, $db = NULL) {
+
+  tripal_report_error(
+    'tripal_deprecated',
+    TRIPAL_NOTICE,
+    "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
+    array(
+      '%old_function'=>'chado_reimport_publications',
+      '%new_function' => 'tripal_reimport_publications'
+    )
+  );
+
+  return tripal_reimport_publications($do_contact, $dbxref, $db);
+}
+
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
@@ -14,7 +102,7 @@
 function tripal_pub_get_remote_search_results($remote_db, $search_array, $num_to_retrieve, $page = 0) {
 
   tripal_report_error(
-    'tripal_api',
+    'tripal_deprecated',
     TRIPAL_NOTICE,
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
@@ -22,7 +110,7 @@ function tripal_pub_get_remote_search_results($remote_db, $search_array, $num_to
       '%new_function' => 'tripal_get_remote_pubs'
     )
   );
-  
+
   return tripal_get_remote_pubs($remote_db, $search_array, $num_to_retrieve, $page);;
 }
 
@@ -36,7 +124,7 @@ function tripal_pub_get_remote_search_results($remote_db, $search_array, $num_to
 function tripal_pub_get_raw_data($dbxref) {
 
   tripal_report_error(
-    'tripal_api',
+    'tripal_deprecated',
     TRIPAL_NOTICE,
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
@@ -44,7 +132,7 @@ function tripal_pub_get_raw_data($dbxref) {
       '%new_function' => 'chado_get_remote_pub_record'
     )
   );
-  
+
   return tripal_get_remote_pub($dbxref);
 }
 
@@ -58,7 +146,7 @@ function tripal_pub_get_raw_data($dbxref) {
 function tripal_pub_update_publications($do_contact = FALSE, $dbxref = NULL, $db = NULL) {
 
   tripal_report_error(
-    'tripal_api',
+    'tripal_deprecated',
     TRIPAL_NOTICE,
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
@@ -66,7 +154,7 @@ function tripal_pub_update_publications($do_contact = FALSE, $dbxref = NULL, $db
       '%new_function' => 'chado_reimport_publications'
     )
   );
-  
+
   return chado_reimport_publications($do_contact, $dbxref, $db);
 }
 
@@ -80,7 +168,7 @@ function tripal_pub_update_publications($do_contact = FALSE, $dbxref = NULL, $db
 function tripal_pub_import_publications_by_import_id($import_id, $job_id = NULL) {
 
   tripal_report_error(
-    'tripal_api',
+    'tripal_deprecated',
     TRIPAL_NOTICE,
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
@@ -102,7 +190,7 @@ function tripal_pub_import_publications_by_import_id($import_id, $job_id = NULL)
 function tripal_pub_import_publications($report_email = FALSE, $do_update = FALSE) {
 
   tripal_report_error(
-    'tripal_api',
+    'tripal_deprecated',
     TRIPAL_NOTICE,
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
@@ -124,7 +212,7 @@ function tripal_pub_import_publications($report_email = FALSE, $do_update = FALS
 function tripal_pub_import_by_dbxref($pub_dbxref, $do_contact = FALSE, $do_update) {
 
   tripal_report_error(
-    'tripal_api',
+    'tripal_deprecated',
     TRIPAL_NOTICE,
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
@@ -139,28 +227,28 @@ function tripal_pub_import_by_dbxref($pub_dbxref, $do_contact = FALSE, $do_updat
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_associate_dbxref().
+ * This function has been replaced by tripal_associate_dbxref().
  *
- * @see chado_associate_dbxref().
+ * @see tripal_associate_dbxref().
  */
 function tripal_pub_add_pub_dbxref($pub_id, $pub_dbxref) {
 
   tripal_report_error(
-    'tripal_api',
+    'tripal_deprecated',
     TRIPAL_NOTICE,
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_pub_add_pub_dbxref',
-      '%new_function' => 'chado_associate_dbxref'
+      '%new_function' => 'tripal_associate_dbxref'
     )
   );
- 
+
   $dbxref = array();
   if(preg_match('/^(.*?):(.*?)$/', trim($pub_dbxref), $matches)) {
     $dbxref['db_name']   = $matches[1];
     $dbxref['accession'] = $matches[2];
   }
-  return chado_associate_dbxref('pub', $pub_id, $dbxref);
+  return tripal_associate_dbxref('pub', $pub_id, $dbxref);
 }
 
 /**
@@ -173,7 +261,7 @@ function tripal_pub_add_pub_dbxref($pub_id, $pub_dbxref) {
 function tripal_pub_get_pubs_by_dbxref($pub_dbxref) {
 
   tripal_report_error(
-    'tripal_api',
+    'tripal_deprecated',
     TRIPAL_NOTICE,
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
@@ -181,7 +269,7 @@ function tripal_pub_get_pubs_by_dbxref($pub_dbxref) {
       '%new_function' => 'chado_get_publication'
     )
   );
-  
+
   $pub = chado_get_publication(array('dbxref' => $pub_dbxref));
   if ($pub) {
     // the original function returned an array of pub_ids
@@ -203,7 +291,7 @@ function tripal_pub_get_pubs_by_dbxref($pub_dbxref) {
 function tripal_pub_get_pubs_by_title_type_pyear_series($title, $type = NULL, $pyear = NULL, $series_name = NULL) {
 
   tripal_report_error(
-    'tripal_api',
+    'tripal_deprecated',
     TRIPAL_NOTICE,
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
@@ -231,7 +319,7 @@ function tripal_pub_get_pubs_by_title_type_pyear_series($title, $type = NULL, $p
 function tripal_pub_get_pub_by_uniquename($uniquenname) {
 
   tripal_report_error(
-    'tripal_api',
+    'tripal_deprecated',
     TRIPAL_NOTICE,
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
@@ -259,7 +347,7 @@ function tripal_pub_get_pub_by_uniquename($uniquenname) {
 function tripal_pub_get_property($pub_id, $property) {
 
   tripal_report_error(
-    'tripal_api',
+    'tripal_deprecated',
     TRIPAL_NOTICE,
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
@@ -281,7 +369,7 @@ function tripal_pub_get_property($pub_id, $property) {
 function tripal_pub_insert_property($pub_id, $property, $value, $update_if_present = 0) {
 
   tripal_report_error(
-    'tripal_api',
+    'tripal_deprecated',
     TRIPAL_NOTICE,
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
@@ -303,7 +391,7 @@ function tripal_pub_insert_property($pub_id, $property, $value, $update_if_prese
 function tripal_pub_update_property($pub_id, $property, $value, $insert_if_missing = 0) {
 
   tripal_report_error(
-    'tripal_api',
+    'tripal_deprecated',
     TRIPAL_NOTICE,
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
@@ -325,7 +413,7 @@ function tripal_pub_update_property($pub_id, $property, $value, $insert_if_missi
 function tripal_pub_delete_property($pub_id, $property) {
 
   tripal_report_error(
-    'tripal_api',
+    'tripal_deprecated',
     TRIPAL_NOTICE,
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(

+ 38 - 38
tripal_pub/api/tripal_pub.api.inc

@@ -9,9 +9,9 @@
  * @ingroup tripal_api
  * @{
  * Provides an application programming interface (API) to manage chado publications
- * 
+ *
  * @stephen add documentation here for how to add a new importer.
- * 
+ *
  * @}
  */
 
@@ -123,8 +123,8 @@ function tripal_get_remote_pub($dbxref) {
  * Builds the SQL statement need to search Chado for the publications
  * that match the user supplied criteria.  Tpyically, this function is
  * called by the search form generated by the tripal_pub_search_form() function
- * but this function is included in the API for calling by anyone. 
- * 
+ * but this function is included in the API for calling by anyone.
+ *
  * @param $search_array
  *   An array of search criteria provided by the user. The search array is
  *   an associative array with the following keys:
@@ -137,23 +137,23 @@ function tripal_get_remote_pub($dbxref) {
  *                     'scope':          The cvterm_id of the property used for filtering
  *                     'mode':           The operation (e.g. AND, OR or NOT)
  * @param $offset
- *   The offset for paging records.  The first record returned will be 
+ *   The offset for paging records.  The first record returned will be
  *   at the offset indicated here, and the next $limit number of records
  *   will be returned.
- *   
+ *
  * @param $limit
  *   The number of records to retrieve
- *   
+ *
  * @param total_records
  *   A value passed by reference. This value will get set to the total
  *   number of matching records
- *   
- * @return 
+ *
+ * @return
  *   a PDO database object of the query results.
  *
  * @ingroup tripal_pub
  */
-function pub_search($search_array, $offset, $limit, &$total_records) {
+function tripal_search_publications($search_array, $offset, $limit, &$total_records) {
 
   // build the SQL based on the criteria provided by the user
   $select = "SELECT DISTINCT P.*, CP.nid ";
@@ -259,11 +259,11 @@ function pub_search($search_array, $offset, $limit, &$total_records) {
   }
   $sql = "$select $from $where $order  LIMIT " . (int) $limit . ' OFFSET ' . (int) $offset;
   $count = "SELECT count(*) FROM ($select $from $where $order) as t1";
-  
+
   // first get the total number of matches
   $total_records = chado_query($count, $args)->fetchField();
   $results = chado_query($sql, $args);
-  
+
   return $results;
 }
 
@@ -272,15 +272,15 @@ function pub_search($search_array, $offset, $limit, &$total_records) {
  *
  * @param $identifier
  *   An array used to uniquely identify a publication. This array has the same
- *   format as that used by the chado_generate_var(). The following keys can be 
+ *   format as that used by the chado_generate_var(). The following keys can be
  *   useful for uniquely identifying a publication as they should be unique:
  *    - pub_id: the chado pub.pub_id primary key
  *    - nid: the drupal nid of the publication
  *    - uniquename: A value to matach with the pub.uniquename field
  *   There are also some specially handled keys. They are:
  *    - property: An array describing the property to select records for. It
- *      should at least have either a 'type_name' key (if unique across cvs) or 
- *      'type_id' key. Other supported keys include: 'cv_id', 'cv_name' (of the type), 
+ *      should at least have either a 'type_name' key (if unique across cvs) or
+ *      'type_id' key. Other supported keys include: 'cv_id', 'cv_name' (of the type),
  *      'value' and 'rank'
  *    - dbxref: The database cross reference accession.  It should be in the form
  *        DB:ACCESSION, where DB is the database name and ACCESSION is the
@@ -296,12 +296,12 @@ function pub_search($search_array, $offset, $limit, &$total_records) {
  *
  * @return
  *   If a singe publication is retreived using the identifiers, then a publication
- *   array will be returned.  The array is of the same format returned by the 
+ *   array will be returned.  The array is of the same format returned by the
  *   chado_generate_var() function. Otherwise, FALSE will be returned.
  *
  * @ingroup tripal_pub_api
  */
-function chado_get_publication($identifiers, $options = array()) {
+function tripal_get_publication($identifiers, $options = array()) {
 
   // Error Checking of parameters
   if (!is_array($identifiers)) {
@@ -319,7 +319,7 @@ function chado_get_publication($identifiers, $options = array()) {
       array('%identifier'=> print_r($identifiers, TRUE))
     );
   }
-  
+
   // If one of the identifiers is property then use chado_get_record_with_property()
   if (array_key_exists('property', $identifiers)) {
     $property = $identifiers['property'];
@@ -330,7 +330,7 @@ function chado_get_publication($identifiers, $options = array()) {
     if(preg_match('/^(.*?):(.*?)$/', $identifiers['dbxref'], $matches)) {
       $dbname = $matches[1];
       $accession = $matches[2];
-    
+
       $values = array(
         'dbxref_id' => array (
           'accession' => $accession,
@@ -358,22 +358,22 @@ function chado_get_publication($identifiers, $options = array()) {
     // first get the pub_dbxref record
     $values = array('dbxref_id' => $identifiers['dbxref_id']);
     $pub_dbxref = chado_select_record('pub_dbxref', array('pub_id'), $values);
-    
-    // now get the pub 
+
+    // now get the pub
     if (count($pub_dbxref) > 0) {
       $pub = chado_generate_var('pub', array('pub_id' => $pub_dbxref[0]->pub_id), $options);
     }
     else {
       return FALSE;
     }
-    
+
   }
   // Else we have a simple case and we can just use chado_generate_var to get the pub
   else {
     // Try to get the pub
     $pub = chado_generate_var('pub', $identifiers, $options);
   }
-  
+
   // Ensure the pub is singular. If it's an array then it is not singular
   if (is_array($pub)) {
     tripal_report_error('tripal_pub_api', TRIPAL_ERROR,
@@ -381,7 +381,7 @@ function chado_get_publication($identifiers, $options = array()) {
       array('%identifier'=> print_r($identifiers, TRUE))
     );
   }
-  
+
   // Report an error if $pub is FALSE since then chado_generate_var has failed
   elseif ($pub === FALSE) {
     tripal_report_error('tripal_pub_api', TRIPAL_ERROR,
@@ -390,7 +390,7 @@ function chado_get_publication($identifiers, $options = array()) {
       array('%identifier'=> print_r($identifiers, TRUE))
     );
   }
-  
+
   // Else, as far we know, everything is fine so give them their pub :)
   else {
     return $pub;
@@ -422,8 +422,8 @@ function chado_get_publication($identifiers, $options = array()) {
  * @return
  *   An array containing the pub_id's of matching publications.
  */
-function chado_does_pub_exist($pub_details) {
-  
+function tripal_publication_exists($pub_details) {
+
 
   // first try to find the publication using the accession number if that key exists in the details array
   if (array_key_exists('Publication Dbxref', $pub_details)) {
@@ -432,7 +432,7 @@ function chado_does_pub_exist($pub_details) {
       return array($pub->pub_id);
     }
   }
-  
+
   // make sure the citation is unique
   if (array_key_exists('Citation', $pub_details)) {
     $pub = chado_get_publication(array('uniquename' => $pub_details['Citation']));
@@ -518,7 +518,7 @@ function chado_does_pub_exist($pub_details) {
 
 /**
  * Updates publication records that currently exist in the Chado pub table
- * with the most recent data in the remote database. 
+ * with the most recent data in the remote database.
  *
  * @param $do_contact
  *   Set to TRUE if authors should automatically have a contact record added
@@ -526,17 +526,17 @@ function chado_does_pub_exist($pub_details) {
  *   database.
  * @param $dbxref
  *   The unique database ID for the record to update.  This value must
- *   be of the format DB_NAME:ACCESSION where DB_NAME is the name of the 
+ *   be of the format DB_NAME:ACCESSION where DB_NAME is the name of the
  *   database (e.g. PMID or AGL) and the ACCESSION is the unique identifier
  *   for the record in the database.
  * @param $db
- *   The name of the remote database to update.  If this value is provided and 
+ *   The name of the remote database to update.  If this value is provided and
  *   no dbxref then all of the publications currently in the Chado database
  *   for this remote database will be updated.
- *   
+ *
  * @ingroup tripal_pub_api
  */
-function chado_reimport_publications($do_contact = FALSE, $dbxref = NULL, $db = NULL) {
+function tripal_reimport_publications($do_contact = FALSE, $dbxref = NULL, $db = NULL) {
 
   print "\nNOTE: Loading of publications is performed using a database transaction. \n" .
       "If the load fails or is terminated prematurely then the entire set of \n" .
@@ -622,7 +622,7 @@ function chado_reimport_publications($do_contact = FALSE, $dbxref = NULL, $db =
 }
 
 /**
- * Imports all publications for a given publication import setup. 
+ * Imports all publications for a given publication import setup.
  *
  * @param $import_id
  *   The ID of the import setup to use
@@ -699,7 +699,7 @@ function tripal_execute_pub_importer($import_id, $job_id = NULL) {
  * @param $do_update
  *   If set to TRUE then publications that already exist in the Chado database
  *   will be updated, whereas if FALSE only new publications will be added
- *   
+ *
  * @ingroup tripal_pub_api
  */
 function tripal_execute_active_pub_importers($report_email = FALSE, $do_update = FALSE) {
@@ -793,16 +793,16 @@ function tripal_execute_active_pub_importers($report_email = FALSE, $do_update =
  *
  * @param $pub_dbxref
  *   The unique database ID for the record to update.  This value must
- *   be of the format DB_NAME:ACCESSION where DB_NAME is the name of the 
+ *   be of the format DB_NAME:ACCESSION where DB_NAME is the name of the
  *   database (e.g. PMID or AGL) and the ACCESSION is the unique identifier
  *   for the record in the database.
  * @param $do_contact
  *   Set to TRUE if authors should automatically have a contact record added
- *   to Chado. 
+ *   to Chado.
  * @param $do_update
  *   If set to TRUE then the publication will be updated if it already exists
  *   in the database.
- *   
+ *
  * @ingroup tripal_pub_api
  */
 function tripal_import_pub_by_dbxref($pub_dbxref, $do_contact = FALSE, $do_update) {

+ 21 - 21
tripal_stock/api/tripal_stock.DEPRECATED.inc

@@ -7,9 +7,9 @@
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_stock_retrieve().
+ * This function has been replaced by tripal_get_stock().
  *
- * @see chado_stock_retrieve().
+ * @see tripal_get_stock().
  */
 function tripal_stock_get_stock_by_nid($nid) {
 
@@ -19,19 +19,19 @@ function tripal_stock_get_stock_by_nid($nid) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_stock_get_stock_by_nid',
-      '%new_function' => 'chado_stock_retrieve'
+      '%new_function' => 'tripal_get_stock'
     )
   );
 
-  return chado_stock_retrieve(array('nid' => $nid));
+  return tripal_get_stock(array('nid' => $nid));
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_stock_retrieve().
+ * This function has been replaced by tripal_get_stock().
  *
- * @see chado_stock_retrieve().
+ * @see tripal_get_stock().
  */
 function tripal_stock_get_stock_by_stock_id($stock_id) {
 
@@ -41,19 +41,19 @@ function tripal_stock_get_stock_by_stock_id($stock_id) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_stock_get_stock_by_stock_id',
-      '%new_function' => 'chado_stock_retrieve'
+      '%new_function' => 'tripal_get_stock'
     )
   );
 
-  return chado_stock_retrieve(array('stock_id' => $stock_id));
+  return tripal_get_stock(array('stock_id' => $stock_id));
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_stock_retrieve_multiple().
+ * This function has been replaced by tripal_get_multiple_stocks().
  *
- * @see chado_stock_retrieve_multiple().
+ * @see tripal_get_multiple_stocks().
  */
 function tripal_stock_get_all_stocks() {
 
@@ -82,9 +82,9 @@ function tripal_stock_get_all_stocks() {
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_stock_retrieve_multiple().
+ * This function has been replaced by tripal_get_multiple_stocks().
  *
- * @see chado_stock_retrieve_multiple().
+ * @see tripal_get_multiple_stocks().
  */
 function tripal_stock_get_stocks($values) {
 
@@ -94,19 +94,19 @@ function tripal_stock_get_stocks($values) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_stock_get_stocks',
-      '%new_function' => 'chado_stock_retrieve_multiple'
+      '%new_function' => 'tripal_get_multiple_stocks'
     )
   );
 
-  return chado_stock_retrieve_multiple($values);
+  return tripal_get_multiple_stocks($values);
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_stock_retrieve().
+ * This function has been replaced by tripal_get_stock().
  *
- * @see chado_stock_retrieve().
+ * @see tripal_get_stock().
  */
 function tripal_stock_get_stocks_by_stockprop($stockprop_values, $stock_values) {
 
@@ -116,18 +116,18 @@ function tripal_stock_get_stocks_by_stockprop($stockprop_values, $stock_values)
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_stock_get_stocks_by_stockprop',
-      '%new_function' => 'chado_stock_retrieve'
+      '%new_function' => 'tripal_get_stock'
     )
   );
 
   $stock_values['property'] = $stockprop_values;
-  return chado_stock_retrieve_multiple($stock_values);
+  return tripal_get_multiple_stocks($stock_values);
 }
 
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by chado_stock_retrieve().
+ * This function has been replaced by tripal_get_stock().
  *
  * Return all stocks with a given name identifier
  *  which might match stock.name, stock.uniquename, dbxref.accession,
@@ -141,7 +141,7 @@ function tripal_stock_get_stocks_by_stockprop($stockprop_values, $stock_values)
  * @return
  *   An array of stock node objects
  *
- * @see chado_stock_retrieve().
+ * @see tripal_get_stock().
  */
 function tripal_stock_get_stock_by_name_identifier($name, $organism_id) {
 
@@ -151,7 +151,7 @@ function tripal_stock_get_stock_by_name_identifier($name, $organism_id) {
     "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
     array(
       '%old_function'=>'tripal_stock_get_stock_by_name_identifier',
-      '%new_function' => 'chado_stock_retrieve'
+      '%new_function' => 'tripal_get_stock'
     )
   );
 

+ 9 - 9
tripal_stock/api/tripal_stock.api.inc

@@ -39,7 +39,7 @@
  *
  * @ingroup tripal_stock_api
  */
-function chado_stock_retrieve($identifiers, $options = array()) {
+function tripal_get_stock($identifiers, $options = array()) {
 
   // Set Defaults
   if (!isset($options['include_fk'])) {
@@ -52,7 +52,7 @@ function chado_stock_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_stock_api',
       TRIPAL_ERROR,
-      "chado_stock_retrieve: The identifier passed in is expected to be an array with the key
+      "tripal_get_stock: The identifier passed in is expected to be an array with the key
         matching a column name in the stock table (ie: stock_id or name). You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
@@ -63,7 +63,7 @@ function chado_stock_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_stock_api',
       TRIPAL_ERROR,
-      "chado_stock_retrieve: You did not pass in anything to identify the stock you want. The identifier
+      "tripal_get_stock: You did not pass in anything to identify the stock you want. The identifier
         is expected to be an array with the key matching a column name in the stock table
         (ie: stock_id or name). You passed in %identifier.",
       array(
@@ -95,7 +95,7 @@ function chado_stock_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_stock_api',
       TRIPAL_ERROR,
-      "chado_stock_retrieve: The identifiers you passed in were not unique. You passed in %identifier.",
+      "tripal_get_stock: The identifiers you passed in were not unique. You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
       )
@@ -107,7 +107,7 @@ function chado_stock_retrieve($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_stock_api',
       TRIPAL_ERROR,
-      "chado_stock_retrieve: chado_generate_var() failed to return a stock based on the identifiers
+      "tripal_get_stock: chado_generate_var() failed to return a stock based on the identifiers
         you passed in. You should check that your identifiers are correct, as well as, look
         for a chado_generate_var error for additional clues. You passed in %identifier.",
       array(
@@ -139,7 +139,7 @@ function chado_stock_retrieve($identifiers, $options = array()) {
  *
  * @ingroup tripal_stock_api
  */
-function chado_stock_retrieve_multiple($identifiers, $options = array()) {
+function tripal_get_multiple_stocks($identifiers, $options = array()) {
 
   // Set Defaults
   if (!isset($options['include_fk'])) {
@@ -152,7 +152,7 @@ function chado_stock_retrieve_multiple($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_stock_api',
       TRIPAL_ERROR,
-      "chado_stock_retrieve: The identifier passed in is expected to be an array with the key
+      "tripal_get_stock: The identifier passed in is expected to be an array with the key
         matching a column name in the stock table (ie: stock_id or name). You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
@@ -163,7 +163,7 @@ function chado_stock_retrieve_multiple($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_stock_api',
       TRIPAL_ERROR,
-      "chado_stock_retrieve: You did not pass in anything to identify the stock you want. The identifier
+      "tripal_get_stock: You did not pass in anything to identify the stock you want. The identifier
         is expected to be an array with the key matching a column name in the stock table
         (ie: stock_id or name). You passed in %identifier.",
       array(
@@ -195,7 +195,7 @@ function chado_stock_retrieve_multiple($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_stock_api',
       TRIPAL_ERROR,
-      "chado_stock_retrieve: chado_generate_var() failed to return a stock based on the identifiers
+      "tripal_get_stock: chado_generate_var() failed to return a stock based on the identifiers
         you passed in. You should check that your identifiers are correct, as well as, look
         for a chado_generate_var error for additional clues. You passed in %identifier.",
       array(