ef2869665d8c2d4fe59743faabe050de406a5278 braney Wed Apr 13 18:00:32 2011 -0700 add support for private hubs. Needs more work and doc, the biggest problem I know of is that you can't switch off the private hubs, but it should give folks an idea of how I'm thinking of supporting them. diff --git src/hg/inc/hubConnect.h src/hg/inc/hubConnect.h index 169c606..e85cfc7 100644 --- src/hg/inc/hubConnect.h +++ src/hg/inc/hubConnect.h @@ -25,49 +25,57 @@ int id; /* Hub ID */ char *shortLabel; /* Hub short label. */ char *longLabel; /* Hub long label. */ char *hubUrl; /* URL to hub.ra file. */ char *errorMessage; /* If non-empty hub has an error and this describes it. */ unsigned dbCount; /* Number of databases hub has data for. */ char **dbArray; /* Array of databases hub has data for. */ }; void hubConnectStatusFree(struct hubConnectStatus **pHub); /* Free hubConnectStatus */ void hubConnectStatusFreeList(struct hubConnectStatus **pList); /* Free a list of dynamically allocated hubConnectStatus's */ -struct hubConnectStatus *hubConnectStatusForId(struct sqlConnection *conn, int id); +struct hubConnectStatus *hubConnectStatusForId(struct cart *cart, + struct sqlConnection *conn, int id); /* Given a hub ID return associated status. */ struct hubConnectStatus *hubConnectStatusListFromCart(struct cart *cart); /* Return list of track hubs that are turned on by user in cart. */ #define hubConnectTrackHubsVarName "trackHubs" /* Name of cart variable with list of track hubs. */ #define hgHubConnectCgiDestUrl "hgHubConnect.destUrl" /* Cart variable to tell hgHubConnect where to go on submit. */ #define hgHubConnectRemakeTrackHub "hgHubConnect.remakeTrackHub" /* Cart variable to indicate trackHub cart variable needs refreshing. */ #define hgHubConnectHubVarPrefix "hgHubConnect.hub." /* Prefix to temporary variable holding selected cart names. */ boolean hubConnectTableExists(); /* Return TRUE if the hubConnect table exists. */ struct slName *hubConnectHubsInCart(struct cart *cart); /* Return list of track hub ids that are turned on by user. */ int hubIdFromTrackName(char *trackName); /* Given something like "hub_123_myWig" return 123 */ -struct trackDb *hubConnectAddHubForTrackAndFindTdb(char *database, char *trackName, - struct trackDb **pTdbList, struct hash *trackHash); +struct trackDb *hubConnectAddHubForTrackAndFindTdb(struct cart *cart, + char *database, char *trackName, struct trackDb **pTdbList, + struct hash *trackHash); /* Go find hub for trackName (which will begin with hub_), and load the tracks * for it, appending to end of list and adding to trackHash. Return the * trackDb associated with trackName. */ +char *hubFileVar(); +/* return the name of the cart variable that holds the name of the + * file in trash that has private hubs */ + +boolean hubWriteToFile(FILE *f, struct hubConnectStatus *el); +/* write out a hubConnectStatus structure to a file */ #endif /* HUBCONNECT_H */