Exemplo n.º 1
0
void doControls(struct sqlConnection *conn)
/* Put up controls pane. */
{
char *listSpec = cartUsualString(cart, hgpListSpec, "");
htmlSetBgColor(0xD0FFE0);
              // resource file link wrapped in html
char * link = webTimeStampedLinkToResourceOnFirstCall("HGStyle.css",TRUE); 
if (link)
    htmlSetStyle(link);
htmStart(stdout, "do controls");
printf("<FORM ACTION=\"%s\" NAME=\"mainForm\" target=\"_parent\" METHOD=GET>\n",
	hgVisiGeneCgiName());
cartSaveSession(cart);

printf("<TABLE WIDTH=100%%><TR>");
printf("<TD WIDTH=230 bgcolor=\"#"HG_COL_HOTLINKS"\">");
printf("&nbsp;<B><A HREF=\"../index.html\" target=\"_parent\" class=\"topbar\">UCSC</A> ");
printf("&nbsp;<A HREF=\"%s?%s=\" target=\"_parent\" class=\"topbar\">VisiGene</A></B> ",
	hgVisiGeneCgiName(), hgpListSpec);
printf("</TD>");

printf("<TD>");
printf("&nbsp");
cgiMakeTextVar(hgpListSpec, listSpec, 16);
cgiMakeButton(hgpDoSearch, "search");
printf("</TD>");

#ifdef SOON
printf("<TD>");
cgiMakeButton(hgpDoConfig, "configure");
printf("</TD>");
#endif /* SOON */

printf("<TD>");
printf("Zoom: ");
printf(
"<INPUT TYPE=SUBMIT NAME=\"hgp_zmOut\" VALUE=\" out \""
" onclick=\"parent.image.bigImg.zoomer('out');return false;\"> "
"<INPUT TYPE=SUBMIT NAME=\"hgp_zmIn\" VALUE=\" in \""
" onclick=\"parent.image.bigImg.zoomer('in');return false;\"> "
"<INPUT TYPE=SUBMIT NAME=\"hgp_zmFull\" VALUE=\" full \""
" onclick=\"parent.image.bigImg.zoomer('full');return false;\"> "
"<INPUT TYPE=SUBMIT NAME=\"hgp_zmFit\" VALUE=\" fit \""
" onclick=\"parent.image.bigImg.zoomer('fit');return false;\"> "
"\n");
printf("</TD>");

printf("<TD ALIGN=Right>");
printf("<A HREF=\"../goldenPath/help/hgTracksHelp.html#VisiGeneHelp\" target=_parent>");
printf("Help");
printf("</A>&nbsp;");
printf("</TD>");
printf("</TR></TABLE>");
printf("</FORM>\n");
htmlEnd();
}
Exemplo n.º 2
0
int main(int argc, char *argv[])
/* Process command line. */
{
long enteredMainTime = clock1000();
cgiSpoof(&argc, argv);
htmlSetStyle(htmlStyleUndecoratedLink);
if (argc != 1)
    usage();
oldVars = hashNew(10);
cartEmptyShell(cartMain, hUserCookie(), excludeVars, oldVars);
cgiExitTime("hgGene", enteredMainTime);
return 0;
}
Exemplo n.º 3
0
int main(int argc, char *argv[])
{
long enteredMainTime = clock1000();
measureTime(NULL);
setUdcCacheDir();
browserName = hBrowserName();
organization = "UCSC";

/* Push very early error handling - this is just
 * for the benefit of the cgiVarExists, which
 * somehow can't be moved effectively into doMiddle. */
htmlPushEarlyHandlers();
cgiSpoof(&argc, argv);
char * link = webTimeStampedLinkToResourceOnFirstCall("HGStyle.css",TRUE); // resource file link
if (link)                                                                  // wrapped in html
    htmlSetStyle(link);

oldVars = hashNew(10);

if (cgiVarExists("hgt.redirectTool"))
    {
    printf("Content-type: text/html\n\n");

    cart = cartForSession(hUserCookie(), NULL, NULL);
    printf("<html><body>\n");
    printf("<form id=\"redirForm\" method=\"POST\" action=\"http://tefor.net/crisporMax/crispor.cgi\">\n");
    printf("<input type=\"hidden\" name=\"pos\" value=\"%s\">", cartString(cart, "position"));
    printf("<input type=\"hidden\" name=\"org\" value=\"%s\">", cartString(cart, "db"));
    printf("<input type=\"hidden\" name=\"pam\" value=\"NGG\">\n");
    // a hidden submit button, see
    // http://stackoverflow.com/questions/477691/submitting-a-form-by-pressing-enter-without-a-submit-button
    printf("<input type=\"submit\" style=\"position: absolute; left: -9999px; width: 1px; height: 1px;\">\n");
    printf("</form>\n");
    // a little javascript that clicks the submit button
    printf("<script>document.getElementById(\"redirForm\").submit();</script>\n");
    printf("</body></html>\n");
    }
else
    cartHtmlShell("UCSC Genome Browser v"CGI_VERSION, doMiddle, hUserCookie(), excludeVars, oldVars);

if (measureTiming)
    measureTime("Time to write and close cart");
if (measureTiming)
    {
    fprintf(stdout, "<span class='timing'>Overall total time: %ld millis<br /></span>\n",
            clock1000() - enteredMainTime);
    }
cgiExitTime("hgTracks", enteredMainTime);
return 0;
}
Exemplo n.º 4
0
int main(int argc, char *argv[])
{
long enteredMainTime = clock1000();
measureTime(NULL);
browserName = hBrowserName();
organization = "UCSC";

/* Push very early error handling - this is just
 * for the benefit of the cgiVarExists, which
 * somehow can't be moved effectively into doMiddle. */
htmlPushEarlyHandlers();
cgiSpoof(&argc, argv);
char * link = webTimeStampedLinkToResourceOnFirstCall("HGStyle.css",TRUE); // resource file link
if (link)                                                                  // wrapped in html
    htmlSetStyle(link);

oldVars = hashNew(10);

if (cgiVarExists("hgt.redirectTool"))
    {
    printf("Content-type: text/html\n\n");
    errAbortSetDoContentType(FALSE);
    cart = cartForSession(hUserCookie(), NULL, NULL);
    extToolRedirect(cart, cgiString("hgt.redirectTool"));
    }
else
    cartHtmlShell("UCSC Genome Browser v"CGI_VERSION, doMiddle, hUserCookie(), excludeVars, oldVars);

if (measureTiming)
    measureTime("Time to write and close cart");
if (measureTiming)
    {
    fprintf(stdout, "<span class='timing'>Overall total time: %ld millis<br /></span>\n",
            clock1000() - enteredMainTime);
    }
cgiExitTime("hgTracks", enteredMainTime);
return 0;
}
Exemplo n.º 5
0
int main(int argc, char *argv[])
/* Process command line */
{
long enteredMainTime = clock1000();
cgiSpoof(&argc, argv);
termOpt = cgiOptionalString(CV_TERM);
tagOpt = cgiOptionalString(CV_TAG);
typeOpt = cgiOptionalString(CV_TYPE);
targetOpt = cgiOptionalString(CV_TARGET);
labelOpt = cgiOptionalString(CV_LABEL);
organismOpt = cgiUsualString(ORGANISM, organismOpt);
if (organismOpt != NULL)
    {
    organismOptLower=cloneString(organismOpt);
    strLower(organismOptLower);
    }
char *bgColor = cgiOptionalString("bgcolor");
if (bgColor)
    htmlSetBgColor(strtol(bgColor, 0, 16));
htmlSetStyle(htmlStyleUndecoratedLink);
htmShell("ENCODE Controlled Vocabulary", doMiddle, "get");
cgiExitTime("hgEncodeVocab", enteredMainTime);
return 0;
}
Exemplo n.º 6
0
int main(int argc, char *argv[])
/* Process command line. */
{
pushCarefulMemHandler(100000000);
cgiSpoof(&argc, argv);
htmlSetStyle(htmlStyleUndecoratedLink);
htmlSetBgColor(HG_CL_OUTSIDE);
oldCart = hashNew(10);

cart = cartAndCookie(hUserCookie(), excludeVars, oldCart);

getDbAndGenome(cart, &database, &genome, oldCart);
//hSetDb(database);
conn = hAllocConn(database);

database = strdup("h1n1");

/* Get sortOn.  Revert to default by subject Id. */
orderOn = cartUsualString(cart, orderVarName, "+subjId");

displayCountString = cartUsualString(cart, countVarName, "50");
if (sameString(displayCountString, "all"))
    displayCount = BIGNUM;
else
    displayCount = atoi(displayCountString);
colList = getColumns(conn);

if (cgiVarExists("submit_filter"))
    {
    struct dyString *head = dyStringNew(1024);
    boolean redir = cgiVarExists(redirectName);
    struct subjInfo *subjList = NULL;
    struct column *ordList = colList;
    struct column *ord = curOrder(ordList);
    subjList = getOrderedList(ord, colList, conn, BIGNUM);
    saveSubjList(subjList);
    if ((!subjList || redir))
	{
	if (subjList && redir)
	    {
	    dyStringPrintf(head,
		"<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"0;URL=/cgi-bin/%s\">"
		"<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">"
		"<META HTTP-EQUIV=\"Expires\" CONTENT=\"-1\">"
		, cgiString(redirectName));
    	    cartRemove(cart, redirectName);
	    }
	htmStartWithHead(stdout, head->string, "GISAID Table View");
	if (!subjList) /* if everything has been filtered out, we'll have to go back */
	    {
	    hPrintf("No subject(s) found with the filtering conditions specified.<br>");
	    hPrintf("Click <a href=\"gisaidTable?gisaidTable.do.advFilter=filter+%%28now+on%%29\">here</a> "
		"to return to Select Subjects.<br>");
	    }
	cartCheckout(&cart);
    	htmlEnd();
	hFreeConn(&conn);
	return 0;
	}
    }

htmStart(stdout, "GISAID Table View");
cartWarnCatcher(doMiddle, cart, htmlVaWarn);
cartCheckout(&cart);
htmlEnd();

hFreeConn(&conn);

return 0;
}
Exemplo n.º 7
0
static void doThumbnails(struct sqlConnection *conn)
/* Write out list of thumbnail images. */
{
char *sidUrl = cartSidUrlString(cart);
char *listSpec = cartUsualString(cart, hgpListSpec, "");
char *matchFile = cartString(cart, hgpMatchFile);
struct visiMatch *matchList = NULL, *match;
int maxCount = 25, count = 0;
int startAt = cartUsualInt(cart, hgpStartAt, 0);
int imageCount;

htmlSetStyle(
"<STYLE TYPE=\"text/css\">\n"
"  BODY {margin: 2px}\n"
"  </STYLE>\n"
);
htmlSetBgColor(0xC0C0D6);
htmStart(stdout, "doThumbnails");
matchList = readMatchFile(matchFile);
imageCount = slCount(matchList);
if (imageCount > 0)
    {
    printf(
"    <DIV"
"    ID='perspClip'"
"    STYLE='position:absolute;left:-1000px;top:-1000px;z-index:2;visibility:visible;overflow:hidden!important;'"
"         onmouseover='this.style.left=\"-1000px\";' "
"    >"
"    <DIV"
"    ID='perspective'"
"    STYLE='position:absolute;left:0px;top:0px;'"
"    >"
"    <IMG ID='perspBox' SRC='../images/dot_clear.gif' STYLE='position:absolute;left:0px;top:0px;width:100px;height:100px;border-style:solid;border-color:#8080FF;border-width:1px' "
">"
"    </DIV>"
"    </DIV>"
    );
    printf("<TABLE>\n");
    printf("<TR><TD><B>");
    printf("%d images match<BR>\n", imageCount);
    printf("</B></TD></TR>\n");
    for (match = slElementFromIx(matchList, startAt);
	    match != NULL; match = match->next)
	{
	int id = match->imageId;
	char *imageFile = visiGeneThumbSizePath(conn, id);
	printf("<TR>");
	printf("<TD>");
	printf("<A HREF=\"%s?%s&%s=%d&%s=do\" target=\"image\" >",
	    hgVisiGeneCgiName(),
	    sidUrl, hgpId, id, hgpDoImage);
	printf("<IMG SRC=\"%s\"></A><BR>\n", imageFile);

	smallCaption(conn, id);
	printf("<BR>\n");
	printf("</TD>");
	printf("</TR>");
	if (++count >= maxCount)
	    break;
	}
    printf("</TABLE>\n");
    printf("<HR>\n");
    }
if (count != imageCount)
    {
    int start;
    int page = 0;
    printf("%d-%d of %d for:<BR>", startAt+1,
	startAt+count, imageCount);
    printf("&nbsp;%s<BR>\n", listSpec);
    printf("Page:\n");
    for (start=0; start<imageCount; start += maxCount)
	{
	++page;
	if (start != startAt)
	    {
	    printf("<A HREF=\"%s?", hgVisiGeneCgiName());
	    printf("%s&", sidUrl);
	    printf("%s=on&", hgpDoThumbnails);
	    printf("%s=%s&", hgpListSpec, listSpec);
	    if (start != 0)
	       printf("%s=%d", hgpStartAt, start);
	    printf("\">");
	    }
	printf("%d", page);
	if (start != startAt)
	   printf("</A>");
	printf(" ");
	}
    }
else
    {
    printf("%d images for:<BR>", imageCount);
    printf("&nbsp;%s<BR>\n", listSpec);
    }
cartRemove(cart, hgpStartAt);
htmlEnd();
}