/* * $Id: PrintBanner_comb.cpp,v 1.1 2005/07/26 17:12:50 chenj Exp $ * * * =========================================================================== * * PUBLIC DOMAIN NOTICE * National Center for Biotechnology Information * * This software/database is a "United States Government Work" under the * terms of the United States Copyright Act. It was written as part of * the author's official duties as a United States Government employee and * thus cannot be copyrighted. This software/database is freely available * to the public for use. The National Library of Medicine and the U.S. * Government have not placed any restriction on its use or reproduction. * * Although all reasonable efforts have been taken to ensure the accuracy * and reliability of the software and data, the NLM and the U.S. * Government do not and cannot warrant the performance or results that * may be obtained by using this software or data. The NLM and the U.S. * Government disclaim all warranties, express or implied, including * warranties of performance, merchantability or fitness for any particular * purpose. * * Please cite the author in any work or product based on this material. * * =========================================================================== * * * Author: Jie Chen * * * $Log: PrintBanner_comb.cpp,v $ * Revision 1.1 2005/07/26 17:12:50 chenj * Making linux VSNbr.cgi * * Revision 1.2 2003/01/22 17:12:50 chenj * Get Cn3D 4.1 * * Revision 1.1.1.1 2002/12/06 20:17:21 chenj * Imported Scouces * * * * * This file is used to print the html head. * * ========================================================================== */ #include "hUtilib.hpp" #include "vastuti.hpp" #include #define DISP_IN_GRAPH 'n' #define DISP_IN_TABLE 'y' extern char URLcgi[PATH_MAX]; extern char CGIname[PATH_MAX]; extern char MMDBCGIname[PATH_MAX], DATApath[PATH_MAX]; extern Uint1 numSubsets; extern bool SubsetInfoLoaded; extern unsigned aSdi, aMmdbId; extern string JobID, Passwd; extern long long ReqId; void PrintHitsSortBanner(FILE *table, SortBy sortby, SubSetID subsetnum, unsigned pagenum, unsigned numpages, char cTable) { unsigned i; static char subsetname[6][100]={"Low redundancy", "Medium redundancy", "High redundancy", "Non-identical seq.", "All sequences", "Selected neighbor(s)"}; WWWInfoPtr www_info; if (WWWGetArgs(&www_info) != WWWErrOk); int idx = -1; char * subsetstr=NULL; if ((idx = WWWFindName(www_info, (char *)"subsetstr")) >=0) { subsetstr = WWWGetValueByIndex(www_info, idx); } //else / error; /* subset 1 should be "All of PDB"; put it second last */ if (! SubsetInfoLoaded) loadSubsetInfo(); fprintf(table, "\n\n"); vector subsetdisp; if (subsetstr) { fprintf(table, "\n", subsetstr); if ((string)subsetstr == "Non") { subsetdisp.reserve(3); subsetdisp.push_back(GetSubsetName_DB(2)); subsetdisp.push_back(GetSubsetName_DB(3)); subsetdisp.push_back(GetSubsetName_DB(6)); } else { subsetdisp.reserve(6); for (i=2; i< numSubsets; i++) subsetdisp.push_back( GetSubsetName_DB(i)); subsetdisp.push_back(GetSubsetName_DB(1)); subsetdisp.push_back(GetSubsetName_DB(6)); } } /* Use the Form created in PrintAlignViewBanner */ fprintf(table, "\n", subsetnum); string altstr = "Click to display and sort the neighbors"; fprintf(table, " "); fprintf(table, "\n"); /* Insert a blank row */ fprintf(table, " \n\n"); fprintf(table, " \n \n\n"); fprintf(table, " \n \n
\n "); fprintf(table, "\n", altstr.c_str(), altstr.c_str()); fprintf(table, " \n"); fprintf(table, "   \n"); fprintf(table, " \n\n"); fprintf(table, "  subset, sorted by \n\n"); fprintf(table, " \n\n"); if (pagenum && numpages > 1) { fprintf(table, "  page \n\n"); fprintf(table, " \n\n"); } fprintf(table, "  in \n"); fprintf(table, " \n\n"); string urlstr = (string)"'" + DATApath + "help_List.html'"; string dispOpstr= "'resizable=yes, scrollbars=yes, width=420, height=250'"; fprintf(table, " \n", urlstr.c_str(), dispOpstr.c_str()); fprintf(table, " \n", DATApath); fprintf(table, "
\n\n\n\n"); } /* end of PrintHitsSortBanner */ void PrintAlignViewBanner(FILE *table, unsigned iFSID, VastPageDataPtr vpp, unsigned numhitsdisplayed) { Int4 i; Char str[50]; string AllId; fprintf(table, "\n\n"); /* Create one Form with 3 submits */ fprintf(table, "
\n", URLcgi, CGIname); fprintf(table, "\n", aSdi); if (JobID != "") { if (ReqId) fprintf(table, "\n",ReqId); else { fprintf(table, "\n", JobID.c_str()); fprintf(table, "\n", Passwd.c_str()); } } ostringstream output; for (i=0; i< numhitsdisplayed; i++) { output.str(""); output << getfid(vpp[i].bSdi, vpp[i].bAlignId) << ","; AllId += output.str(); } fprintf(table, "\n", AllId.c_str()); fprintf(table, "\n", getfid(vpp[0].bSdi, vpp[0].bAlignId)); // fprintf(table, "\n"); fprintf(table, " "); fprintf(table, " \n"); string altstr = "Click to view 3D superpositions"; fprintf(table, " \n \n\n"); fprintf(table, " \n \n
\n "); fprintf(table, "\n",altstr.c_str(),altstr.c_str()); fprintf(table, " \n"); fprintf(table, "   of \n\n"); fprintf(table, " \n\n"); fprintf(table, "  with \n\n"); fprintf(table, " \n\n"); fprintf(table, " \n\n"); string urlstr = (string)"'" + DATApath + "help_V3D.html'"; string dispOpstr= "'resizable=yes, scrollbars=yes, width=420, height=250'"; fprintf(table, " \n", urlstr.c_str(), dispOpstr.c_str()); fprintf(table, " \n", DATApath); fprintf(table, " \"New\"\n"); fprintf(table, " Get Cn3D 4.1!\n"); fprintf(table, "
\n"); fprintf(table, "\n\n\n"); fprintf(table, "\n\n"); fprintf(table, " "); fprintf(table, "\n"); /* Insert a blank row */ fprintf(table, " \n\n"); altstr = "Click to view sequence alignment"; fprintf(table, " \n \n\n"); fprintf(table, " \n \n
\n "); fprintf(table,"\n",altstr.c_str(),altstr.c_str()); fprintf(table, " \n"); fprintf(table, "   using \n\n"); fprintf(table, " \n\n"); fprintf(table, "  for \n\n"); fprintf(table, " \n\n"); fprintf(table, "  VAST neighbors\n"); urlstr = (string)"'" + DATApath + "help_VSEQ.html'"; fprintf(table, " \n", urlstr.c_str(), dispOpstr.c_str()); fprintf(table, " \n", DATApath); fprintf(table, "
\n"); fprintf(table, "\n\n\n"); } /* end PrintAlignViewBanner */ void PrintQueryInfo(FILE *table, char *pcPDB, char cChain,int iDomain) { Char title[MAX_TBUFF]; fprintf(table, "\n\n"); fprintf(table, " \n"); /* insert two blank rows for spacing */ fprintf(table, " \n"); fprintf(table, " \n"); fprintf(table, " \n"); fprintf(table, " \n\n"); fprintf(table, " \n"); fprintf(table, " \n\n\n"); if (ReqId) fprintf(table, " \n \n\n"); if (JobID != "" && constructPdbDescr(aMmdbId, title, MAX_TBUFF)) { fprintf(table, " \n"); fprintf(table, " \n"); fprintf(table, " \n \n\n"); } fprintf(table, "
   
\n"); if (!ReqId) fprintf(table, "Query: \n"); else fprintf(table, " Request Id:  %llu", ReqId); if (cChain != ' ' || iDomain >0) fprintf(table, ", \n"); else fprintf(table, "\n"); fprintf(table, " "); else fprintf(table, " "); if (aMmdbId && JobID == "") { fprintf(table, "MMDB "); fprintf(table, "%d", aMmdbId); fprintf(table, ", "); } if (!ReqId) if (pcPDB[0] != NULLB) fprintf(table, "%s", pcPDB); if (cChain != ' ') fprintf(table, " chain %c", cChain); if (iDomain > 0) fprintf(table, " domain %d", (int) iDomain); fprintf(table, "
\n"); fprintf(table, "Description:%s", title); fprintf(table, "
\n"); fprintf(table, "\n\n\n"); } /* end PrintQueryInfo */ void PrintSearchNbr(FILE *table) { fprintf(table, "\n\n"); fprintf(table, " "); fprintf(table, "\n"); /* Insert a blank row */ fprintf(table, " \n\n"); /* use the form created in PrintAlignViewBanner */ string altstr = "Click to look for neighbors"; fprintf(table, " \n \n\n"); fprintf(table, " \n \n\n"); fprintf(table, "
\n "); fprintf(table, "\n", altstr.c_str(), altstr.c_str()); fprintf(table, " \n"); fprintf(table, "  MMDB or PDB ids: \n"); fprintf(table, " \n"); fprintf(table, "   or 3D-Domain ids: \n"); fprintf(table, " "); string urlstr = (string)"'" + DATApath + "help_Find.html'"; string dispOpstr= "'resizable=yes, scrollbars=yes, width=420, height=150'"; fprintf(table, " \n", urlstr.c_str(), dispOpstr.c_str()); fprintf(table, " \n", DATApath); fprintf(table, "
\n"); fprintf(table, "\n\n\n"); } /* PrintSearchNbr */