The Tripal Stock Module provides functionality for adding, editing, deleting and accessing chado stocks. The stock module was designed to store information about stock collections in a laboratory. What is called a stock could also be called a strain or an accession. There is a lot in common between a Drosophila stock and a Saccharomyces strain and an Arabidopsis line. They all come from some taxon, have genotypes, physical locations in the lab, some conceivable relationship with a publication, some conceivable relationship with a sequence feature (such as a transgene), and could be described by some ontology term. For more information about the chado Stock Module see the GMOD Wiki Page
Set Permissions: The stock module supports the Drupal user permissions interface for controlling access to stock content and functions. These permissions include viewing, creating, editing or administering of stock content. The default is that only the original site administrator has these permissions. You can add roles for classifying users, assign users to roles and assign permissions for the stock content to those roles. For a simple setup, allow anonymous users access to view organism content and allow the site administrator all other permissions.
This allows you to create content in your drupal and chado for a stock (only the unique stock identifier is duplicated). A Generic Stock must have a unique name, a type and an organism. In addition, you can optionally supply a more human-readable name, a primary database reference and even a short description. The Create Generic Stock form is a multistep form with the first step creating the Basic stock (stored in the stock table). All the remaining steps are optional and descriptions of each follow:
Each stock get's it's own page on this website. This page is meant to give an overall picture of the stock including listing the basic details, as well as, all properties, database references and relationships. To understand where it is -All page content in Drupal is known as a node and is given a unique identifier or nid. Thus every drupal page has a path of node/
If you want to customize the look of the stock Details page simply copy the PHP/HTML template node-chado_stock.tpl.php from theme_tripal to the base theme you are currently using. Then edit it as desired. There are plans to integrate this details page with Drupal Panels which will provide a much more user-friendly and no-programming-needed method to customize this page.
The Stock Details Page also acts as a landing pad for updating/deleting stocks. To update a stock, go to the stocks details page and click on the Edit tab near the top of the page. This tab will only be visable if you have permission to edit chado stock content (See post installation steps above for information on setting user permissions). If you want to delete a stock, click the Edit tab and then near the bottom of the form, click the Delete button. This will delete the entire stock including it's properties, database references and any relationships including it.
To update/delete a given property of a stock, click the "Edit Properties" Tab near the top of the stock details page. This form provides a listing of all existing properties for the given stock with form elements allowing you to change their value. After editing the properties you wanted to, simply click the "Update Properties" button to update all the properties for that stock. To delete a given property simply click the "Delete" Button beside the property you want to delete. You cannot undo this action! To add a property to the given stock simply fill out the "Add Property" form at the bottom of the "Edit Properties" Tab.
Adding, updating and deleting Database References and Relationships for a given stock is exactly the same as the method for properties. To edit Database References, click the "Edit DB References" tab and to add/edit/update stock relationships, click the "Edit Relationships" tab.
This module also provides a basic listing of all stocks currently sync'd with Drupal. To access this listing, there should be a Stocks Primary Menu item which links you to this page. This page lists each stock on it's own row and provides a link to each stock by clicking on it's name. Currently there is no way to easily customize this listing.
In order to access a more flexible listing of stocks you must first install the Drupal Views2 module. You should then be able to access the default views here. Essentially, Views is a module which allows you to create custom SQL queries completely through the web interface without knowing SQL. Furthermore, it also does some formatting of the results allowing you to display them as HTML lists, tables or grids. You can also expose filters to the user to let them customize the results they see and even implement various sorting.
To use one of the Default Views simply click "Enable" and then "Edit" to change it to show exactly what you want. To view the current listing simply clikc "View Page" at the top of the Edit user interface. There are a number of good tutorials out there for Views2, any of which can be used to help you create your own custom listings of biological content. (Note: there aren't any tutorials specifically for tripal content but any tutorial for Views2 will show you how to use the views interface.
There are several ways to customize the look-and-feel for the way Chado data is presented through Tripal. Below is a description of several methods. These methods may be used in conjunction with one another to provide fine-grained control.
Integration with Drupal Panels: Drupal Panels allows for customization of a page layout if you don't want to do PHP/Javascript/CSS programming. Tripal comes with pre-set layouts for stock pages. However, Panels become useful if you prefer a layout that is different from the pre-set layouts. Chado content is provided to Panels in the form of Drupal "blocks" which you can then place anywhere on a page using the Panel's GUI.
Drupal's Content Construction Kit (CCK): the Content Construction Kit (CCK) is a powerful way to add non-Chado content to any page without need to edit template files or knowing PHP. You must first download and install CCK. With CCK, the site administartor can create a new field to appear on the page. For example, currently, the Chado publication module is not yet supported by Tripal. Therefore, the site administrator can add a text field to the stock pages. This content is not stored in Chado, but will appear on the stock page. A field added by CCK will also appear in the form when editing a stock to allow users to manually enter the appropriate text. If the default pre-set layout and themeing for Tripal is used, it is better to create the CCK element, indicate that it is not to be shown (using the CCK interface), then manually add the new content type where desired by editing the templates (as described below). If using Panels, the CCK field can be added to the location desired using the Panels interface.
Drupal Node Templates: The Tripal packages comes with a "theme_tripal" directory that contains the themeing for Chado content. The stock module has a template file for stock "nodes" (Tripal stock pages). This file is named "node-chado_stock.tpl.php", and provides javascript, HTML and PHP code for display of the stock pages. You can edit this file to control which types of information (or which stock "blocks") are displayed for stocks. Be sure to copy these template to your primary theme directory for editing. Do not edit them in the "theme_tripal" directory as future Tripal updates may overwrite your customizations. See the Tripal website for instructions on how to access variables and other Chado content within the template file.
Stock "Block" Templates: In the "theme_tripal" directory is a subdirectory named "tripal_stock". Inside this directory is a set of templates that control distinct types of information for stocks. For example, there is a "base" template for displaying of data directly from the Chado stock table, and a "references" template for showing external site references for a stock (data from the stock_dbxref table). These templates are used both by Drupal blocks for use in Drupal Panels (as described above) or for use in the default pre-set layout that the node template provides (also desribed above). You can customize this template as you desire. Be sure to copy the template to your primary theme directory for editing. Do not edit them in the "theme_tripal" directory as future Tripal updates may overwrite your customizations. See the Tripal website for instructions on how to access variables and other Chado content within the template files.
Adding Links to the "Resources" Sidebar: If you use the pre-set default Tripal layout for theming, you will see a "Resources" sidebar on each page. The links that appear on the sidebar are automatically generated using Javascript for all of the stock "Blocks" that appear on the page. If you want to add additional links (e.g. a dynamic link to additional stock content) and you want that link to appear in the "Resources" sidebar, simply edit the Drupal Node Template (as described above) and add the link to the section at the bottom of the template file where the resources section is found.