Browse Source

Tripal: Removed Old Bulk Loader (Stephen) from core module

laceysanderson 14 years ago
parent
commit
ade56a6971

+ 12 - 5
tripal_analysis/tripal_analysis.admin.inc

@@ -136,6 +136,8 @@ function tripal_analysis_module_description_page() {
  * We have defined a hook_get_settings() function. When a sub-module
  * is enabled, we'll look for this function to provide a form for the
  * administrative setting.
+ *
+ * @ingroup tripal_analysis
  */
 function tripal_analysis_admin() {
 	// Create a new administrative form. We'll add main functions to the form
@@ -200,8 +202,9 @@ function tripal_analysis_admin() {
 	return system_settings_form($form);
 }
 
-/************************************************************************
+/**
  *
+ * @ingroup tripal_analysis
  */
 function get_tripal_analysis_admin_form_taxonomy_set(&$form) {
 	$form['taxonify'] = array(
@@ -245,8 +248,9 @@ function get_tripal_analysis_admin_form_taxonomy_set(&$form) {
       '#weight'      => 3
 	);
 }
-/************************************************************************
+/** 
  *
+ * @ingroup tripal_analysis
  */
 function get_tripal_analysis_admin_form_reindex_set(&$form) {
 	// define the fieldsets
@@ -288,8 +292,9 @@ function get_tripal_analysis_admin_form_reindex_set(&$form) {
       '#weight' => 3,
 	);
 }
-/************************************************************************
+/** 
  *
+ * @ingroup tripal_analysis
  */
 function get_tripal_analysis_admin_form_cleanup_set(&$form) {
 	$form['cleanup'] = array(
@@ -311,8 +316,9 @@ function get_tripal_analysis_admin_form_cleanup_set(&$form) {
       '#weight' => 2,
 	);
 }
-/************************************************************************
+/** 
  *
+ * @ingroup tripal_analysis
  */
 function get_tripal_analysis_admin_form_sync_set (&$form) {
 	// define the fieldsets
@@ -388,8 +394,9 @@ function get_tripal_analysis_admin_form_sync_set (&$form) {
 		);
 	}
 }
-/************************************************************************
+/**
  *
+ * @ingroup tripal_analysis
  */
 function tripal_analysis_admin_validate($form, &$form_state) {
 	global $user;  // we need access to the user info

+ 20 - 5
tripal_analysis/tripal_analysis.api.inc

@@ -1,5 +1,10 @@
 <?php
 
+/**
+ * @defgroup tripal_analysis_api Analysis Module API
+ * @ingroup tripal_analysis
+ * @ingroup tripal_api
+ */
 /****************************************************************************
  * @section Chado Table Descriptions
  ****************************************************************************/
@@ -11,7 +16,7 @@
  * @return
  *    Array describing the analysis table
  *
- * @ingroup tripal_analysis
+ * @ingroup tripal_analysis_api
  */
 function tripal_analysis_chado_analysis_schema() {
   $description = array();
@@ -36,6 +41,8 @@ function tripal_analysis_chado_analysis_schema() {
  *
  * @return
  *    Array describing the analysisfeature table
+ *
+ * @ingroup tripal_analysis_api
  */
 function tripal_analysis_chado_analysisfeature_schema() {
   $description = array();
@@ -64,6 +71,8 @@ function tripal_analysis_chado_analysisfeature_schema() {
  *
  * @return
  *    Array describing the analysisfeatureprop table
+ *
+ * @ingroup tripal_analysis_api
  */
 function tripal_analysis_chado_analysisfeatureprop_schema() {
   $description = array();
@@ -92,6 +101,8 @@ function tripal_analysis_chado_analysisfeatureprop_schema() {
  *
  * @return
  *    Array describing the analysisprop table
+ *
+ * @ingroup tripal_analysis_api
  */
 function tripal_analysis_chado_analysisprop_schema() {
   $description = array();
@@ -114,28 +125,32 @@ function tripal_analysis_chado_analysisprop_schema() {
 }
 /**
 *
-* @ingroup tripal_api
+ *
+ * @ingroup tripal_analysis_api
 */
 function tripal_analysis_get_property($analysis_id,$property){
    return tripal_core_get_property('analysis',$analysis_id,$property,'tripal');
 }
 /**
 *
-* @ingroup tripal_api
+ *
+ * @ingroup tripal_analysis_api
 */
 function tripal_analysis_insert_property($analysis_id,$property,$value,$update_if_present = 0){
     return tripal_core_insert_property('analysis',$analysis_id,$property,'tripal',$value,$update_if_present);
 }
 /**
 *
-* @ingroup tripal_api
+ *
+ * @ingroup tripal_analysis_api
 */
 function tripal_analysis_update_property($analysis_id,$property,$value,$insert_if_missing = 0){
    return tripal_core_update_property('analysis',$analysis_id,$property,'tripal',$value, $insert_if_missing);
 }
 /**
 *
-* @ingroup tripal_api
+ *
+ * @ingroup tripal_analysis_api
 */
 function tripal_analysis_delete_property($analysis_id,$property){
    return tripal_core_delete_property('analysis',$analysis_id,$property,'tripal');

+ 38 - 40
tripal_analysis/tripal_analysis.module

@@ -11,14 +11,15 @@
  * @{
  * Provides functions for managing chado analysis' including creating details pages for each one
  * @}
+ * @ingroup tripal_modules
  */
 
 require('tripal_analysis.api.inc');
 
 
 
-/*************************************************************************
-*
+/**
+ *
  *
  * @ingroup tripal_analysis
  */
@@ -26,8 +27,8 @@ function tripal_analysis_register_child($modulename){
    $sql = "INSERT INTO {tripal_analysis} (modulename) VALUES ('%s')";
    db_query($sql, $modulename);
 }
-/*************************************************************************
-*
+/**
+ *
  *
  * @ingroup tripal_analysis
  */
@@ -37,14 +38,16 @@ function tripal_analysis_unregister_child($modulename){
       db_query($sql, $modulename);
    }
 }
-/******************************************************************************
+
+/**
  *
  * @ingroup tripal_analysis
  */
 function tripal_analysis_init(){
    drupal_add_js(drupal_get_path('theme', 'tripal').'/js/tripal_analysis.js');
 }
-/*******************************************************************************
+
+/**
  * tripal_analysis_menu()
  * HOOK: Implementation of hook_menu()
  * Entry points and paths of the module
@@ -89,7 +92,7 @@ function tripal_analysis_menu() {
 	return $items;
 }
 
-/*******************************************************************************
+/** 
  * Display the summary view of analyses when click on the 'Analyses'
  * primary-link
  *
@@ -108,7 +111,7 @@ function tripal_analysis_show_analyses (){
 
 }
 
-/*******************************************************************************
+/** 
  *  Provide information to drupal about the node types that we're creating
  *  in this module
  *
@@ -128,7 +131,7 @@ function tripal_analysis_node_info() {
 	);
 	return $nodes;
 }
-/*******************************************************************************
+/** 
  *  When a new chado_analysis node is created we also need to add information
  *  to our chado_analysis table.  This function is called on insert of a new
  *  node of type 'chado_analysis' and inserts the necessary information.
@@ -206,7 +209,7 @@ function chado_analysis_insert($node){
    $node->analysis = $analysis;
    $node->analysis_id = $analysis_id; // we need to set this for children
 }
-/*******************************************************************************
+/** 
  *
  * @ingroup tripal_analysis
  */
@@ -239,7 +242,7 @@ function chado_analysis_delete($node){
 	tripal_db_set_active($previous_db);
 }
 
-/*******************************************************************************
+/**
  * Update analyses
  *
  * @ingroup tripal_analysis
@@ -297,7 +300,7 @@ function chado_analysis_update($node){
 	}
 }
 
-/*******************************************************************************
+/**
  *  When editing or creating a new node of type 'chado_analysis' we need
  *  a form.  This function creates the form that will be used for this.
  *
@@ -451,7 +454,7 @@ function chado_analysis_form ($node){
 	return $form;
 }
 
-/*******************************************************************************
+/**
  *  When a node is requested by the user this function is called to allow us
  *  to add auxiliary data to the node object.
  *
@@ -469,7 +472,7 @@ function chado_analysis_load($node){
    return $additions;
 }
 
-/*******************************************************************************
+/**
  *  This function customizes the view of the chado_analysis node.  It allows
  *  us to generate the markup.
  *
@@ -493,7 +496,7 @@ function chado_analysis_view ($node, $teaser = FALSE, $page = FALSE) {
 	return $node;
 }
 
-/*******************************************************************************
+/**
  * Synchronize analyses from chado to drupal
  *
  * @ingroup tripal_analysis
@@ -605,7 +608,7 @@ function tripal_analysis_sync_analyses ($analysis_id = NULL, $job_id = NULL){
                 print_r($errors);
             }
             else{
-			##if(!form_get_errors()){
+			// if(!form_get_errors()){
 				$node = node_submit($new_node);
 				node_save($node);
 
@@ -619,16 +622,19 @@ function tripal_analysis_sync_analyses ($analysis_id = NULL, $job_id = NULL){
 	}
 	return $page_content;
 }
+
 /**
-*
-*/
+ *
+ * @ingroup tripal_analysis
+ */
 function chado_analysis_validate($node,&$form){
    // use the analysis parent to validate the node
    tripal_analysis_validate($node, $form); 
 }
 /**
-*
-*/
+ *
+ *@ingroup tripal_analysis
+ */
 function tripal_analysis_validate($node, &$form){
 ##dprint_r($node);
 
@@ -679,7 +685,7 @@ function tripal_analysis_validate($node, &$form){
         }
     }
 }
-/*******************************************************************************
+/**
  * Display help and module information
  * @param path which path of the site we're displaying help
  * @param arg array that holds the current path as would be returned from arg()
@@ -699,7 +705,7 @@ function tripal_analysis_help($path, $arg) {
 	}
 	return $output;
 }
-/*******************************************************************************
+/**
  *  The following function proves access control for users trying to
  *  perform actions on data managed by this module
  *
@@ -728,7 +734,7 @@ function chado_analysis_access($op, $node, $account){
 	return FALSE;
 }
 
-/*******************************************************************************
+/**
  *  Set the permission types that the chado module uses.  Essentially we
  *  want permissionis that protect creation, editing and deleting of chado
  #  data objects
@@ -744,7 +750,7 @@ function tripal_analysis_perm(){
 	);
 }
 
-/*******************************************************************************
+/**
  *  We need to let drupal know about our theme functions and their arguments.
  *  We create theme functions to allow users of the module to customize the
  *  look and feel of the output generated in this module
@@ -759,7 +765,7 @@ function tripal_analysis_theme () {
 	);
 }
 
-/*******************************************************************************
+/**
  * This function uses analysis_id's of all drupal analysis nodes as input and
  * pull the analysis information (name, description, program, programversion,
  * algorithm, sourcename, sourceversion, sourceuri, timeexecuted) from
@@ -801,7 +807,7 @@ function get_chado_analyses() {
 		return $analyses;
 	}
 }
-/************************************************************************
+/**
  *
  *
  * @ingroup tripal_analysis
@@ -856,7 +862,7 @@ function theme_tripal_analysis_analysis_page($analyses) {
 	return $output;
 }
 
-/************************************************************************
+/**
  *
  *
  * @ingroup tripal_analysis
@@ -916,12 +922,8 @@ function tripal_analyses_cleanup($dummy = NULL, $job_id = NULL) {
 	}
 	return '';
 }
-/*******************************************************************************
- *
- *
- * @ingroup tripal_analysis
- */
-/*
+ 
+/**
 function tripal_analysis_reindex_features ($analysis_id = NULL, $job_id = NULL){
 	$i = 0;
 
@@ -963,12 +965,8 @@ function tripal_analysis_reindex_features ($analysis_id = NULL, $job_id = NULL){
 		$i++;
 	}
 } */
-/*******************************************************************************
- *
- *
- * @ingroup tripal_analysis
- */
-/*
+ 
+/**
 function tripal_analysis_taxonify_features ($analysis_id = NULL, $job_id = NULL){
 	$i = 0;
 
@@ -1021,7 +1019,7 @@ function tripal_analysis_taxonify_features ($analysis_id = NULL, $job_id = NULL)
 	}
 }
 */
-/*************************************************************************
+/**
  * Implements hook_views_api()
  * Purpose: Essentially this hook tells drupal that there is views support for
  *  for this module which then includes tripal_analysis.views.inc where all the

+ 0 - 491
tripal_core/bulk_loader.php

@@ -1,491 +0,0 @@
-<?php
-
-/*************************************************************************
-*
-*/
-function tripal_core_bulk_loader_create (){
-  
-   return drupal_get_form('tripal_core_bulk_loader_create_form');
-}
-/*************************************************************************
-*
-*/
-function tripal_core_bulk_loader_create_form (&$form_state = NULL){
-   $form = array();  
-
-   // get the step used by this multistep form
-   $step = 1;
-   if(isset($form_state['storage'])){
-      $step = (int)$form_state['storage']['step'];
-   }  
-
-   $form = array();
-   if($step == 1){
-      tripal_core_bulk_loader_create_form_step1 ($form,$form_state);
-      $form_state['storage']['step'] = $step + 1;
-   }
-   if($step == 2){
-      tripal_core_bulk_loader_create_form_step2 ($form,$form_state);
-   }
-
-   return $form;
-}
-/*************************************************************************
-*
-*/
-function tripal_core_bulk_loader_create_form_validate ($form,&$form_state) {
-
-
-}
-/*************************************************************************
-*
-*/
-function tripal_core_bulk_loader_create_form_submit ($form,&$form_state) {
-   if($form_State['storage']['step'] < 4){
-      return;
-   }
-}
-
-/*************************************************************************
-*
-*/
-function tripal_core_bulk_loader_create_form_step2 (&$form,$form_state){
-
-   if(isset($form_state['values']['columns'])){
-      $form_state['storage']['columns'] = $form_state['values']['columns'];
-   }
-
-   $form['bulk_loader'] = array(
-      '#type' => 'fieldset',
-      '#title' => t('Step 2: Define the columns of the file'),
-   );
-
-   $columns = $form_state['storage']['columns'];
-//   $form['debug']= array(
-//      '#value' => "Columns: $columns",
-//      '#weight'        => -1
-//   );
-
-	$fields = array();
-   $fields[''] = '';
-/*
-   $form_fields = array(
-      'Feature details' => array (          
-         'name' => array(
-            'description' => 'Feature Name (human readable)',
-            'table' => array(
-               'table name' => 'feature',
-               'fields' => array('name'),
-            ),
-         ),               
-         'uniquename' => array(
-            'description' => 'Unique Name (must be unique for this organism and feature type)',
-            'table' => array(
-               'table name' => 'feature',
-               'fields' => array('uniquename'),
-            ),
-         ), 
-         'type_id' => array(
-            'description' => 'Feature type (must be a valid SO term',
-            'table' => array(
-               'table name' => 'feature',
-               'fields' => array('uniquename'),
-            ),
-         ), 
-         'residues' => array(
-            'description' => 'Residues',
-            'table' => array(
-               'table name' => 'feature',
-               'fields' => array('residues'),
-            ),
-         ), 
-      ),     
-      'Organism specification' => array (           
-         'organism_id' => array(
-            'description' => 'Organism ID number',
-            'table' => array(
-               'table name' => 'organism',
-               'fields' => array('organism_id'),
-            ),
-         ), 
-         'genus' => array(
-            'description' => 'Genus',
-            'table' => array(
-               'table name' => 'organism',
-               'fields' => array('genus'),
-            ),
-            'valid values' => 'this'
-         ), 
-         'species' => array(
-            'description' => 'Species',
-            'table' => array(
-               'table name' => 'organism',
-               'fields' => array('species'),
-            ),
-         ), 
-         'full_name' => array(
-            'description' => 'Scientific Name (genus + species)',
-            'table' => array(
-               'table name' => 'organism',
-               'fields' => array('genus','species'),
-               'parser' => '/^(.*?)\s+(.*?)$/',
-            ),
-         ), 
-         'common_name' => array(
-            'description' => 'Common Name',
-            'table' => array(
-               'table name' => 'organism',
-               'fields' => array('common_name'),
-            ),
-         ), 
-      ),
-1.  allow the user to specify the term from a specific vocabulary
-2.  allow the user to specify the vocabulary to choose from
-3.  
-      'Feature Property' => array (
-         'property' => array(
-            'description' => 'Feature property value',
-            'table' => array(
-               'table name' => 'featureprop',
-               'fields' => array('value'),
-               'check' => array(
-                  'type_id' => {
-                ),
-            ).
-         ), 
-      ),
-   );
-
-*/
-   // these fields correspond with the columns of the feature table and
-   // the foreign key contraints for the feature table.
-   $fields = array(
-        '' => '',
-        'ignore' => 'Ignore this column',
-        'Feature details' => array (
-           'name' => 'Feature Name (human readable)',
-           'uniquename' => 'Unique Feature Name',
-           'type' => 'Feature type (must be a valid SO term)',
-           'alt_type' => 'Additional ontology term',
-           'residues' => 'Residues',
-         ),
-        'Organism specification' => array (
-           'organism_id' => 'Organism ID number',
-           'genus' => 'Genus',
-           'species' => 'Species',
-           'full_name' => 'Scientific Name (genus + species)',
-           'common_name' => 'Common Name',
-         ),
-        'External Database Cross-Reference' => array(
-           'db_id' => 'Database ID number',
-           'db_name' => 'Database name (must exists in the database)',
-           'accession' => 'Accession',
-         ),
-        'Feature Relationship' => array (
-            'rel_type' => 'Relationship Type (must be a valid relationship term)',
-            'parent' => 'Parent unique name',
-            'parent type' => 'Parent Type (must be a valid SO term)',
-         ),
-        'Feature Location' => array (
-           'srcfeature' => 'Reference feature (must already exist in the database)',
-           'srcfeature_type' => 'Reference feature type (must be a valid SO term)',
-           'fmin' => 'Start position',
-           'fmax' => 'Stop position',
-           'strand' => 'Strand (valid values: 0,-1,+1)',
-           'phase' => 'Phase (valid values: (+,-,.)',
-         ),
-         'Feature Property' => array (
-            'property' => 'Feature property value',
-         ),
-         'Feature Synonym' => array (
-            'syn_name' => 'Synonym name',
-         ),
-         'Library specification' => array (
-            'library_id' => 'Library ID number',
-            'library_name' => 'Library name',
-         ),
-         'Analysis specification' => array (
-            'analysis_id' => 'Analysis ID number',
-            'analysis_source' => 'Analysis identifying name (sourcename column in Chado)',
-            'analysis_desc' => 'Analysis description',
-            'analysis_program' => 'Analysis program',
-            'analysis_program_version' => 'Analysis program version'
-         ),
-   );
-
-   // organism foreign key identifies.  These are used to find the organism
-   // for which the feature belongs.
-   $form['columns'] = array(
-      '#type' => 'hidden',
-      '#value' => $columns,
-   );
-
-
-   // get the list of organisms
-   $sql = "SELECT * FROM {organism} ORDER BY genus, species";
-   $previous_db = tripal_db_set_active('chado');  // use chado database
-   $org_rset = db_query($sql);
-   tripal_db_set_active($previous_db);  // now use drupal database
-   $organisms = array();
-   $genus = array();
-   $species = array();
-   $common_names = array();
-   $genera[''] = '';
-   $species[''] = '';
-   $common_names[''] = '';
-   $full_names[''] = '';
-   while($organism = db_fetch_object($org_rset)){
-      $full_names["$organism->genus $organism->species"] = "$organism->genus $organism->species";
-      $genera[$organism->genus] = "$organism->genus";
-      $species[$organism->species] = "$organism->species";
-      $common_names[$organism->common_name] = "$organism->common_name";
-   }
-
-   for($i = 1; $i <= $columns; $i++){
-      $form['bulk_loader']["col_$i"] = array(
-         '#type' => 'fieldset',
-         '#title' => t("Column $i of the input file"),
-      );
-      $form['bulk_loader']["col_$i"]["col_type_$i"] = array(
-       '#title'         => t('Field Selection'),
-       '#type'          => 'select',
-       '#options'       => $fields,
-       '#weight'        => 0,
-        // this field will use AJAX to populate and information needed
-        // for specific types, such as for feature properties.  It
-        // calls the step2_get_type URL and passes the column ($i).  
-        // the return value is additional form items or text
-       '#ahah'          => array(
-          'event' => 'change',
-          'wrapper' => "type_cols_$i",
-          'path' => "/admin/tripal/bulk_load/step2_get_type/$i",
-          'effect' => 'fade',
-          'method' => 'replace'
-        ),
- 	   );
-
-     // these next fields are hidden (access = false) and will be shown
-     // if the user selects the feature property type in the drop down
-     // above.  
-
-
-     //-------------------------------------------------------------------------
-     // default text box for allowed values
-     $form['bulk_loader']["col_$i"]["col_prop_valid_$i"] = array(
-       '#title'         => t('Allowed Values'),
-       '#type'          => 'textarea',
-       '#weight'        => 0,
-       '#description'   => 'Please provide a list of allowed values for this field. Separate these values with a space. Leave blank to allow any value',
-       '#access'        => FALSE
-     );
-
-     //-------------------------------------------------------------------------
-     // Organism allowed values
-     $form['bulk_loader']["col_$i"]["col_prop_genera_$i"] = array (
-        '#title'       => t('Allowed Values'),
-        '#type'        => t('select'),
-        '#description' => t("Choose all allowed genera values for this column (ctrl+click to select multiple values). Select none to allow all"),
-        '#required'    => FALSE,
-        '#options'     => $genera,
-        '#weight'      => 2,
-        '#multiple'    => TRUE,
-        '#size'        => 10,
-        '#access'        => FALSE
-      );
-     $form['bulk_loader']["col_$i"]["col_prop_species_$i"] = array (
-        '#title'       => t('Allowed Values'),
-        '#type'        => t('select'),
-        '#description' => t("Choose all allowed species values for this column (ctrl+click to select multiple values). Select none to allow all"),
-        '#required'    => FALSE,
-        '#options'     => $species,
-        '#weight'      => 2,
-        '#multiple'    => TRUE,
-        '#size'        => 10,
-        '#access'        => FALSE
-      );
-     $form['bulk_loader']["col_$i"]["col_prop_common_name_$i"] = array (
-        '#title'       => t('Allowed Values'),
-        '#type'        => t('select'),
-        '#description' => t("Choose all allowed values for this column (ctrl+click to select multiple values). Select none to allow all"),
-        '#required'    => FALSE,
-        '#options'     => $common_names,
-        '#weight'      => 2,
-        '#multiple'    => TRUE,
-        '#size'        => 10,
-        '#access'        => FALSE
-      );
-     $form['bulk_loader']["col_$i"]["col_prop_full_name_$i"] = array (
-        '#title'       => t('Allowed Values'),
-        '#type'        => t('select'),
-        '#description' => t("Choose all allowed values for this column (shift+click to select multiple values). Select none to allow all"),
-        '#required'    => FALSE,
-        '#options'     => $full_names,
-        '#weight'      => 2,
-        '#multiple'    => TRUE,
-        '#size'        => 10,
-        '#access'        => FALSE
-      );
-
-
-     //-------------------------------------------------------------------------
-     // feature property fields
-     $form['bulk_loader']["col_$i"]["col_prop_name_$i"] = array(
-       '#title'         => t('Property Name'),
-       '#type'          => 'textfield',
-       '#weight'        => 1,
-       '#description'   => 'Please provide a name for this property.  It should be a single 
-                            word with only alphanumeric characters and underscores.  If this 
-                            name exists as a CV term in Chado already it will be reused, otherwise
-                            a new CV term with this name will be added.',
-       '#required'      => TRUE,
-       '#access'        => FALSE
-     );
-     $form['bulk_loader']["col_$i"]["col_prop_full_name_$i"] = array(
-       '#title'         => t('Property Full Name'),
-       '#type'          => 'textfield',
-       '#weight'        => 3,
-       '#description'   => 'Please provide a human readable name for this property.  This will be used when
-                            displaying the property title',
-       '#access'        => FALSE
-     );
-     $form['bulk_loader']["col_$i"]["col_prop_desc_$i"] = array(
-       '#title'         => t('Property Description'),
-       '#type'          => 'textarea',
-       '#weight'        => 4,
-       '#description'   => 'Please provide a description of this property.',
-       '#access'        => FALSE
-     );
-
-     // this is an empty div box that gets put on the form.  This is the
-     // box where the hidden form elements will be rendered when the
-     // AJAX call returns
-     $form['bulk_loader']["col_$i"]["type_wrap_$i"] = array(        
-            '#prefix' => "<div class=\"clear-block\" id=\"type_cols_$i\">",
-            '#value' => ' ',             
-            '#suffix' => '</div>',
-        );
-   }
-
-   
-   $form['submit'] = array (
-     '#type'         => 'submit',
-     '#value'        => t('Next'),
-     '#weight'       => 5,
-     '#executes_submit_callback' => TRUE,
-   );   
-}
-/*************************************************************************
-*
-*/
-
-function tripal_core_bulk_loader_ahah_step2_feature_type($column){
-
-
-  // create a form_state array to hold the form variables
-  $form_state = array('storage' => NULL, 'submitted' => FALSE);
-  $form_state['storage']['step'] = 2;
-  
-  // retreive the form from the cache
-  $form_build_id = $_POST['form_build_id'];
-  $form = form_get_cache($form_build_id, $form_state);
-
-  // get the form name
-  $args = $form['#parameters'];
-  $form_id = array_shift($args); 
-
-  // add the post variables to the form and set a few other items
-  $form['#post'] = $_POST;
-  $form['#redirect'] = FALSE;
-  $form['#programmed'] = FALSE;
-  $form_state['post'] = $_POST;
-
-  drupal_process_form($form_id, $form, $form_state);
-  $form = drupal_rebuild_form($form_id, $form_state, $args, $form_build_id);
-
-  // get the column
-  $i = $column;
-
-  // check to see what type of field has been selected and provide the
-  // additional fields as appropriate
-  $type = $form_state["post"]["col_type_$i"];
-  if(strcmp($type,'genus')==0){
-     $propform['bulk_loader']["col_$i"]["col_prop_genera_$i"] = $form['bulk_loader']["col_$i"]["col_prop_genera_$i"];
-     $propform['bulk_loader']["col_$i"]["col_prop_genera_$i"]['#access'] = TRUE;
-
-  }
-  elseif(strcmp($type,'species')==0){
-     $propform['bulk_loader']["col_$i"]["col_prop_species_$i"] = $form['bulk_loader']["col_$i"]["col_prop_species_$i"];
-     $propform['bulk_loader']["col_$i"]["col_prop_species_$i"]['#access'] = TRUE;
-
-  }
-  elseif(strcmp($type,'common_name')==0){
-     $propform['bulk_loader']["col_$i"]["col_prop_common_name_$i"] = $form['bulk_loader']["col_$i"]["col_prop_common_name_$i"];
-     $propform['bulk_loader']["col_$i"]["col_prop_common_name_$i"]['#access'] = TRUE;
-
-  }
-  elseif(strcmp($type,'full_name')==0){
-     $propform['bulk_loader']["col_$i"]["col_prop_full_name_$i"] = $form['bulk_loader']["col_$i"]["col_prop_full_name_$i"];
-     $propform['bulk_loader']["col_$i"]["col_prop_full_name_$i"]['#access'] = TRUE;
-
-  }
-  elseif(strcmp($type,'property')==0){
-     // we just want to render the property fields that were previously not visible
-     $propform['bulk_loader']["col_$i"]["col_prop_name_$i"] = $form['bulk_loader']["col_$i"]["col_prop_name_$i"];
-     $propform['bulk_loader']["col_$i"]["col_prop_full_name_$i"] = $form['bulk_loader']["col_$i"]["col_prop_full_name_$i"];
-     $propform['bulk_loader']["col_$i"]["col_prop_desc_$i"] = $form['bulk_loader']["col_$i"]["col_prop_desc_$i"];
-     $propform['bulk_loader']["col_$i"]["col_prop_name_$i"]['#access'] = TRUE;
-     $propform['bulk_loader']["col_$i"]["col_prop_full_name_$i"]['#access'] = TRUE;
-     $propform['bulk_loader']["col_$i"]["col_prop_desc_$i"]['#access'] = TRUE;
-  } 
-  else {
-     // use a default valid values textbox if we have no special needs for the type
-     $propform['bulk_loader']["col_$i"]["col_prop_valid_$i"] = $form['bulk_loader']["col_$i"]["col_prop_valid_$i"];
-     $propform['bulk_loader']["col_$i"]["col_prop_valid_$i"]['#access'] = TRUE;
-  }
-
-  $output = theme('status_messages') . drupal_render($propform);
-
-  // Final rendering callback.
-  drupal_json(array('status' => TRUE, 'data' => $output));
-}
-/*************************************************************************
-*
-*/
-function tripal_core_bulk_loader_create_form_step1 (&$form,$form_state){
-	$modules = array();
-   $modules['feature'] = 'Feature';
-   $modules['organism'] = 'Organism';
-   $modules['library'] = 'Library';
-   $modules['analysis'] = 'Analysis';
-
-
-   // set the fieldset title to indicate the step
-   $form['bulk_loader'] = array(
-      '#type' => 'fieldset',
-      '#title' => t('Step 1: Select the Chado module'),
-   );
-
-	$form['bulk_loader']['chado_module'] = array(
-      '#title'         => t('Chado Module'),
-      '#description'   => t('Please select the module for which you would like to create an importer'),
-      '#type'          => 'select',
-      '#options'       => $modules,
-      '#weight'        => 0,
-      '#required'      => TRUE
-	);
-
-   $form['bulk_loader']['columns']= array(
-      '#type'          => 'textfield',
-      '#title'         => t('Number of Columns'),
-      '#description'   => t('Please specify the number of columns in the input file.'),
-      '#weight'        => 2,
-      '#required'      => TRUE
-   );
-
-   $form['submit'] = array (
-     '#type'         => 'submit',
-     '#value'        => t('Next'),
-     '#weight'       => 5,
-     '#executes_submit_callback' => TRUE,
-   );   
-}

+ 140 - 45
tripal_core/jobs.php

@@ -1,11 +1,35 @@
 <?php
 
+/** 
+ * @defgroup tripal_jobs_api Tripal Jobs API
+ * @{
+ * Provides an application programming interface (API) to interact with the Tripal Jobs
+ * @}
+ * @ingroup tripal_api
+ */
+ 
 /**
-*
-*
-* @ingroup tripal_core
-* @ingroup tripal_api
-*/
+ * Adds a job to the Tripal Jbo queue
+ *
+ * @param $job_name
+ *    The human readable name for the job
+ * @param $modulename
+ *    The name of the module adding the job
+ * @param $callback
+ *    The name of a function to be called when the job is executed
+ * @param $arguments
+ *    An array of arguements to be passed on to the callback
+ * @param $uid
+ *    The uid of the user adding the job
+ * @param $priority
+ *    The priority at which to run the job where the highest priority is 10 and the lowest priority 
+ *    is 1. The default priority is 10.
+ *
+ * @return
+ *    The job_id of the registered job
+ *
+ * @ingroup tripal_jobs_api
+ */
 function tripal_add_job ($job_name,$modulename,$callback,$arguments,$uid,$priority = 10){
 
    # convert the arguments into a string for storage in the database
@@ -31,12 +55,20 @@ function tripal_add_job ($job_name,$modulename,$callback,$arguments,$uid,$priori
 
    return $record->job_id;
 }
+
 /**
-*   
-*
-* @ingroup tripal_core
-* @ingroup tripal_api
-*/
+ * An internal function for setting the progress for a current job
+ *
+ * @param $job_id
+ *   The job_id to set the progress for
+ * @param $percentage
+ *   The progress to set the job to
+ *
+ * @return
+ *   True on success and False otherwise
+ *
+ * @ingroup tripal_core
+ */
 function tripal_job_set_progress($job_id,$percentage){
 
    if(preg_match("/^(\d\d|100)$/",$percentage)){
@@ -49,11 +81,18 @@ function tripal_job_set_progress($job_id,$percentage){
    }
    return 0;
 }
+
 /**
-*   Returns a list of jobs associated with the given module
-*
-* @ingroup tripal_core
-*/
+ * Returns a list of jobs associated with the given module
+ *
+ * @param $modulename
+ *    The module to return a list of jobs for
+ *
+ * @return
+ *    An array of objects where each object describes a tripal job
+ *
+ * @ingroup tripal_jobs_api
+ */
 function tripal_get_module_active_jobs ($modulename){
    $sql =  "SELECT * FROM {tripal_jobs} TJ ".
            "WHERE TJ.end_time IS NULL and TJ.modulename = '%s' ";
@@ -61,10 +100,13 @@ function tripal_get_module_active_jobs ($modulename){
 
 }
 /**
-*
-*
-* @ingroup tripal_core
-*/
+ * Returns the Tripal Job Report
+ *
+ * @return
+ *   The HTML to be rendered which describes the job report
+ *
+ * @ingroup tripal_core
+ */
 function tripal_jobs_report () {
    //$jobs = db_query("SELECT * FROM {tripal_jobs} ORDER BY job_id DESC");
    $jobs = pager_query(
@@ -125,9 +167,18 @@ function tripal_jobs_report () {
 	$output .= theme_pager();
    return $output;
 }
+
 /**
-*
-*/
+ * Returns the start time for a given job
+ * 
+ * @param $job
+ *   An object describing the job
+ *
+ * @return
+ *   The start time of the job if it was already run and either "Cancelled" or "Not Yet Started" otherwise
+ *
+ * @ingroup tripal_jobs_api
+ */
 function tripal_jobs_get_start_time($job){
    if($job->start_time > 0){
       $start = format_date($job->start_time);
@@ -140,9 +191,18 @@ function tripal_jobs_get_start_time($job){
    }
    return $start;
 }
+
 /**
-*
-*/
+ * Returns the end time for a given job
+ * 
+ * @param $job
+ *   An object describing the job
+ *
+ * @return
+ *   The end time of the job if it was already run and empty otherwise
+ *
+ * @ingroup tripal_jobs_api
+ */
 function tripal_jobs_get_end_time($job){
    if($job->end_time > 0){
       $end = format_date($job->end_time);
@@ -151,17 +211,30 @@ function tripal_jobs_get_end_time($job){
    }
    return $end;
 }
+
 /**
-*
-*/
+ * Returns the date the job was added to the queue
+ *
+ * @param $job
+ *   An object describing the job
+ *
+ * @return
+ *   The date teh job was submitted
+ *
+ * @ingroup tripal_jobs_api
+ */
 function tripal_jobs_get_submit_date($job){
    return format_date($job->submit_date);
 }
+
 /**
-*
-*
-* @ingroup tripal_core
-*/
+ * A function used to manually launch all queued tripal jobs
+ *
+ * @param $do_parallel
+ *   A boolean indicating whether jobs should be attempted to run in parallel
+ *
+ * @ingroup tripal_jobs_api
+ */
 function tripal_jobs_launch ($do_parallel = 0){
    
    // first check if any jobs are currently running
@@ -205,12 +278,15 @@ function tripal_jobs_launch ($do_parallel = 0){
 		// send an email to the user advising that the job has finished
    }
 }
+
 /**
-*
-*
-* @ingroup tripal_core
-* @ingroup tripal_api
-*/
+ * Returns a list of running tripal jobs
+ *
+ * @return
+ *    and array of objects where each object describes a running job or false if no jobs are running
+ *
+ * @ingroup tripal_jobs_api
+ */
 function tripal_jobs_check_running () {
    // iterate through each job that has not ended
    // and see if it is still running. If it is not
@@ -240,14 +316,27 @@ function tripal_jobs_check_running () {
 }
 
 /**
-*
-*/
+ * Returns the HTML code to display a given job
+ *
+ * @param $job_id
+ *   The job_id of the job to display
+ * 
+ * @return
+ *   The HTML describing the indicated job
+ * @ingroup tripal_core
+ */
 function tripal_jobs_view ($job_id){
    return theme('tripal_core_job_view',$job_id);
 }
+
 /**
-*
-*/
+ * Registers variables for the tripal_core_job_view themeing function
+ *
+ * @param $variables
+ *   An array containing all variables supplied to this template
+ *
+ * @ingroup tripal_core
+ */
 function tripal_core_preprocess_tripal_core_job_view (&$variables){
    // get the job record
    $job_id = $variables['job_id'];
@@ -288,10 +377,13 @@ function tripal_core_preprocess_tripal_core_job_view (&$variables){
    $variables['job'] = $job;
 }
 /**
-*
-* @ingroup tripal_core
-* @ingroup tripal_api
-*/
+ * Set a job to be re-ran (ie: add it back into the job queue)
+ * 
+ * @param $job_id
+ *   The job_id of the job to be re-ran
+ * 
+ * @ingroup tripal_jobs_api
+ */
 function tripal_jobs_rerun ($job_id){
    global $user;
 
@@ -306,10 +398,13 @@ function tripal_jobs_rerun ($job_id){
 }
 
 /**
-*
-* @ingroup tripal_core
-* @ingroup tripal_api
-*/
+ * Cancel a Tripal Job currently waiting in the job queue
+ *
+ * @param $job_id
+ *   The job_id of the job to be cancelled
+ *
+ * @ingroup tripal_jobs_api
+ */
 function tripal_jobs_cancel ($job_id){
    $sql = "select * from {tripal_jobs} where job_id = %d";
    $job = db_fetch_object(db_query($sql,$job_id));

+ 167 - 29
tripal_core/tripal_core.api.inc

@@ -30,6 +30,14 @@
  */
 require_once "tripal_core.schema.api.inc";
 
+/** 
+ * @defgroup tripal_chado_api Tripal Chado DB API
+ * @{
+ * Provides an application programming interface (API) to interact with the Chado database.
+ * @}
+ * @ingroup tripal_api
+ */
+ 
 // just a temporary function for debugging
 function tripal_core_chado_insert_test(){
    $ivalues =  array(
@@ -83,6 +91,7 @@ function tripal_core_chado_insert_test(){
    return $result;
 
 }
+
 /**
 * Provides a generic routine for inserting into any Chado table
 *
@@ -124,7 +133,7 @@ function tripal_core_chado_insert_test(){
 * specified using its foreign key and the cv_id for the cvterm is nested as
 * well.
 *
-* @ingroup tripal_api
+* @ingroup tripal_chado_api
 */
 function tripal_core_chado_insert($table,$values){
    $insert_values = array();
@@ -226,9 +235,61 @@ function tripal_core_chado_insert($table,$values){
    }
    return false;
 }
+
 /**
-*
-*/
+ * Provides a generic function for deleting a record(s) from any chado table
+ *
+ * Use this function to delete a record(s) in any Chado table.  The first
+ * argument specifies the table to delete from and the second is an array
+ * of values to match for locating the record(s) to be deleted.  The arrays 
+ * are mutli-dimensional such that foreign key lookup values can be specified.
+ *
+ * @param $table
+ *  The name of the chado table for inserting
+ * @param $match
+ *  An associative array containing the values for locating a record to update.
+ *
+ * @return 
+ *   On success this function returns TRUE. On failure, it returns FALSE.
+ *
+ * Example usage:
+ * @code
+   $umatch = array(
+     'organism_id' => array(
+         'genus' => 'Citrus',
+         'species' => 'sinensis',
+      ),
+     'uniquename' => 'orange1.1g000034m.g7',
+     'type_id' => array (
+         'cv_id' => array (
+            'name' => 'sequence',
+         ),
+         'name' => 'gene',
+         'is_obsolete' => 0
+      ),
+   );
+   $uvalues = array(
+      'name' => 'orange1.1g000034m.g',
+      'type_id' => array (
+         'cv_id' => array (
+            'name' => 'sequence',
+         ),
+         'name' => 'mRNA',
+         'is_obsolete' => 0
+      ),
+   );
+ *   $result = tripal_core_chado_update('feature',$umatch,$uvalues);
+ * @endcode
+ * The above code species that a feature with a given uniquename, organism_id,
+ * and type_id (the unique constraint for the feature table) will be deleted.
+ * The organism_id is specified as a nested array that uses the organism_id
+ * foreign key constraint to lookup the specified values to find the exact 
+ * organism_id. The same nested struture is also used for specifying the 
+ * values to update.  The function will find all records that match the 
+ * columns specified and delete them.
+ *
+ * @ingroup tripal_chado_api
+ */
 function tripal_core_chado_delete($table,$match){
    $delete_matches = array();  // contains the values for the where clause
    
@@ -278,6 +339,7 @@ function tripal_core_chado_delete($table,$match){
    }
    return false;
 }
+
 /**
 * Provides a generic routine for updating into any Chado table
 *
@@ -333,7 +395,7 @@ function tripal_core_chado_delete($table,$match){
 * values to update.  The function will find the record that matches the 
 * columns specified and update the record with the avlues in the $uvalues array.
 *
-* @ingroup tripal_api
+* @ingroup tripal_chado_api
 */
 function tripal_core_chado_update($table,$match,$values){
    $update_values = array();   // contains the values to be updated
@@ -415,6 +477,7 @@ function tripal_core_chado_update($table,$match,$values){
    }
    return false;
 }
+
 /**
 * Provides a generic routine for selecting data from a Chado table
 *
@@ -481,7 +544,7 @@ function tripal_core_chado_update($table,$match,$values){
 * for the cvterm is nested as well.  In the example above, two different species
 * are allowed to match
 *
-* @ingroup tripal_api
+* @ingroup tripal_chado_api
 */
 function tripal_core_chado_select($table,$columns,$values,$options = null){
     if (!is_array($options)) { $options = array(); }
@@ -608,6 +671,7 @@ function tripal_core_chado_select($table,$columns,$values,$options = null){
       return count($results);
    }
 }
+
 /**
 * Gets the value of a foreign key relationship
 *
@@ -624,6 +688,15 @@ function tripal_core_chado_select($table,$columns,$values,$options = null){
 *  The field in the table that is the foreign key.
 * @param $values
 *  An associative array containing the values 
+* @param $options
+*  An associative array of additional options where the key is the option 
+*  and the value is the value of that option. These options are passed on to tripal_core_chado_select.
+*
+* Additional Options Include:
+*  - case_insensitive_columns
+*     An array of columns to do a case insensitive search on.
+*  - regex_columns
+*     An array of columns where the value passed in should be treated as a regular expression
 * 
 * @return
 *  A string containg the results of the foreign key lookup, or FALSE if failed.
@@ -645,7 +718,7 @@ function tripal_core_chado_select($table,$columns,$values,$options = null){
 * species.  The cvterm is also specified using its foreign key and the cv_id 
 * for the cvterm is nested as well.
 *
-* @ingroup tripal_api
+* @ingroup tripal_chado_api
 */
 function tripal_core_chado_get_foreign_key($table_desc,$field,$values, $options = null){
     if (!is_array($options)) { $options = array(); }
@@ -701,8 +774,6 @@ function tripal_core_chado_get_foreign_key($table_desc,$field,$values, $options
 /** 
  * Generates an object containing the full details of a record(s) in chado. 
  *
- * @todo Add expand_tables arrays
- *
  * This differs from the objects returned by tripal_core_chado_select in so far as all foreign key 
  * relationships have been followed meaning you have more complete details. Thus this function 
  * should be used whenever you need a full variable and tripal_core_chado_select should be used if 
@@ -755,9 +826,9 @@ function tripal_core_chado_get_foreign_key($table_desc,$field,$values, $options
  * @endcode
  *      will exclude all text fields with a length > 50. Thus if $feature.residues is longer than 50 *      it will be excluded, otherwise it will be added.
  *
- * @ingroup tripal_api
+ * @ingroup tripal_chado_api
  */
-function tripal_core_generate_chado_var($table, $values, $base_options=array()) {
+ function tripal_core_generate_chado_var($table, $values, $base_options=array()) {
   
   // get description for the current table----------------------------------------------------------
   $table_desc = module_invoke_all('chado_'.$table.'_schema');
@@ -983,7 +1054,7 @@ function tripal_core_generate_chado_var($table, $values, $base_options=array())
       $feature = tripal_core_expand_chado_vars($feature, 'table', 'featureprop');
  * @endcode
  *
- * @ingroup tripal_api
+ * @ingroup tripal_chado_api
  */
 function tripal_core_expand_chado_vars ($object, $type, $to_expand,$table_options = array()) {
   $base_table = $object->tablename;
@@ -1190,7 +1261,7 @@ function tripal_core_expand_chado_vars ($object, $type, $to_expand,$table_option
  * @return
  *   An array of type => criteria where the type is excluded if the criteria evaluates to TRUE
  *
- * @ingroup tripal_api
+ * @ingroup tripal_chado_api
  */
 function tripal_core_exclude_type_by_default() {
   return array('text' => "strlen('&gt;field_value&lt; ') > 100");
@@ -1219,7 +1290,7 @@ function tripal_core_exclude_type_by_default() {
  * @return
  *   An array of type => criteria where the type is excluded if the criteria evaluates to TRUE
  *
- * @ingroup tripal_api
+ * @ingroup tripal_chado_api
  */
 function tripal_core_exclude_field_from_feature_by_default() {
   return array();
@@ -1269,10 +1340,23 @@ function chado_get_node_id ($table, $id) {
 }
 
 /**
-* Adds a single property to an existing library record.
-*
-* @ingroup tripal_api
-*/
+ * Retrieve a property for a given base table record
+ *
+ * @param $basetable
+ *   The base table for which the property should be retrieved. Thus to retrieve a property
+ *   for a feature the basetable=feature and property is retrieved from featureprop
+ * @param $record_id
+ *   The primary key of the basetable to retrieve properties for. This should be in integer.
+ * @param $property
+ *   The cvterm name describing the type of properties to be retrieved
+ * @param $cv_name
+ *   The name of the cv that the above cvterm is part of
+ *
+ * @return
+ *   A chado variable with the specified properties expanded
+ *
+ * @ingroup tripal_chado_api
+ */
 function tripal_core_get_property($basetable, $record_id, $property, $cv_name){
 
    // get the foreign key for this property table
@@ -1295,10 +1379,27 @@ function tripal_core_get_property($basetable, $record_id, $property, $cv_name){
    return $results;
 }
 /**
-* Adds a single property to an existing record.
-*
-* @ingroup tripal_core.api
-*/
+ * Insert a property for a given basetable record
+ *
+ * @param $basetable
+ *   The base table for which the property should be inserted. Thus to insert a property
+ *   for a feature the basetable=feature and property is inserted into featureprop
+ * @param $record_id
+ *   The primary key of the basetable to insert a property for. This should be in integer.
+ * @param $property
+ *   The cvterm name describing the type of properties to be inserted
+ * @param $cv_name
+ *   The name of the cv that the above cvterm is part of
+ * @param $value
+ *   The value of the property to be inserted (can be empty)
+ * @param $update_if_present
+ *   A boolean indicating whether an existing record should be updated or an error thrown
+ *
+ * @return
+ *   Return True on Insert/Update and False otherwise
+ *
+ * @ingroup tripal_chado_api
+ */
 function tripal_core_insert_property($basetable, $record_id, $property, 
    $cv_name, $value, $update_if_present = 0)
 {
@@ -1331,11 +1432,32 @@ function tripal_core_insert_property($basetable, $record_id, $property,
    );
    return tripal_core_chado_insert($basetable.'prop',$values);
 }
+
 /**
-* Adds a single property to an existing record.
-*
-* @ingroup tripal_api
-*/
+ * Update a property for a given basetable record
+ *
+ * @param $basetable
+ *   The base table for which the property should be updated. Thus to update a property
+ *   for a feature the basetable=feature and property is updated in featureprop
+ * @param $record_id
+ *   The primary key of the basetable to update a property for. This should be in integer.
+ * @param $property
+ *   The cvterm name describing the type of property to be updated
+ * @param $cv_name
+ *   The name of the cv that the above cvterm is part of
+ * @param $value
+ *   The value of the property to be inserted (can be empty)
+ * @param $insert_if_missing
+ *   A boolean indicating whether a record should be inserted if one doesn't exist to update
+ *
+ * Note: The property to be updated is select via theu nique combination of $record_id and
+ * $property and then it is updated with the supplied value
+ *
+ * @return
+ *   Return True on Update/Insert and False otherwise
+ *
+ * @ingroup tripal_chado_api
+ */
 function tripal_core_update_property($basetable, $record_id,$property,$cv_name,
    $value,$insert_if_missing = 0)
 {
@@ -1370,11 +1492,27 @@ function tripal_core_update_property($basetable, $record_id,$property,$cv_name,
    );
    return tripal_core_chado_update($basetable.'prop',$match,$values);
 }
+
 /**
-* Adds a single property to an existing record.
-*
-* @ingroup tripal_api
-*/
+ * Deletes a property for a given basetable record
+ *
+ * @param $basetable
+ *   The base table for which the property should be deleted. Thus to deleted a property
+ *   for a feature the basetable=feature and property is deleted from featureprop
+ * @param $record_id
+ *   The primary key of the basetable to delete a property for. This should be in integer.
+ * @param $property
+ *   The cvterm name describing the type of property to be deleted
+ * @param $cv_name
+ *   The name of the cv that the above cvterm is part of
+ *
+ * Note: The property to be deleted is select via theu nique combination of $record_id and $property 
+ *
+ * @return
+ *   Return True on Delete and False otherwise
+ *
+ * @ingroup tripal_chado_api
+ */
 function tripal_core_delete_property($basetable, $record_id,$property,$cv_name){
    // get the foreign key for this property table
    $table_desc = module_invoke_all('chado_'.$basetable.'prop_schema');

+ 19 - 3
tripal_core/tripal_core.module

@@ -9,11 +9,16 @@ require_once "bulk_loader.php";
 require_once "tripal_core.api.inc";
 
 /**
- * @defgroup tripal_core Core Tripal Module
+ * @defgroup tripal_modules Tripal Modules
  * @{
- * Provides basic functions for interacting with chado
+ * All documented functions for the various Tripal Modules
  * @}
  */
+
+/**
+ * @defgroup tripal_core Core Tripal Module
+ * @ingroup tripal_modules
+ */
  
 /**
  *
@@ -244,7 +249,14 @@ function tripal_core_admin () {
  * schemas.  It is also used for backwards compatibility with older versions
  * of tripal or in cases where chado is located outside of the Drupal database.
  *
- * @ingroup tripal_core
+ * @param $dbname
+ *   The name of the database to switch to as indicated in settings.php
+ *   Should be either default or chado
+ *
+ * @return 
+ *   The name of the previously set database
+ *
+ * @ingroup tripal_chado_api
  */
 function tripal_db_set_active($dbname){
    global $db_url, $db_type;
@@ -377,6 +389,10 @@ function tripal_get_max_chado_rank ($tablename, $where_options) {
 	}
 }
 
+/**
+ *
+ * @ingroup tripal_core
+ */
 function tripal_core_theme () {
    return array(      
       'tripal_core_job_view' => array (

+ 3 - 1
tripal_feature/tripal_feature.module

@@ -1,9 +1,11 @@
 <?php
 
 /**
- * @defgroup tripal_feature Feature Module
+ * @defgroup tripal_feature Feature
  * @{
  * Provides functions for managing chado features including creating details pages for each feature
+ * @}
+ * @ingroup tripal_modules
  */
  
 require_once "tripal_feature.admin.inc";

+ 1 - 0
tripal_stock/tripal_stock.module

@@ -20,6 +20,7 @@
  * transgene), and could be described by some ontology term. For more information about the chado 
  * Stock Module see the GMOD Wiki Page (http://gmod.org/wiki/Chado_Stock_Module)
  * @}
+ * @ingroup tripal_modules
  */
 require("tripal_stock-administration.inc");