dc4dc74eb9e0b860f56347141d6d3e1ae76bd9ad
braney
  Fri May 30 15:09:18 2014 -0700
clean up some code for opening trackHubs, removed hgHubConnectCgiDestUrlcart variable, added ability to tell CGI's to default to a particular
database supported by a hub

diff --git src/hg/inc/hubConnect.h src/hg/inc/hubConnect.h
index 5a2d4f3..867a03c 100644
--- src/hg/inc/hubConnect.h
+++ src/hg/inc/hubConnect.h
@@ -29,30 +29,32 @@
 /* name of cgi variable containing new hub name */
 
 #define hubTrackPrefix "hub_"
 /* The names of all hub tracks begin with this.  Use in cart. */
 
 #define hgHubSearchTerms      "hubSearchTerms"
 /* name of cart/cgi variable containing the current search terms */
 
 #define hgHub             "hgHub_"  /* prefix for all control variables */
 #define hgHubDo            hgHub   "do_"    /* prefix for all commands */
 #define hgHubDoClear       hgHubDo "clear"
 #define hgHubDoReset       hgHubDo "reset"
 #define hgHubDoSearch      hgHubDo "search"
 #define hgHubDoDeleteSearch      hgHubDo "deleteSearch"
 #define hgHubDoDisconnect  hgHubDo "disconnect"
+#define hgHubDoFirstDb     hgHubDo "firstDb"
+#define hgHubDoDecorateDb  hgHubDo "decorateDb"
 
 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 *hubUrl;	/* URL to hub.ra file. */
     char *errorMessage;	/* If non-empty hub has an error and this describes it. */
     struct trackHub *trackHub; /* pointer to structure that describes hub */
     unsigned  status;   /* 1 if private */
@@ -65,33 +67,30 @@
 /* Free a list of dynamically allocated hubConnectStatus's */
 
 struct hubConnectStatus *hubConnectStatusForId( 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. */
 
 struct hubConnectStatus *hubConnectStatusListFromCartAll(struct cart *cart);
 /* Return list of all track hubs that are referenced by 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 hubIdFromCartName(char *trackName);
 /* Given something like "hgHubConnect.hub.123" return 123 */
 
@@ -117,45 +116,38 @@
 
 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 */
 
-void hubCheckForNew( 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 hubUpdateStatus(char *errorMessage, struct hubConnectStatus *hub);
 /* set the error message in the hubStatus table */
 
 boolean trackHubHasDatabase(struct trackHub *hub, char *database) ;
 /* Return TRUE if hub has contents for database */
 
 struct trackDb *hubAddTracks(struct hubConnectStatus *hub, char *database);
 /* Load up stuff from data hub and append to list. The hubUrl points to
  * a trackDb.ra format file.  */
 
-struct hubConnectStatus *hubConnectLoadHubs(struct cart *cart);
+char *hubConnectLoadHubs(struct cart *cart);
 /* load the track data hubs.  Set a static global to remember them */
 
 struct hubConnectStatus *hubConnectGetHubs();
 /* return the static global to the track data hubs */
 
 struct trackDb *hubCollectTracks( char *database, struct grp **pGroupList);
 /* Generate trackDb structures for all the tracks in attached hubs.  
  * Make grp structures for each hub. Returned group list is reversed. */
 
 char *hubConnectSkipHubPrefix(char *trackName);
 /* Given something like "hub_123_myWig" return myWig.  Don't free this, it's not allocated */
 #endif /* HUBCONNECT_H */