Browse Source

Tripal: Stock Default View

laceysanderson 14 years ago
parent
commit
d8a974f205
1 changed files with 377 additions and 0 deletions
  1. 377 0
      tripal_stock/tripal_stock.views.inc

+ 377 - 0
tripal_stock/tripal_stock.views.inc

@@ -180,3 +180,380 @@ function tripal_stock_views_pre_render	(&$view) {
 		} //if there are stocks
 	} //if we're dealing with a stock view
 }
+
+function tripal_stock_views_default_views() {
+  $views = array();
+  
+$view = new view;
+$view->name = 'all_stocks';
+$view->description = 'This view lists all stocks by default. There are exposed filters available but no arguments are used.';
+$view->tag = 'chado';
+$view->view_php = '';
+$view->base_table = 'stock';
+$view->is_cacheable = FALSE;
+$view->api_version = 2;
+$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+$handler = $view->new_display('default', 'Defaults', 'default');
+$handler->override_option('fields', array(
+  'uniquename' => array(
+    'label' => 'Unique Name',
+    '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,
+    'link_to_node' => 1,
+    'exclude' => 0,
+    'id' => 'uniquename',
+    'table' => 'stock',
+    'field' => 'uniquename',
+    'relationship' => 'none',
+  ),
+  'name_2' => array(
+    'label' => 'Name',
+    '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,
+    'link_to_node' => 1,
+    'exclude' => 0,
+    'id' => 'name_2',
+    'table' => 'stock',
+    'field' => 'name',
+    'relationship' => 'none',
+  ),
+  'name' => array(
+    'label' => 'Type',
+    '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' => 'name',
+    'table' => 'cvterm',
+    'field' => 'name',
+    'relationship' => 'none',
+  ),
+  'common_name' => array(
+    'label' => 'Organism',
+    '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,
+    'link_to_node' => 1,
+    'exclude' => 0,
+    'id' => 'common_name',
+    'table' => 'organism',
+    'field' => 'common_name',
+    'relationship' => 'none',
+  ),
+  'all_dbxref' => array(
+    'label' => 'All Database References',
+    '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,
+    'type' => 'ul',
+    'separator' => ', ',
+    'exclude' => 0,
+    'id' => 'all_dbxref',
+    'table' => 'stock',
+    'field' => 'all_dbxref',
+    'relationship' => 'none',
+  ),
+  'all_properties' => array(
+    'label' => 'All Properties',
+    '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,
+    'type' => 'ul',
+    'separator' => ', ',
+    'exclude' => 0,
+    'id' => 'all_properties',
+    'table' => 'stock',
+    'field' => 'all_properties',
+    'relationship' => 'none',
+  ),
+  'all_relationships' => array(
+    'label' => 'All Relationships',
+    '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,
+    'type' => 'ul',
+    'separator' => ', ',
+    'exclude' => 0,
+    'id' => 'all_relationships',
+    'table' => 'stock',
+    'field' => 'all_relationships',
+    'relationship' => 'none',
+  ),
+));
+$handler->override_option('sorts', array(
+  'common_name' => array(
+    'order' => 'ASC',
+    'id' => 'common_name',
+    'table' => 'organism',
+    'field' => 'common_name',
+    'relationship' => 'none',
+  ),
+  'uniquename' => array(
+    'order' => 'ASC',
+    'id' => 'uniquename',
+    'table' => 'stock',
+    'field' => 'uniquename',
+    'relationship' => 'none',
+  ),
+));
+$handler->override_option('filters', array(
+  'common_name' => array(
+    'operator' => '=',
+    'value' => 'All',
+    'group' => '0',
+    'exposed' => TRUE,
+    'expose' => array(
+      'use_operator' => 0,
+      'operator' => 'common_name_op',
+      'identifier' => 'organism_common_name',
+      'label' => 'Organism',
+      'optional' => 1,
+      'remember' => 0,
+    ),
+    'case' => 1,
+    'id' => 'common_name',
+    'table' => 'organism',
+    'field' => 'common_name',
+    'relationship' => 'none',
+  ),
+  'name' => array(
+    'operator' => '=',
+    'value' => 'All',
+    'group' => '0',
+    'exposed' => TRUE,
+    'expose' => array(
+      'use_operator' => 0,
+      'operator' => 'name_op',
+      'identifier' => 'name',
+      'label' => 'Chado CV Terms: Name',
+      'optional' => 1,
+      'remember' => 0,
+    ),
+    'case' => 1,
+    'id' => 'name',
+    'table' => 'cvterm',
+    'field' => 'name',
+    'relationship' => 'none',
+  ),
+  'status' => array(
+    'operator' => '=',
+    'value' => '1',
+    'group' => '0',
+    'exposed' => FALSE,
+    'expose' => array(
+      'operator' => FALSE,
+      'label' => '',
+    ),
+    'id' => 'status',
+    'table' => 'node',
+    'field' => 'status',
+    'override' => array(
+      'button' => 'Override',
+    ),
+    'relationship' => 'none',
+  ),
+));
+$handler->override_option('access', array(
+  'type' => 'perm',
+  'perm' => 'access chado_stock content',
+));
+$handler->override_option('cache', array(
+  'type' => 'none',
+));
+$handler->override_option('title', 'Stocks');
+$handler->override_option('empty', 'There are no stocks that match this criteria. If you think there should be, ensure that all stocks in chado are sync\'d with your website.');
+$handler->override_option('empty_format', '1');
+$handler->override_option('items_per_page', 25);
+$handler->override_option('use_pager', '1');
+$handler->override_option('style_plugin', 'table');
+$handler->override_option('style_options', array(
+  'grouping' => '',
+  'override' => 1,
+  'sticky' => 0,
+  'order' => 'asc',
+  'columns' => array(
+    'uniquename' => 'uniquename',
+    'name_2' => 'name_2',
+    'name' => 'name',
+    'common_name' => 'common_name',
+    'all_dbxref' => 'all_dbxref',
+    'all_properties' => 'all_properties',
+    'all_relationships' => 'all_relationships',
+  ),
+  'info' => array(
+    'uniquename' => array(
+      'sortable' => 1,
+      'separator' => '',
+    ),
+    'name_2' => array(
+      'sortable' => 1,
+      'separator' => '',
+    ),
+    'name' => array(
+      'sortable' => 1,
+      'separator' => '',
+    ),
+    'common_name' => array(
+      'sortable' => 1,
+      'separator' => '',
+    ),
+    'all_dbxref' => array(
+      'separator' => '',
+    ),
+    'all_properties' => array(
+      'separator' => '',
+    ),
+    'all_relationships' => array(
+      'separator' => '',
+    ),
+  ),
+  'default' => '-1',
+));
+$handler = $view->new_display('page', 'Page', 'page_1');
+$handler->override_option('path', 'stocks');
+$handler->override_option('menu', array(
+  'type' => 'normal',
+  'title' => 'Stocks',
+  'description' => 'A full listing of all chado stocks',
+  'weight' => '0',
+  'name' => 'primary-links',
+));
+$handler->override_option('tab_options', array(
+  'type' => 'none',
+  'title' => '',
+  'description' => '',
+  'weight' => 0,
+  'name' => 'navigation',
+));
+$views[$view->name] = $view;  
+  
+  return $views;
+}