cf924d2aa402c655a84131bbcb689bfc3d5307aa
angie
  Fri Nov 20 16:21:13 2015 -0800
Data Integrator UI for adding related SQL tables and fields for SQL-based
tracks using all.joiner.  This is only the UI -- the implementation will be
in a subsequent commit.  Main changes:
- cartJson interface between hgIntegrator.c and hgIntegratorModel.js:
- new command getRelatedTables
- the getFields command used to expect a simple comma-sep list of tracks.
Now it expects a list of ';'-sep track blobs, each of which may include
multiple comma-sep tables (track plus related tables).
- UI state interface between hgIntegrator.jsx and hgIntegratorModel.js:
- fieldSelect now supports multiple tables per track
- js/react/hgIntegrator/hgIntegrator.jsx: new subsections of 'Choose fields...'
dialog (FieldSelect) for adding related tables and showing their available
fields w/checkboxes; corresponding new UI state and events.
- js/model/hgIntegrator/hgIntegratorModel.js:
- new handlers for UI events and cartJson data for related tables/fields
- hgIntegrator.c: new code to return information about what tables (if any)
are related to each selected track, and what fields are in selected related
tables.

Other changes:
- hgIntegratorModel.js:
- split monolithic handleCartVar into separate handlers
- add new 'hgi_uiChoices' cart var to remember things that may not pertain
to the current query, such as a user's related tables/fields selections
for a table that is not included in the current query.
- convert between hgi_querySpec and internal UI state representation
(querySpecUpdateUiChoices, toQuerySpecJS)
- cart.js: added uiChoices convenience functions, stringifying of cartSet val
- cartJson interface between hgIntegrator.c and hgIntegratorModel.js:
- new command getQueryState: bundle querySpec and uiChoices from the cart
since they need to be processed together
- UI state interface between hgIntegrator.jsx and hgIntegratorModel.js:
- split UI state's querySpec object into separate dataSources and
outFileOptions objects (no point in bundling those in the UI)

Thanks to Kate and Matt for helpful suggestions about the UI.

refs #15544

diff --git src/hg/inc/hui.h src/hg/inc/hui.h
index d002761..0ffb726 100644
--- src/hg/inc/hui.h
+++ src/hg/inc/hui.h
@@ -1356,32 +1356,36 @@
     char *label;                // Label (which could include HTML)
     enum fieldType type;        // string, int, float
     };
 
 struct extraField *extraFieldsGet(char *db, struct trackDb *tdb);
 // returns any extraFields defined in trackDb
 
 struct extraField *extraFieldsFind(struct extraField *extras, char *name);
 // returns the extraField matching the name (case insensitive).  Note: slNameFind does NOT work.
 
 void extraFieldsFree(struct extraField **pExtras);
 // frees all mem for extraFields list
 #endif///def EXTRA_FIELDS_SUPPORT
 
 
+struct asObject *asFromTableDescriptions(struct sqlConnection *conn, char *table);
+// If there is a tableDescriptions table and it has an entry for table, return
+// a parsed autoSql object; otherwise return NULL.
+
 struct asObject *asForTdb(struct sqlConnection *conn, struct trackDb *tdb);
-// Get autoSQL description if any associated with table.
+// Get autoSQL description if any associated with table, ignoring errAborts if any.
 
 struct asColumn *asColumnFind(struct asObject *asObj, char *name);
 // Return named column.
 
 struct slName *asColNames(struct asObject *as);
 // Get list of column names.
 
 /********************/
 /* Basic info for controlled vocabulary terms (e.g. to display for composites, or cluster tracks */
 
 char *vocabLink(struct hash *vocabFieldHash, char *term, char *title);
 /* Make an anchor with mouseover containing description and link if present */
 
 struct hash *vocabBasicFromSetting(struct trackDb *parentTdb, struct cart *cart);
 /* Get description and URL for all vocabTables. Returns a hash of hashes */