217c8a80da9dfabfda95956e5b9b40435f0a9a79 kent Thu Jan 13 19:56:32 2011 -0800 Making hub work with table browser. diff --git src/hg/hgTables/schema.c src/hg/hgTables/schema.c index 1418738..ebb2126 100644 --- src/hg/hgTables/schema.c +++ src/hg/hgTables/schema.c @@ -11,30 +11,31 @@ #include "jksql.h" #include "hdb.h" #include "web.h" #include "trackDb.h" #include "joiner.h" #include "tableDescriptions.h" #include "asParse.h" #include "customTrack.h" #include "bedCart.h" #include "hgMaf.h" #include "hgTables.h" #include "wikiTrack.h" #include "makeItemsItem.h" #include "bedDetail.h" #include "pgSnp.h" +#include "hubConnect.h" static char const rcsid[] = "$Id: schema.c,v 1.66 2010/06/07 16:53:10 angie Exp $"; static char *nbForNothing(char *val) /* substitute   for empty strings to keep table formating sane */ { char *s = skipLeadingSpaces(val); if ((s == NULL) || (s[0] == '\0')) return " "; else return val; } static char *abbreviateInPlace(char *val, int len) /* Abbreviate a string to len characters. */ @@ -567,45 +568,57 @@ showSchemaCtBed(table, ct); else if (startsWithWord("maf", type)) showSchemaCtMaf(table, ct); else if (startsWithWord("array", type)) showSchemaCtArray(table, ct); else if (startsWithWord("makeItems", type)) showSchemaWithAutoSqlString(db, table, ct, makeItemsItemAutoSqlString); else if (sameWord("bedDetail", type)) showSchemaWithAutoSqlString(db, table, ct, bedDetailAutoSqlString); else if (sameWord("pgSnp", type)) showSchemaWithAutoSqlString(db, table, ct, pgSnpAutoSqlString); else errAbort("Unrecognized customTrack type %s", type); } +static void showSchemaHub(char *db, char *table) +/* Show schema on a hub track. */ +{ +struct trackDb *tdb = hashMustFindVal(fullTrackAndSubtrackHash, table); +char *type = cloneFirstWord(tdb->type); +hPrintf("Binary file of type %s stored at %s
\n", + type, trackDbSetting(tdb, "bigDataUrl")); +if (sameString(type, "bigBed")) + showSchemaBigBed(table); +} static void showSchemaWiki(struct trackDb *tdb, char *table) /* Show schema for the wikiTrack. */ { hPrintf("User annotations to UCSC genes or genome regions
\n"); showSchemaDb(wikiDbName(), tdb, table); } static void showSchema(char *db, struct trackDb *tdb, char *table) /* Show schema to open html page. */ { if (hIsBigBed(database, table, curTrack, ctLookupName)) showSchemaBigBed(table); else if (isCustomTrack(table)) showSchemaCt(db, table); +else if (isHubTrack(table)) + showSchemaHub(db, table); else if (sameWord(table, WIKI_TRACK_TABLE)) showSchemaWiki(tdb, table); else showSchemaDb(db, tdb, table); } void doTableSchema(char *db, char *table, struct sqlConnection *conn) /* Show schema around table (which is not described by curTrack). */ { struct trackDb *tdb = NULL; char parseBuf[256]; dbOverrideFromTable(parseBuf, &db, &table); htmlOpen("Schema for %s", table); tdb = hTrackDbForTrack(database, table); showSchema(db, tdb, table);