Browse Source

Removed property of TripalField as it's not used until field_create_field function. It's been put in the array. Also properties types are automatically added for all types in the database

Stephen Ficklin 8 years ago
parent
commit
a71c957ea6
73 changed files with 181 additions and 507 deletions
  1. 5 13
      tripal/includes/TripalFields/TripalField.inc
  2. 6 0
      tripal/includes/tripal.fields.inc
  3. 1 13
      tripal_chado/includes/TripalFields/chado_linker__contact/chado_linker__contact.inc
  4. 2 3
      tripal_chado/includes/TripalFields/chado_linker__contact/chado_linker__contact_formatter.inc
  5. 1 1
      tripal_chado/includes/TripalFields/chado_linker__contact/chado_linker__contact_widget.inc
  6. 1 14
      tripal_chado/includes/TripalFields/chado_linker__cvterm/chado_linker__cvterm.inc
  7. 2 3
      tripal_chado/includes/TripalFields/chado_linker__cvterm/chado_linker__cvterm_formatter.inc
  8. 1 1
      tripal_chado/includes/TripalFields/chado_linker__cvterm/chado_linker__cvterm_widget.inc
  9. 1 14
      tripal_chado/includes/TripalFields/chado_linker__cvterm_adder/chado_linker__cvterm_adder.inc
  10. 1 3
      tripal_chado/includes/TripalFields/chado_linker__cvterm_adder/chado_linker__cvterm_adder_formatter.inc
  11. 1 1
      tripal_chado/includes/TripalFields/chado_linker__cvterm_adder/chado_linker__cvterm_adder_widget.inc
  12. 14 41
      tripal_chado/includes/TripalFields/chado_linker__prop/chado_linker__prop.inc
  13. 16 3
      tripal_chado/includes/TripalFields/chado_linker__prop/chado_linker__prop_formatter.inc
  14. 1 1
      tripal_chado/includes/TripalFields/chado_linker__prop/chado_linker__prop_widget.inc
  15. 1 14
      tripal_chado/includes/TripalFields/chado_linker__prop_adder/chado_linker__prop_adder.inc
  16. 1 3
      tripal_chado/includes/TripalFields/chado_linker__prop_adder/chado_linker__prop_adder_formatter.inc
  17. 1 1
      tripal_chado/includes/TripalFields/chado_linker__prop_adder/chado_linker__prop_adder_widget.inc
  18. 1 14
      tripal_chado/includes/TripalFields/data__accession/data__accession.inc
  19. 1 3
      tripal_chado/includes/TripalFields/data__accession/data__accession_formatter.inc
  20. 1 1
      tripal_chado/includes/TripalFields/data__accession/data__accession_widget.inc
  21. 1 14
      tripal_chado/includes/TripalFields/data__protein_sequence/data__protein_sequence.inc
  22. 1 3
      tripal_chado/includes/TripalFields/data__protein_sequence/data__protein_sequence_formatter.inc
  23. 1 1
      tripal_chado/includes/TripalFields/data__protein_sequence/data__protein_sequence_widget.inc
  24. 1 14
      tripal_chado/includes/TripalFields/data__sequence/data__sequence.inc
  25. 1 4
      tripal_chado/includes/TripalFields/data__sequence/data__sequence_formatter.inc
  26. 1 1
      tripal_chado/includes/TripalFields/data__sequence/data__sequence_widget.inc
  27. 1 14
      tripal_chado/includes/TripalFields/data__sequence_checksum/data__sequence_checksum.inc
  28. 1 5
      tripal_chado/includes/TripalFields/data__sequence_checksum/data__sequence_checksum_formatter.inc
  29. 1 1
      tripal_chado/includes/TripalFields/data__sequence_checksum/data__sequence_checksum_widget.inc
  30. 1 14
      tripal_chado/includes/TripalFields/data__sequence_coordinates/data__sequence_coordinates.inc
  31. 1 3
      tripal_chado/includes/TripalFields/data__sequence_coordinates/data__sequence_coordinates_formatter.inc
  32. 1 1
      tripal_chado/includes/TripalFields/data__sequence_coordinates/data__sequence_coordinates_widget.inc
  33. 1 14
      tripal_chado/includes/TripalFields/data__sequence_length/data__sequence_length.inc
  34. 1 3
      tripal_chado/includes/TripalFields/data__sequence_length/data__sequence_length_formatter.inc
  35. 1 1
      tripal_chado/includes/TripalFields/data__sequence_length/data__sequence_length_widget.inc
  36. 1 14
      tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression.inc
  37. 1 3
      tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression_formatter.inc
  38. 1 1
      tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression_widget.inc
  39. 1 16
      tripal_chado/includes/TripalFields/obi__organism/obi__organism.inc
  40. 1 4
      tripal_chado/includes/TripalFields/obi__organism/obi__organism_formatter.inc
  41. 1 1
      tripal_chado/includes/TripalFields/obi__organism/obi__organism_widget.inc
  42. 1 14
      tripal_chado/includes/TripalFields/ogi__location_on_map/ogi__location_on_map.inc
  43. 1 3
      tripal_chado/includes/TripalFields/ogi__location_on_map/ogi__location_on_map_formatter.inc
  44. 1 1
      tripal_chado/includes/TripalFields/ogi__location_on_map/ogi__location_on_map_widget.inc
  45. 1 14
      tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference.inc
  46. 1 3
      tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference_formatter.inc
  47. 1 1
      tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference_widget.inc
  48. 1 14
      tripal_chado/includes/TripalFields/sbo__phenotype/sbo__phenotype.inc
  49. 1 3
      tripal_chado/includes/TripalFields/sbo__phenotype/sbo__phenotype_formatter.inc
  50. 1 1
      tripal_chado/includes/TripalFields/sbo__phenotype/sbo__phenotype_widget.inc
  51. 1 14
      tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship.inc
  52. 1 3
      tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship_formatter.inc
  53. 1 1
      tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship_widget.inc
  54. 1 14
      tripal_chado/includes/TripalFields/schema__alternate_name/schema__alternate_name.inc
  55. 1 3
      tripal_chado/includes/TripalFields/schema__alternate_name/schema__alternate_name_formatter.inc
  56. 1 1
      tripal_chado/includes/TripalFields/schema__alternate_name/schema__alternate_name_widget.inc
  57. 1 13
      tripal_chado/includes/TripalFields/schema__publication/schema__publication.inc
  58. 1 3
      tripal_chado/includes/TripalFields/schema__publication/schema__publication_formatter.inc
  59. 1 1
      tripal_chado/includes/TripalFields/schema__publication/schema__publication_widget.inc
  60. 1 14
      tripal_chado/includes/TripalFields/so__cds/so__cds.inc
  61. 1 4
      tripal_chado/includes/TripalFields/so__cds/so__cds_formatter.inc
  62. 1 1
      tripal_chado/includes/TripalFields/so__cds/so__cds_widget.inc
  63. 1 14
      tripal_chado/includes/TripalFields/so__genotype/so__genotype.inc
  64. 1 3
      tripal_chado/includes/TripalFields/so__genotype/so__genotype_formatter.inc
  65. 1 1
      tripal_chado/includes/TripalFields/so__genotype/so__genotype_widget.inc
  66. 1 14
      tripal_chado/includes/TripalFields/so__transcript/so__transcript.inc
  67. 1 3
      tripal_chado/includes/TripalFields/so__transcript/so__transcript_formatter.inc
  68. 1 1
      tripal_chado/includes/TripalFields/so__transcript/so__transcript_widget.inc
  69. 1 14
      tripal_chado/includes/TripalFields/taxrank__infraspecific_taxon/taxrank__infraspecific_taxon.inc
  70. 1 3
      tripal_chado/includes/TripalFields/taxrank__infraspecific_taxon/taxrank__infraspecific_taxon_formatter.inc
  71. 1 1
      tripal_chado/includes/TripalFields/taxrank__infraspecific_taxon/taxrank__infraspecific_taxon_widget.inc
  72. 66 47
      tripal_chado/includes/tripal_chado.fields.inc
  73. 5 1
      tripal_chado/tripal_chado.module

+ 5 - 13
tripal/includes/TripalFields/TripalField.inc

@@ -24,6 +24,7 @@ class TripalField {
   // Once instances exist for a field type then these settings cannot be
   // changed.
   public static $default_settings = array(
+    'storage' => 'tripal_no_storage',
   );
 
   // Provide a list of instance specific settings. These can be access within
@@ -46,10 +47,6 @@ class TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'tripal_no_storage';
-
   // The default widget for this field.
   public static $default_widget = '';
 
@@ -89,11 +86,11 @@ class TripalField {
     // Make sure the term exist.
     if (!$instance) {
       tripal_set_message(t('Missing instance of field "%field"', array('%field' => $field['field_name'])), TRIPAL_ERROR);
-    } 
+    }
     else {
       if (!array_key_exists('term_vocabulary', $instance['settings'])) {
         tripal_set_message(t('Missing controlled vocbulary for field "%field"', array('%field' => $field['field_name'])), TRIPAL_ERROR);
-      } 
+      }
       else {
         $vocabulary = $instance['settings']['term_vocabulary'];
         $accession = $instance['settings']['term_accession'];
@@ -126,15 +123,10 @@ class TripalField {
     return array(
       'label' => $class::$default_label,
       'description' => $class::$default_description,
-      'default_widget' => $class::$default_widget,
-      'default_formatter' => $class::$default_formatter,
       'settings' => $class::$default_settings,
       'instance_settings' => $class::$default_instance_settings,
-      'storage' => array(
-        'type' => $class::$storage,
-        'module' => 'tripal',
-        'active' => TRUE
-      ),
+      'default_widget' => $class::$default_widget,
+      'default_formatter' => $class::$default_formatter,
     );
   }
 

+ 6 - 0
tripal/includes/tripal.fields.inc

@@ -1,5 +1,11 @@
 <?php
 
+/**
+ * Implements hook_field_create_instance().
+ */
+function tripal_field_create_instance($instance) {
+  // When a field is added to an entity and instance are created on
+}
 /**
  * Implements hook_field_info().
  *

+ 1 - 13
tripal_chado/includes/TripalFields/chado_linker__contact/chado_linker__contact.inc

@@ -1,6 +1,6 @@
 <?php
 
-class chado_linker__contact extends TripalField {
+class chado_linker__contact extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -18,15 +18,6 @@ class chado_linker__contact extends TripalField {
   public static $description = 'Associates an indviddual or organization with
           this record';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -47,9 +38,6 @@ class chado_linker__contact extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
 
   // The default widget for this field.
   public static $default_widget = 'chado_linker__contact_widget';

+ 2 - 3
tripal_chado/includes/TripalFields/chado_linker__contact/chado_linker__contact_formatter.inc

@@ -1,14 +1,13 @@
 <?php
 
-class chado_linker__contact_formatter extends TripalFieldFormatter {
+class chado_linker__contact_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Contacts';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('chado_linker__contact');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
+
   /**
    *
    * @see TripalFieldFormatter::settingsForm()

+ 1 - 1
tripal_chado/includes/TripalFields/chado_linker__contact/chado_linker__contact_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class chado_linker__contact_widget extends TripalFieldWidget {
+class chado_linker__contact_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Contacts';
 

+ 1 - 14
tripal_chado/includes/TripalFields/chado_linker__cvterm/chado_linker__cvterm.inc

@@ -1,6 +1,6 @@
 <?php
 
-class chado_linker__cvterm extends TripalField {
+class chado_linker__cvterm extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -18,15 +18,6 @@ class chado_linker__cvterm extends TripalField {
   public static $description = 'This record can be annotated with terms from other
               vocabularies.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -47,10 +38,6 @@ class chado_linker__cvterm extends TripalField {
     'term_fixed' => FALSE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'chado_linker__cvterm_widget';
 

+ 2 - 3
tripal_chado/includes/TripalFields/chado_linker__cvterm/chado_linker__cvterm_formatter.inc

@@ -1,14 +1,13 @@
 <?php
 
-class chado_linker__cvterm_formatter extends TripalFieldFormatter {
+class chado_linker__cvterm_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Annotations';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('chado_linker__cvterm');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
+
   /**
    *
    * @see TripalFieldFormatter::settingsForm()

+ 1 - 1
tripal_chado/includes/TripalFields/chado_linker__cvterm/chado_linker__cvterm_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class chado_linker__cvterm_widget extends TripalFieldWidget {
+class chado_linker__cvterm_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Annotations';
 

+ 1 - 14
tripal_chado/includes/TripalFields/chado_linker__cvterm_adder/chado_linker__cvterm_adder.inc

@@ -1,6 +1,6 @@
 <?php
 
-class chado_linker__cvterm_adder extends TripalField {
+class chado_linker__cvterm_adder extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -19,15 +19,6 @@ class chado_linker__cvterm_adder extends TripalField {
   public static $description = 'This record may have any number of types of
         annotations. Use this field to first add the type.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -48,10 +39,6 @@ class chado_linker__cvterm_adder extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'tripal_no_storage';
-
   // The default widget for this field.
   public static $default_widget = 'chado_linker__cvterm_adder_widget';
 

+ 1 - 3
tripal_chado/includes/TripalFields/chado_linker__cvterm_adder/chado_linker__cvterm_adder_formatter.inc

@@ -1,14 +1,12 @@
 <?php
 
-class chado_linker__cvterm_adder_formatter extends TripalFieldFormatter {
+class chado_linker__cvterm_adder_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Add an Annotation Type';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('chado_linker__cvterm_adder');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
   /**
    *
    * @see TripalFieldFormatter::settingsForm()

+ 1 - 1
tripal_chado/includes/TripalFields/chado_linker__cvterm_adder/chado_linker__cvterm_adder_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class chado_linker__cvterm_adder_widget extends TripalFieldWidget {
+class chado_linker__cvterm_adder_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Add an Annotation Type';
 

+ 14 - 41
tripal_chado/includes/TripalFields/chado_linker__prop/chado_linker__prop.inc

@@ -1,6 +1,6 @@
 <?php
 
-class chado_linker__prop extends TripalField {
+class chado_linker__prop extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -17,15 +17,6 @@ class chado_linker__prop extends TripalField {
   // The default description for this field.
   public static $description = 'Add details about this property.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -46,37 +37,12 @@ class chado_linker__prop extends TripalField {
     'term_fixed' => FALSE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'chado_linker__prop_widget';
 
   // The default formatter for this field.
   public static $default_formatter = 'chado_linker__prop_formatter';
 
-  // --------------------------------------------------------------------------
-  //              PROTECTED CLASS MEMBERS -- DO NOT OVERRIDE
-  // --------------------------------------------------------------------------
-  // An array containing details about the field. The format of this array
-  // is the same as that returned by field_info_fields()
-  protected $field;
-  // An array containing details about an instance of the field. A field does
-  // not have to have an instance.  But if dealing with an instance (such as
-  // when using the widgetForm, formatterSettingsForm, etc.) it should be set.
-  protected $instance;
-
-
-  /**
-   *
-   * @see TripalField::validate()
-   */
-  public function validate($entity_type, $entity, $field, $items, &$errors) {
-
-  }
-
-
   /**
    *
    * @see TripalField::load()
@@ -88,10 +54,18 @@ class chado_linker__prop extends TripalField {
     $field_column = $this->field['settings']['chado_column'];
     $base_table = $this->field['settings']['base_table'];
 
-    $matches = array();
-    preg_match('/(.*?)__(\d+)/', $field_name, $matches);
-    $table_name = $matches[1];
-    $cvterm_id = $matches[2];
+    $vocabulary = $this->instance['settings']['term_vocabulary'];
+    $accession = $this->instance['settings']['term_accession'];
+    $cvterm = tripal_get_cvterm(array(
+      'dbxref_id' => array(
+        'db_id' => array(
+          'name' => $vocabulary,
+        ),
+        'accession' => $accession,
+      ),
+    ));
+    $cvterm_id = $cvterm->cvterm_id;
+
     // Get the FK that links to the base record.
     $schema = chado_get_schema($field_table);
     $pkey = $schema['primary key'][0];
@@ -109,8 +83,7 @@ class chado_linker__prop extends TripalField {
       'chado-' . $field_table . '__rank' => '',
     );
 
-    // Get the properties associated with this base record for this fields
-    // given type.
+    // Get the properties associated with this record for the given type.
     $columns = array('*');
     $match = array(
       $fkey_lcolumn => $chado_record->{$fkey_lcolumn},

+ 16 - 3
tripal_chado/includes/TripalFields/chado_linker__prop/chado_linker__prop_formatter.inc

@@ -1,14 +1,13 @@
 <?php
 
-class chado_linker__prop_formatter extends TripalFieldFormatter {
+class chado_linker__prop_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Property';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('chado_linker__prop');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
+
   /**
    *
    * @see TripalFieldFormatter::settingsForm()
@@ -22,6 +21,20 @@ class chado_linker__prop_formatter extends TripalFieldFormatter {
    * @see TripalFieldFormatter::view()
    */
   public function view(&$element, $entity_type, $entity, $langcode, $items, $display) {
+    $field_name = $this->field['field_name'];
+    $chado_table = $this->field['settings']['chado_table'];
+
+    $properties = array();
+    foreach ($items as $delta => $item) {
+      $properties[] = $item['chado-' . $chado_table . '__value'];
+    }
+    $content = implode(', ', $properties);
 
+    if (count($items) > 0) {
+      $element[0] = array(
+        '#type' => 'markup',
+        '#markup' => $content,
+      );
+    }
   }
 }

+ 1 - 1
tripal_chado/includes/TripalFields/chado_linker__prop/chado_linker__prop_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class chado_linker__prop_widget extends TripalFieldWidget {
+class chado_linker__prop_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Property';
 

+ 1 - 14
tripal_chado/includes/TripalFields/chado_linker__prop_adder/chado_linker__prop_adder.inc

@@ -1,6 +1,6 @@
 <?php
 
-class chado_linker__prop_adder extends TripalField {
+class chado_linker__prop_adder extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -18,15 +18,6 @@ class chado_linker__prop_adder extends TripalField {
   public static $description = 'This record may have any number of properties. Use
             this field to first add the type.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -47,10 +38,6 @@ class chado_linker__prop_adder extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'tripal_no_storage';
-
   // The default widget for this field.
   public static $default_widget = 'chado_linker__prop_adder_widget';
 

+ 1 - 3
tripal_chado/includes/TripalFields/chado_linker__prop_adder/chado_linker__prop_adder_formatter.inc

@@ -1,14 +1,12 @@
 <?php
 
-class chado_linker__prop_adder_formatter extends TripalFieldFormatter {
+class chado_linker__prop_adder_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Add a Property Type';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('chado_linker__prop_adder');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
   /**
    *
    * @see TripalFieldFormatter::settingsForm()

+ 1 - 1
tripal_chado/includes/TripalFields/chado_linker__prop_adder/chado_linker__prop_adder_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class chado_linker__prop_adder_widget extends TripalFieldWidget {
+class chado_linker__prop_adder_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Add a Property Type';
 

+ 1 - 14
tripal_chado/includes/TripalFields/data__accession/data__accession.inc

@@ -1,6 +1,6 @@
 <?php
 
-class data__accession extends TripalField {
+class data__accession extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -18,15 +18,6 @@ class data__accession extends TripalField {
   public static $description = 'The unique stable accession (ID) for
         this record on this site.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -47,10 +38,6 @@ class data__accession extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'data__accession_widget';
 

+ 1 - 3
tripal_chado/includes/TripalFields/data__accession/data__accession_formatter.inc

@@ -1,14 +1,12 @@
 <?php
 
-class data__accession_formatter extends TripalFieldFormatter {
+class data__accession_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Accession';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('data__accession');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
 
   /**
    * @see TripalFieldFormatter::view()

+ 1 - 1
tripal_chado/includes/TripalFields/data__accession/data__accession_widget.inc

@@ -1,5 +1,5 @@
 <?php
-class data__accession_widget extends TripalFieldWidget {
+class data__accession_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Accession';
 

+ 1 - 14
tripal_chado/includes/TripalFields/data__protein_sequence/data__protein_sequence.inc

@@ -1,6 +1,6 @@
 <?php
 
-class data__protein_sequence extends TripalField {
+class data__protein_sequence extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -17,15 +17,6 @@ class data__protein_sequence extends TripalField {
   // The default description for this field.
   public static $description = 'polypeptide sequences.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -46,10 +37,6 @@ class data__protein_sequence extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'data__protein_sequence_widget';
 

+ 1 - 3
tripal_chado/includes/TripalFields/data__protein_sequence/data__protein_sequence_formatter.inc

@@ -1,14 +1,12 @@
 <?php
 
-class data__protein_sequence_formatter extends TripalFieldFormatter {
+class data__protein_sequence_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Protein Sequence';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('data__protein_sequence');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
 
   /**
    *

+ 1 - 1
tripal_chado/includes/TripalFields/data__protein_sequence/data__protein_sequence_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class data__protein_sequence_widget extends TripalFieldWidget {
+class data__protein_sequence_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Protein Sequence';
 

+ 1 - 14
tripal_chado/includes/TripalFields/data__sequence/data__sequence.inc

@@ -1,6 +1,6 @@
 <?php
 
-class data__sequence extends TripalField {
+class data__sequence extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -17,15 +17,6 @@ class data__sequence extends TripalField {
   // The default description for this field.
   public static $description = 'A field for managing nucleotide and protein residues.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -46,10 +37,6 @@ class data__sequence extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'data__sequence_widget';
 

+ 1 - 4
tripal_chado/includes/TripalFields/data__sequence/data__sequence_formatter.inc

@@ -1,15 +1,12 @@
 <?php
 
-class data__sequence_formatter extends TripalFieldFormatter {
+class data__sequence_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Sequence';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('data__sequence');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
-
   /**
    *
    * @param unknown $element

+ 1 - 1
tripal_chado/includes/TripalFields/data__sequence/data__sequence_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class data__sequence_widget extends TripalFieldWidget {
+class data__sequence_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Sequence';
 

+ 1 - 14
tripal_chado/includes/TripalFields/data__sequence_checksum/data__sequence_checksum.inc

@@ -1,6 +1,6 @@
 <?php
 
-class data__sequence_checksum extends TripalField {
+class data__sequence_checksum extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -17,15 +17,6 @@ class data__sequence_checksum extends TripalField {
   // The default description for this field.
   public static $description = 'A field for generating MD5 checksum for a sequence.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -46,10 +37,6 @@ class data__sequence_checksum extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'data__sequence_checksum_widget';
 

+ 1 - 5
tripal_chado/includes/TripalFields/data__sequence_checksum/data__sequence_checksum_formatter.inc

@@ -1,16 +1,12 @@
 <?php
 
-class data__sequence_checksum_formatter extends TripalFieldFormatter {
+class data__sequence_checksum_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Sequence checksum';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('data__sequence_checksum');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
-
-
  /**
   * @see TripalFieldFormatter::view()
   */

+ 1 - 1
tripal_chado/includes/TripalFields/data__sequence_checksum/data__sequence_checksum_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class data__sequence_checksum_widget extends TripalFieldWidget {
+class data__sequence_checksum_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Sequence checksum';
 

+ 1 - 14
tripal_chado/includes/TripalFields/data__sequence_coordinates/data__sequence_coordinates.inc

@@ -1,6 +1,6 @@
 <?php
 
-class data__sequence_coordinates extends TripalField {
+class data__sequence_coordinates extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -17,15 +17,6 @@ class data__sequence_coordinates extends TripalField {
   // The default description for this field.
   public static $description = 'Locations on reference sequences where the feature is located.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -46,10 +37,6 @@ class data__sequence_coordinates extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'data__sequence_coordinates_widget';
 

+ 1 - 3
tripal_chado/includes/TripalFields/data__sequence_coordinates/data__sequence_coordinates_formatter.inc

@@ -1,14 +1,12 @@
 <?php
 
-class data__sequence_coordinates_formatter extends TripalFieldFormatter {
+class data__sequence_coordinates_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Sequence Coordinates';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('data__sequence_coordinates');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
   /**
    *
    * @see TripalFieldFormatter::settingsForm()

+ 1 - 1
tripal_chado/includes/TripalFields/data__sequence_coordinates/data__sequence_coordinates_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class data__sequence_coordinates_widget extends TripalFieldWidget {
+class data__sequence_coordinates_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Sequence Coordinates';
 

+ 1 - 14
tripal_chado/includes/TripalFields/data__sequence_length/data__sequence_length.inc

@@ -1,6 +1,6 @@
 <?php
 
-class data__sequence_length extends TripalField {
+class data__sequence_length extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -18,15 +18,6 @@ class data__sequence_length extends TripalField {
   // The default description for this field.
   public static $description = 'A field for calculating the length of a sequence.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -47,10 +38,6 @@ class data__sequence_length extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'data__sequence_length_widget';
 

+ 1 - 3
tripal_chado/includes/TripalFields/data__sequence_length/data__sequence_length_formatter.inc

@@ -1,14 +1,12 @@
 <?php
 
-class data__sequence_length_formatter extends TripalFieldFormatter {
+class data__sequence_length_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Sequence length';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('data__sequence_length');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
   /**
    *
    * @see TripalFieldFormatter::settingsForm()

+ 1 - 1
tripal_chado/includes/TripalFields/data__sequence_length/data__sequence_length_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class data__sequence_length_widget extends TripalFieldWidget {
+class data__sequence_length_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Sequence length';
 

+ 1 - 14
tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression.inc

@@ -1,6 +1,6 @@
 <?php
 
-class go__gene_expression extends TripalField {
+class go__gene_expression extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -22,15 +22,6 @@ class go__gene_expression extends TripalField {
       Protein maturation is included when required to form an active form of a product from
       an inactive precursor form.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -51,10 +42,6 @@ class go__gene_expression extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'go__gene_expression_widget';
 

+ 1 - 3
tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression_formatter.inc

@@ -1,14 +1,12 @@
 <?php
 
-class go__gene_expression_formatter extends TripalFieldFormatter {
+class go__gene_expression_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Gene expression';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('go__gene_expression');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
   /**
    *
    * @see TripalFieldFormatter::settingsForm()

+ 1 - 1
tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class go__gene_expression_widget extends TripalFieldWidget {
+class go__gene_expression_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Gene expression';
 

+ 1 - 16
tripal_chado/includes/TripalFields/obi__organism/obi__organism.inc

@@ -1,6 +1,6 @@
 <?php
 
-class obi__organism extends TripalField {
+class obi__organism extends ChadoField {
 
   // The default lable for this field.
   public static $default_label = 'Organism';
@@ -8,17 +8,6 @@ class obi__organism extends TripalField {
   // The default description for this field.
   public static $description = 'The organism to which this resource is sssociated.';
 
-  // Add any default settings elements.  If you override the globalSettingsForm()
-  // or the instanceSettingsForm() functions then you need to be sure that
-  // any settings you want those functions to manage are listed in this
-  // array.
-  public static $default_settings = array(
-    'field_display_string' => '<i>[organism.genus] [organism.species]</i>',
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -39,10 +28,6 @@ class obi__organism extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'OBI__organism_widget';
 

+ 1 - 4
tripal_chado/includes/TripalFields/obi__organism/obi__organism_formatter.inc

@@ -1,6 +1,6 @@
 <?php
 
-class obi__organism_formatter extends TripalFieldFormatter {
+class obi__organism_formatter extends ChadoFieldFormatter {
 
   // The default lable for this field.
   public static $default_label = 'Organism';
@@ -8,9 +8,6 @@ class obi__organism_formatter extends TripalFieldFormatter {
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('obi__organism');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
-
   /**
    * @see TripalFieldFormatter::view()
    */

+ 1 - 1
tripal_chado/includes/TripalFields/obi__organism/obi__organism_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class obi__organism_widget extends TripalFieldWidget {
+class obi__organism_widget extends ChadoFieldWidget {
 
   // The default lable for this field.
   public static $default_label = 'Organism';

+ 1 - 14
tripal_chado/includes/TripalFields/ogi__location_on_map/ogi__location_on_map.inc

@@ -1,6 +1,6 @@
 <?php
 
-class ogi__location_on_map extends TripalField {
+class ogi__location_on_map extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -17,15 +17,6 @@ class ogi__location_on_map extends TripalField {
   // The default description for this field.
   public static $description = 'Map position of a sequence.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -46,10 +37,6 @@ class ogi__location_on_map extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'ogi__location_on_map_widget';
 

+ 1 - 3
tripal_chado/includes/TripalFields/ogi__location_on_map/ogi__location_on_map_formatter.inc

@@ -1,14 +1,12 @@
 <?php
 
-class ogi__location_on_map_formatter extends TripalFieldFormatter {
+class ogi__location_on_map_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Location on Map';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('ogi__location_on_map');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
   /**
    *
    * @see TripalFieldFormatter::settingsForm()

+ 1 - 1
tripal_chado/includes/TripalFields/ogi__location_on_map/ogi__location_on_map_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class ogi__location_on_map_widget extends TripalFieldWidget {
+class ogi__location_on_map_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Location on Map';
 

+ 1 - 14
tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference.inc

@@ -1,6 +1,6 @@
 <?php
 
-class sbo__database_cross_reference extends TripalField {
+class sbo__database_cross_reference extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -19,15 +19,6 @@ class sbo__database_cross_reference extends TripalField {
           another online database. This field is intended for one or more
           references.  At a minimum, the database and accession must be provided.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -48,10 +39,6 @@ class sbo__database_cross_reference extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'sbo__database_cross_reference_widget';
 

+ 1 - 3
tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference_formatter.inc

@@ -1,14 +1,12 @@
 <?php
 
-class sbo__database_cross_reference_formatter extends TripalFieldFormatter {
+class sbo__database_cross_reference_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Database cross reference';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('sbo__database_cross_reference');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
   /**
    *
    * @see TripalFieldFormatter::settingsForm()

+ 1 - 1
tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class sbo__database_cross_reference_widget extends TripalFieldWidget {
+class sbo__database_cross_reference_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Database cross reference';
 

+ 1 - 14
tripal_chado/includes/TripalFields/sbo__phenotype/sbo__phenotype.inc

@@ -1,6 +1,6 @@
 <?php
 
-class sbo__phenotype extends TripalField {
+class sbo__phenotype extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -19,15 +19,6 @@ class sbo__phenotype extends TripalField {
       biological processes. Such processes can take place at different levels and are
       independent of the biochemical network itself.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -48,10 +39,6 @@ class sbo__phenotype extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'sbo__phenotype_widget';
 

+ 1 - 3
tripal_chado/includes/TripalFields/sbo__phenotype/sbo__phenotype_formatter.inc

@@ -1,14 +1,12 @@
 <?php
 
-class sbo__phenotype_formatter extends TripalFieldFormatter {
+class sbo__phenotype_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Phenotype';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('sbo__phenotype');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
   /**
    *
    * @see TripalFieldFormatter::settingsForm()

+ 1 - 1
tripal_chado/includes/TripalFields/sbo__phenotype/sbo__phenotype_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class sbo__phenotype_widget extends TripalFieldWidget {
+class sbo__phenotype_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Phenotype';
 

+ 1 - 14
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship.inc

@@ -1,6 +1,6 @@
 <?php
 
-class sbo__relationship extends TripalField {
+class sbo__relationship extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -17,15 +17,6 @@ class sbo__relationship extends TripalField {
   // The default description for this field.
   public static $description = 'Relationships between records.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -46,10 +37,6 @@ class sbo__relationship extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'sbo__relationship_widget';
 

+ 1 - 3
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship_formatter.inc

@@ -1,14 +1,12 @@
 <?php
 
-class sbo__relationship_formatter extends TripalFieldFormatter {
+class sbo__relationship_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Relationship';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('sbo__relationship');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
   /**
    *
    * @see TripalFieldFormatter::settingsForm()

+ 1 - 1
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class sbo__relationship_widget extends TripalFieldWidget {
+class sbo__relationship_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Relationship';
 

+ 1 - 14
tripal_chado/includes/TripalFields/schema__alternate_name/schema__alternate_name.inc

@@ -1,6 +1,6 @@
 <?php
 
-class schema__alternate_name extends TripalField {
+class schema__alternate_name extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -17,15 +17,6 @@ class schema__alternate_name extends TripalField {
   // The default description for this field.
   public static $description = 'Adds an alternative name (synonym or alias) to this record.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -46,10 +37,6 @@ class schema__alternate_name extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'schema__alternate_name_widget';
 

+ 1 - 3
tripal_chado/includes/TripalFields/schema__alternate_name/schema__alternate_name_formatter.inc

@@ -1,14 +1,12 @@
 <?php
 
-class schema__alternate_name_formatter extends TripalFieldFormatter {
+class schema__alternate_name_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Synonyms';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('schema__alternate_name');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
   /**
    *
    * @see TripalFieldFormatter::settingsForm()

+ 1 - 1
tripal_chado/includes/TripalFields/schema__alternate_name/schema__alternate_name_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class schema__alternate_name_widget extends TripalFieldWidget {
+class schema__alternate_name_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Synonyms';
 

+ 1 - 13
tripal_chado/includes/TripalFields/schema__publication/schema__publication.inc

@@ -1,6 +1,6 @@
 <?php
 
-class schema__publication extends TripalField {
+class schema__publication extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -18,15 +18,6 @@ class schema__publication extends TripalField {
   public static $description = 'Associates a publication (e.g. journal article,
             conference proceedings, book chapter, etc.) with this record.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -47,9 +38,6 @@ class schema__publication extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
 
   // The default widget for this field.
   public static $default_widget = 'schema__publication_widget';

+ 1 - 3
tripal_chado/includes/TripalFields/schema__publication/schema__publication_formatter.inc

@@ -1,14 +1,12 @@
 <?php
 
-class schema__publication_formatter extends TripalFieldFormatter {
+class schema__publication_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Publication';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('schema__publication');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
   /**
    *
    * @see TripalFieldFormatter::settingsForm()

+ 1 - 1
tripal_chado/includes/TripalFields/schema__publication/schema__publication_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class schema__publication_widget extends TripalFieldWidget {
+class schema__publication_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Publication';
 

+ 1 - 14
tripal_chado/includes/TripalFields/so__cds/so__cds.inc

@@ -1,6 +1,6 @@
 <?php
 
-class so__cds extends TripalField {
+class so__cds extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -17,15 +17,6 @@ class so__cds extends TripalField {
   // The default description for this field.
   public static $description = 'A contiguous sequence which begins with, and includes, a start codon and ends with, and includes, a stop codon.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -46,10 +37,6 @@ class so__cds extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'so__cds_widget';
 

+ 1 - 4
tripal_chado/includes/TripalFields/so__cds/so__cds_formatter.inc

@@ -1,15 +1,12 @@
 <?php
 
-class so__cds_formatter extends TripalFieldFormatter {
+class so__cds_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Coding Sequence';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('so__cds');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
-
   /**
    * @see TripalFieldFormatter::view()
    */

+ 1 - 1
tripal_chado/includes/TripalFields/so__cds/so__cds_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class so__cds_widget extends TripalFieldWidget {
+class so__cds_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Coding Sequence';
 

+ 1 - 14
tripal_chado/includes/TripalFields/so__genotype/so__genotype.inc

@@ -1,6 +1,6 @@
 <?php
 
-class so__genotype extends TripalField {
+class so__genotype extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -18,15 +18,6 @@ class so__genotype extends TripalField {
   public static $description = 'Associates an indviddual or organization with
           this record.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -47,10 +38,6 @@ class so__genotype extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'so__genotype_widget';
 

+ 1 - 3
tripal_chado/includes/TripalFields/so__genotype/so__genotype_formatter.inc

@@ -1,14 +1,12 @@
 <?php
 
-class so__genotype_formatter extends TripalFieldFormatter {
+class so__genotype_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Genotype';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('so__genotype');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
   /**
    *
    * @see TripalFieldFormatter::settingsForm()

+ 1 - 1
tripal_chado/includes/TripalFields/so__genotype/so__genotype_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class so__genotype_widget extends TripalFieldWidget {
+class so__genotype_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Genotype';
 

+ 1 - 14
tripal_chado/includes/TripalFields/so__transcript/so__transcript.inc

@@ -1,6 +1,6 @@
 <?php
 
-class so__transcript extends TripalField {
+class so__transcript extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -17,15 +17,6 @@ class so__transcript extends TripalField {
   // The default description for this field.
   public static $description = 'An RNA synthesized on a DNA or RNA template by an RNA polymerase.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -46,10 +37,6 @@ class so__transcript extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'so__transcript_widget';
 

+ 1 - 3
tripal_chado/includes/TripalFields/so__transcript/so__transcript_formatter.inc

@@ -1,14 +1,12 @@
 <?php
 
-class so__transcript_formatter extends TripalFieldFormatter {
+class so__transcript_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Transcript';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('so__transcript');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
   /**
    *
    * @see TripalFieldFormatter::settingsForm()

+ 1 - 1
tripal_chado/includes/TripalFields/so__transcript/so__transcript_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class so__transcript_widget extends TripalFieldWidget {
+class so__transcript_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Transcript';
 

+ 1 - 14
tripal_chado/includes/TripalFields/taxrank__infraspecific_taxon/taxrank__infraspecific_taxon.inc

@@ -1,6 +1,6 @@
 <?php
 
-class taxrank__infraspecific_taxon extends TripalField {
+class taxrank__infraspecific_taxon extends ChadoField {
 
 
   // --------------------------------------------------------------------------
@@ -17,15 +17,6 @@ class taxrank__infraspecific_taxon extends TripalField {
   // The default description for this field.
   public static $description = 'Specifies the infraspecific taxon of an organism.';
 
-  // Provide a list of global settings. These can be accessed witihn the
-  // globalSettingsForm.  When the globalSettingsForm is submitted then
-  // Drupal will automatically change these settings for all fields.
-  public static $default_settings = array(
-    'chado_table' => '',
-    'chado_column' => '',
-    'base_table' => '',
-  );
-
   // Provide a list of instance specific settings. These can be access within
   // the instanceSettingsForm.  When the instanceSettingsForm is submitted
   // then Drupal with automatically change these settings for the instnace.
@@ -46,10 +37,6 @@ class taxrank__infraspecific_taxon extends TripalField {
     'term_fixed' => TRUE,
   );
 
-  // Set this to the name of the storage backend that by default will support
-  // this field.
-  public static $storage = 'field_chado_storage';
-
   // The default widget for this field.
   public static $default_widget = 'HERE_widget';
 

+ 1 - 3
tripal_chado/includes/TripalFields/taxrank__infraspecific_taxon/taxrank__infraspecific_taxon_formatter.inc

@@ -1,14 +1,12 @@
 <?php
 
-class taxrank__infraspecific_taxon_formatter extends TripalFieldFormatter {
+class taxrank__infraspecific_taxon_formatter extends ChadoFieldFormatter {
   // The default lable for this field.
   public static $default_label = 'Infraspecific Taxon';
 
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('taxrank__infraspecific_taxon');
 
-  // The list of default settings for this formatter.
-  public static $default_settings = array();
   /**
    *
    * @see TripalFieldFormatter::settingsForm()

+ 1 - 1
tripal_chado/includes/TripalFields/taxrank__infraspecific_taxon/taxrank__infraspecific_taxon_widget.inc

@@ -1,6 +1,6 @@
 <?php
 
-class taxrank__infraspecific_taxon_widget extends TripalFieldWidget {
+class taxrank__infraspecific_taxon_widget extends ChadoFieldWidget {
   // The default lable for this field.
   public static $default_label = 'Infraspecific Taxon';
 

+ 66 - 47
tripal_chado/includes/tripal_chado.fields.inc

@@ -96,7 +96,7 @@ function tripal_chado_bundle_create_fields_base(&$info, $details, $entity_type,
   }
 
   $pkey = $schema['primary key'][0];
- 
+
 
   // Get the list of columns for this table and create a new field for each one.
   $columns = $schema['fields'];
@@ -107,8 +107,8 @@ function tripal_chado_bundle_create_fields_base(&$info, $details, $entity_type,
     }
     $cvterm = tripal_get_chado_semweb_term($table_name, $column_name, array('return_object' => TRUE));
     if (!$cvterm) {
-      tripal_report_error('tripal', TRIPAL_ERROR, 
-        'Cannot create term for "%table_name.%column_name". Missing an appropriate vocabulary term', 
+      tripal_report_error('tripal', TRIPAL_ERROR,
+        'Cannot create term for "%table_name.%column_name". Missing an appropriate vocabulary term',
          array('%table_name' => $table_name, '%column_name' => $column_name));
       drupal_set_message(t('Cannot create term for "%table_name.%column_name". Missing an appropriate vocabulary term',
         array('%table_name' => $table_name, '%column_name' => $column_name)), 'error');
@@ -126,7 +126,6 @@ function tripal_chado_bundle_create_fields_base(&$info, $details, $entity_type,
       continue;
     }
 
-
     // Set some defaults for the field.
     $base_info = array(
       'field_name' => $field_name,
@@ -560,20 +559,28 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
   // PROPERTIES
   $prop_table = $table_name . 'prop';
   if (chado_table_exists($prop_table)) {
-    $field_name = $table_name . 'prop';
-    $field_type = 'chado_linker__prop_adder';
-    $info[$field_name] = array(
-      'field_name' => $field_name,
-      'type' => $field_type,
-      'cardinality' => 1,
-      'locked' => FALSE,
-      'storage' => array(
-        'type' => 'field_chado_storage',
-      ),
-      'settings' => array(
-        'base_table' => $table_name
-      ),
-    );
+    // Get the list of existing property types for this table.
+    $sql = 'SELECT DISTINCT type_id FROM {' . $prop_table . '}';
+    $props = chado_query($sql);
+    while ($prop = $props->fetchObject()) {
+      $term = chado_generate_var('cvterm', array('cvterm_id' => $prop->type_id));
+      $field_name = strtolower($term->dbxref_id->db_id->name . '__' . $term->name);
+      $field_type = 'chado_linker__prop';
+      $info[$field_name] = array(
+        'field_name' => $field_name,
+        'type' => $field_type,
+        'cardinality' => 1,
+        'locked' => FALSE,
+        'storage' => array(
+          'type' => 'field_chado_storage',
+        ),
+        'settings' => array(
+          'base_table' => $table_name,
+          'chado_table' => $prop_table,
+          'chado_column' => $pkey,
+        ),
+      );
+    }
   }
 
   // PUBLICATIONS
@@ -1370,35 +1377,47 @@ function tripal_chado_bundle_create_instances_linker(&$info, $entity_type, $bund
     );
   }
 
-  // PROPERTIES
-  $prop_table = $table_name . 'prop';
-  if (chado_table_exists($prop_table)) {
-    $field_name = $table_name . 'prop';
-    $info[$field_name] = array(
-      'field_name' => $field_name,
-      'entity_type' => $entity_type,
-      'bundle' => $bundle->name,
-      'label' => 'Add Properties',
-      'description' => 'Add additional property types to this record.',
-      'required' => FALSE,
-      'settings' => array(
-        'auto_attach' => FALSE,
-      ),
-      'widget' => array(
-        'type' => 'chado_linker__prop_adder_widget',
-        'settings' => array(
-          'display_label' => 1,
-        ),
-      ),
-      'display' => array(
-        'default' => array(
-          'label' => 'above',
-          'type' => 'chado_linker__prop_adder_formatter',
-          'settings' => array(),
-        ),
-      ),
-    );
-  }
+  // TODO: we need to add a property for each type that already exists
+  // in the prop table.
+   // PROPERTIES
+   $prop_table = $table_name . 'prop';
+   if (chado_table_exists($prop_table)) {
+     // Get the list of existing property types for this table.
+     $sql = 'SELECT DISTINCT type_id FROM {' . $prop_table . '}';
+     $props = chado_query($sql);
+     while ($prop = $props->fetchObject()) {
+       $term = chado_generate_var('cvterm', array('cvterm_id' => $prop->type_id));
+       $field_name = strtolower($term->dbxref_id->db_id->name . '__' . $term->name);
+       $info[$field_name] = array(
+         'field_name' => $field_name,
+         'entity_type' => $entity_type,
+         'bundle' => $bundle->name,
+         'label' => ucwords(preg_replace('/_/', ' ', $term->name)),
+         'description' => $term->definition,
+         'required' => FALSE,
+         'settings' => array(
+           'auto_attach' => TRUE,
+           'term_vocabulary' => $term->dbxref_id->db_id->name,
+           'term_accession' => $term->dbxref_id->accession,
+           'term_name' => $term->name,
+         ),
+         'widget' => array(
+           'type' => 'chado_linker__prop_widget',
+           'settings' => array(
+             'display_label' => 1,
+           ),
+         ),
+         'display' => array(
+           'default' => array(
+             'label' => 'inline',
+             'type' => 'chado_linker__prop_formatter',
+             'settings' => array(),
+           ),
+         ),
+       );
+     }
+   }
+
 
   // PUBLICATIONS
   $pub_table = $table_name . '_pub';

+ 5 - 1
tripal_chado/tripal_chado.module

@@ -40,6 +40,10 @@ require_once "includes/tripal_chado.field_storage.inc";
 require_once "includes/tripal_chado.fields.inc";
 require_once "includes/tripal_chado.mapping.inc";
 
+require_once "includes/TripalFields/ChadoField.inc";
+require_once "includes/TripalFields/ChadoFieldWidget.inc";
+require_once "includes/TripalFields/ChadoFieldFormatter.inc";
+
 tripal_chado_set_globals();
 
 /**
@@ -796,4 +800,4 @@ function tripal_chado_form_field_ui_field_edit_form_alter(&$form, &$form_state,
   }
 
   // TODO: don't the the maximum length be larger than the field size.
-}
+}