16ac161a7e0835ba943b8c33c21858b0d1938219 braney Thu Oct 6 15:02:49 2011 -0700 change the relationship between the trackHub structure and the hubConnectStatus structure to be hierarchical. This fixes #4920. We now *always* fetch the URL contents instead of trusting what's in the hubStatus table *unless* there's an error message in the hubStatus table. diff --git src/hg/inc/hubConnect.h src/hg/inc/hubConnect.h index d4a4c83..fd20091 100644 --- src/hg/inc/hubConnect.h +++ src/hg/inc/hubConnect.h @@ -16,36 +16,33 @@ /* name of cgi variable containing new hub name */ #define hubTrackPrefix "hub_" /* The names of all hub tracks begin with this. Use in cart. */ boolean isHubTrack(char *trackName); /* Return TRUE if it's a hub track. */ struct hubConnectStatus /* Basic status in hubStatus. Note it is *not* the same as the * hubStatus table, that has a bunch of extra fields to help * keep track of whether the hub is alive. */ { struct hubConnectStatus *next; unsigned 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. */ + struct trackHub *trackHub; /* pointer to structure that describes hub */ unsigned status; /* 1 if private */ }; /* status bits */ #define HUB_UNLISTED (1 << 0) boolean isHubUnlisted(struct hubConnectStatus *hub) ; /* Return TRUE if it's an unlisted hub */ void hubConnectStatusFree(struct hubConnectStatus **pHub); /* Free hubConnectStatus */ void hubConnectStatusFreeList(struct hubConnectStatus **pList); /* Free a list of dynamically allocated hubConnectStatus's */ @@ -98,28 +95,28 @@ unsigned hubFindOrAddUrlInStatusTable(char *database, struct cart *cart, char *url, char **errorMessage); /* find or add a URL to the status table */ unsigned hubResetError(char *url); /* clear the error for this url in the hubStatus table,return the id */ unsigned hubClearStatus(char *url); /* drop the information about this url from the hubStatus table,return the id */ void hubDisconnect(struct cart *cart, char *url); /* drop the information about this url from the hubStatus table, and * the cart variable the references this hub */ -unsigned hubCheckForNew(char *database, struct cart *cart); -/* see if the user just typed in a new hub url, return hubId if so */ +void hubCheckForNew(char *database, struct cart *cart); +/* see if the user just typed in a new hub url, add to cart and hubStatus */ struct trackHub *trackHubFromId(unsigned hubId); /* Given a hub ID number, return corresponding trackHub structure. * ErrAbort if there's a problem. */ -void hubSetErrorMessage(char *errorMessage, unsigned id); +void hubUpdateStatus(char *errorMessage, struct hubConnectStatus *hub); /* set the error message in the hubStatus table */ -boolean hubHasDatabase(struct hubConnectStatus *hub, char *database) ; +boolean trackHubHasDatabase(struct trackHub *hub, char *database) ; /* Return TRUE if hub has contents for database */ #endif /* HUBCONNECT_H */