src/hg/hgSession/hgSession.c 1.51

1.51 2009/06/15 18:15:53 angie
Merged some duplicate notification messages about custom tracks and blat results when creating a session -- Thanks Ann.
Index: src/hg/hgSession/hgSession.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgSession/hgSession.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -b -B -U 4 -r1.50 -r1.51
--- src/hg/hgSession/hgSession.c	19 Mar 2009 21:38:36 -0000	1.50
+++ src/hg/hgSession/hgSession.c	15 Jun 2009 18:15:53 -0000	1.51
@@ -605,8 +605,9 @@
     dyStringAppend(dy, "', ");
     dyStringPrintf(dy, "%d, ", (shareSession ? 1 : 0));
     dyStringPrintf(dy, "%s, now(), %d);", firstUse, useCount);
     sqlUpdate(conn, dy->string);
+    dyStringFree(&dy);
 
     if (useCount > INITIAL_USE_COUNT)
 	dyStringPrintf(dyMessage,
 	  "Overwrote the contents of session <B>%s</B> "
@@ -621,32 +622,10 @@
 	  "%s %s",
 	  htmlEncode(sessionName), (shareSession ? "may" : "may not"),
 	  getSessionLink(encUserName, encSessionName),
 	  getSessionEmailLink(encUserName, encSessionName));
-    if (cartFindPrefix(cart, CT_FILE_VAR_PREFIX) != NULL)
-	{
-	dyStringPrintf(dyMessage,
-		"<P>The session contains a reference to at least one "
-		"custom track.  Custom tracks are "
-		"subject to an expiration policy described in the "
-		"<A HREF=\"../goldenPath/help/customTrack.html\" "
-		"TARGET=_BLANK>custom track documentation</A>.  "
-		"In order to keep a custom track from expiring, you can "
-		"periodically view the custom track in the genome browser."
-		"</P>");
 	checkForCustomTracks(dyMessage);
 	}
-    if (cartOptionalString(cart, "ss") != NULL)
-	dyStringPrintf(dyMessage,
-		"<P>Note: the session contains a reference to saved BLAT "
-		"results, which are subject to the same expiration policy as "
-		"<A HREF=\"../goldenPath/help/customTrack.html\" "
-		"TARGET=_BLANK>custom tracks</A>.  "
-		"In order to keep BLAT results from expiring, you can "
-		"periodically view them in the genome browser."
-		"</P>");
-    dyStringFree(&dy);
-    }
 else
     dyStringPrintf(dyMessage,
 	  "Sorry, required table %s does not exist yet in the central "
 	  "database (%s).  Please ask a developer to create it using "
@@ -703,9 +682,9 @@
 	    dyStringPrintf(dyMessage, "<A HREF=\"hgCustom?%s&db=%s\">%s</A>%s",
 			   cartSidUrlString(cart), sln->name,
 			   sln->name, (sln->next ? sln->next->next ? ", " : " and " : ""));
 	dyStringAppend(dyMessage, "; click on the database link "
-		       "to manage custom tracks).");
+		       "to manage custom tracks).  ");
 
 	}
     if (gotExpiredCT)
 	{
@@ -716,11 +695,15 @@
 	for (sln = expiredDbList;  sln != NULL;  sln = sln->next)
 	    dyStringPrintf(dyMessage, "%s%s",
 			   sln->name, (sln->next ? sln->next->next ? ", " : " and " : ""));
 	dyStringPrintf(dyMessage,
-		       "), so it may not appear as originally intended."
-		       "</P>");
+		       "), so it may not appear as originally intended.  ");
 	}
+    dyStringPrintf(dyMessage,
+		   "Custom tracks are subject to an expiration policy described in the "
+		   "<A HREF=\"../goldenPath/help/customTrack.html\" TARGET=_BLANK>custom "
+		   "track documentation</A>.  In order to keep a custom track from expiring, "
+		   "you can periodically view the custom track in the genome browser.</P>");
     slNameFreeList(&liveDbList);
     slNameFreeList(&expiredDbList);
     }
 /* Check for saved blat results (quasi custom track). */
@@ -739,20 +722,19 @@
 	exists = fileExists(words[0]) && fileExists(words[1]);
 
     if (exists)
 	dyStringPrintf(dyMessage,
-		"<P>Note: the session contains saved BLAT results "
-		"which are subject to the same expiration policy as "
-		"<A HREF=\"../goldenPath/help/customTrack.html\" "
-		"TARGET=_BLANK>custom tracks</A>.  "
-		"In order to keep blat results from expiring, you can "
-		"periodically view them in the genome browser."
-		"</P>");
+		       "<P>Note: the session contains saved BLAT results.  ");
     else
 	dyStringPrintf(dyMessage,
 		"<P>Note: the session contains an expired reference to "
 		"previously saved BLAT results, so it may not appear as "
-		"originally intended.</P>");
+		"originally intended.  ");
+    dyStringPrintf(dyMessage,
+		   "BLAT results are subject to the same expiration policy as "
+		   "<A HREF=\"../goldenPath/help/customTrack.html\" TARGET=_BLANK>custom "
+		   "tracks</A>.  In order to keep BLAT results from expiring, you can "
+		   "periodically view them in the genome browser.</P>");
     }
 }
 
 char *doUpdateSessions()