e5071fb49ba86bae0fc173976c576c2440e0fe6e
braney
Fri Jun 6 10:31:51 2014 -0700
oops... another tweak to get "no public hubs" message to come out
diff --git src/hg/hgHubConnect/hgHubConnect.c src/hg/hgHubConnect/hgHubConnect.c
index e546774..db4100b 100644
--- src/hg/hgHubConnect/hgHubConnect.c
+++ src/hg/hgHubConnect/hgHubConnect.c
@@ -285,31 +285,31 @@
/* find hubs that match search term in trixFile */
{
struct hash *urlSearchHash = newHash(5);
struct trix *trix = trixOpen(trixFile);
int trixWordCount = chopString(hubSearchTerms, " ", NULL, 0);
char *trixWords[trixWordCount];
trixWordCount = chopString(hubSearchTerms, " ", trixWords, trixWordCount);
struct trixSearchResult *tsList = trixSearch(trix, trixWordCount, trixWords, TRUE);
for ( ; tsList != NULL; tsList = tsList->next)
hashStore(urlSearchHash, tsList->itemId);
return urlSearchHash;
}
-static struct hash *outputPublicTable(struct sqlConnection *conn, char *publicTable, char *statusTable)
+static boolean outputPublicTable(struct sqlConnection *conn, char *publicTable, char *statusTable, struct hash **pHash)
/* Put up the list of public hubs and other controls for the page. */
{
char *trixFile = cfgOptionEnvDefault("HUBSEARCHTRIXFILE", "hubSearchTrixFile", "/gbdb/hubs/public.ix");
char *hubSearchTerms = cartOptionalString(cart, hgHubSearchTerms);
char *cleanSearchTerms = cloneString(hubSearchTerms);
boolean haveTrixFile = fileExists(trixFile);
struct hash *urlSearchHash = NULL;
printf("
\n");
// if we have a trix file, draw the search box
if (haveTrixFile)
{
puts("Enter search terms to find in public track hub description pages: "
"\n");
puts("
\n");
strLower(cleanSearchTerms);
urlSearchHash = getUrlSearchHash(trixFile, cleanSearchTerms);
}
-puts("Clicking Connect redirects to the gateway page of the selected hub's default assembly. ");
// make sure all the public hubs are in the hubStatus table.
addPublicHubsToHubStatus(conn, publicTable, statusTable);
struct hash *publicHash = newHash(5);
char query[512];
bool hasDescription = sqlColumnExists(conn, publicTable, "descriptionUrl");
if (hasDescription)
sqlSafef(query, sizeof(query), "select p.hubUrl,p.shortLabel,p.longLabel,p.dbList,s.errorMessage,s.id,p.descriptionUrl from %s p,%s s where p.hubUrl = s.hubUrl",
publicTable, statusTable);
else
sqlSafef(query, sizeof(query), "select p.hubUrl,p.shortLabel,p.longLabel,p.dbList,s.errorMessage,s.id from %s p,%s s where p.hubUrl = s.hubUrl",
publicTable, statusTable);
struct sqlResult *sr = sqlGetResult(conn, query);
char **row;
@@ -362,30 +361,31 @@
*dbList = row[3], *errorMessage = row[4], *descriptionUrl = row[6];
int id = atoi(row[5]);
hashStore(publicHash, url);
if ((urlSearchHash != NULL) && (hashLookup(urlSearchHash, url) == NULL))
continue;
struct slName *dbListNames = slNameListFromComma(dbList);
if (gotAnyRows)
webPrintLinkTableNewRow();
else
{
/* output header */
+ puts("Clicking Connect redirects to the gateway page of the selected hub's default assembly. ");
printf("