979a6409ad7d171eeb48d44b5a0d2cba0d304059 hiram Thu Jun 27 13:43:01 2019 -0700 checking for supported table and avoid container tracks on requests refs #23589 diff --git src/hg/hubApi/apiUtils.c src/hg/hubApi/apiUtils.c index f3a4887..29c1489 100644 --- src/hg/hubApi/apiUtils.c +++ src/hg/hubApi/apiUtils.c @@ -313,30 +313,31 @@ for (trackFound = tdb; trackFound; trackFound = trackFound->next) { if (trackFound->subtracks) { struct trackDb *subTrack = findTrackDb(track, trackFound->subtracks); if (subTrack) { if (sameOk(subTrack->track, track)) trackFound = subTrack; } } if (sameOk(trackFound->track, track)) break; } + return trackFound; } boolean allowedBigBedType(char *type) /* return TRUE if the big* bed-like type is to be supported * add to this list as the big* bed-like supported types are expanded */ { if (startsWithWord("bigBed", type) || startsWithWord("bigPsl", type) ) return TRUE; else return FALSE; } @@ -462,15 +463,33 @@ else sqlSafef(query, sizeof(query), "select * from dbDb where active=1"); struct dbDb *dbList = NULL, *el = NULL; struct sqlResult *sr = sqlGetResult(conn, query); char **row; while ((row = sqlNextRow(sr)) != NULL) { el = dbDbLoad(row); slAddHead(&dbList, el); } sqlFreeResult(&sr); hDisconnectCentral(&conn); slSort(&dbList, dbDbCmpName); return dbList; } + +boolean isSupportedType(char *type) +/* is given type in the supportedTypes list ? */ +{ +boolean ret = FALSE; +if (startsWith("wigMaf", type)) /* not wigMaf at this time */ + return ret; +struct slName *el; +for (el = supportedTypes; el; el = el->next) + { + if (startsWith(el->name, type)) + { + ret = TRUE; + break; + } + } +return ret; +}