9602d19ee87ad78e36ba6970cf4372937406d170
braney
  Thu Sep 7 15:57:32 2017 -0700
copy hgCollection hubs when saved or restored from sessions

diff --git src/hg/hgCollection/hgCollection.c src/hg/hgCollection/hgCollection.c
index 6732a7a..4ab61dd 100644
--- src/hg/hgCollection/hgCollection.c
+++ src/hg/hgCollection/hgCollection.c
@@ -20,31 +20,31 @@
 #include "customComposite.h"
 #include "stdlib.h"
 
 /* Global Variables */
 struct cart *cart;		/* CGI and other variables */
 struct hash *oldVars = NULL;	/* The cart before new cgi stuff added. */
 char *genome = NULL;		/* Name of genome - mouse, human, etc. */
 char *database = NULL;		/* Current genome database - hg17, mm5, etc. */
 char *regionType = NULL;	/* genome, ENCODE pilot regions, or specific position range. */
 struct grp *fullGroupList = NULL;	/* List of all groups. */
 struct trackDb *fullTrackList = NULL;	/* List of all tracks in database. */
  struct pipeline *compressPipeline = (struct pipeline *)NULL;
 
 
 // Null terminated list of CGI Variables we don't want to save permanently:
-char *excludeVars[] = {"Submit", "submit", "hgva_startQuery", NULL,};
+char *excludeVars[] = {"Submit", "submit", "hgva_startQuery", "jsonp", NULL,};
 
 struct track
 {
 struct track *next;
 struct track *trackList;
 struct trackDb *tdb;
 char *name;
 char *shortLabel;
 char *longLabel;
 char *visibility;
 unsigned long color;
 char *viewFunc;
 };
 
 char *getString(char **input)
@@ -145,40 +145,36 @@
 if (tdb->subtracks)
     {
     struct trackDb *subTdb;
 
     jsInlineF("<ul>");
     for(subTdb = tdb->subtracks; subTdb; subTdb = subTdb->next)
         printGroup(trackHubSkipHubName(tdb->track), subTdb, user && (subTdb->subtracks != NULL), user);
     jsInlineF("</ul>");
     }
 jsInlineF("</li>");
 }
 
 static void outHubHeader(FILE *f, char *db, char *hubName)
 // output a track hub header
 {
-char *hubFile = strrchr(hubName, '/') + 1;
-
 fprintf(f,"hub hub1\n\
 shortLabel User Composite\n\
 longLabel User Composite\n\
-genomesFile %s\n\
-email braney@soe.ucsc.edu\n\
-descriptionUrl hub.html\n\n", hubFile);
-fprintf(f,"genome %s\n\
-trackDb %s\n\n", db, hubFile);  
+useOneFile on\n\
+email genome-www@soe.ucsc.edu\n\n");
+fprintf(f,"genome %s\n\n", db);  
 }
 
 
 static char *getHubName(char *db)
 // get the name of the hub to use for user collections
 {
 struct tempName hubTn;
 char buffer[4096];
 safef(buffer, sizeof buffer, "%s-%s", customCompositeCartName, db);
 char *hubName = cartOptionalString(cart, buffer);
 
 if (hubName == NULL)
     {
     trashDirDateFile(&hubTn, "hgComposite", "hub", ".txt");
     hubName = cloneString(hubTn.forCgi);
@@ -460,31 +456,31 @@
 fprintf(f, "\n");
 }
 
 static void outComposite(FILE *f, struct track *collection)
 // output a composite header for user composite
 {
 char *parent = collection->name;
 char *shortLabel = collection->shortLabel;
 char *longLabel = collection->longLabel;
 fprintf(f,"track %s\n\
 shortLabel %s\n\
 compositeTrack on\n\
 aggregate none\n\
 longLabel %s\n\
 %s on\n\
-\tcolor %ld,%ld,%ld \n\
+color %ld,%ld,%ld \n\
 type wig \n\
 visibility full\n\n", parent, shortLabel, longLabel, CUSTOM_COMPOSITE_SETTING,
  0xff& (collection->color >> 16),0xff& (collection->color >> 8),0xff& (collection->color));
 
 }
 
 int snakePalette2[] =
 {
 0x1f77b4, 0xaec7e8, 0xff7f0e, 0xffbb78, 0x2ca02c, 0x98df8a, 0xd62728, 0xff9896, 0x9467bd, 0xc5b0d5, 0x8c564b, 0xc49c94, 0xe377c2, 0xf7b6d2, 0x7f7f7f, 0xc7c7c7, 0xbcbd22, 0xdbdb8d, 0x17becf, 0x9edae5
 };
 
 static char *skipColl(char *str)
 {
 if (startsWith("coll_", str))
     return &str[5];