/* gsidPbGateway - GSID Protein View Gateway. */
#include "common.h"
#include "linefile.h"
#include "hash.h"
#include "cheapcgi.h"
#include "htmshell.h"
#include "obscure.h"
#include "web.h"
#include "cart.h"
#include "hdb.h"
#include "dbDb.h"
#include "hgFind.h"
#include "hCommon.h"
#include "hui.h"
struct cart *cart = NULL;
struct hash *oldVars = NULL;
static char * const orgCgiName = "org";
static char * const dbCgiName = "db";
char *organism = NULL;
char *db = NULL;
void gsidPbGateway()
/* gsidPbGateway - GSID Protein View. */
{
char *defaultPosition = hDefaultPos(db);
char *position = cloneString(cartUsualString(cart, "position", defaultPosition));
if (sameString(position, "proteome") || sameString(position, "genome") ||
sameString(position, "hgBatch"))
position = defaultPosition;
puts(
"
\n"
);
printf("
");
}
void doMiddle(struct cart *theCart)
/* Set up pretty web display and save cart in global. */
{
cart = theCart;
getDbAndGenome(cart, &db, &organism, oldVars);
if (! hDbIsActive(db))
{
db = hDefaultDb();
organism = hGenome(db);
}
if (hIsGsidServer())
{
cartWebStart(theCart, NULL, "GSID Protein View Gateway \n");
}
else
{
errAbort("This Customized Proteome Browser should be used on a GSID server only.");
}
/* start with a clean slate */
cartResetInDb(hUserCookie());
/* This cartResetInDb does nothing since database will be overwritten
* with memory by cartWebEnd ... unless pgGateway crashes, in which
* case along with the crash it will wipe out all the users settings.
* Is that a nice thing to do? -Jim */
gsidPbGateway();
cartWebEnd();
}
char *excludeVars[] = {NULL};
int main(int argc, char *argv[])
/* Process command line. */
{
oldVars = hashNew(10);
cgiSpoof(&argc, argv);
cartEmptyShell(doMiddle, hUserCookie(), excludeVars, oldVars);
return 0;
}