Explorar o código

Renamed tripal_data to tripal_entity and tripal_data_type to tripal_bundle

Chun-Huai Cheng %!s(int64=9) %!d(string=hai) anos
pai
achega
20d5b2c02b

+ 13 - 13
tripal_entities/api/tripal_entities.api.inc

@@ -2,43 +2,43 @@
 
 
 /**
- * Deletes a tripal_data.
+ * Deletes a tripal_entity.
  */
-function tripal_data_delete(TripalData $tripal_data) {
-  $tripal_data->delete();
+function tripal_entity_delete(TripalEntity $tripal_entity) {
+  $tripal_entity->delete();
 }
 
 /**
- * Saves a tripal_data to the database.
+ * Saves a tripal_entity to the database.
  *
- * @param $tripal_data
- *   The tripal_data object.
+ * @param $tripal_entity
+ *   The tripal_entity object.
  */
-function tripal_data_save(TripalData $entity) {
+function tripal_entity_save(TripalEntity $entity) {
   return $entity->save();
 }
 
 
 /**
- * Saves a tripal_data type to the db.
+ * Saves a tripal_entity type to the db.
  */
-function tripal_data_type_save(TripalDataType $entity) {
+function tripal_bundle_save(TripalBundle $entity) {
   $entity->save();
 }
 
 
 /**
- * Deletes a tripal_data type from the db.
+ * Deletes a tripal_entity type from the db.
  */
-function tripal_data_type_delete(TripalDataType $type) {
+function tripal_bundle_delete(TripalBundle $type) {
   $type->delete();
 }
 
 
 /**
- * URI callback for tripal_datas
+ * URI callback for tripal_entitys
  */
-function tripal_data_uri(TripalData $entity){
+function tripal_entity_uri(TripalEntity $entity){
   return array(
     'path' => 'data/' . $entity->id,
   );

+ 1 - 1
tripal_entities/includes/TripalDataType.inc → tripal_entities/includes/TripalBundle.inc

@@ -2,7 +2,7 @@
 /**
  * The class used for Tripal data type entities
  */
-class TripalDataType extends Entity {
+class TripalBundle extends Entity {
 
   public function __construct($values = array(), $entity_type) {
     parent::__construct($values, $entity_type);

+ 2 - 2
tripal_entities/includes/TripalDataTypeController.inc → tripal_entities/includes/TripalBundleController.inc

@@ -2,7 +2,7 @@
 /**
  * The Controller for Tripal data type entities
  */
-class TripalDataTypeController extends EntityAPIControllerExportable {
+class TripalBundleController extends EntityAPIControllerExportable {
   public function __construct($entityType) {
     parent::__construct($entityType);
     // The 'bundle of' property is usually set in the hook_entity_info()
@@ -15,7 +15,7 @@ class TripalDataTypeController extends EntityAPIControllerExportable {
     // can handle all of the Tripal entity types, we have to set the
     // 'bundle of' property here rather than in the hook_entity_info() function.
     $bundle_of = $entityType;
-    $bundle_of = preg_replace('/_type/', '', $bundle_of);
+    $bundle_of = preg_replace('/_bundle/', '', $bundle_of);
     $info = entity_get_info($bundle_of);
     $this->bundleKey = $info['bundle keys']['bundle'];
     $this->entityInfo['bundle of'] = $bundle_of;

+ 14 - 14
tripal_entities/includes/TripalDataTypeUIController.inc → tripal_entities/includes/TripalBundleUIController.inc

@@ -7,7 +7,7 @@
 /**
  * UI controller.
  */
-class TripalDataTypeUIController extends EntityDefaultUIController {
+class TripalBundleUIController extends EntityDefaultUIController {
 
   public function __construct($entity_type, $entity_info) {
     // The 'bundle of' property is usually set in the hook_entity_info()
@@ -20,7 +20,7 @@ class TripalDataTypeUIController extends EntityDefaultUIController {
     // can handle all of the Tripal entity types, we have to set the
     // 'bundle of' property here rather than in the hook_entity_info() function.
     $bundle_of = $entity_type;
-    $bundle_of = preg_replace('/_type/', '', $bundle_of);
+    $bundle_of = preg_replace('/_bundle/', '', $bundle_of);
     $entity_info['bundle of'] = $bundle_of;
     parent::__construct($entity_type, $entity_info);
   }
@@ -62,7 +62,7 @@ class TripalDataTypeUIController extends EntityDefaultUIController {
     // named after the entity type but we can't dynamically create these
     // functions. We'll use a single form for all entity types.
     $forms[$this->entityType . '_form'] = array(
-      'callback' => 'tripal_entities_tripal_data_type_form',
+      'callback' => 'tripal_entities_tripal_bundle_form',
       'callback arguments' => array($this->entityType)
     );
 
@@ -75,35 +75,35 @@ class TripalDataTypeUIController extends EntityDefaultUIController {
  * @param $form_state
  * @param $entity
  */
-function tripal_entities_tripal_data_type_form($form, &$form_state, $entityDataType) {
+function tripal_entities_tripal_bundle_form($form, &$form_state, $entityDataType) {
   $form = array();
   $form['message'] = array(
     '#type' => 'item',
-    '#markup' => 'Edit the function "tripal_entities_tripal_data_type_form()" to add a form each type. Put access controls here?',
+    '#markup' => 'Edit the function "tripal_entities_tripal_bundle_form()" to add a form each type. Put access controls here?',
   );
   return $form;
 }
 /**
  * Access callback for the entity API.
  */
-function tripal_data_type_access($op, $type = NULL, $account = NULL) {
+function tripal_bundle_access($op, $type = NULL, $account = NULL) {
   return user_access('administer tripal data types', $account);
 }
 
 /**
  * Generates the tripal data type editing form.
  */
-function tripal_data_type_form($form, &$form_state, $tripal_data_type, $op = 'edit') {
+function tripal_bundle_form($form, &$form_state, $tripal_bundle, $op = 'edit') {
 
   if ($op == 'clone') {
-    $tripal_data_type->label .= ' (cloned)';
-    $tripal_data_type->type = '';
+    $tripal_bundle->label .= ' (cloned)';
+    $tripal_bundle->type = '';
   }
 
   $form['label'] = array(
     '#title' => t('Label'),
     '#type' => 'textfield',
-    '#default_value' => $tripal_data_type->label,
+    '#default_value' => $tripal_bundle->label,
     '#description' => t('The human-readable name of this tripal data type.'),
     '#required' => TRUE,
     '#size' => 30,
@@ -115,16 +115,16 @@ function tripal_data_type_form($form, &$form_state, $tripal_data_type, $op = 'ed
 /**
  * Form API submit callback for the type form.
  */
-function tripal_data_type_form_submit(&$form, &$form_state) {
-  $tripal_data_type = entity_ui_form_submit_build_entity($form, $form_state);
-  $tripal_data_type->save();
+function tripal_bundle_form_submit(&$form, &$form_state) {
+  $tripal_bundle = entity_ui_form_submit_build_entity($form, $form_state);
+  $tripal_bundle->save();
   $form_state['redirect'] = $this->path;
 }
 
 /**
  * Form API submit callback for the delete button.
  */
-function tripal_data_type_form_submit_delete(&$form, &$form_state) {
+function tripal_bundle_form_submit_delete(&$form, &$form_state) {
   $form_state['redirect'] = $this->path;
 }
 

+ 2 - 2
tripal_entities/includes/TripalData.inc → tripal_entities/includes/TripalEntity.inc

@@ -1,8 +1,8 @@
 <?php
 /**
- * A class the controller will use for instantiating the TripalData entity.
+ * A class the controller will use for instantiating the TripalEntity entity.
  */
-class TripalData extends Entity {
+class TripalEntity extends Entity {
   public function __construct($values = array(), $entity_type) {
     parent::__construct($values, $entity_type);
   }

+ 4 - 4
tripal_entities/includes/TripalDataController.inc → tripal_entities/includes/TripalEntityController.inc

@@ -1,11 +1,11 @@
 <?php
 /**
- * TripalDataController extends DrupalDefaultEntityController.
+ * TripalEntityController extends DrupalDefaultEntityController.
  *
  * Our subclass of DrupalDefaultEntityController lets us add a few
  * important create, update, and delete methods.
  */
-class TripalDataController extends EntityAPIController {
+class TripalEntityController extends EntityAPIController {
 
   public function __construct($entityType) {
     parent::__construct($entityType);
@@ -64,7 +64,7 @@ class TripalDataController extends EntityAPIController {
           field_attach_delete($entity->type, $entity);
           $ids[] = $entity->id;
         }
-        db_delete('tripal_data')
+        db_delete('tripal_entity')
           ->condition('id', $ids, 'IN')
           ->execute();
       }
@@ -122,7 +122,7 @@ class TripalDataController extends EntityAPIController {
     if ($invocation == 'entity_update') {
       $record['id'] = $entity->id;
     }
-    $success = drupal_write_record('tripal_data', $record, $pkeys);
+    $success = drupal_write_record('tripal_entity', $record, $pkeys);
     if ($success == SAVED_NEW) {
       $entity->id = $record['id'];
     }

+ 46 - 46
tripal_entities/includes/TripalDataUIController.inc → tripal_entities/includes/TripalEntityUIController.inc

@@ -2,7 +2,7 @@
 /**
  * UI controller.
  */
-class TripalDataUIController extends EntityDefaultUIController {
+class TripalEntityUIController extends EntityDefaultUIController {
 
   /**
    * Overrides hook_menu() defaults. Main reason for doing this is that
@@ -31,8 +31,8 @@ class TripalDataUIController extends EntityDefaultUIController {
       'title' => 'Add new biological data',
       'description' => 'Add new biological data',
       'page callback'  => 'drupal_get_form',
-      'page arguments' => array('tripal_data_form'),
-      'access callback'  => 'tripal_data_access',
+      'page arguments' => array('tripal_entity_form'),
+      'access callback'  => 'tripal_entity_access',
       'access arguments' => array('administer tripal data'),
       'type' => MENU_LOCAL_ACTION,
       'weight' => 20,
@@ -43,8 +43,8 @@ class TripalDataUIController extends EntityDefaultUIController {
       'title' => 'Add Tripal data',
       'description' => 'Add a new tripal data record',
       'page callback'  => 'drupal_get_form',
-      'page arguments' => array('tripal_data_form'),
-      'access callback'  => 'tripal_data_access',
+      'page arguments' => array('tripal_entity_form'),
+      'access callback'  => 'tripal_entity_access',
       'access arguments' => array('edit'),
       'type' => MENU_NORMAL_ITEM,
       'weight' => 20,
@@ -52,11 +52,11 @@ class TripalDataUIController extends EntityDefaultUIController {
 
     // Link for viewing a tripal data type.
     $items['data/' . $wildcard] = array(
-      'title callback' => 'tripal_data_title',
+      'title callback' => 'tripal_entity_title',
       'title arguments' => array(1),
-      'page callback' => 'tripal_data_view',
+      'page callback' => 'tripal_entity_view',
       'page arguments' => array(1),
-      'access callback' => 'tripal_data_access',
+      'access callback' => 'tripal_entity_access',
       'access arguments' => array('view', 1),
       'type' => MENU_CALLBACK,
     );
@@ -64,9 +64,9 @@ class TripalDataUIController extends EntityDefaultUIController {
     // 'View' tab for an individual entity page.
     $items['data/' . $wildcard . '/view'] = array(
       'title' => 'View',
-      'page callback' => 'tripal_data_view',
+      'page callback' => 'tripal_entity_view',
       'page arguments' => array(1),
-      'access callback' => 'tripal_data_access',
+      'access callback' => 'tripal_entity_access',
       'access arguments' => array('view', 1),
       'type' => MENU_DEFAULT_LOCAL_TASK,
       'weight' => -10,
@@ -77,8 +77,8 @@ class TripalDataUIController extends EntityDefaultUIController {
     $items['data/' . $wildcard . '/edit'] = array(
       'title' => 'Edit',
       'page callback' => 'drupal_get_form',
-      'page arguments' => array('tripal_data_form', 1),
-      'access callback' => 'tripal_data_access',
+      'page arguments' => array('tripal_entity_form', 1),
+      'access callback' => 'tripal_entity_access',
       'access arguments' => array('edit', 1),
       'type' => MENU_LOCAL_TASK,
 
@@ -88,8 +88,8 @@ class TripalDataUIController extends EntityDefaultUIController {
     $items['data/' . $wildcard . '/delete'] = array(
       'title'  => 'Delete',
       'page callback' => 'drupal_get_form',
-      'page arguments' => array('tripal_data_delete_form', 1),
-      'access callback' => 'tripal_data_access',
+      'page arguments' => array('tripal_entity_delete_form', 1),
+      'access callback' => 'tripal_entity_access',
       'access arguments' => array('edit', 1),
       'type' => MENU_CALLBACK,
 
@@ -113,7 +113,7 @@ class TripalDataUIController extends EntityDefaultUIController {
  * @return boolean
  *   Whether access is allowed or not.
  */
-function tripal_data_access($op, $entity = NULL, $account = NULL) {
+function tripal_entity_access($op, $entity = NULL, $account = NULL) {
   if (user_access('administer tripal data', $account)) {
     return TRUE;
   }
@@ -128,7 +128,7 @@ function tripal_data_access($op, $entity = NULL, $account = NULL) {
 /**
  *
  */
-function tripal_data_form($form, &$form_state, $entity = NULL) {
+function tripal_entity_form($form, &$form_state, $entity = NULL) {
 
   // Set the defaults.
   $cv_id = NULL;
@@ -157,8 +157,8 @@ function tripal_data_form($form, &$form_state, $entity = NULL) {
     $cvterm = chado_generate_var('cvterm', $values);
   }
 
-  // Let the user select the vocabulary          defaut and tripal_data but only if they haven't
-  // already selected a tripal_data.
+  // Let the user select the vocabulary          defaut and tripal_entity but only if they haven't
+  // already selected a tripal_entity.
   $cvs = tripal_entities_get_published_vocabularies_as_select_options();
   if (!$term_name) {
     $form['cv_id'] = array(
@@ -169,8 +169,8 @@ function tripal_data_form($form, &$form_state, $entity = NULL) {
       '#description' => t('Select a vocabulary that contains the term for the type of data you want to add.'),
       '#default_value' => $cv_id,
       '#ajax' => array(
-        'callback' => "tripal_data_form_ajax_callback",
-        'wrapper' => 'tripal_data_form',
+        'callback' => "tripal_entity_form_ajax_callback",
+        'wrapper' => 'tripal_entity_form',
         'effect' => 'fade',
         'method' => 'replace'
       )
@@ -263,43 +263,43 @@ function tripal_data_form($form, &$form_state, $entity = NULL) {
     // the Entity API to work.  It must have a key of the entity name.
     $form_state[$cvterm->dbxref_id->db_id->name] = $entity;
   }
-  $form['#prefix'] = '<div id="tripal_data_form">';
+  $form['#prefix'] = '<div id="tripal_entity_form">';
   $form['#suffix'] = '</div>';
   return $form;
 }
 
 /**
- * An Ajax callback for the tripal_data_form.
+ * An Ajax callback for the tripal_entity_form.
  */
-function tripal_data_form_ajax_callback($form, $form_state) {
+function tripal_entity_form_ajax_callback($form, $form_state) {
   // return the form so Drupal can update the content on the page
   return $form;
 
 }
 /**
- * Implements hook_validate() for the tripal_data_form.
+ * Implements hook_validate() for the tripal_entity_form.
  */
-function tripal_data_form_validate($form, &$form_state) {
+function tripal_entity_form_validate($form, &$form_state) {
 
   if ($form_state['clicked_button']['#name'] == 'add_data') {
-    $tripal_data = (object) $form_state['values'];
+    $tripal_entity = (object) $form_state['values'];
     $entity_type = $form_state['values']['entity_type'];
-    field_attach_form_validate($entity_type, $tripal_data, $form, $form_state);
+    field_attach_form_validate($entity_type, $tripal_entity, $form, $form_state);
   }
 }
 
 /**
- * Implements hook_submit() for the tripal_data_form.
+ * Implements hook_submit() for the tripal_entity_form.
  *
  */
-function tripal_data_form_submit($form, &$form_state) {
+function tripal_entity_form_submit($form, &$form_state) {
   if ($form_state['clicked_button']['#name'] == 'cancel') {
     if (array_key_exists('id', $form_state['values'])){
       $entity = $form_state['values']['entity'];
       $form_state['redirect'] = "data/$entity->id";
     }
     else {
-      $form_state['redirect'] = "admin/structure/tripal_data";
+      $form_state['redirect'] = "admin/structure/tripal_entity";
     }
     return;
   }
@@ -322,27 +322,27 @@ function tripal_data_form_submit($form, &$form_state) {
  *
  * @todo Remove hard-coded path
  */
-function tripal_data_form_submit_delete(&$form, &$form_state) {
-  $form_state['redirect'] = 'admin/content/tripal_datas/tripal_data/' . $form_state['tripal_data']->tripal_data_id . '/delete';
+function tripal_entity_form_submit_delete(&$form, &$form_state) {
+  $form_state['redirect'] = 'admin/content/tripal_entitys/tripal_entity/' . $form_state['tripal_entity']->tripal_entity_id . '/delete';
 }
 
 
 /**
- * Form callback: confirmation form for deleting a tripal_data.
+ * Form callback: confirmation form for deleting a tripal_entity.
  *
- * @param $tripal_data
- *   The tripal_data to delete
+ * @param $tripal_entity
+ *   The tripal_entity to delete
  *
  * @see confirm_form()
  */
-function tripal_data_delete_form($form, &$form_state, $entity) {
+function tripal_entity_delete_form($form, &$form_state, $entity) {
   $form_state['entity'] = $entity;
 
-  $form['#submit'][] = 'tripal_data_delete_form_submit';
+  $form['#submit'][] = 'tripal_entity_delete_form_submit';
 
   $form = confirm_form($form,
     t('Click the delete button below to confirm deltion of the record titled: %title', array('%title' => $entity->title)),
-    'admin/content/tripal_data',
+    'admin/content/tripal_entity',
     '<p>' . t('This action cannot be undone.') . '</p>',
     t('Delete'),
     t('Cancel'),
@@ -353,17 +353,17 @@ function tripal_data_delete_form($form, &$form_state, $entity) {
 }
 
 /**
- * Submit callback for tripal_data_delete_form
+ * Submit callback for tripal_entity_delete_form
  */
-function tripal_data_delete_form_submit($form, &$form_state) {
+function tripal_entity_delete_form_submit($form, &$form_state) {
   $entity = $form_state['entity'];
 
-  tripal_data_delete($entity);
+  tripal_entity_delete($entity);
 
-  drupal_set_message(t('The tripal_data %name has been deleted.', array('%name' => $tripal_data->name)));
-  watchdog('tripal_data', 'Deleted tripal_data %name.', array('%name' => $tripal_data->name));
+  drupal_set_message(t('The tripal_entity %name has been deleted.', array('%name' => $tripal_entity->name)));
+  watchdog('tripal_entity', 'Deleted tripal_entity %name.', array('%name' => $tripal_entity->name));
 
-  $form_state['redirect'] = 'admin/content/tripal_datas';
+  $form_state['redirect'] = 'admin/content/tripal_entitys';
 }
 
 /**
@@ -376,7 +376,7 @@ function tripal_data_delete_form_submit($form, &$form_state) {
  * @see hook_entity_view()
  * @see hook_entity_view_alter()
  */
-function tripal_data_view($entity, $view_mode = 'full') {
+function tripal_entity_view($entity, $view_mode = 'full') {
   $controller = entity_get_controller($entity->type);
   $content = $controller->view(array($entity->id => $entity));
   drupal_set_title($entity->title);
@@ -386,6 +386,6 @@ function tripal_data_view($entity, $view_mode = 'full') {
 /**
  * Menu title callback for showing individual entities
  */
-function tripal_data_title(TripalData $entity){
+function tripal_entity_title(TripalEntity $entity){
   return $entity->title;
 }

+ 18 - 18
tripal_entities/includes/tripal_entities.admin.inc

@@ -7,7 +7,7 @@
  */
 function tripal_entities_admin_view() {
 
-  $form = drupal_get_form('tripal_entities_admin_data_types_form');
+  $form = drupal_get_form('tripal_entities_admin_bundles_form');
   $output = drupal_render($form) . "<br>[ Image Place Holder for Data Type Summary ]<br>";
 
   // set the breadcrumb
@@ -15,7 +15,7 @@ function tripal_entities_admin_view() {
   $breadcrumb[] = l('Home', '<front>');
   $breadcrumb[] = l('Administration', 'admin');
   $breadcrumb[] = l('Tripal', 'admin/tripal');
-  $breadcrumb[] = l('Biological Data', 'admin/tripal/data_types');
+  $breadcrumb[] = l('Biological Data', 'admin/tripal/bundles');
   drupal_set_breadcrumb($breadcrumb);
 
 /*   // Add the view
@@ -72,7 +72,7 @@ function tripal_entities_content_view() {
 function tripal_entities_content_overview_form($form, &$form_state) {
   $form = array();
 
-  $entities = db_select('tripal_data', 'td')
+  $entities = db_select('tripal_entity', 'td')
     ->fields('td')
     ->orderBy('created', 'DESC')//ORDER BY created
     ->range(0,25)
@@ -118,7 +118,7 @@ function tripal_entities_content_overview_form($form, &$form_state) {
  * @param unknown $form_state
  * @return multitype:
  */
-function tripal_entities_admin_data_types_form($form, &$form_state) {
+function tripal_entities_admin_bundles_form($form, &$form_state) {
   $form = array();
 
   // Set the defaults.
@@ -131,8 +131,8 @@ function tripal_entities_admin_data_types_form($form, &$form_state) {
     $term_name = array_key_exists('term_name', $form_state['values']) ? $form_state['values']['term_name'] : NULL;
   }
 
-  // Let the user select the vocabulary and tripal_data but only if they haven't
-  // already selected a tripal_data.
+  // Let the user select the vocabulary and tripal_entity but only if they haven't
+  // already selected a tripal_entity.
   $sql = "
     SELECT CV.cv_id, CV.name
     FROM {cv} CV
@@ -151,26 +151,26 @@ function tripal_entities_admin_data_types_form($form, &$form_state) {
     '#description' => t('Select a vocabulary to view potential data types in the chart below. Limit the chart to only published data types by selecting the checkbox.'),
     '#default_value' => $cv_id,
     '#ajax' => array(
-      'callback' => "tripal_entities_admin_data_types_form_ajax_callback",
-      'wrapper' => 'tripal_entities_admin_data_types_form',
+      'callback' => "tripal_entities_admin_bundles_form_ajax_callback",
+      'wrapper' => 'tripal_entities_admin_bundles_form',
       'effect' => 'fade',
       'method' => 'replace'
     )
   );
 
-  $form['refresh_data_types'] = array(
+  $form['refresh_bundles'] = array(
     '#type' => 'submit',
     '#value' => t('Refresh Data Types'),
-    '#submit' => array('tripal_entity_admin_data_types_form_submit_refresh_data_types'),
+    '#submit' => array('tripal_entity_admin_bundles_form_submit_refresh_bundles'),
   );
 
   $form['publish_new_data'] = array(
     '#type' => 'submit',
     '#value' => t('Publish New Data'),
-    '#submit' => array('tripal_entity_admin_data_types_form_submit_publish_new_data'),
+    '#submit' => array('tripal_entity_admin_bundles_form_submit_publish_new_data'),
   );
 
-  $form['#prefix'] = '<div id="tripal_entities_admin_data_type_form">';
+  $form['#prefix'] = '<div id="tripal_entities_admin_bundle_form">';
   $form['#suffix'] = '</div>';
   return $form;
 }
@@ -179,7 +179,7 @@ function tripal_entities_admin_data_types_form($form, &$form_state) {
  * Submit a job to populate the entity tables
  * This operation makes available data types in the database publishable
  */
-function tripal_entity_admin_data_types_form_submit_refresh_data_types () {
+function tripal_entity_admin_bundles_form_submit_refresh_bundles () {
   global $user;
   tripal_add_job('Create publishable data types', 'tripal_entity', 'tripal_entities_populate_entity_tables', array(), $user->uid);
 }
@@ -203,8 +203,8 @@ function tripal_entities_admin_publish_form($form, &$form_state) {
     $term_name = array_key_exists('term_name', $form_state['values']) ? $form_state['values']['term_name'] : NULL;
   }
 
-  // Let the user select the vocabulary and tripal_data but only if they haven't
-  // already selected a tripal_data.
+  // Let the user select the vocabulary and tripal_entity but only if they haven't
+  // already selected a tripal_entity.
   $sql = "
     SELECT CV.cv_id, CV.name
     FROM {tripal_vocabulary} TET
@@ -359,7 +359,7 @@ function tripal_entities_admin_publish_form_submit($form, &$form_state) {
       // Add in the bundle's fields.
       tripal_entities_add_bundle_fields($tablename, $entity_type_name, $bundle_name);
 
-      // The TripalDataType Entity manages the bundles we have available.
+      // The TripalBundle Entity manages the bundles we have available.
       // Therefore, we need to add a new entity for each bundle "type".
        $vals = array(
         'label' => $bundle_name  . ' (' . $type->name . ')',
@@ -368,8 +368,8 @@ function tripal_entities_admin_publish_form_submit($form, &$form_state) {
         'data' => serialize(array()),
         'module' => 'tripal_entities'
       );
-      $tripal_data_type = new TripalDataType($vals, $entity_type_name . '_type');
-      $tripal_data_type->save();
+      $tripal_bundle = new TripalBundle($vals, $entity_type_name . '_bundle');
+      $tripal_bundle->save();
     }
     drupal_set_message(t('Data type, %type, is now set as publishable.', array('%type' => $term_name)));
   }

+ 2 - 2
tripal_entities/tripal_entities.install

@@ -311,7 +311,7 @@ function tripal_entities_add_tripal_term_relationship_table(){
  */
 function tripal_entities_schema() {
 
-  $schema['tripal_data'] = array(
+  $schema['tripal_entity'] = array(
     'description' => 'The base table for Tripal Vocabulary-based entities.',
     'fields' => array(
       'id' => array(
@@ -400,7 +400,7 @@ function tripal_entities_schema() {
     'primary key' => array('id'),
   );
 
-  $schema['tripal_data_type'] = array(
+  $schema['tripal_bundle'] = array(
     'description' => 'Stores information about defined tripal data types.',
     'fields' => array(
       'id' => array(

+ 40 - 40
tripal_entities/tripal_entities.module

@@ -5,12 +5,12 @@ require_once "includes/tripal_entities.chado_entity.inc";
 require_once "includes/tripal_entities.field_storage.inc";
 require_once "includes/tripal_entities.fields.inc";
 require_once "includes/tripal_entities.tables.inc";
-require_once "includes/TripalData.inc";
-require_once "includes/TripalDataController.inc";
-require_once "includes/TripalDataUIController.inc";
-require_once "includes/TripalDataType.inc";
-require_once "includes/TripalDataTypeController.inc";
-require_once "includes/TripalDataTypeUIController.inc";
+require_once "includes/TripalEntity.inc";
+require_once "includes/TripalEntityController.inc";
+require_once "includes/TripalEntityUIController.inc";
+require_once "includes/TripalBundle.inc";
+require_once "includes/TripalBundleController.inc";
+require_once "includes/TripalBundleUIController.inc";
 
 /**
  * Implements hook_views_api().
@@ -94,9 +94,9 @@ function tripal_entities_permission() {
  */
 function tripal_entities_theme($existing, $type, $theme, $path) {
   return array(
-    'tripal_data' => array(
+    'tripal_entity' => array(
       'render element' => 'elements',
-      'template' => 'tripal_data',
+      'template' => 'tripal_entity',
       'path' => "$path/theme/templates"
     ),
   );
@@ -108,7 +108,7 @@ function tripal_entities_theme($existing, $type, $theme, $path) {
 function tripal_entities_rdf_mapping() {
   return array();
 /*   return array(
-    'type' => 'tripal_data',
+    'type' => 'tripal_entity',
     'bundle' => 'gene',
     'mapping' => array(
       'rdftype' => array('sioc:Item', 'foaf:Document'),
@@ -152,11 +152,11 @@ function tripal_entities_entity_info() {
 
       // The entity class and controller class extend the classes provided by the
       // Entity API.
-      'entity class' => 'TripalData',
-      'controller class' => 'TripalDataController',
+      'entity class' => 'TripalEntity',
+      'controller class' => 'TripalEntityController',
 
       // The table for this entity defined in hook_schema()
-      'base table' => 'tripal_data',
+      'base table' => 'tripal_entity',
 
       // Returns the uri elements of an entity.
       'uri callback' => 'tripal_entities_vocbulary_term_uri',
@@ -176,7 +176,7 @@ function tripal_entities_entity_info() {
       ),
 
       // Callback function for access to this entity.
-      'access callback' => 'tripal_data_access',
+      'access callback' => 'tripal_entity_access',
 
       // FALSE disables caching. Caching functionality is handled by Drupal core.
       'static cache' => FALSE,
@@ -184,17 +184,17 @@ function tripal_entities_entity_info() {
       // Bundles are added in the hook_entities_info_alter() function.
       'bundles' => array (),
 
-      'label callback' => 'tripal_data_label',
+      'label callback' => 'tripal_entity_label',
 
-      // The information below is used by the TripalDataUIController
+      // The information below is used by the TripalEntityUIController
       // (which extends the EntityDefaultUIController). The admin_ui
       // key here is mean to appear on the 'Find Content' page of the
       // administrative menu.
       'admin ui' => array (
         'path' => 'admin/content/bio_data',
-        'controller class' => 'TripalDataUIController',
-        'menu wildcard' => '%tripal_data',
-        'file' => 'includes/TripalDataUIController.inc'
+        'controller class' => 'TripalEntityUIController',
+        'menu wildcard' => '%tripal_entity',
+        'file' => 'includes/TripalEntityUIController.inc'
       ),
       'view modes' => array (
         'full' => array (
@@ -208,11 +208,11 @@ function tripal_entities_entity_info() {
       )
     );
     // The entity that holds information about the entity types.
-    $entities [$voc->db_id->name . '_type'] = array (
-      'label' => $voc->db_id->name . ' (' . $voc->cv_id->name . ') Data Types',
-      'entity class' => 'TripalDataType',
-      'controller class' => 'TripalDataTypeController',
-      'base table' => 'tripal_data_type',
+    $entities [$voc->db_id->name . '_bundle'] = array (
+      'label' => $voc->db_id->name . ' (' . $voc->cv_id->name . ') Data Type',
+      'entity class' => 'TripalBundle',
+      'controller class' => 'TripalBundleController',
+      'base table' => 'tripal_bundle',
       'fieldable' => FALSE,
       'exportable' => FALSE,
       'entity keys' => array (
@@ -220,14 +220,14 @@ function tripal_entities_entity_info() {
         'name' => 'bundle',
         'label' => 'label'
       ),
-      'access callback' => 'tripal_data_type_access',
+      'access callback' => 'tripal_bundle_access',
       'module' => 'tripal_entities',
       // Enable the entity API's admin UI.
       'admin ui' => array (
         'path' => 'admin/structure/bio_data/' . $voc->db_id->name,
-        'controller class' => 'TripalDataTypeUIController',
-        'file' => 'includes/TripalDataTypeUIController.inc',
-        'menu wildcard' => '%tripal_data_type',
+        'controller class' => 'TripalBundleUIController',
+        'file' => 'includes/TripalBundleUIController.inc',
+        'menu wildcard' => '%tripal_bundle',
       )
     );
   }
@@ -258,7 +258,7 @@ function tripal_entities_entity_info_alter(&$entity_info) {
     $entity_info[$entity_type]['bundles'][$bundle_id] = array (
       'label' => $label,
       'admin' => array (
-        'path' => 'admin/structure/bio_data/' . $entity_type . '/manage/%tripal_data_type',
+        'path' => 'admin/structure/bio_data/' . $entity_type . '/manage/%tripal_bundle',
         'real path' => 'admin/structure/bio_data/' . $entity_type . '/manage/' . $bundle_id,
         'bundle argument' => 5,
         'access arguments' => array (
@@ -311,37 +311,37 @@ function tripal_entities_get_published_terms_as_select_options($cv_id = NULL) {
  *   A tripal data type array or FALSE if $type does not exist.
  */
 
-function tripal_data_type_load($bundle_type, $reset = FALSE) {
+function tripal_bundle_load($bundle_type, $reset = FALSE) {
   // Get the type of entity by the ID.
-  $bundle_types = db_select('tripal_data_type', 'tdt')
+  $bundle_types = db_select('tripal_bundle', 'tdt')
     ->fields('tdt', array('id', 'type'))
     ->condition('bundle', $bundle_type)
     ->execute()
     ->fetchObject();
 
-  // Load the tripal_data_type entity. These entities are always the same
-  // as an Tripal entity type but with a '_type' extension.
-  $entity = entity_load($bundle_types->type . '_type', array($bundle_types->id), array(), $reset);
+  // Load the tripal_bundle entity. These entities are always the same
+  // as an Tripal entity type but with a '_bundle' extension.
+  $entity = entity_load($bundle_types->type . '_bundle', array($bundle_types->id), array(), $reset);
   return reset($entity);
 }
 
 /**
- * Fetch a tripal_data object. Make sure that the wildcard you choose
- * in the tripal_data entity definition fits the function name here.
+ * Fetch a tripal_entity object. Make sure that the wildcard you choose
+ * in the tripal_entity entity definition fits the function name here.
  *
  * @param $id
- *   Integer specifying the tripal_data id.
+ *   Integer specifying the tripal_entity id.
  * @param $reset
  *   A boolean indicating that the internal cache should be reset.
  * @return
- *   A fully-loaded $tripal_data object or FALSE if it cannot be loaded.
+ *   A fully-loaded $tripal_entity object or FALSE if it cannot be loaded.
  *
- * @see tripal_data_load_multiple()
+ * @see tripal_entity_load_multiple()
  */
-function tripal_data_load($id, $reset = FALSE) {
+function tripal_entity_load($id, $reset = FALSE) {
 
   // Get the type of entity by the ID.
-  $entity_type = db_select('tripal_data', 'td')
+  $entity_type = db_select('tripal_entity', 'td')
     ->fields('td', array('type'))
     ->condition('id', $id)
     ->execute()