adebe24a8bd4bae96112b0565465e43fa202a50d
hiram
Thu Apr 11 14:39:46 2019 -0700
add JSON public hubs and UCSC database genomes example links refs #18869
diff --git src/hg/hubApi/hubApi.c src/hg/hubApi/hubApi.c
index 68ac29a..5e657f0 100644
--- src/hg/hubApi/hubApi.c
+++ src/hg/hubApi/hubApi.c
@@ -1117,30 +1117,31 @@
/* setup the selection pull-downs for source */
{
char *hubDropDown = cartUsualString(cart, "publicHubs", defaultHub);
char *urlDropDown = urlFromShortLabel(hubDropDown);
char *otherHubUrl = cartUsualString(cart, "urlHub", "");
char *ucscDb = cartUsualString(cart, "ucscGenome", defaultDb);
if (isEmpty(otherHubUrl))
otherHubUrl = urlDropDown;
char *radioOn = cartUsualString(cart, RADIO_GROUP, RADIO_PUBHUB);
/* create border around table, but not inside the table with the data */
hPrintf("
\n");
hPrintf("\n");
+hPrintf("Select one of these three sources, and display options: | \n");
int maxDbNameWidth = 0;
struct dbDb *dbList = ucscDbDb();
char **ucscDbList = NULL;
int listSize = slCount(dbList);
AllocArray(ucscDbList, listSize);
struct dbDb *el = dbList;
int ucscDataBaseCount = 0;
for ( ; el != NULL; el = el->next )
{
ucscDbList[ucscDataBaseCount++] = el->name;
if (strlen(el->name) > maxDbNameWidth)
maxDbNameWidth = strlen(el->name);
}
maxDbNameWidth += 1;
@@ -1195,30 +1196,33 @@
hWrites("\n");
trackLeavesOnly = cartUsualBoolean(cart, "trackLeavesOnly", trackLeavesOnly);
hWrites(" | JSON list output: | ");
hCheckBox("trackLeavesOnly", trackLeavesOnly);
hWrites(" show only data tracks, do not show composite container information");
hWrites(" | \n");
/* go button at the bottom of the table */
hWrites(" | ");
hButton("sourceSelected", "go");
hWrites(" | press 'go' after selections made | \n");
hPrintf("\n");
+
+hPrintf("(example JSON list output: Public hubs, and UCSC database genomes) | \n");
+
hPrintf(" \n");
hPrintf(" |
\n");
/* how does debug carry forward ? */
// if (debug)
// cgiMakeHiddenVar("debug", "1");
}
static void doMiddle(struct cart *theCart)
/* Set up globals and make web page */
{
cart = theCart;
measureTiming = hPrintStatus() && isNotEmpty(cartOptionalString(cart, "measureTiming"));
measureTiming = TRUE;
char *database = NULL;
@@ -1345,43 +1349,42 @@
if (commandError)
{
hPrintf("ERROR: no such command: '%s/%s' for endpoint '%s'
", words[0], words[1], pathInfo);
}
long lastTime = clock1000();
struct trackHub *hub = errCatchTrackHubOpen(urlInput);
if (measureTiming || debug)
{
long thisTime = clock1000();
if (debug)
hPrintf("hub open time: %ld millis
\n", thisTime - lastTime);
}
-hPrintf("Please refer to API help documentation for more information about the JSON data API operation.
\n");
-hPrintf("\n");
+hPrintf("\n");
if (debug)
showCartDump();
hPrintf("Explore hub or database assemblies and tracks
\n");
-hPrintf("Select one of these three sources, and display options:
\n");
selectionForm();
/* these style mentions need to go into custom css file */
-hPrintf("\n");
+hPrintf("
\n");
+
if (sameWord(RADIO_UCSCDB, selectRadio)) /* requested UCSC db track list */
{
tracksForUcscDb(ucscDb);
}
else
{
hPrintf("
%s url: %s
\n", sameWord(RADIO_PUBHUB,selectRadio) ? "Public hub" : "Other hub", urlInput);
hPrintf("
\n");
hubInfo("hub name", hub->name);
hubInfo("short label", hub->shortLabel);
hubInfo("long label", hub->longLabel);
hubInfo("genomes file", hub->genomesFile);
hubInfo("default db", hub->defaultDb);
hubInfo("description url", hub->descriptionUrl);
hubInfo("email", hub->email);