Browse Source

Merge branch '7.x-2.x' of git.drupal.org:sandbox/spficklin/1337878 into 7.x-2.x

Stephen Ficklin 11 years ago
parent
commit
b35bc1b996

+ 10 - 5
tripal_contact/api/tripal_contact.DEPRECATED.inc

@@ -23,7 +23,7 @@ function tripal_contact_get_property($contact_id, $property) {
     )
   );
 
-  return FALSE;
+  return chado_get_property('contact', $contact_id, $property, 'tripal_contact');;
 }
 
 /**
@@ -45,7 +45,7 @@ function tripal_contact_insert_property($contact_id, $property, $value, $update_
     )
   );
 
-  return FALSE;
+  return chado_insert_property('contact', $contact_id, $property, 'tripal_contact', $value, $update_if_present);
 }
 
 /**
@@ -67,7 +67,7 @@ function tripal_contact_update_property($contact_id, $property, $value, $insert_
     )
   );
 
-  return FALSE;
+  return chado_update_property('contact', $contact_id, $property, 'tripal_contact', $value, $insert_if_missing);
 }
 
 /**
@@ -89,7 +89,7 @@ function tripal_contact_delete_property($contact_id, $property) {
     )
   );
 
-  return FALSE;
+  return chado_delete_property('contact', $contact_id, $property, 'tripal_contact');
 }
 
 /**
@@ -111,5 +111,10 @@ function tripal_contact_add_contact($name, $description, $type, $properties) {
     )
   );
 
-  return FALSE;
+  return chado_insert_contact(array(
+    'name' => $name,
+    'description' => $description,
+    'type_name' => $type,
+    'properties' => $properties
+  ));
 }

+ 14 - 93
tripal_contact/api/tripal_contact.api.inc

@@ -14,101 +14,17 @@
  * @}
  */
 
-/**
- * Retrieve properties of a given type for a given contact
- *
- * @param $contact_id
- *    The contact_id of the properties you would like to retrieve
- * @param $property
- *    The cvterm name of the properties to retrieve
- *
- * @return
- *    An contact chado variable with the specified properties expanded
- *
- * @ingroup tripal_contact_api
- */
-function tripal_contact_get_property($contact_id, $property) {
-  return chado_get_property('contact', $contact_id, $property, 'tripal_contact');
-}
-
-/**
- * Insert a given property
- *
- * @param $contact_id
- *   The contact_id of the property to insert
- * @param $property
- *   The cvterm name of the property to insert
- * @param $value
- *   The value of the property to insert
- * @param $update_if_present
- *   A boolean indicated whether to update the record if it's already present
- *
- * @return
- *   True of success, False otherwise
- *
- * @ingroup tripal_contact_api
- */
-function tripal_contact_insert_property($contact_id, $property, $value, $update_if_present = 0) {
-  return chado_insert_property('contact', $contact_id, $property, 'tripal_contact', $value, $update_if_present);
-}
-
-/**
- * Update a given property
- *
- * @param $contact_id
- *   The contact_id of the property to update
- * @param $property
- *   The cvterm name of the property to update
- * @param $value
- *   The value of the property to update
- * @param $insert_if_missing
- *   A boolean indicated whether to insert the record if it's absent
- *
- * Note: The property will be identified using the unique combination of the $contact_id and $property
- * and then it will be updated with the supplied value
- *
- * @return
- *   True of success, False otherwise
- *
- * @ingroup tripal_contact_api
- */
-function tripal_contact_update_property($contact_id, $property, $value, $insert_if_missing = 0) {
-  return chado_update_property('contact', $contact_id, $property, 'tripal_contact', $value, $insert_if_missing);
-}
-
-/**
- * Delete a given property
- *
- * @param $contact_id
- *   The contact_id of the property to delete
- * @param $property
- *   The cvterm name of the property to delete
- *
- * Note: The property will be identified using the unique combination of the $contact_id and $property
- * and then it will be deleted
- *
- * @return
- *   True of success, False otherwise
- *
- * @ingroup tripal_contact_api
- */
-function tripal_contact_delete_property($contact_id, $property) {
-  return chado_delete_property('contact', $contact_id, $property, 'tripal_contact');
-}
-
 /**
  * Adds a contact to the Chado contact table
  *
- * @param $name
- *   The name of the contact
- * @param $description
- *   Text describing the contact
- * @param $type
- *   The type of contact.  Must be a term in the tripal_contact vocabulary
- * @param $properties
- *   An associative array containing a list of key value pairs for the properites.
- *   The key's must be valid terms in the tripal_contact vocabulary (e.g. Affiliation,
- *   Address, etc).
+ * @param $values
+ *   An array of values to be inserted. Valid keys include:
+ *   - name: The name of the contact
+ *   - description: Text describing the contact
+ *   - type_name: The type of contact.  Must be a term in the tripal_contact vocabulary
+ *   - properties: An associative array containing a list of key value pairs for the properites.
+ *     The key's must be valid terms in the tripal_contact vocabulary (e.g. Affiliation,
+ *     Address, etc).
  *
  * @return
  *   On success, an array is returned containing the fields of the contact
@@ -117,7 +33,12 @@ function tripal_contact_delete_property($contact_id, $property) {
  *
  * @ingroup tripal_contact_api
  */
-function tripal_contact_add_contact($name, $description, $type, $properties) {
+function chado_insert_contact($values) {
+
+  $name = $values['name'];
+  $description = $values['description'];
+  $type = $values['type_name'];
+  $properties = $values['properties'];
 
   // check to see if this contact name already exists.
   $values =  array('name' => $name);

+ 1 - 1
tripal_contact/tripal_contact.module

@@ -15,7 +15,7 @@
  */
 
 require_once 'api/tripal_contact.api.inc';
-// require_once 'api/tripal_contact.DEPRECATED.inc';
+require_once 'api/tripal_contact.DEPRECATED.inc';
 
 require_once 'theme/tripal_contact.theme.inc';
 

+ 99 - 16
tripal_feature/api/tripal_feature.DEPRECATED.inc

@@ -23,7 +23,24 @@ function tripal_feature_analysis_get_property($analysis_id = NULL, $feature_id =
     )
   );
 
-  return FALSE;
+  // check that the incoming arguments are correct
+  if (($analysis_id and !$feature_id) or
+    (!$analysis_id and $feature_id)) {
+      tripal_report_error('tripal_feature', TRIPAL_WARNING,
+      'tripal_feature_analysis_get_property: Both an analysis ID and feature ID should be specified',
+      array());
+  }
+
+  // get the analysisfeature_id if one is not provided
+  if (!$analysisfeature_id) {
+    $columns = array('analysisfeature_id');
+    $values = array('analysis_id' => $analysis_id, 'feature_id' => $feature_id);
+    $result = chado_select_record('analysisfeature', $columns, $values);
+    $analysisfeature_id = $result[0]->analysisfeature_id;
+  }
+
+  // get the property.
+  return chado_get_property('analysisfeature', $analysisfeature_id, $property, $cv_name);
 }
 
 /**
@@ -45,7 +62,26 @@ function tripal_feature_analysis_insert_property($analysis_id = NULL, $feature_i
     )
   );
 
-  return FALSE;
+    // check that the incoming arguments are correct
+  if (($analysis_id and !$feature_id) or
+      (!$analysis_id and $feature_id)) {
+    tripal_report_error('tripal_feature', TRIPAL_WARNING,
+      'tripal_feature_analysis_insert_property: Both an analysis ID and feature ID should be specified',
+      array());
+  }
+
+  // get the analysisfeature_id if one is not provided
+  if (!$analysisfeature_id) {
+    $columns = array('analysisfeature_id');
+    $values = array('analysis_id' => $analysis_id, 'feature_id' => $feature_id);
+    $result = chado_select_record('analysisfeature', $columns, $values);
+    $analysisfeature_id = $result[0]->analysisfeature_id;
+  }
+
+  // insert the property.
+  return chado_insert_property('analysisfeature', $analysisfeature_id,
+    $property, $cv_name, $value, $update_if_present);
+
 }
 
 /**
@@ -67,7 +103,24 @@ function tripal_feature_analysis_update_property($analysis_id = NULL, $feature_i
     )
   );
 
-  return FALSE;
+  // check that the incoming arguments are correct
+  if (($analysis_id and !$feature_id) or
+    (!$analysis_id and $feature_id)) {
+      tripal_report_error('tripal_feature', TRIPAL_WARNING,
+      'tripal_feature_analysis_update_property: Both an analysis ID and feature ID should be specified',
+      array());
+  }
+
+  // get the analysisfeature_id if one is not provided
+  if (!$analysisfeature_id) {
+    $columns = array('analysisfeature_id');
+    $values = array('analysis_id' => $analysis_id, 'feature_id' => $feature_id);
+    $result = chado_select_record('analysisfeature', $columns, $values);
+    $analysisfeature_id = $result[0]->analysisfeature_id;
+  }
+
+  // update the property.
+  return chado_update_property('analysisfeature', $analysisfeature_id, $property, $cv_name, $value, $insert_if_missing);
 }
 
 /**
@@ -89,7 +142,8 @@ function tripal_feature_analysis_update_property_by_id($analysisfeatureprop_id,
     )
   );
 
-  return FALSE;
+  // update the property.
+  return chado_update_property('analysisfeature', NULL, $property, $cv_name, $value, FALSE, $analysisfeatureprop_id);
 }
 
 /**
@@ -111,15 +165,33 @@ function tripal_feature_analysis_delete_property($analysis_id = NULL, $feature_i
     )
   );
 
-  return FALSE;
+  // check that the incoming arguments are correct
+  if (($analysis_id and !$feature_id) or
+    (!$analysis_id and $feature_id)) {
+      tripal_report_error('tripal_feature', TRIPAL_WARNING,
+      'tripal_feature_analysis_delete_property: Both an analysis ID and feature ID should be specified',
+        array());
+  }
+
+  // get the analysisfeature_id if one is not provided
+  if (!$analysisfeature_id) {
+    $columns = array('analysisfeature_id');
+    $values = array('analysis_id' => $analysis_id, 'feature_id' => $feature_id);
+    $result = chado_select_record('analysisfeature', $columns, $values);
+    $analysisfeature_id = $result[0]->analysisfeature_id;
+  }
+
+  // get the property.
+  return chado_delete_property('analysisfeature', $analysisfeature_id, $property, $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 chado_delete_property().
+ * This function has been replaced by chado_delete_record().
  *
- * @see chado_delete_property().
+ * @see chado_delete_record().
  */
 function tripal_feature_analysis_delete_property_by_id($analysisfeatureprop_id) {
 
@@ -133,7 +205,12 @@ function tripal_feature_analysis_delete_property_by_id($analysisfeatureprop_id)
     )
   );
 
-  return FALSE;
+  // construct the array that will match the exact record to update
+  $match = array(
+    'analysisfeatureprop_id' => $analysisfeatureprop_id,
+  );
+
+  return chado_delete_record('analysisfeatureprop', $match);
 }
 
 /**
@@ -155,7 +232,7 @@ function tripal_feature_get_property($feature_id, $property, $cv_name='tripal')
     )
   );
 
-  return FALSE;
+  return chado_get_property('feature', $feature_id, $property, $cv_name);
 }
 
 /**
@@ -177,7 +254,8 @@ function tripal_feature_insert_property($feature_id, $property, $value, $update_
     )
   );
 
-  return FALSE;
+  return chado_insert_property('feature', $feature_id, $property,
+    $cv_name, $value, $update_if_present);
 }
 
 /**
@@ -199,7 +277,7 @@ function tripal_feature_update_property($feature_id, $property, $value, $insert_
     )
   );
 
-  return FALSE;
+  return chado_update_property('feature', $feature_id, $property, $cv_name, $value, $insert_if_missing);
 }
 
 /**
@@ -221,7 +299,7 @@ function tripal_feature_update_property_by_id($featureprop_id, $property, $value
     )
   );
 
-  return FALSE;
+  return chado_update_property('feature', NULL, $property, $cv_name, $value, FALSE, $featureprop_id);
 }
 
 /**
@@ -243,15 +321,15 @@ function tripal_feature_delete_property($feature_id, $property, $cv_name='tripal
     )
   );
 
-  return FALSE;
+  return chado_delete_property('feature', $feature_id, $property, $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 chado_delete_property().
+ * This function has been replaced by chado_delete_record().
  *
- * @see chado_delete_property().
+ * @see chado_delete_record().
  */
 function tripal_feature_delete_property_by_id($featureprop_id) {
 
@@ -265,7 +343,12 @@ function tripal_feature_delete_property_by_id($featureprop_id) {
     )
   );
 
-  return FALSE;
+  // construct the array that will match the exact record to update
+  $match = array(
+    'featureprop_id' => $featureprop_id,
+  );
+
+  return chado_delete_record('featureprop', $match);
 }
 
 /**

+ 60 - 5
tripal_featuremap/api/tripal_featuremap.DEPRECATED.inc

@@ -23,7 +23,7 @@ function tripal_featuremap_get_property($featuremap_id, $property) {
     )
   );
 
-  return FALSE;
+  return chado_get_property('featuremap', $featuremap_id, $property, 'featuremap_property');
 }
 
 /**
@@ -45,7 +45,7 @@ function tripal_featuremap_insert_property($featuremap_id, $property, $value, $u
     )
   );
 
-  return FALSE;
+  return chado_insert_property('featuremap', $featuremap_id, $property, 'featuremap_property', $value, $update_if_present);
 }
 
 /**
@@ -67,7 +67,7 @@ function tripal_featuremap_update_property($featuremap_id, $property, $value, $i
     )
   );
 
-  return FALSE;
+  return chado_update_property('featuremap', $featuremap_id, $property, 'featuremap_property', $value, $insert_if_missing);
 }
 
 /**
@@ -89,7 +89,7 @@ function tripal_featuremap_delete_property($featuremap_id, $property) {
     )
   );
 
-  return FALSE;
+  return chado_delete_property('featuremap', $featuremap_id, $property, 'featuremap_property');
 }
 
 /**
@@ -111,5 +111,60 @@ function tripal_featuremap_add_featuremap_dbxref($featuremap_id, $featuremap_dbx
     )
   );
 
-  return FALSE;
+  // break apart the dbxref
+  $dbname = '';
+  $accession = '';
+  if(preg_match('/^(.*?):(.*?)$/', $featuremap_dbxref, $matches)) {
+    $dbname = $matches[1];
+    $accession = $matches[2];
+  }
+  else {
+    return FALSE;
+  }
+
+  // check to see if the featuremap_dbxref record already exist
+  $values = array(
+    'dbxref_id' => array(
+      'accession' => $accession,
+      'db_id' => array(
+        'name' => $dbname,
+      ),
+    ),
+    'featuremap_id' => $featuremap_id,
+  );
+  $options = array('statement_name' => 'sel_featuremapdbxref_dbpu');
+  $results = chado_select_record('featuremap_dbxref', array('*'), $values, $options);
+
+  // if the featuremap_dbxref record  exist then we don't need to re-add it.
+  if(count($results) > 0) {
+    return $results[0];
+  }
+
+  // make sure our database already exists
+  $db = tripal_db_add_db($dbname);
+
+  // get the database cross-reference
+  $dbxvalues = array(
+    'accession' => $accession,
+    'db_id' => $db->db_id,
+  );
+  $dbxoptions = array('statement_name' => 'sel_dbxref_acdb');
+  $results = chado_select_record('dbxref', array('dbxref_id'), $dbxvalues, $dbxoptions);
+  // if the accession doesn't exist then add it
+  if(count($results) == 0){
+    $dbxref = tripal_db_add_dbxref($db->db_id, $accession);
+  }
+  else {
+    $dbxref = $results[0];
+  }
+
+  // now add the record
+  $options = array('statement_name' => 'ins_featuremapdbxref_dbpu');
+  $results = chado_insert_record('featuremap_dbxref', $values, $options);
+  if (!$results) {
+    tripal_report_error('t_featuremap', TRIPAL_ERROR, "Cannot add map dbxref: %db:%accession.",
+      array('%db' => $dbname, '%accession' => $accession));
+    return FALSE;
+  }
+  return $results;
 }

+ 0 - 153
tripal_featuremap/api/tripal_featuremap.api.inc

@@ -11,156 +11,3 @@
  * Provides an application programming interface (API) to manage chado feature maps
  * @}
  */
-
-/**
- * Retrieve properties of a given type for a given featuremap
- *
- * @param $featuremap_id
- *    The featuremap_id of the properties you would like to retrieve
- * @param $property
- *    The cvterm name of the properties to retrieve
- *
- * @return
- *    An featuremap chado variable with the specified properties expanded
- *
- * @ingroup tripal_featuremap_api
- */
-function tripal_featuremap_get_property($featuremap_id, $property) {
-  return chado_get_property('featuremap', $featuremap_id, $property, 'featuremap_property');
-}
-
-/**
- * Insert a given property
- *
- * @param $featuremap_id
- *   The featuremap_id of the property to insert
- * @param $property
- *   The cvterm name of the property to insert
- * @param $value
- *   The value of the property to insert
- * @param $update_if_present
- *   A boolean indicated whether to update the record if it's already present
- *
- * @return
- *   True of success, False otherwise
- *
- * @ingroup tripal_featuremap_api
- */
-function tripal_featuremap_insert_property($featuremap_id, $property, $value, $update_if_present = 0) {
-  return chado_insert_property('featuremap', $featuremap_id, $property, 'featuremap_property', $value, $update_if_present);
-}
-
-/**
- * Update a given property
- *
- * @param $featuremap_id
- *   The featuremap_id of the property to update
- * @param $property
- *   The cvterm name of the property to update
- * @param $value
- *   The value of the property to update
- * @param $insert_if_missing
- *   A boolean indicated whether to insert the record if it's absent
- *
- * Note: The property will be identified using the unique combination of the $featuremap_id and $property
- * and then it will be updated with the supplied value
- *
- * @return
- *   True of success, False otherwise
- *
- * @ingroup tripal_featuremap_api
- */
-function tripal_featuremap_update_property($featuremap_id, $property, $value, $insert_if_missing = 0) {
-  return chado_update_property('featuremap', $featuremap_id, $property, 'featuremap_property', $value, $insert_if_missing);
-}
-
-/**
- * Delete a given property
- *
- * @param $featuremap_id
- *   The featuremap_id of the property to delete
- * @param $property
- *   The cvterm name of the property to delete
- *
- * Note: The property will be identified using the unique combination of the $featuremap_id and $property
- * and then it will be deleted
- *
- * @return
- *   True of success, False otherwise
- *
- * @ingroup tripal_featuremap_api
- */
-function tripal_featuremap_delete_property($featuremap_id, $property) {
-  return chado_delete_property('featuremap', $featuremap_id, $property, 'featuremap_property');
-}
-
-/**
- * Add a dbxref to the featuremap_dbxref table
- *
- * @param $featuremap_id
- *  The id of the featuremap of interest
- * @param $featuremap_dbxref
- *  A string describing the dbxref with the db name separated from the dbxref accession
- *  by a colon (:)
- *
- * @ingroup tripal_featuremap_api
- */
-function tripal_featuremap_add_featuremap_dbxref($featuremap_id, $featuremap_dbxref) {
-
-  // break apart the dbxref
-  $dbname = '';
-  $accession = '';
-  if(preg_match('/^(.*?):(.*?)$/', $featuremap_dbxref, $matches)) {
-    $dbname = $matches[1];
-    $accession = $matches[2];
-  }
-  else {
-    return FALSE;
-  }
-
-  // check to see if the featuremap_dbxref record already exist
-  $values = array(
-    'dbxref_id' => array(
-      'accession' => $accession,
-      'db_id' => array(
-        'name' => $dbname,
-      ),
-    ),
-    'featuremap_id' => $featuremap_id,
-  );
-  $options = array('statement_name' => 'sel_featuremapdbxref_dbpu');
-  $results = chado_select_record('featuremap_dbxref', array('*'), $values, $options);
-
-  // if the featuremap_dbxref record  exist then we don't need to re-add it.
-  if(count($results) > 0) {
-    return $results[0];
-  }
-
-  // make sure our database already exists
-  $db = tripal_db_add_db($dbname);
-
-  // get the database cross-reference
-  $dbxvalues = array(
-    'accession' => $accession,
-    'db_id' => $db->db_id,
-  );
-  $dbxoptions = array('statement_name' => 'sel_dbxref_acdb');
-  $results = chado_select_record('dbxref', array('dbxref_id'), $dbxvalues, $dbxoptions);
-  // if the accession doesn't exist then add it
-  if(count($results) == 0){
-    $dbxref = tripal_db_add_dbxref($db->db_id, $accession);
-  }
-  else {
-    $dbxref = $results[0];
-  }
-
-  // now add the record
-  $options = array('statement_name' => 'ins_featuremapdbxref_dbpu');
-  $results = chado_insert_record('featuremap_dbxref', $values, $options);
-  if (!$results) {
-    tripal_report_error('t_featuremap', TRIPAL_ERROR, "Cannot add map dbxref: %db:%accession.",
-      array('%db' => $dbname, '%accession' => $accession));
-    return FALSE;
-  }
-  return $results;
-}

+ 2 - 9
tripal_featuremap/tripal_featuremap.module

@@ -13,7 +13,7 @@
  */
 
 require_once 'api/tripal_featuremap.api.inc';
-//require_once 'api/tripal_featuremap.DEPRECATED.inc';
+require_once 'api/tripal_featuremap.DEPRECATED.inc';
 
 require_once 'theme/tripal_featuremap.theme.inc';
 
@@ -218,13 +218,6 @@ function tripal_featuremap_theme($existing, $type, $theme, $path) {
       'variables' =>  array(NULL),
       'path' => "$path/theme/tripal_featuremap",
     ),
-    
-    // templates for the chado_feature node type
-    'tripal_feature_featurepos' => array(
-      'arguments' => array('node' => NULL),
-      'template' => 'tripal_feature_featurepos',
-      'path' => "$path/theme/tripal_feature",
-    ),
   );
   return $items;
 }
@@ -284,7 +277,7 @@ function tripal_featuremap_block_view($delta = '') {
         $block['content'] = theme('tripal_featuremap_publication', $node);
         break;
       case 'maprefs':
-        $block['subject'] = t('Cross References');
+        $block['subject'] = t('References');
         $block['content'] = theme('tripal_featuremap_references', $node);
         break;
       default :

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

@@ -23,7 +23,7 @@ function tripal_library_get_property($library_id, $property) {
     )
   );
 
-  return FALSE;
+  return chado_get_property('library', $library_id, $property, 'library_property');
 }
 
 /**
@@ -45,7 +45,7 @@ function tripal_library_insert_property($library_id, $property, $value, $update_
     )
   );
 
-  return FALSE;
+  return chado_insert_property('library', $library_id, $property, 'library_property', $value, $update_if_present);
 }
 
 /**
@@ -67,7 +67,7 @@ function tripal_library_update_property($library_id, $property, $value, $insert_
     )
   );
 
-  return FALSE;
+  return chado_update_property('library', $library_id, $property, 'library_property', $value, $insert_if_missing);
 }
 
 /**
@@ -89,5 +89,5 @@ function tripal_library_delete_property($library_id, $property) {
     )
   );
 
-  return FALSE;
+  return chado_delete_property('library', $library_id, $property, 'library_property');
 }

+ 0 - 82
tripal_library/api/tripal_library.api.inc

@@ -11,85 +11,3 @@
  * Provides an application programming interface (API) to manage libraries
  * @}
  */
-
-/**
- * Retrieve properties of a given type for a given library
- *
- * @param $library_id
- *    The library_id of the properties you would like to retrieve
- * @param $property
- *    The cvterm name of the properties to retrieve
- *
- * @return
- *    An library chado variable with the specified properties expanded
- *
- * @ingroup tripal_library_api
- */
-function tripal_library_get_property($library_id, $property) {
-  return chado_get_property('library', $library_id, $property, 'library_property');
-}
-
-/**
- * Insert a given property
- *
- * @param $library_id
- *   The library_id of the property to insert
- * @param $property
- *   The cvterm name of the property to insert
- * @param $value
- *   The value of the property to insert
- * @param $update_if_present
- *   A boolean indicated whether to update the record if it's already present
- *
- * @return
- *   True of success, False otherwise
- *
- * @ingroup tripal_library_api
- */
-function tripal_library_insert_property($library_id, $property, $value, $update_if_present = 0) {
-  return chado_insert_property('library', $library_id, $property, 'library_property', $value, $update_if_present);
-}
-
-/**
- * Update a given property
- *
- * @param $library_id
- *   The library_id of the property to update
- * @param $property
- *   The cvterm name of the property to update
- * @param $value
- *   The value of the property to update
- * @param $insert_if_missing
- *   A boolean indicated whether to insert the record if it's absent
- *
- * Note: The property will be identified using the unique combination of the $library_id and $property
- * and then it will be updated with the supplied value
- *
- * @return
- *   True of success, False otherwise
- *
- * @ingroup tripal_library_api
- */
-function tripal_library_update_property($library_id, $property, $value, $insert_if_missing = 0) {
-  return chado_update_property('library', $library_id, $property, 'library_property', $value, $insert_if_missing);
-}
-
-/**
- * Delete a given property
- *
- * @param $library_id
- *   The library_id of the property to delete
- * @param $property
- *   The cvterm name of the property to delete
- *
- * Note: The property will be identified using the unique combination of the $library_id and $property
- * and then it will be deleted
- *
- * @return
- *   True of success, False otherwise
- *
- * @ingroup tripal_library_api
- */
-function tripal_library_delete_property($library_id, $property) {
-  return chado_delete_property('library', $library_id, $property, 'library_property');
-}

+ 1 - 1
tripal_library/tripal_library.module

@@ -13,7 +13,7 @@
  */
 
 require_once 'api/tripal_library.api.inc';
-//require_once 'api/tripal_library.DEPRECATED.inc';
+require_once 'api/tripal_library.DEPRECATED.inc';
 
 require_once 'theme/tripal_library.theme.inc';
 

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

@@ -23,7 +23,7 @@ function tripal_project_get_property($project_id, $property) {
     )
   );
 
-  return FALSE;
+  return chado_get_property('project', $project_id, $property, 'project_property');
 }
 
 /**
@@ -45,7 +45,7 @@ function tripal_project_insert_property($project_id, $property, $value, $update_
     )
   );
 
-  return FALSE;
+  return chado_insert_property('project', $project_id, $property, 'project_property', $value, $update_if_present);
 }
 
 /**
@@ -67,7 +67,7 @@ function tripal_project_update_property($project_id, $property, $value, $insert_
     )
   );
 
-  return FALSE;
+  return chado_update_property('project', $project_id, $property, 'project_property', $value, $insert_if_missing);
 }
 
 /**
@@ -89,5 +89,5 @@ function tripal_project_delete_property($project_id, $property) {
     )
   );
 
-  return FALSE;
+  return chado_delete_property('project', $project_id, $property, 'project_property');
 }

+ 0 - 81
tripal_project/api/tripal_project.api.inc

@@ -11,84 +11,3 @@
  * Provides an application programming interface (API) to manage projects
  * @}
  */
-
-/**
- * Retrieve properties of a given type for a given project
- *
- * @param $project_id
- *    The project_id of the properties you would like to retrieve
- * @param $property
- *    The cvterm name of the properties to retrieve
- *
- * @return
- *    An project chado variable with the specified properties expanded
- *
- * @ingroup tripal_project_api
- */
-function tripal_project_get_property($project_id, $property) {
-  return chado_get_property('project', $project_id, $property, 'project_property');
-}
-
-/**
- * Insert a given property
- *
- * @param $project_id
- *   The project_id of the property to insert
- * @param $property
- *   The cvterm name of the property to insert
- * @param $value
- *   The value of the property to insert
- * @param $update_if_present
- *   A boolean indicated whether to update the record if it's already present
- *
- * @return
- *   True of success, False otherwise
- *
- * @ingroup tripal_project_api
- */
-function tripal_project_insert_property($project_id, $property, $value, $update_if_present = 0) {
-  return chado_insert_property('project', $project_id, $property, 'project_property', $value, $update_if_present);
-}
-
-/**
- * Update a given property
- *
- * @param $project_id
- *   The project_id of the property to update
- * @param $property
- *   The cvterm name of the property to update
- * @param $value
- *   The value of the property to update
- * @param $insert_if_missing
- *   A boolean indicated whether to insert the record if it's absent
- *
- * Note: The property will be identified using the unique combination of the $project_id and $property
- * and then it will be updated with the supplied value
- *
- * @return
- *   True of success, False otherwise
- *
- * @ingroup tripal_project_api
- */
-function tripal_project_update_property($project_id, $property, $value, $insert_if_missing = 0) {
-  return chado_update_property('project', $project_id, $property, 'project_property', $value, $insert_if_missing);
-}
-/**
- * Delete a given property
- *
- * @param $project_id
- *   The project_id of the property to delete
- * @param $property
- *   The cvterm name of the property to delete
- *
- * Note: The property will be identified using the unique combination of the $project_id and $property
- * and then it will be deleted
- *
- * @return
- *   True of success, False otherwise
- *
- * @ingroup tripal_project_api
- */
-function tripal_project_delete_property($project_id, $property) {
-  return chado_delete_property('project', $project_id, $property, 'project_property');
-}

+ 1 - 1
tripal_project/tripal_project.module

@@ -5,7 +5,7 @@
  */
 
 require_once 'api/tripal_project.api.inc';
-//require_once 'api/tripal_project.DEPRECATED.inc';
+require_once 'api/tripal_project.DEPRECATED.inc';
 
 require_once 'theme/tripal_project.theme.inc';
 

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

@@ -309,7 +309,7 @@ function tripal_pub_get_property($pub_id, $property) {
     )
   );
 
-  return FALSE;
+  return chado_get_property('pub', $pub_id, $property, 'tripal_pub');
 }
 
 /**
@@ -331,7 +331,7 @@ function tripal_pub_insert_property($pub_id, $property, $value, $update_if_prese
     )
   );
 
-  return FALSE;
+  return chado_insert_property('pub', $pub_id, $property, 'tripal_pub', $value, $update_if_present);
 }
 
 /**
@@ -353,7 +353,7 @@ function tripal_pub_update_property($pub_id, $property, $value, $insert_if_missi
     )
   );
 
-  return FALSE;
+  return chado_update_property('pub', $pub_id, $property, 'tripal_pub', $value, $insert_if_missing);
 }
 
 /**
@@ -375,7 +375,7 @@ function tripal_pub_delete_property($pub_id, $property) {
     )
   );
 
-  return FALSE;
+  return chado_delete_property('pub', $pub_id, $property, 'tripal_pub');
 }
 
 /**