README 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. This directory contains all additional views code needed to integrate this module with views2.
  2. FILE/FOLDER DESCRIPTIONS
  3. ---------------------------
  4. <chado table name>.views.inc:
  5. contains a single function retrieve_<chado table name>_views_data()
  6. which describes that table to views. This function is called by
  7. tripal_stock_views_data() in ../tripal_stock.views.inc.
  8. For more information on the form of this data array look up the
  9. views2 documentation for hook_views_data()
  10. -http://views2.logrus.com/doc/html/index.html
  11. handlers/
  12. Each file contained within this folder defines a views handler. Only custom
  13. handlers are included in this folder and each must be described in
  14. hook_views_handlers() in ../tripal_stock.views.inc.
  15. A views handler does one of the following:
  16. 1) describe the type of a field and how it should be displayed
  17. 2) describe a method to sort this field
  18. 3) describe a method to filter this field
  19. STANDARDS TO FOLLOW
  20. ---------------------------
  21. 1. All table definition files should be named tablename.views.inc
  22. 2. All handlers should be in a handlers sub-directory and follow the naming convention of
  23. views handlers (ie: views_handler_field/filter/sort_handlername.inc )
  24. Views Table Definitions:
  25. - Please use the template files provided whenever you are describing a new table to views.
  26. For any table in chado simply copy template.table_defn.views.inc to tablename.views.inc and
  27. follow the instructions listed at the top of the template file.
  28. - ONLY ONE TABLE DEFINITION PER FILE
  29. - To join a chado table to it's drupal node simply copy template.node_join.views.inc to
  30. basetablename.views.inc and replace all XXX with basetablename.
  31. NOTE: Creating the table definition file is not enough. You also need to call the
  32. retrieve_XXX_views_data() function from ../tripal_stock.views.inc:tripal_stock_views_data()
  33. by adding the following line:
  34. $data = array_merge($data, retrieve_XXX_views_data());
  35. to the function and including the file directly above the function (blow the function
  36. header by adding:
  37. require_once('views/XXX.views.inc');