Legacy Chado Nodes

Many Tripal modules implement Drupal node types as a means of displaying chado records individually through Drupal as a single web page. In order to do this, many of the same drupal hooks are implemented and the code between modules is actually quite similar. This API aims to abstract much of the common functionality in order to make it easier for new Tripal modules to implement drupal node types and to centralize the maintenance effort as much as possible.

A generic sync form has been created. See chado_node_sync_form() for instructions on how to implement this form in your module.

Many of the base chado tables also have associated prop, _dbxref and _relationship tables. Generic mini-forms have been created to help you handle these forms. To implement this functionality you call the mini-form from your module node form and then call the associated update functions from both your hook_insert and hook_update. The functions of interest are as follows:

Parent topics

File

legacy/tripal_core/api/tripal_core.chado_nodes.api.inc, line 7
API to handle much of the common functionality implemented when creating a drupal node type.

Functions

Namesort descending Location Description
chado_add_admin_form_set_title legacy/tripal_core/api/tripal_core.chado_nodes.title_and_path.inc Generic "Set Node Title" sub-form for setting the title of any chado node
chado_add_admin_form_set_url legacy/tripal_core/api/tripal_core.chado_nodes.title_and_path.inc Generic "Set Node URL" sub-form for setting the url of any chado node
chado_add_node_form_dbxrefs legacy/tripal_core/api/tripal_core.chado_nodes.dbxrefs.api.inc Provides a form for adding to BASE_dbxref and dbxref tables
chado_add_node_form_relationships legacy/tripal_core/api/tripal_core.chado_nodes.relationships.api.inc Provides a form for adding to BASE_relationship and relationship tables
chado_cleanup_orphaned_nodes legacy/tripal_core/api/tripal_core.chado_nodes.api.inc This function is a wrapper for the chado_cleanup_orphaned_nodes function. It breaks up the work of chado_cleanup_orphaned_nodes into smaller pieces that are more managable for servers that may have low php memory settings.
chado_cleanup_orphaned_nodes_part legacy/tripal_core/api/tripal_core.chado_nodes.api.inc This function will delete Drupal nodes for any sync'ed table (e.g. feature, organism, analysis, stock, library) if the chado record has been deleted or the entry in the chado_[table] table has been removed.
chado_get_id_from_nid legacy/tripal_core/api/tripal_core.chado_nodes.api.inc Get chado id for a node. E.g, if you want to get 'analysis_id' from the 'analysis' table for a synced 'chado_analysis' node, (the same for organisms and features): $analysis_id = chado_get_id_from_nid…
chado_get_nid_from_id legacy/tripal_core/api/tripal_core.chado_nodes.api.inc Get node id for a chado feature/organism/analysis. E.g, if you want to get the node id for an analysis, use: $nid = chado_get_nid_from_id ('analysis', $analysis_id) Likewise, $nid = chado_get_nid_from_id ('organism',…
chado_get_node_title legacy/tripal_core/api/tripal_core.chado_nodes.title_and_path.inc Get the title of a node based on the Title Format set in the admin section of the module. If the format has not yet been set than the the unique constrain and name fields will be used to generate a default format
chado_get_node_url legacy/tripal_core/api/tripal_core.chado_nodes.title_and_path.inc Get the url of a node based on the url Format set in the admin section of the module. If the format has not yet been set than the the unique constrain and name fields will be used to generate a default format
chado_get_token_value legacy/tripal_core/api/tripal_core.chado_nodes.title_and_path.inc Retrieve the value of the token from the node based on the $token_info['location']
chado_node_add_token_format legacy/tripal_core/api/tripal_core.chado_nodes.title_and_path.inc Save a format to be used by chado_get_node_title() or chado_get_node_url()
chado_node_generate_tokens legacy/tripal_core/api/tripal_core.chado_nodes.title_and_path.inc Generate tokens for a particular base table
chado_node_get_base_table legacy/tripal_core/api/tripal_core.chado_nodes.api.inc Determine the chado base table for a given content type
chado_node_get_legacy_title_default legacy/tripal_core/api/tripal_core.chado_nodes.title_and_path.inc Handles legacy title options
chado_node_get_legacy_url_default legacy/tripal_core/api/tripal_core.chado_nodes.title_and_path.inc Handles legacy URL options
chado_node_get_title_format legacy/tripal_core/api/tripal_core.chado_nodes.title_and_path.inc Get the title format for a specific content type
chado_node_get_token_format legacy/tripal_core/api/tripal_core.chado_nodes.title_and_path.inc Get the format for the given application of a given content type (ie: the feature title)
chado_node_get_unique_constraint_format legacy/tripal_core/api/tripal_core.chado_nodes.title_and_path.inc Generate the unique constraint for a given base table using the Chado Schema API definition
chado_node_get_url_format legacy/tripal_core/api/tripal_core.chado_nodes.title_and_path.inc Get the url format for a specific content type
chado_node_sync_form legacy/tripal_core/api/tripal_core.chado_nodes.api.inc Generic Sync Form to aid in sync'ing (create drupal nodes linking to chado content) any chado node type.
chado_node_sync_records legacy/tripal_core/api/tripal_core.chado_nodes.api.inc Generic function for syncing records in Chado with Drupal nodes.
chado_retrieve_node_form_dbxrefs legacy/tripal_core/api/tripal_core.chado_nodes.dbxrefs.api.inc This function is used in a hook_insert, hook_update for a node form when the additional_dbxrefs form has been added to the form. It retrieves all of the dbxrefs and returns them in an array of the format:
chado_retrieve_node_form_properties legacy/tripal_core/api/tripal_core.chado_nodes.properties.api.inc This function is used in a hook_insert, hook_update for a node form when the chado node properties form has been added to the form. It retrieves all of the properties and returns them in an array of the format:
chado_retrieve_node_form_relationships legacy/tripal_core/api/tripal_core.chado_nodes.relationships.api.inc This function is used in a hook_insert, hook_update for a node form when the relationships form has been added to the form. It retrieves all of the relationships and returns them in an array of the format:
chado_set_node_url legacy/tripal_core/api/tripal_core.chado_nodes.title_and_path.inc Set the URL for a given node.
chado_update_existing_node_urls legacy/tripal_core/api/tripal_core.chado_nodes.title_and_path.inc Tripal Job for updating all node URLs for a particular node type.
chado_update_node_form_dbxrefs legacy/tripal_core/api/tripal_core.chado_nodes.dbxrefs.api.inc This function is used in hook_insert or hook_update and handles inserting of any new dbxrefs and creation of links between those dbxrefs and node content
chado_update_node_form_properties legacy/tripal_core/api/tripal_core.chado_nodes.properties.api.inc This function is used in hook_insert or hook_update and handles inserting of any new properties
chado_update_node_form_relationships legacy/tripal_core/api/tripal_core.chado_nodes.relationships.api.inc This function is used in hook_insert or hook_update and handles inserting of relationships between the current nodetype and other memebers of the same nodetype
hook_chado_node_sync_create_new_node legacy/tripal_core/api/tripal_core.chado_nodes.api.inc Create New Node
hook_chado_node_sync_form legacy/tripal_core/api/tripal_core.chado_nodes.api.inc Alter the Chado node sync form.
hook_chado_node_sync_form_submit legacy/tripal_core/api/tripal_core.chado_nodes.api.inc Bypass chado node api sync form submit.
hook_chado_node_sync_select_query legacy/tripal_core/api/tripal_core.chado_nodes.api.inc Alter the query that retrieves records to be sync'd (optional)

Files

Namesort descending Location Description
tripal_core.chado_nodes.dbxrefs.api.inc legacy/tripal_core/api/tripal_core.chado_nodes.dbxrefs.api.inc API to manage the Chado dbxref table for various Tripal Node Types
tripal_core.chado_nodes.properties.api.inc legacy/tripal_core/api/tripal_core.chado_nodes.properties.api.inc API to manage the chado prop table for various Tripal Node Types
tripal_core.chado_nodes.relationships.api.inc legacy/tripal_core/api/tripal_core.chado_nodes.relationships.api.inc API to manage the chado _relationship table for various Tripal Node Types