3846f517009c43abc65d227a4695645c9b5f3e8a
braney
  Fri Feb 15 18:31:21 2013 -0800
changes necessary to support assembly hubs (#8072)
diff --git src/hg/hgGateway/hgGateway.c src/hg/hgGateway/hgGateway.c
index ad767e5..97f4513 100644
--- src/hg/hgGateway/hgGateway.c
+++ src/hg/hgGateway/hgGateway.c
@@ -23,31 +23,33 @@
 
 struct cart *cart = NULL;
 struct hash *oldVars = NULL;
 char *clade = NULL;
 char *organism = NULL;
 char *db = NULL;
 
 void hgGateway()
 /* hgGateway - Human Genome Browser Gateway. */
 {
 char *defaultPosition = hDefaultPos(db);
 char *position = cloneString(cartUsualString(cart, "position", defaultPosition));
 boolean gotClade = hGotClade();
 char *survey = cfgOptionEnv("HGDB_SURVEY", "survey");
 char *surveyLabel = cfgOptionEnv("HGDB_SURVEY_LABEL", "surveyLabel");
-boolean supportsSuggest = assemblySupportsGeneSuggest(db);
+boolean supportsSuggest = FALSE;
+if (!trackHubDatabase(db))
+    supportsSuggest = assemblySupportsGeneSuggest(db);
 
 /* JavaScript to copy input data on the change genome button to a hidden form
 This was done in order to be able to flexibly arrange the UI HTML
 */
 char *onChangeDB = "onchange=\"document.orgForm.db.value = document.mainForm.db.options[document.mainForm.db.selectedIndex].value; document.orgForm.submit();\"";
 char *onChangeOrg = "onchange=\"document.orgForm.org.value = document.mainForm.org.options[document.mainForm.org.selectedIndex].value; document.orgForm.db.value = 0; document.orgForm.submit();\"";
 char *onChangeClade = "onchange=\"document.orgForm.clade.value = document.mainForm.clade.options[document.mainForm.clade.selectedIndex].value; document.orgForm.org.value = 0; document.orgForm.db.value = 0; document.orgForm.submit();\"";
 
 /*
    If we are changing databases via explicit cgi request,
    then remove custom track data which will
    be irrelevant in this new database .
    If databases were changed then use the new default position too.
 */
 
@@ -256,31 +258,31 @@
     cartWebStart(theCart, db, "GSID %s Sequence View (UCSC Genome Browser) Gateway \n", organism);
 else
     {
     char buffer[128];
 
     /* tell html routines *not* to escape htmlOut strings*/
     htmlNoEscape();
     buffer[0] = 0;
     if (*scientificName != 0)
 	{
 	if (sameString(clade,"ancestor"))
 	    safef(buffer, sizeof(buffer), "(<I>%s</I> Ancestor) ", scientificName);
 	else
 	    safef(buffer, sizeof(buffer), "(<I>%s</I>) ", scientificName);
 	}
-    cartWebStart(theCart, db, "%s %s%s Gateway\n", organism, buffer, hBrowserName());
+    cartWebStart(theCart, db, "%s %s%s Gateway\n", trackHubRemoveHubName(organism), buffer, hBrowserName());
     htmlDoEscape();
     }
 hgGateway();
 cartWebEnd();
 }
 
 static void checkForGeoMirrorRedirect()
 {
 // Implement Geo/IP based redirection
 //
 // NOTE that we want to redirect people as quickly as possible, so for efficiency purposes, this code is designed to be
 // called from main BEFORE the cart is loaded (so we only use CGI parameters and/or cookies).
 
 char *thisNodeStr = geoMirrorNode();
 if (thisNodeStr)
@@ -330,22 +332,24 @@
             }
         hDisconnectCentral(&centralConn);
         }
     }
 }
 
 char *excludeVars[] = {NULL};
 
 int main(int argc, char *argv[])
 /* Process command line. */
 {
 long enteredMainTime = clock1000();
 oldVars = hashNew(10);
 cgiSpoof(&argc, argv);
 
+setUdcCacheDir();
+
 if(cgiIsOnWeb())
     checkForGeoMirrorRedirect();
 
 cartEmptyShell(doMiddle, hUserCookie(), excludeVars, oldVars);
 cgiExitTime("hgGateway", enteredMainTime);
 return 0;
 }