Tripal
Functions
tripal_chado_views.views.inc File Reference

Functions

 tripal_chado_views_views_handlers ()
 
 tripal_chado_views_views_pre_render (&$view)
 
 tripal_chado_views_views_data ()
 
 tripal_chado_views_views_data_tripal_views_tables ($data)
 
 tripal_chado_views_views_data_alter (&$data)
 
 tripal_chado_views_views_pre_view (&$view, &$display_id, &$args)
 

Detailed Description

Chado Views Integration

Function Documentation

◆ tripal_chado_views_views_data()

tripal_chado_views_views_data ( )

Implements hook_views_data().

Generates a dynamic data array for Views

This function is a hook used by the Views module. It populates and returns a data array that specifies for the Views module the base table, the tables it joins with and handlers. The data array is populated using the data stored in the tripal_views tables.

Returns
a data array formatted for the Views module

D7

Todo:
: Add support for materialized views relationships using the new method

◆ tripal_chado_views_views_data_alter()

tripal_chado_views_views_data_alter ( $data)

Implements hook_views_data_alter(). Used to add Chado <-> Node Joins & Relationships since you need to add to the $data['node'] to do this

See also
https://api.drupal.org/api/views/views.api.php/function/hook_views_data/7.x-3.x

◆ tripal_chado_views_views_data_tripal_views_tables()

tripal_chado_views_views_data_tripal_views_tables (   $data)

Describes the tripal views integration tables to views for the administration views

◆ tripal_chado_views_views_handlers()

tripal_chado_views_views_handlers ( )

Implements hook_views_handlers().

Purpose: Register all custom handlers with views where a handler describes either "the type of field", "how a field should be filtered", "how a field should be sorted"

Returns
An array of handler definitions

CANT FIX UNTIL Tripal Feature is working 'tripal_views_handler_field_sequence' => array( 'parent' => 'views_handler_field', ),

D7

Todo:
: get handlers working

CANT FIX UNTIL Tripal Feature is working 'tripal_views_handler_filter_sequence' => array( 'parent' => 'chado_views_handler_filter_string', ),

◆ tripal_chado_views_views_pre_render()

tripal_chado_views_views_pre_render ( $view)

Implements hook_views_pre_render().

Purpose: Intercepts the view after the query has been executed All the results are stored in $view->result Looking up the NID here ensures the query is only executed once for all stocks in the table.

◆ tripal_chado_views_views_pre_view()

tripal_chado_views_views_pre_view ( $view,
$display_id,
$args 
)

Implementation of hook_views_pre_view().

Merge the $_GET and $_POST into the $_GET. This is because Views and Views Data Export modules only uses the $_GET variable but file uploads require $_POST. We need to make sure these two modules have access to everything needed for this view to work properly.