7e514a3e21033e87921d8c98bb4ac2e79caed9d1 tdreszer Thu May 9 12:50:15 2013 -0700 Initial check in of new hgGene section: Gene Alleles. The ra file is not being checked in yet. diff --git src/hg/hgGene/hgGene.c src/hg/hgGene/hgGene.c index 0513328..eaee604 100644 --- src/hg/hgGene/hgGene.c +++ src/hg/hgGene/hgGene.c @@ -360,30 +360,43 @@ { //printf("
adding %s section \n", section->name);fflush(stdout); if (section != NULL && hashLookup(section->settings, "hide") == NULL && section->exists(section, conn, curGeneId)) slAddHead(pList, section); } struct section *loadSectionList(struct sqlConnection *conn) /* Load up section list - first load up sections.ra, and then * call each section loader. */ { struct hash *sectionRa = NULL; struct section *sectionList = NULL; readRa("section.ra", §ionRa); + +// Could be an ajax request for a single section! +char *ajaxSection = cartOptionalString(cart, hggAjaxSection); +if (ajaxSection != NULL) + { + // Currently only one section supports ajax update. + if (sameString(ajaxSection,HGG_GENE_ALLELES)) + { + addGoodSection(allelesSection(conn, sectionRa), conn, §ionList); + return sectionList; + } + } + addGoodSection(linksSection(conn, sectionRa), conn, §ionList); /* disable ortherOrg section for CGB servers for the time being */ if (!hIsCgbServer()) addGoodSection(otherOrgsSection(conn, sectionRa), conn, §ionList); addGoodSection(gadSection(conn, sectionRa), conn, §ionList); addGoodSection(ctdSection(conn, sectionRa), conn, §ionList); /*if (isRgdGene(conn)) { addGoodSection(ctdRgdGene2Section(conn, sectionRa), conn, §ionList); } else { addGoodSection(ctdSection(conn, sectionRa), conn, §ionList); } */ addGoodSection(rgdGeneRawSection(conn, sectionRa), conn, §ionList); @@ -401,30 +414,31 @@ addGoodSection(swissProtCommentsSection(conn, sectionRa), conn, §ionList); addGoodSection(flyBaseRolesSection(conn, sectionRa), conn, §ionList); addGoodSection(flyBasePhenotypesSection(conn, sectionRa), conn, §ionList); addGoodSection(flyBaseSynonymsSection(conn, sectionRa), conn, §ionList); addGoodSection(bdgpExprInSituSection(conn, sectionRa), conn, §ionList); addGoodSection(goSection(conn, sectionRa), conn, §ionList); addGoodSection(infoSection(conn, sectionRa), conn, §ionList); addGoodSection(methodSection(conn, sectionRa), conn, §ionList); addGoodSection(localizationSection(conn, sectionRa), conn, §ionList); addGoodSection(transRegCodeMotifSection(conn, sectionRa), conn, §ionList); addGoodSection(pathwaysSection(conn, sectionRa), conn, §ionList); addGoodSection(mrnaDescriptionsSection(conn, sectionRa), conn, §ionList); //addGoodSection(pseudoGeneSection(conn, sectionRa), conn, §ionList); addGoodSection(synonymSection(conn, sectionRa), conn, §ionList); addGoodSection(geneReviewsSection(conn, sectionRa), conn, §ionList); +addGoodSection(allelesSection(conn, sectionRa), conn, §ionList); // addGoodSection(xyzSection(conn, sectionRa), conn, §ionList); slSort(§ionList, sectionCmpPriority); return sectionList; } void printIndex(struct section *sectionList) /* Print index to section. */ { int maxPerRow = 6, itemPos = 0; int rowIx = 0; struct section *section; @@ -666,30 +680,30 @@ cartWebStart(cart, database, "%s Gene %s (%s) Description and Page Index", genome, curGeneName, curGeneId); webMain(conn); cartWebEnd(); } hFreeConn(&spConn); hFreeConn(&conn); } /* load the cart with the position info we got from the gene name */ char buffer[1024]; safef(buffer, sizeof buffer, "%s:%d-%d", curGeneChrom, curGeneStart+1, curGeneEnd); cartSetString(cart, "position", cloneString(buffer)); cartRemovePrefix(cart, hggDoPrefix); } -char *excludeVars[] = {"Submit", "submit", NULL}; +char *excludeVars[] = {"Submit", "submit", "ajax", hggAjaxSection, NULL}; 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; }