|
@@ -1,5 +1,5 @@
|
|
<?php
|
|
<?php
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @file
|
|
* @file
|
|
* This file defines the data array for a given chado table. This array
|
|
* This file defines the data array for a given chado table. This array
|
|
@@ -7,12 +7,12 @@
|
|
* with this module in:
|
|
* with this module in:
|
|
* @see tripal_natural_diversity.views.inc --in tripal_natural_diversity_views_data()
|
|
* @see tripal_natural_diversity.views.inc --in tripal_natural_diversity_views_data()
|
|
*
|
|
*
|
|
- * Documentation on views integration can be found at
|
|
|
|
|
|
+ * Documentation on views integration can be found at
|
|
* http://views2.logrus.com/doc/html/index.html.
|
|
* http://views2.logrus.com/doc/html/index.html.
|
|
*/
|
|
*/
|
|
|
|
|
|
/*************************************************************************
|
|
/*************************************************************************
|
|
- * Purpose: this function returns the portion of the data array
|
|
|
|
|
|
+ * Purpose: this function returns the portion of the data array
|
|
* which describes the nd_experiment table, it's fields and any joins between it and other tables
|
|
* which describes the nd_experiment table, it's fields and any joins between it and other tables
|
|
* @see tripal_natural_diversity_views_data() --in tripal_natural_diversity.views.inc
|
|
* @see tripal_natural_diversity_views_data() --in tripal_natural_diversity.views.inc
|
|
*
|
|
*
|
|
@@ -23,7 +23,7 @@
|
|
CREATE TABLE nd_experiment (
|
|
CREATE TABLE nd_experiment (
|
|
nd_experiment_id serial PRIMARY KEY NOT NULL,
|
|
nd_experiment_id serial PRIMARY KEY NOT NULL,
|
|
nd_geolocation_id integer NOT NULL references nd_geolocation (nd_geolocation_id) on delete cascade INITIALLY DEFERRED,
|
|
nd_geolocation_id integer NOT NULL references nd_geolocation (nd_geolocation_id) on delete cascade INITIALLY DEFERRED,
|
|
- type_id integer NOT NULL references cvterm (cvterm_id) on delete cascade INITIALLY DEFERRED
|
|
|
|
|
|
+ type_id integer NOT NULL references cvterm (cvterm_id) on delete cascade INITIALLY DEFERRED
|
|
);
|
|
);
|
|
* @endcode
|
|
* @endcode
|
|
*/
|
|
*/
|
|
@@ -34,32 +34,32 @@
|
|
// if the chado database is not local to the drupal database
|
|
// if the chado database is not local to the drupal database
|
|
// then we need to set the database name. This should always
|
|
// then we need to set the database name. This should always
|
|
// be 'chado'.
|
|
// be 'chado'.
|
|
- if(is_array($db_url) and array_key_exists('chado',$db_url)){
|
|
|
|
|
|
+ if (is_array($db_url) and array_key_exists('chado', $db_url)) {
|
|
$database = 'chado';
|
|
$database = 'chado';
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
//Basic table definition-----------------------------------
|
|
//Basic table definition-----------------------------------
|
|
$data['nd_experiment']['table']['group'] = t('Chado ND Experiment');
|
|
$data['nd_experiment']['table']['group'] = t('Chado ND Experiment');
|
|
-
|
|
|
|
|
|
+
|
|
$data['nd_experiment']['table']['base'] = array(
|
|
$data['nd_experiment']['table']['base'] = array(
|
|
'field' => 'nd_experiment_id',
|
|
'field' => 'nd_experiment_id',
|
|
'title' => t('Chado Natural Diversity Experiment'),
|
|
'title' => t('Chado Natural Diversity Experiment'),
|
|
'help' => t('Represents one data point in a natural diversity project.'),
|
|
'help' => t('Represents one data point in a natural diversity project.'),
|
|
);
|
|
);
|
|
- if($database){
|
|
|
|
|
|
+ if ($database) {
|
|
$data['nd_experiment']['table']['database'] = $database;
|
|
$data['nd_experiment']['table']['database'] = $database;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
//Relationship Definitions---------------------------------
|
|
//Relationship Definitions---------------------------------
|
|
//Join: nd_experiment => nd_geolocation
|
|
//Join: nd_experiment => nd_geolocation
|
|
// In nd_experiment.views.inc
|
|
// In nd_experiment.views.inc
|
|
-
|
|
|
|
|
|
+
|
|
//Join: nd_experiment => nd_experiment_contact => contact
|
|
//Join: nd_experiment => nd_experiment_contact => contact
|
|
$data['nd_experiment']['table']['join']['nd_experiment_contact'] = array(
|
|
$data['nd_experiment']['table']['join']['nd_experiment_contact'] = array(
|
|
'left_field' => 'nd_experiment_id',
|
|
'left_field' => 'nd_experiment_id',
|
|
'field' => 'nd_experiment_id',
|
|
'field' => 'nd_experiment_id',
|
|
- );
|
|
|
|
|
|
+ );
|
|
$data['nd_experiment']['table']['join']['contact'] = array(
|
|
$data['nd_experiment']['table']['join']['contact'] = array(
|
|
'left_table' => 'nd_experiment_contact',
|
|
'left_table' => 'nd_experiment_contact',
|
|
'left_field' => 'nd_experiment_id',
|
|
'left_field' => 'nd_experiment_id',
|
|
@@ -69,12 +69,12 @@
|
|
'left_field' => 'contact_id',
|
|
'left_field' => 'contact_id',
|
|
'field' => 'contact_id',
|
|
'field' => 'contact_id',
|
|
);
|
|
);
|
|
-
|
|
|
|
|
|
+
|
|
//Join: nd_experiment => nd_experiment_dbxref => dbxref
|
|
//Join: nd_experiment => nd_experiment_dbxref => dbxref
|
|
$data['nd_experiment']['table']['join']['nd_experiment_dbxref'] = array(
|
|
$data['nd_experiment']['table']['join']['nd_experiment_dbxref'] = array(
|
|
'left_field' => 'nd_experiment_id',
|
|
'left_field' => 'nd_experiment_id',
|
|
'field' => 'nd_experiment_id',
|
|
'field' => 'nd_experiment_id',
|
|
- );
|
|
|
|
|
|
+ );
|
|
$data['nd_experiment']['table']['join']['dbxref'] = array(
|
|
$data['nd_experiment']['table']['join']['dbxref'] = array(
|
|
'left_table' => 'nd_experiment_dbxref',
|
|
'left_table' => 'nd_experiment_dbxref',
|
|
'left_field' => 'nd_experiment_id',
|
|
'left_field' => 'nd_experiment_id',
|
|
@@ -84,12 +84,12 @@
|
|
'left_field' => 'dbxref_id',
|
|
'left_field' => 'dbxref_id',
|
|
'field' => 'dbxref_id',
|
|
'field' => 'dbxref_id',
|
|
);
|
|
);
|
|
-
|
|
|
|
|
|
+
|
|
//Join: nd_experiment => nd_experiment_genotype => genotype
|
|
//Join: nd_experiment => nd_experiment_genotype => genotype
|
|
$data['nd_experiment']['table']['join']['nd_experiment_genotype'] = array(
|
|
$data['nd_experiment']['table']['join']['nd_experiment_genotype'] = array(
|
|
'left_field' => 'nd_experiment_id',
|
|
'left_field' => 'nd_experiment_id',
|
|
'field' => 'nd_experiment_id',
|
|
'field' => 'nd_experiment_id',
|
|
- );
|
|
|
|
|
|
+ );
|
|
$data['nd_experiment']['table']['join']['genotype'] = array(
|
|
$data['nd_experiment']['table']['join']['genotype'] = array(
|
|
'left_table' => 'nd_experiment_genotype',
|
|
'left_table' => 'nd_experiment_genotype',
|
|
'left_field' => 'nd_experiment_id',
|
|
'left_field' => 'nd_experiment_id',
|
|
@@ -99,12 +99,12 @@
|
|
'left_field' => 'genotype_id',
|
|
'left_field' => 'genotype_id',
|
|
'field' => 'genotype_id',
|
|
'field' => 'genotype_id',
|
|
);
|
|
);
|
|
-
|
|
|
|
|
|
+
|
|
//Join: nd_experiment => nd_experiment_phenotype => phenotype
|
|
//Join: nd_experiment => nd_experiment_phenotype => phenotype
|
|
$data['nd_experiment']['table']['join']['nd_experiment_phenotype'] = array(
|
|
$data['nd_experiment']['table']['join']['nd_experiment_phenotype'] = array(
|
|
'left_field' => 'nd_experiment_id',
|
|
'left_field' => 'nd_experiment_id',
|
|
'field' => 'nd_experiment_id',
|
|
'field' => 'nd_experiment_id',
|
|
- );
|
|
|
|
|
|
+ );
|
|
$data['nd_experiment']['table']['join']['phenotype'] = array(
|
|
$data['nd_experiment']['table']['join']['phenotype'] = array(
|
|
'left_table' => 'nd_experiment_phenotype',
|
|
'left_table' => 'nd_experiment_phenotype',
|
|
'left_field' => 'nd_experiment_id',
|
|
'left_field' => 'nd_experiment_id',
|
|
@@ -114,12 +114,12 @@
|
|
'left_field' => 'phenotype_id',
|
|
'left_field' => 'phenotype_id',
|
|
'field' => 'phenotype_id',
|
|
'field' => 'phenotype_id',
|
|
);
|
|
);
|
|
-
|
|
|
|
|
|
+
|
|
//Join: nd_experiment => nd_experiment_project => project
|
|
//Join: nd_experiment => nd_experiment_project => project
|
|
$data['nd_experiment']['table']['join']['nd_experiment_project'] = array(
|
|
$data['nd_experiment']['table']['join']['nd_experiment_project'] = array(
|
|
'left_field' => 'nd_experiment_id',
|
|
'left_field' => 'nd_experiment_id',
|
|
'field' => 'nd_experiment_id',
|
|
'field' => 'nd_experiment_id',
|
|
- );
|
|
|
|
|
|
+ );
|
|
$data['nd_experiment']['table']['join']['project'] = array(
|
|
$data['nd_experiment']['table']['join']['project'] = array(
|
|
'left_table' => 'nd_experiment_project',
|
|
'left_table' => 'nd_experiment_project',
|
|
'left_field' => 'nd_experiment_id',
|
|
'left_field' => 'nd_experiment_id',
|
|
@@ -129,12 +129,12 @@
|
|
'left_field' => 'project_id',
|
|
'left_field' => 'project_id',
|
|
'field' => 'project_id',
|
|
'field' => 'project_id',
|
|
);
|
|
);
|
|
-
|
|
|
|
|
|
+
|
|
//Join: nd_experiment => nd_experiment_pub => pub
|
|
//Join: nd_experiment => nd_experiment_pub => pub
|
|
$data['nd_experiment']['table']['join']['nd_experiment_pub'] = array(
|
|
$data['nd_experiment']['table']['join']['nd_experiment_pub'] = array(
|
|
'left_field' => 'nd_experiment_id',
|
|
'left_field' => 'nd_experiment_id',
|
|
'field' => 'nd_experiment_id',
|
|
'field' => 'nd_experiment_id',
|
|
- );
|
|
|
|
|
|
+ );
|
|
$data['nd_experiment']['table']['join']['pub'] = array(
|
|
$data['nd_experiment']['table']['join']['pub'] = array(
|
|
'left_table' => 'nd_experiment_pub',
|
|
'left_table' => 'nd_experiment_pub',
|
|
'left_field' => 'nd_experiment_id',
|
|
'left_field' => 'nd_experiment_id',
|
|
@@ -149,7 +149,7 @@
|
|
$data['nd_experiment']['table']['join']['nd_experiment_stock'] = array(
|
|
$data['nd_experiment']['table']['join']['nd_experiment_stock'] = array(
|
|
'left_field' => 'nd_experiment_id',
|
|
'left_field' => 'nd_experiment_id',
|
|
'field' => 'nd_experiment_id',
|
|
'field' => 'nd_experiment_id',
|
|
- );
|
|
|
|
|
|
+ );
|
|
$data['nd_experiment']['table']['join']['stock'] = array(
|
|
$data['nd_experiment']['table']['join']['stock'] = array(
|
|
'left_table' => 'nd_experiment_stock',
|
|
'left_table' => 'nd_experiment_stock',
|
|
'left_field' => 'nd_experiment_id',
|
|
'left_field' => 'nd_experiment_id',
|
|
@@ -161,7 +161,7 @@
|
|
);
|
|
);
|
|
|
|
|
|
//Table Field Definitions----------------------------------
|
|
//Table Field Definitions----------------------------------
|
|
-
|
|
|
|
|
|
+
|
|
//Field: nd_experiment_id (primary key)
|
|
//Field: nd_experiment_id (primary key)
|
|
$data['nd_experiment']['nd_experiment_id'] = array(
|
|
$data['nd_experiment']['nd_experiment_id'] = array(
|
|
'title' => t('ND Experiment Primary Key'),
|
|
'title' => t('ND Experiment Primary Key'),
|
|
@@ -177,6 +177,6 @@
|
|
'handler' => 'views_handler_filter_numeric',
|
|
'handler' => 'views_handler_filter_numeric',
|
|
),
|
|
),
|
|
);
|
|
);
|
|
-
|
|
|
|
|
|
+
|
|
return $data;
|
|
return $data;
|
|
-}
|
|
|
|
|
|
+}
|