dec6f042b7ff330fbdbabb312a91fee93e7ea135 braney Tue Jul 8 10:50:36 2014 -0700 put "retry hub" button with error message so folks can disconnect frompublic hubs with errors diff --git src/hg/hgHubConnect/hgHubConnect.c src/hg/hgHubConnect/hgHubConnect.c index 999108f..52c0822 100644 --- src/hg/hgHubConnect/hgHubConnect.c +++ src/hg/hgHubConnect/hgHubConnect.c @@ -186,93 +186,93 @@ printf(""); return; } // time to output the big table. First the header printf( " " "Display " "Hub Name " "Description " "Assemblies " "\n" "\n"); // start first row -printf(""); +printf(""); int count = 0; for(hub = unlistedHubList; hub; hub = hub->next) { if (count) webPrintLinkTableNewRow(); // ends last row and starts a new one count++; - // if there's an error message, we don't let people select it - if (isEmpty(hub->errorMessage)) - { + puts(""); + ourCellStart(); char hubName[32]; safef(hubName, sizeof(hubName), "%s%u", hgHubConnectHubVarPrefix, hub->id); if (cartUsualBoolean(cart, hubName, FALSE)) printf("\n", hub->id); ourCellEnd(); - } - else - { - // give people a chance to clear the error - ourCellStart(); - printf( - "\n" - , hub->hubUrl); - ourCellEnd(); - } + if (hub->trackHub != NULL) { ourPrintCellLink(hub->trackHub->shortLabel, hub->hubUrl); } else ourPrintCell(""); if (!isEmpty(hub->errorMessage)) - printf("ERROR: %s " - "Debug\n", + { + ourCellStart(); + printf("ERROR: %s " + "Debug Help\n", hub->errorMessage); + + // give people a chance to clear the error + printf("" + , hub->hubUrl); + ourCellEnd(); + } else if (hub->trackHub != NULL) { if (hub->trackHub->descriptionUrl != NULL) ourPrintCellLink(hub->trackHub->longLabel, hub->trackHub->descriptionUrl); else ourPrintCell(hub->trackHub->longLabel); } else ourPrintCell(""); if (hub->trackHub != NULL) printGenomes(hub->trackHub, count); else ourPrintCell(""); + + puts(""); } -printf("\n"); +printf("\n"); printf(""); } static void addPublicHubsToHubStatus(struct sqlConnection *conn, char *publicTable, char *statusTable) /* add url's in the hubPublic table to the hubStatus table if they aren't there already */ { char query[1024]; sqlSafef(query, sizeof(query), "select hubUrl from %s where hubUrl not in (select hubUrl from %s)\n", publicTable, statusTable); struct sqlResult *sr = sqlGetResult(conn, query); char **row; while ((row = sqlNextRow(sr)) != NULL) { char *errorMessage = NULL; char *url = row[0]; @@ -313,31 +313,31 @@ { puts("Enter search terms to find in public track hub description pages:
" " \n" "\n"); puts("

\n"); } // if we have search terms, put out the line telling the user so if (haveTrixFile && !isEmpty(hubSearchTerms)) { - printf("Displayed list restricted by search terms: %s\n", hubSearchTerms); + printf("Displayed list restricted by search terms: %s\n", hubSearchTerms); puts("\n"); puts("

\n"); strLower(cleanSearchTerms); urlSearchHash = getUrlSearchHash(trixFile, cleanSearchTerms); } // make sure all the public hubs are in the hubStatus table. addPublicHubsToHubStatus(conn, publicTable, statusTable); struct hash *publicHash = newHash(5); @@ -375,31 +375,31 @@ puts("Clicking Connect redirects to the gateway page of the selected hub's default assembly.
"); printf(" " " " " " " " " " " " "\n"); // start first row printf(""); gotAnyRows = TRUE; } - if ((id != 0) && isEmpty(errorMessage)) + if (id != 0) { ourCellStart(); char hubName[32]; safef(hubName, sizeof(hubName), "%s%u", hgHubConnectHubVarPrefix, id); if (cartUsualBoolean(cart, hubName, FALSE)) printf("\n", id); else { // get first name off of list of supported databases char * name = dbListNames->name; @@ -410,58 +410,56 @@ safef(buffer, sizeof buffer, "hub_%d_%s", id, name); name = cloneString(buffer); } printf("\n", url,name); } ourCellEnd(); } - else if (!isEmpty(errorMessage)) - { - // give user a chance to clear the error - ourCellStart(); - printf( - "" - , url); - ourCellEnd(); - } else errAbort("cannot get id for hub with url %s\n", url); ourPrintCellLink(shortLabel, url); if (isEmpty(errorMessage)) { if (hasDescription && !isEmpty(descriptionUrl)) ourPrintCellLink(longLabel, descriptionUrl); else ourPrintCell(longLabel); } else - printf("", + { + ourCellStart(); + printf("ERROR: %s " + "Debug Help", errorMessage); + printf( + "" + , url); + ourCellEnd(); + } printGenomeList(dbListNames, count); } sqlFreeResult(&sr); if (gotAnyRows) printf("
DisplayHub NameDescriptionAssemblies
ERROR: %s " - "Debug
\n"); printf(""); *pHash = publicHash; return gotAnyRows; } struct hash *hgHubConnectPublic()