Browse Source

Updated the analysis default view

Lacey Sanderson 13 years ago
parent
commit
4d8a8f3f7a
1 changed files with 114 additions and 216 deletions
  1. 114 216
      tripal_analysis/tripal_analysis.views.inc

+ 114 - 216
tripal_analysis/tripal_analysis.views.inc

@@ -37,6 +37,13 @@ function tripal_analysis_views_data()  {
     $tablename = 'analysis';
     $tablename = 'analysis';
     if (!tripal_views_is_integrated($tablename, 9)) {
     if (!tripal_views_is_integrated($tablename, 9)) {
       $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename, TRUE);
       $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename, TRUE);
+
+      // Make table-specific modifications
+      $table_integration_array['fields']['program']['handlers']['filter']['name'] = 'chado_views_handler_filter_select_string';
+      $table_integration_array['fields']['algorithm']['handlers']['filter']['name'] = 'chado_views_handler_filter_select_string';
+
+      dpm($table_integration_array, 'analysis integration');
+
       tripal_views_integration_add_entry($table_integration_array);
       tripal_views_integration_add_entry($table_integration_array);
     }
     }
 
 
@@ -120,15 +127,13 @@ function tripal_analysis_views_default_views() {
   $views = array();
   $views = array();
 
 
   // Main default view
   // Main default view
-  // List all cvterms based on cv
   $view = new view;
   $view = new view;
-  $view->name = 'all_analysis';
-  $view->description = 'A listing of all analysis\'';
-  $view->tag = 'chado';
-  $view->view_php = '';
+  $view->name = 'analysis_listing';
+  $view->description = 'A default listing of analyses provided by Tripal';
+  $view->tag = 'chado default';
   $view->base_table = 'analysis';
   $view->base_table = 'analysis';
-  $view->is_cacheable = FALSE;
-  $view->api_version = 2;
+  $view->core = 0;
+  $view->api_version = '2';
   $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
   $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
   $handler = $view->new_display('default', 'Defaults', 'default');
   $handler = $view->new_display('default', 'Defaults', 'default');
   $handler->override_option('fields', array(
   $handler->override_option('fields', array(
@@ -139,8 +144,10 @@ function tripal_analysis_views_default_views() {
         'text' => '',
         'text' => '',
         'make_link' => 0,
         'make_link' => 0,
         'path' => '',
         'path' => '',
+        'absolute' => 0,
         'link_class' => '',
         'link_class' => '',
         'alt' => '',
         'alt' => '',
+        'rel' => '',
         'prefix' => '',
         'prefix' => '',
         'suffix' => '',
         'suffix' => '',
         'target' => '',
         'target' => '',
@@ -155,42 +162,16 @@ function tripal_analysis_views_default_views() {
       'empty' => '',
       'empty' => '',
       'hide_empty' => 0,
       'hide_empty' => 0,
       'empty_zero' => 0,
       'empty_zero' => 0,
-      'link_to_node' => 1,
+      'hide_alter_empty' => 1,
+      'type' => 'separator',
+      'separator' => ', ',
       'exclude' => 0,
       'exclude' => 0,
+      'link_to_node' => 1,
       'id' => 'name',
       'id' => 'name',
       'table' => 'analysis',
       'table' => 'analysis',
       'field' => 'name',
       'field' => 'name',
       'relationship' => 'none',
       'relationship' => 'none',
     ),
     ),
-    'algorithm' => array(
-      'label' => 'Algorithm',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'link_class' => '',
-        'alt' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'exclude' => 0,
-      'id' => 'algorithm',
-      'table' => 'analysis',
-      'field' => 'algorithm',
-      'relationship' => 'none',
-    ),
     'program' => array(
     'program' => array(
       'label' => 'Program',
       'label' => 'Program',
       'alter' => array(
       'alter' => array(
@@ -198,8 +179,10 @@ function tripal_analysis_views_default_views() {
         'text' => '',
         'text' => '',
         'make_link' => 0,
         'make_link' => 0,
         'path' => '',
         'path' => '',
+        'absolute' => 0,
         'link_class' => '',
         'link_class' => '',
         'alt' => '',
         'alt' => '',
+        'rel' => '',
         'prefix' => '',
         'prefix' => '',
         'suffix' => '',
         'suffix' => '',
         'target' => '',
         'target' => '',
@@ -214,79 +197,24 @@ function tripal_analysis_views_default_views() {
       'empty' => '',
       'empty' => '',
       'hide_empty' => 0,
       'hide_empty' => 0,
       'empty_zero' => 0,
       'empty_zero' => 0,
+      'hide_alter_empty' => 1,
       'exclude' => 0,
       'exclude' => 0,
       'id' => 'program',
       'id' => 'program',
       'table' => 'analysis',
       'table' => 'analysis',
       'field' => 'program',
       'field' => 'program',
       'relationship' => 'none',
       'relationship' => 'none',
     ),
     ),
-    'programversion' => array(
-      'label' => 'Program Version',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'link_class' => '',
-        'alt' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'exclude' => 0,
-      'id' => 'programversion',
-      'table' => 'analysis',
-      'field' => 'programversion',
-      'relationship' => 'none',
-    ),
-    'description' => array(
-      'label' => 'Description',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'link_class' => '',
-        'alt' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'exclude' => 0,
-      'id' => 'description',
-      'table' => 'analysis',
-      'field' => 'description',
-      'relationship' => 'none',
-    ),
     'sourcename' => array(
     'sourcename' => array(
-      'label' => 'Source Name',
+      'label' => 'Source',
       'alter' => array(
       'alter' => array(
         'alter_text' => 0,
         'alter_text' => 0,
         'text' => '',
         'text' => '',
         'make_link' => 0,
         'make_link' => 0,
         'path' => '',
         'path' => '',
+        'absolute' => 0,
         'link_class' => '',
         'link_class' => '',
         'alt' => '',
         'alt' => '',
+        'rel' => '',
         'prefix' => '',
         'prefix' => '',
         'suffix' => '',
         'suffix' => '',
         'target' => '',
         'target' => '',
@@ -301,21 +229,24 @@ function tripal_analysis_views_default_views() {
       'empty' => '',
       'empty' => '',
       'hide_empty' => 0,
       'hide_empty' => 0,
       'empty_zero' => 0,
       'empty_zero' => 0,
+      'hide_alter_empty' => 1,
       'exclude' => 0,
       'exclude' => 0,
       'id' => 'sourcename',
       'id' => 'sourcename',
       'table' => 'analysis',
       'table' => 'analysis',
       'field' => 'sourcename',
       'field' => 'sourcename',
       'relationship' => 'none',
       'relationship' => 'none',
     ),
     ),
-    'sourceuri' => array(
-      'label' => 'Source URL',
+    'timeexecuted' => array(
+      'label' => 'Time Executed',
       'alter' => array(
       'alter' => array(
         'alter_text' => 0,
         'alter_text' => 0,
         'text' => '',
         'text' => '',
         'make_link' => 0,
         'make_link' => 0,
         'path' => '',
         'path' => '',
+        'absolute' => 0,
         'link_class' => '',
         'link_class' => '',
         'alt' => '',
         'alt' => '',
+        'rel' => '',
         'prefix' => '',
         'prefix' => '',
         'suffix' => '',
         'suffix' => '',
         'target' => '',
         'target' => '',
@@ -330,121 +261,109 @@ function tripal_analysis_views_default_views() {
       'empty' => '',
       'empty' => '',
       'hide_empty' => 0,
       'hide_empty' => 0,
       'empty_zero' => 0,
       'empty_zero' => 0,
+      'hide_alter_empty' => 1,
+      'date_format' => 'custom',
+      'custom_date_format' => 'F j, Y',
       'exclude' => 0,
       'exclude' => 0,
-      'id' => 'sourceuri',
+      'id' => 'timeexecuted',
       'table' => 'analysis',
       'table' => 'analysis',
-      'field' => 'sourceuri',
+      'field' => 'timeexecuted',
+      'override' => array(
+        'button' => 'Override',
+      ),
       'relationship' => 'none',
       'relationship' => 'none',
     ),
     ),
-    'sourceversion' => array(
-      'label' => 'Source Version',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'link_class' => '',
-        'alt' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
+  ));
+  $handler->override_option('filters', array(
+    'search_results' => array(
+      'operator' => '=',
+      'value' => '',
+      'group' => '0',
+      'exposed' => FALSE,
+      'expose' => array(
+        'operator' => FALSE,
+        'label' => '',
       ),
       ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'exclude' => 0,
-      'id' => 'sourceversion',
-      'table' => 'analysis',
-      'field' => 'sourceversion',
+      'id' => 'search_results',
+      'table' => 'views',
+      'field' => 'search_results',
       'relationship' => 'none',
       'relationship' => 'none',
+      'apply_button' => 'Show ',
+      'no_results_text' => 'Click "Show" to see a list of all analysis matching the entered criteria. If you leave a any of the criteria blank then the analysis will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all analysis will be listed.',
     ),
     ),
-    'num_features' => array(
-      'label' => 'Number of Features',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'link_class' => '',
-        'alt' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
+    'program' => array(
+      'operator' => '=',
+      'value' => array(),
+      'group' => '0',
+      'exposed' => TRUE,
+      'expose' => array(
+        'use_operator' => 0,
+        'operator' => 'program_op',
+        'identifier' => 'program',
+        'label' => 'Program',
+        'remember' => 0,
       ),
       ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'exclude' => 0,
-      'id' => 'num_features',
+      'case' => 1,
+      'id' => 'program',
       'table' => 'analysis',
       'table' => 'analysis',
-      'field' => 'num_features',
+      'field' => 'program',
       'relationship' => 'none',
       'relationship' => 'none',
+      'values_form_type' => 'select',
+      'multiple' => 1,
+      'optional' => 0,
+      'agg' => array(
+        'records_with' => 1,
+        'aggregates_with' => 0,
+      ),
     ),
     ),
     'timeexecuted' => array(
     'timeexecuted' => array(
-      'label' => 'Time Executed',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'link_class' => '',
-        'alt' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
+      'operator' => '>',
+      'value' => array(
+        'type' => 'date',
+        'value' => '',
+        'min' => '',
+        'max' => '',
+      ),
+      'group' => '0',
+      'exposed' => TRUE,
+      'expose' => array(
+        'use_operator' => 1,
+        'operator' => 'timeexecuted_op',
+        'identifier' => 'timeexecuted',
+        'label' => 'Time Executed',
+        'optional' => 1,
+        'remember' => 0,
       ),
       ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'date_format' => 'large',
-      'custom_date_format' => '',
-      'exclude' => 0,
       'id' => 'timeexecuted',
       'id' => 'timeexecuted',
       'table' => 'analysis',
       'table' => 'analysis',
       'field' => 'timeexecuted',
       'field' => 'timeexecuted',
       'relationship' => 'none',
       'relationship' => 'none',
+      'agg' => array(
+        'records_with' => 1,
+        'aggregates_with' => 0,
+      ),
     ),
     ),
-  ));
-  $handler->override_option('filters', array(
-    'program' => array(
-      'operator' => '=',
-      'value' => 'All',
+    'name' => array(
+      'operator' => 'contains',
+      'value' => '',
       'group' => '0',
       'group' => '0',
       'exposed' => TRUE,
       'exposed' => TRUE,
       'expose' => array(
       'expose' => array(
         'use_operator' => 0,
         'use_operator' => 0,
-        'operator' => 'program_op',
-        'identifier' => 'program',
-        'label' => 'Program',
-        'optional' => 1,
+        'operator' => 'name_op',
+        'identifier' => 'name',
+        'label' => 'Name Contains',
+        'bef_filter_description' => '',
         'remember' => 0,
         'remember' => 0,
       ),
       ),
       'case' => 0,
       'case' => 0,
-      'id' => 'program',
+      'id' => 'name',
       'table' => 'analysis',
       'table' => 'analysis',
-      'field' => 'program',
+      'field' => 'name',
       'relationship' => 'none',
       'relationship' => 'none',
+      'values_form_type' => 'textfield',
+      'multiple' => 0,
+      'optional' => 0,
     ),
     ),
     'sourcename' => array(
     'sourcename' => array(
       'operator' => 'contains',
       'operator' => 'contains',
@@ -455,8 +374,8 @@ function tripal_analysis_views_default_views() {
         'use_operator' => 0,
         'use_operator' => 0,
         'operator' => 'sourcename_op',
         'operator' => 'sourcename_op',
         'identifier' => 'sourcename',
         'identifier' => 'sourcename',
-        'label' => 'Source Name Contains',
-        'optional' => 1,
+        'label' => 'Source Contains',
+        'bef_filter_description' => '',
         'remember' => 0,
         'remember' => 0,
       ),
       ),
       'case' => 0,
       'case' => 0,
@@ -474,6 +393,9 @@ function tripal_analysis_views_default_views() {
     'type' => 'none',
     'type' => 'none',
   ));
   ));
   $handler->override_option('title', 'Analysis');
   $handler->override_option('title', 'Analysis');
+  $handler->override_option('header', 'Click "Show" to see a list of all analysis matching the entered criteria. If you leave a any of the criteria blank then the analysis will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all analysis will be listed.');
+  $handler->override_option('header_format', '2');
+  $handler->override_option('header_empty', 1);
   $handler->override_option('empty', 'No analysis match the supplied criteria.');
   $handler->override_option('empty', 'No analysis match the supplied criteria.');
   $handler->override_option('empty_format', '1');
   $handler->override_option('empty_format', '1');
   $handler->override_option('items_per_page', 50);
   $handler->override_option('items_per_page', 50);
@@ -484,52 +406,28 @@ function tripal_analysis_views_default_views() {
     'override' => 1,
     'override' => 1,
     'sticky' => 0,
     'sticky' => 0,
     'order' => 'asc',
     'order' => 'asc',
+    'summary' => '',
     'columns' => array(
     'columns' => array(
-      'algorithm' => 'algorithm',
-      'description' => 'description',
       'name' => 'name',
       'name' => 'name',
-      'num_features' => 'num_features',
       'program' => 'program',
       'program' => 'program',
-      'programversion' => 'programversion',
       'sourcename' => 'sourcename',
       'sourcename' => 'sourcename',
-      'sourceuri' => 'sourceuri',
-      'sourceversion' => 'sourceversion',
+      'num_features' => 'num_features',
       'timeexecuted' => 'timeexecuted',
       'timeexecuted' => 'timeexecuted',
     ),
     ),
     'info' => array(
     'info' => array(
-      'algorithm' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'description' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
       'name' => array(
       'name' => array(
         'sortable' => 1,
         'sortable' => 1,
         'separator' => '',
         'separator' => '',
       ),
       ),
-      'num_features' => array(
-        'separator' => '',
-      ),
       'program' => array(
       'program' => array(
         'sortable' => 1,
         'sortable' => 1,
         'separator' => '',
         'separator' => '',
       ),
       ),
-      'programversion' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
       'sourcename' => array(
       'sourcename' => array(
         'sortable' => 1,
         'sortable' => 1,
         'separator' => '',
         'separator' => '',
       ),
       ),
-      'sourceuri' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'sourceversion' => array(
-        'sortable' => 1,
+      'num_features' => array(
         'separator' => '',
         'separator' => '',
       ),
       ),
       'timeexecuted' => array(
       'timeexecuted' => array(
@@ -537,7 +435,7 @@ function tripal_analysis_views_default_views() {
         'separator' => '',
         'separator' => '',
       ),
       ),
     ),
     ),
-    'default' => 'timeexecuted',
+    'default' => 'name',
   ));
   ));
   $handler = $view->new_display('page', 'Page', 'page_1');
   $handler = $view->new_display('page', 'Page', 'page_1');
   $handler->override_option('path', 'analyses');
   $handler->override_option('path', 'analyses');