Kaynağa Gözat

Accidentally removed a view I shouldn't have

Stephen Ficklin 9 yıl önce
ebeveyn
işleme
8657493e0b

+ 3 - 40
legacy/tripal_cv/tripal_cv.module

@@ -40,7 +40,7 @@ function tripal_cv_init() {
 function tripal_cv_menu() {
   $items = array();
 
-  $items['admin/tripal/vocab'] = array(
+ /*  $items['admin/tripal/vocab'] = array(
     'title' => 'Controlled Vocabularies',
     'description' => 'Controlled Vocabularies control the types available for entities and fields.',
     'page callback' => 'tripal_cv_admin_cv_listing',
@@ -69,29 +69,6 @@ function tripal_cv_menu() {
     'weight' => 10
   );
 
-  // The OBO loader will be available in two places
-  $items['admin/tripal/vocab/obo_loader'] = array(
-    'title' => 'OBO File Loader',
-    'description' => 'Load an ontology in OBO format chado as a controlled vocabulary.',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('tripal_cv_obo_form'),
-    'access arguments' => array('administer controlled vocabularies'),
-    'type' => MENU_CALLBACK,
-  );
-
-  $items['admin/tripal/loaders/obo_loader'] = array(
-    'title' => 'OBO File Loader',
-    'description' => 'Load an ontology in OBO format into chado as a controlled vocabulary.',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('tripal_cv_obo_form'),
-    'access arguments' => array('administer controlled vocabularies'),
-    'type' => MENU_NORMAL_ITEM,
-  );
-
-  /*
-   * Menu for updating the cvtermpath
-   */
-
   $items['admin/tripal/vocab/cvtermpath'] = array(
     'title' => 'Update Chado cvtermpath table',
     'description' => 'The Chado cvtermpath table provides lineage for terms and is useful for quickly finding any ancestor parent of a term.  However, this table must be populated.  This page allows for populating of this table one vocabulary at a time',
@@ -101,9 +78,6 @@ function tripal_cv_menu() {
     'type' => MENU_CALLBACK,
   );
 
-  /*
-   * Menu items for adding and editing CVs
-   */
   $items['admin/tripal/vocab/cv/edit/%'] = array(
     'title' => 'Edit a Controlled Vocabulary',
     'description' => 'Edit the details such as name and description for an existing controlled vocabulary.',
@@ -124,9 +98,6 @@ function tripal_cv_menu() {
     'type' => MENU_CALLBACK,
   );
 
-  /*
-   * Menu items for adding and editing CVterms
-   */
   $items['admin/tripal/vocab/cv/%/cvterm/add'] = array(
     'title' => 'Add a Controlled Vocabulary Term',
     'description' => 'Add a new controlled vocabulary term.',
@@ -157,9 +128,7 @@ function tripal_cv_menu() {
     'access arguments' => array('administer controlled vocabularies'),
     'type' => MENU_CALLBACK,
   );
-  /*
-   * Menu items for enabling views
-   */
+
   $items['admin/tripal/vocab/views/cvs/enable'] = array(
     'title' => 'Enable Vocabulary Administrative View',
     'page callback' => 'tripal_enable_view',
@@ -174,10 +143,8 @@ function tripal_cv_menu() {
     'access arguments' => array('administer controlled vocabularies'),
     'type' => MENU_CALLBACK,
   );
+ */
 
-  /*
-   * Charts
-  */
   $items['tripal_cv_chart'] = array(
     'path' => 'tripal_cv_chart',
     'page callback' => 'tripal_cv_chart',
@@ -186,10 +153,6 @@ function tripal_cv_menu() {
     'type' => MENU_CALLBACK
   );
 
-
-  /*
-   * Menu items for working with CV Trees
-   */
   $items['cv_browser'] = array(
     'page callback' => 'tripal_cv_show_browser',
     'access arguments' => array('access content'),

+ 2 - 1
legacy/tripal_db/tripal_db.module

@@ -29,6 +29,7 @@ require_once 'includes/tripal_db.admin.inc';
 function tripal_db_menu() {
   $items = array();
 
+  /*
   $items['admin/tripal/chado/tripal_db'] = array(
     'title' => 'Databases',
     'description' => 'References to External Database sites such as NCBI',
@@ -87,7 +88,7 @@ function tripal_db_menu() {
     'access arguments' => array('administer db cross-references'),
     'type' => MENU_CALLBACK,
   );
-
+ */
   return $items;
 }
 

+ 266 - 0
tripal/tripal.views.inc

@@ -12,6 +12,272 @@
  */
 function tripal_views_data() {
   $data = array();
+  // Job Management System
+  $data = tripal_views_data_jobs($data);
 
   return $data;
 }
+
+/**
+ * Provides the data array for the tripal job management system
+ *
+ * @param $data
+ *   Previously generated tripal views data array
+ * return
+ *   $data array with job management system described
+ *
+ * @ingroup tripal
+ */
+function tripal_views_data_jobs($data) {
+
+  $data['tripal_jobs']['table']['group'] = t('Tripal Jobs');
+  $data['tripal_jobs']['table']['base'] = array(
+    'field' => 'job_id', // This is the identifier field for the view.
+    'title' => t('Tripal Jobs'),
+    'help' => t('The Job Management system for Tripal.'),
+    'weight' => 10,
+  );
+
+  // Job ID
+  $data['tripal_jobs']['job_id'] = array(
+    'title' => t('Job ID'),
+    'help' => t('The job primary key.'),
+    'field' => array(
+      'handler' => 'views_handler_field_numeric',
+      'click sortable' => TRUE,
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_numeric',
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+  );
+
+  // User ID: Submitter
+  $data['tripal_jobs']['uid'] = array(
+    'title' => t('Job Submitter'),
+    'help' => t('The user who submitted the job.'),
+    'relationship' => array(
+      'base' => 'user', // The name of the table to join with.
+      'base field' => 'uid', // The name of the field on the joined table.
+      'handler' => 'views_handler_relationship',
+      'label' => t('Submitting User'),
+      'title' => t('Submitting User'),
+      'help' => t('The user who submitted the job'),
+    ),
+  );
+
+  // Job Name
+  $data['tripal_jobs']['job_name'] = array(
+    'title' => t('Job Name'),
+    'help' => t('The name of the job.'),
+    'field' => array(
+      'handler' => 'views_handler_field',
+      'click sortable' => TRUE, // This is use by the table display plugin.
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_string',
+    ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_string',
+    ),
+  );
+
+  // Module Name
+  $data['tripal_jobs']['modulename'] = array(
+    'title' => t('Module Name'),
+    'help' => t('The name of the module that submitted the job.'),
+    'field' => array(
+      'handler' => 'views_handler_field',
+      'click sortable' => TRUE, // This is use by the table display plugin.
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_string',
+    ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_string',
+    ),
+  );
+
+  // Callback
+  $data['tripal_jobs']['callback'] = array(
+    'title' => t('Callback'),
+    'help' => t('The callback executed when the job runs.'),
+    'field' => array(
+      'handler' => 'views_handler_field',
+      'click sortable' => TRUE, // This is use by the table display plugin.
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_string',
+    ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_string',
+    ),
+  );
+
+  // Arguments
+  $data['tripal_jobs']['arguments'] = array(
+    'title' => t('Arguements'),
+    'help' => t('Any arguements passed to the callback.'),
+    'field' => array(
+      'handler' => 'views_handler_field',
+      'click sortable' => TRUE, // This is use by the table display plugin.
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_string',
+    ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_string',
+    ),
+  );
+
+  // Progress
+  $data['tripal_jobs']['progress'] = array(
+    'title' => t('Progress'),
+    'help' => t('The current progress of the job.'),
+    'field' => array(
+      'handler' => 'views_handler_field_numeric',
+      'click sortable' => TRUE,
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_numeric',
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+  );
+
+  // Status
+  $data['tripal_jobs']['status'] = array(
+    'title' => t('Status'),
+    'help' => t('The current status of the job.'),
+    'field' => array(
+      'handler' => 'views_handler_field',
+      'click sortable' => TRUE, // This is use by the table display plugin.
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_string',
+    ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_string',
+    ),
+  );
+
+  // Submit Data
+  $data['tripal_jobs']['submit_date'] = array(
+    'title' => t('Submit Date'),
+    'help' => t('The date the job was submitted.'),
+    'field' => array(
+      'handler' => 'views_handler_field_date',
+      'click sortable' => TRUE,
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort_date',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_date',
+    ),
+  );
+
+  // Start Time
+  $data['tripal_jobs']['start_time'] = array(
+    'title' => t('Start Time'),
+    'help' => t('The time the job started.'),
+    'field' => array(
+      'handler' => 'views_handler_field_date',
+      'click sortable' => TRUE,
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort_date',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_date',
+    ),
+  );
+
+  // End Time
+  $data['tripal_jobs']['end_time'] = array(
+    'title' => t('End Time'),
+    'help' => t('The time the job ended.'),
+    'field' => array(
+      'handler' => 'views_handler_field_date',
+      'click sortable' => TRUE,
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort_date',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_date',
+    ),
+  );
+
+  // Error Message
+  $data['tripal_jobs']['error_msg'] = array(
+    'title' => t('Error Message '),
+    'help' => t('A short description of any error the job might have had.'),
+    'field' => array(
+      'handler' => 'views_handler_field',
+      'click sortable' => TRUE, // This is use by the table display plugin.
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_string',
+    ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_string',
+    ),
+  );
+
+  // Unix Pid of the job
+  $data['tripal_jobs']['pid'] = array(
+    'title' => t('Job PID'),
+    'help' => t('The Unix PID of the job.'),
+    'field' => array(
+      'handler' => 'views_handler_field_numeric',
+      'click sortable' => TRUE,
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_numeric',
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+  );
+
+  // Priority
+  $data['tripal_jobs']['priority'] = array(
+    'title' => t('Priority'),
+    'help' => t('The priority of this job.'),
+    'field' => array(
+      'handler' => 'views_handler_field_numeric',
+      'click sortable' => TRUE,
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_numeric',
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+  );
+
+  return $data;
+}
+

+ 14 - 14
tripal_chado/tripal_chado.install

@@ -1,14 +1,14 @@
 <?php
 
 function tripal_chado_install() {
-  // The foreign key specification doesn't really add one to the
-  // Drupal schema, it is just used internally, but we want one.
-  db_query('
-      ALTER TABLE {tripal_custom_tables}
-      ADD CONSTRAINT tripal_custom_tables_fk1
-      FOREIGN KEY (mview_id) REFERENCES {tripal_mviews} (mview_id)
-      ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED
-  ');
+//   // The foreign key specification doesn't really add one to the
+//   // Drupal schema, it is just used internally, but we want one.
+//   db_query('
+//       ALTER TABLE {tripal_custom_tables}
+//       ADD CONSTRAINT tripal_custom_tables_fk1
+//       FOREIGN KEY (mview_id) REFERENCES {tripal_mviews} (mview_id)
+//       ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED
+//   ');
 }
 
 
@@ -19,12 +19,12 @@ function tripal_chado_install() {
  */
 function tripal_chado_uninstall() {
 
-  // Drop the foreign key between tripal_custom_tables and tripal_mviews
-  // so that Drupal can then drop the tables
-  db_query('
-    ALTER TABLE {tripal_custom_tables}
-    DROP CONSTRAINT tripal_custom_tables_fk1 CASCADE
-  ');
+//   // Drop the foreign key between tripal_custom_tables and tripal_mviews
+//   // so that Drupal can then drop the tables
+//   db_query('
+//     ALTER TABLE {tripal_custom_tables}
+//     DROP CONSTRAINT tripal_custom_tables_fk1 CASCADE
+//   ');
 }
 
 /**