1a2011f25ac0bd4ce02ed0eb093ff169724f9047
angie
Mon May 2 16:39:23 2016 -0700
Added trackDb setting "tableBrowser noGenome", which allows tables to appear in TB and DI menus,
unlike "tableBrowser off", but does not allow genome-wide queries on the tables. The new "noGenome"
setting is used for OMIM tracks -- OMIM gave the OK for non-genome-wide queries on their tables.
See #4458#note-53 for details of UI & functional changes to the TB and DI for noGenome tracks.
hg/lib/cartTrackDb.c handles access control based on trackDb tableBrowser settings (and the
seldom-used tableAccessControl database tables that restrict tables to be viewed only by
certain hosts). As before, 'tableBrowser off' means that the track is removed from the
trackList so the TB & DI don't even know that it exists. 'tableBrowser noGenome' tracks are
included in the trackList, but the tracks and any tables listed after 'noGenome' are hashed
for later use by cartTrackDbIsNoGenome(). The hash used to contain permitted-host lists,
but now contains structs that combine the permitted-host lists with a noGenome flag.
hgIntegrator.c now includes a 'noGenome' flag in the JSONified groupedTrackDb, which the JS
code uses to identify noGenome tracks. When executing a query, if the query region is genome
but hgi_querySpec has noGenome related tables left over from past position-only queries, those
related table settings are removed from the parsed JSON querySpec->config->relatedTables that is
passed down into annoStreamDb. If one of the dataSources is noGenome but the region is genome
(should be possible only by URL-tweaking), the region is forced to position.
In hgTables, when region is genome, correlation and intersection track menu options for
noGenome tracks are disabled. On the main page, JS code controls whether options are disabled
depending on the current region. When listing related tables for filtering or selected fields
output, if region is genome then the checkboxes for noGenome tables are disabled. If the cart
has noGenome related table or intersection settings left over from past searches, they are
ignored. If a noGenome query URL is tweaked to have hgta_region=genome, the TB errors out.
hgIntegratorModel.js handles disabling of menu options and related table field settings for
noGenome tracks when region is genome.
refs #4458
diff --git src/hg/lib/jsHelper.c src/hg/lib/jsHelper.c
index 9348b02..a1a6980 100644
--- src/hg/lib/jsHelper.c
+++ src/hg/lib/jsHelper.c
@@ -80,43 +80,53 @@
{
dyStringPrintf(dy,
"document.hiddenForm.%s.value=document.mainForm.%s.value; ",
var, var);
}
void jsTrackingVar(char *jsVar, char *val)
/* Emit a little Javascript to keep track of a variable.
* This helps especially with radio buttons. */
{
hPrintf("\n");
}
-void jsMakeTrackingRadioButton(char *cgiVar, char *jsVar,
- char *val, char *selVal)
-/* Make a radio button that also sets tracking variable
+void jsMakeTrackingRadioButtonExtraHtml(char *cgiVar, char *jsVar,
+ char *val, char *selVal, char *extraHtml)
+/* Make a radio button with extra HTML attributes that also sets tracking variable
* in javascript. */
{
hPrintf("");
}
+void jsMakeTrackingRadioButton(char *cgiVar, char *jsVar,
+ char *val, char *selVal)
+/* Make a radio button that also sets tracking variable
+ * in javascript. */
+{
+jsMakeTrackingRadioButtonExtraHtml(cgiVar, jsVar, val, selVal, NULL);
+}
+
void jsMakeTrackingCheckBox(struct cart *cart,
char *cgiVar, char *jsVar, boolean usualVal)
/* Make a check box filling in with existing value and
* putting a javascript tracking variable on it. */
{
char buf[256];
boolean oldVal = cartUsualBoolean(cart, cgiVar, usualVal);
hPrintf("\n", jsVar, oldVal);
hPrintf("");
safef(buf, sizeof(buf), "%s%s", cgiBooleanShadowPrefix(), cgiVar);
cgiMakeHiddenVar(buf, "0");