b312b42ad8c3e89350417bb7b05c9e05a1507281 kate Thu Jan 27 22:10:20 2011 -0800 Support for genome browser preview site. 1. Changes browser title in CGIs 2. Prints warning text on hgGateway 3. Prints warning text on home page 1. and 2. activated by HTTP_HOST prefix 'genome-preview', or by setting test.preview=true in hg.conf diff --git src/hg/hgGateway/hgGateway.c src/hg/hgGateway/hgGateway.c index 450149d..dbbae3a 100644 --- src/hg/hgGateway/hgGateway.c +++ src/hg/hgGateway/hgGateway.c @@ -10,31 +10,30 @@ #include "hdb.h" #include "dbDb.h" #include "hgFind.h" #include "hCommon.h" #include "hui.h" #include "customTrack.h" #include "hubConnect.h" #include "hgConfig.h" #include "jsHelper.h" #include "hPrint.h" #include "suggest.h" #include "searchTracks.h" static char const rcsid[] = "$Id: hgGateway.c,v 1.117 2010/04/29 02:54:35 larrym Exp $"; -boolean isPrivateHost; /* True if we're on genome-test. */ struct cart *cart = NULL; struct hash *oldVars = NULL; char *clade = NULL; char *organism = NULL; char *db = NULL; void hgGateway() /* hgGateway - Human Genome Browser Gateway. */ { char *defaultPosition = hDefaultPos(db); char *position = cloneString(cartUsualString(cart, "position", defaultPosition)); boolean gotClade = hGotClade(); char *survey = cfgOptionEnv("HGDB_SURVEY", "survey"); char *surveyLabel = cfgOptionEnv("HGDB_SURVEY_LABEL", "surveyLabel"); boolean supportsSuggest = assemblySupportsGeneSuggest(db); @@ -216,36 +215,48 @@ if(supportsSuggest) cgiMakeOnClickButton("document.mainForm.position.value=''; document.getElementById('suggest').value='';", "clear position"); else cgiMakeOnClickButton("document.mainForm.position.value=''", "clear position"); puts("</TD>"); puts("</TR></TABLE>"); puts("</center>\n" "</td></tr></table>\n" "</td></tr></table>\n" "</td></tr></table>\n" ); puts("</center>"); puts("</FORM>"); -if (isPrivateHost) -puts("<P>This is just our test site. It usually works, but it is filled with tracks in various " +if (hIsPreviewHost()) + { +puts("<P>" +"WARNING: This is our preview site. It is a weekly mirror of our internal development server for public access. " +"Data and tools here are under construction, have not been quality reviewed, and are subject to change " +"at any time. We provide this site for early access, with the warning that it is less available " +"and stable than our public site. For high-quality reviewed annotations on our production server, visit " +" <A HREF=\"http://genome.ucsc.edu\">http://genome.ucsc.edu</A>." +"</P><BR>"); + } +else if (hIsPrivateHost()) + { +puts("<P>WARNING: This is our development and test site. It usually works, but it is filled with tracks in various " "stages of construction, and others of little interest to people outside of our local group. " "It is usually slow because we are building databases on it. The documentation is poor. " "More data than usual is flat out wrong. Maybe you want to go to " "<A HREF=\"http://genome.ucsc.edu\">genome.ucsc.edu</A> instead."); + } if (hIsGsidServer()) { webNewSection("%s", "Sequence View\n"); printf("%s", "Sequence View is a customized version of the UCSC Genome Browser, which is specifically tailored to provide functions needed for the GSID HIV Data Browser.\n"); } hgPositionsHelpHtml(organism, db); puts("<FORM ACTION=\"../cgi-bin/hgGateway\" METHOD=\"GET\" NAME=\"orgForm\">"); cartSaveSession(cart); /* Put up hgsid= as hidden variable. */ if (gotClade) printf("<input type=\"hidden\" name=\"clade\" value=\"%s\">\n", clade); else @@ -263,46 +274,44 @@ cart = theCart; getDbGenomeClade(cart, &db, &organism, &clade, oldVars); if (! hDbIsActive(db)) { db = hDefaultDb(); organism = hGenome(db); clade = hClade(organism); } scientificName = hScientificName(db); if (hIsGsidServer()) cartWebStart(theCart, db, "GSID %s Sequence View (UCSC Genome Browser) Gateway \n", organism); else { char buffer[128]; - char *browserName = (isPrivateHost ? "TEST Genome Browser" : "Genome Browser"); /* tell html routines *not* to escape htmlOut strings*/ htmlNoEscape(); buffer[0] = 0; if (*scientificName != 0) { if (sameString(clade,"ancestor")) safef(buffer, sizeof(buffer), "(<I>%s</I> Ancestor) ", scientificName); else safef(buffer, sizeof(buffer), "(<I>%s</I>) ", scientificName); } - cartWebStart(theCart, db, "%s %s%s Gateway\n", organism, buffer, browserName); + cartWebStart(theCart, db, "%s %s%s Gateway\n", organism, buffer, hBrowserName()); htmlDoEscape(); } hgGateway(); cartWebEnd(); } char *excludeVars[] = {NULL}; int main(int argc, char *argv[]) /* Process command line. */ { -isPrivateHost = hIsPrivateHost(); oldVars = hashNew(10); cgiSpoof(&argc, argv); cartEmptyShell(doMiddle, hUserCookie(), excludeVars, oldVars); return 0; }