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("<table border=4>\n"); hPrintf("<tr><td><table border=0>\n"); +hPrintf("<tr><th colspan=3>Select one of these three sources, and display options:</th></tr>\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("</td></tr>\n"); trackLeavesOnly = cartUsualBoolean(cart, "trackLeavesOnly", trackLeavesOnly); hWrites("<tr><td> </td><th>JSON list output:</th><td>"); hCheckBox("trackLeavesOnly", trackLeavesOnly); hWrites(" show only data tracks, do not show composite container information"); hWrites("</td></tr>\n"); /* go button at the bottom of the table */ hWrites("<tr><td> </td><td align=center>"); hButton("sourceSelected", "go"); hWrites("</td><td>press 'go' after selections made</td></tr>\n"); hPrintf("</form>\n"); + +hPrintf("<tr><th colspan=3>(example JSON list output: <a href='/list/publicHubs' target=_blank>Public hubs</a>, and <a href='/list/ucscGenomes' target=_blank>UCSC database genomes</a>)</th></tr>\n"); + hPrintf("</table>\n"); hPrintf("</td></tr></table>\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("<h3>ERROR: no such command: '%s/%s' for endpoint '%s'</h3>", words[0], words[1], pathInfo); } long lastTime = clock1000(); struct trackHub *hub = errCatchTrackHubOpen(urlInput); if (measureTiming || debug) { long thisTime = clock1000(); if (debug) hPrintf("<em>hub open time: %ld millis</em><br>\n", thisTime - lastTime); } -hPrintf("<h3>Please refer to <a href='../../goldenPath/help/api.html'>API help</a> documentation for more information about the JSON data API operation.</h3>\n"); -hPrintf("<h3>See also: <a href='../../goldenPath/help/trackDb/trackDbHub.html' target=_blank>Track definition document</a> for definitions of track settings.</h3>\n"); +hPrintf("<h3>Documentation: <a href='../../goldenPath/help/api.html'>API definitions/help</a>, and <a href='../../goldenPath/help/trackDb/trackDbHub.html' target=_blank>Track definition document</a> for definitions of track settings.</h3>\n"); if (debug) showCartDump(); hPrintf("<h2>Explore hub or database assemblies and tracks</h2>\n"); -hPrintf("<h3>Select one of these three sources, and display options:</h3>\n"); selectionForm(); /* these style mentions need to go into custom css file */ -hPrintf("<div style='border:1px solid black;height:500px;overflow:scroll'>\n"); +hPrintf("<div style='height:500px;overflow:scroll'>\n"); + if (sameWord(RADIO_UCSCDB, selectRadio)) /* requested UCSC db track list */ { tracksForUcscDb(ucscDb); } else { hPrintf("<h3>%s url: <em>%s</em></h3>\n", sameWord(RADIO_PUBHUB,selectRadio) ? "Public hub" : "Other hub", urlInput); hPrintf("<ul>\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);