Преглед изворни кода

Merge branch '7.x-3.x' into 759_3x_tripal-registration-form

Shawna Spoor пре 5 година
родитељ
комит
80fbac37dc

+ 1 - 0
docs/user_guide.rst

@@ -15,6 +15,7 @@ User's Guide
    user_guide/example_genomics
    user_guide/file_management
    user_guide/mviews
+   user_guide/custom_tables
    user_guide/searching
    user_guide/job_management
    user_guide/web_services

+ 8 - 0
docs/user_guide/content_types/field_permissions.rst

@@ -17,6 +17,14 @@ Not all Tripal Fields are created equal.  You may have some fields that you don'
 
 Simply disabling the display of the formatter won't prevent the widget from showing up on the submission page, and besides, you might want site admins to still have access to those fields!  Deleting the field will cause them to re-appear when you press the "Check for New Fields" button!  Field Permissions allows you to configure field-specific permissions so that users contributing content via Chado only see the fields they need to see.
 
+
+
+.. warning::
+
+	Because all Tripal Entities are the same base entity type (``TripalEntity``), configuring field permissions on one bundle will configure it for **all** bundles.  This means, for example, hiding a field on Organism will also hide it on Analysis.
+   
+
+
 Installing the Drupal Field Permissions module
 -----------------------------------------------
 

BIN
docs/user_guide/custom_tables.1.png


BIN
docs/user_guide/custom_tables.2.png


+ 27 - 0
docs/user_guide/custom_tables.rst

@@ -0,0 +1,27 @@
+Custom Tables
+=============
+
+Chado has a large number of tables that can be used for storing a variety of biological and ancillary data.  All effort should be made to use the existing tables for storing data. However, there are times when the current set of tables is not adequate for storing some data. Tripal allows you to create custom tables in Chado using the Tripal web interface.  The interface for managing custom tables can be found on the **Tripal → Data Storage → Chado -> Custom Tables** page.
+
+.. image:: ./custom_tables.1.png
+
+This page contains a link to add a new custom table (at the top), a search interface to find tables by name, and a listing of existing tables.  You can use this interface to add, edit and remove custom tables.  By default, several custom tables have been created automatically by Tripal modules.  These tables hold data managed by the modules.  Also, tables used as materialized views appear in this list as well. They are identified with the `Is Mview` column.
+
+.. warning::
+
+  You should not remove or edit custom tables that were created programmatically by tripal modules as it may cause problems with the proper function of the modules that created them.
+
+If you need to create a new table you should follow the following procedure.
+
+1.  Plan and design your table. It is best if you follow Chado design style so that your table would easily fit into Chado.
+2.  Reach out to the Chado community on the `Chado mailing list <https://sourceforge.net/projects/gmod/lists/gmod-schema>`_ and ask for advice on your design.
+3.  If you think your new table would benefit others, consider requesting it be added to a future version of Chado by adding an issue in the `Chado GitHub issue queue <https://github.com/gmod/chado/issues>`_.
+4.  Write your table in the `Drupal Schema API <https://www.drupal.org/docs/7/api/schema-api/introduction-to-schema-api>`_ array format.
+5.  Navigate to the  **Tripal → Data Storage → Chado -> Custom Tables** page on your site. Click the `Add Custom Table` link at the top and cut-and-paste the schema array and click the `Add` button.
+
+.. image:: ./custom_tables.2.png
+
+One your table is created, you will want to add data to it.  You can do so without any programming by using the :doc:`./bulk_loader`.  The bulk loader expects that your data is housed in a tab-delimited text file and allows you to map columns from your file to columns in your new custom table. Each row of your file becomes a new record in your table.  
+
+Alternatively, if you can write custom loaders using the Tripal API as described in the 
+:doc:`../dev_guide`

BIN
docs/user_guide/drupal_overview.create_content1.png


BIN
docs/user_guide/drupal_overview.create_content2.png


BIN
docs/user_guide/drupal_overview.find_content.png


+ 4 - 0
docs/user_guide/drupal_overview.rst

@@ -27,6 +27,8 @@ You'll notice at the top a **Title** field and a **Body** text box. All pages re
 
 For practice, try to create two new pages. A **Home** page and an **About** page for our site. First, create the home page and second create the about page. Add whatever text you like for the body.
 
+In the screenshots above, you may have noticed the link **Add Tripal Content**.  Tripal content is different from the typical Drupal content types: **Basic Page** or **Article**.  Instead the content that Tripal provides is the biological and ancillary data that your site will provide to users.  Later this tutorial will describe how to add new biological data.
+
 Finding Content
 ---------------
 
@@ -36,6 +38,8 @@ To find any content that has been created on the site, click the **Find Content*
 
 You'll also notice a set of drop down boxes for filtering the content. For sites with many different content types and pages this helps to find content. You can use this list to click to view each page or to edit.
 
+Later in this guide, instructions will be provided for finding Tripal Content. Tripal content is different from the typical Drupal content types: **Basic Page** or **Article**.  Instead the content that Tripal provides is the biological and ancillary data that your site will provide to users.  It is also accessible via a link named **Find Tripal Content** found on the same menu bar as **Find Content**
+
 Site Administration
 -------------------
 

+ 20 - 1
docs/user_guide/install_tripal/upgrade_from_tripal2.rst

@@ -25,6 +25,8 @@ Step 1: Upgrade Tripal
   .. warning::
 
     If you have made customizations to Chado you may encounter problems during the upgrade.  It is not recommended to ever change any of the existing tables of Chado. However, if you have and if you do encounter such issues, please use the Tripal Issue queue to request help: https://github.com/tripal/tripal/issues
+    
+    If you have custom Drupal fields attached to Tripal nodes then the content in those fields will not automatically be migrated to the new Tripal v3 entities. Bradford Condon has provided some instructions to help migrate these fields after the site has been upgrade. You can find those instructions `here <https://gist.github.com/bradfordcondon/0dddfd015ff6ef1f545364c2ceff1f0b>`_.
 
 2. Put the site in maintenance mode. Before completing any upgrade you should put your site into "maintenance mode". This ensures that users are isolated from any temporary error messages generated through the process. To put the site in maintenance mode, navigate to **Administration > Configuration > Maintenance Mode** . Then click the **Put site into maintenance mode** checkbox and click **Save Configuration**. Additionally, there is a text area on this page that allows you to customize the message displayed to your users while your site is in maintenance mode.
 
@@ -184,8 +186,25 @@ You have now completed the migration process and can safely disable the Tripal v
 
 Troubleshooting
 ---------------
+1. Dealing with ``stack depth limit exceeded`` on Step 4 of the Migration.
 
-1. For sites that have upgrading from Drupal 6:
+When there is a large number of nodes, Drupal's search module fails to update the search_total table and gives the following error:
+
+.. code-block:: bash
+
+    Uncaught exception thrown in shutdown function. PDOException: SQLSTATE[54001]: Statement too complex: 7 ERROR:  stack depth limit exceeded
+    HINT:  Increase the configuration parameter &amp;quot;max_stack_depth
+
+
+You can avoid this problem by clearing out the Drupal search tables byu executing the following SQL commands:
+
+.. code-block:: sql
+
+    TRUNCATE search_total;
+    TRUNCATE search_index;
+
+
+2. For sites that have upgrading from Drupal 6:
 
   If your site was upgraded from Drupal 6, you'll need to add a new text format with a machine name called 'full_html' as this is the default formatter that Tripal v3 uses. As in Drupal 6, the 'Full HTML' text format has a numeric machine name (usually '2') that was later changed to 'full_html' in Drupal 7.
 

+ 9 - 0
tripal_ws/includes/TripalWebService/TripalContentService_v0_1.inc

@@ -161,18 +161,27 @@ class TripalContentService_v0_1 extends TripalWebService {
       $field_name = $instance['field_name'];
       $field = field_info_field($field_name);
       $field_type = $field['type'];
+
       // Skip fields of remote data.
       if ($field_type == 'remote__data') {
         continue;
       }
+
       $vocabulary = $instance['settings']['term_vocabulary'];
       $accession = $instance['settings']['term_accession'];
       $temp_term = tripal_get_term_details($vocabulary, $accession);
+
+      // See if the name matches perfectly.
+      if (strtolower($temp_term['name']) == strtolower($expfield)) {
+        return [$field, $instance, $temp_term];
+      }
+
       // See if the name provided matches the field name after a bit of
       // cleanup.
       if (strtolower(preg_replace('/[^\w]/', '_', $temp_term['name'])) == strtolower($expfield)) {
         return [$field, $instance, $temp_term];
       }
+
       // Alternatively if the CV term accession matches then we're good too.
       if ($vocabulary . ':' . $accession == $expfield) {
         return [$field, $instance, $temp_term];