void CSeqBasicCommand::Execute( CCgiContext& ctx ) { const CNcbiRegistry& reg = ctx.GetConfig(); /* load in the html template file */ string baseFile = reg.Get( "filesystem", "HtmlBaseFile" ); auto_ptr<CHTMLPage> page( new CHTMLPage( NcbiEmptyString, baseFile ) ); /* set up to replace <@VIEW@> in template file with html returned from CreateView */ page->AddTagMap( "QUICKSEARCH", CreateQuickSearch(ctx) ); page->AddTagMap( "VIEW", CreateView( ctx ) ); /* actual page output */ ctx.GetResponse().WriteHeader(); page->Print(ctx.GetResponse().out(), CNCBINode::eHTML ); }
void CHelloCommand::Execute( CCgiContext& ctx ) { const CNcbiRegistry& reg = ctx.GetConfig(); // load in the html template file string baseFile = reg.Get( "filesystem", "HtmlBaseFile" ); auto_ptr<CHTMLPage> page( new CHTMLPage( NcbiEmptyString, baseFile ) ); // set up to replace <@VIEW@> in template file with html returned // from CreateView page->AddTagMap( "VIEW", CreateView( ctx ) ); // actual page output ctx.GetResponse().WriteHeader(); page->Print(ctx.GetResponse().out(), CNCBINode::eHTML ); }
/* carries out the construction of the webpage when the * cmd=advanced is set in the query string. */ void CSeqAdvancedGOCommand::Execute( CCgiContext& ctx ) { const CNcbiRegistry& reg = ctx.GetConfig(); /* load in the html template file */ string baseFile = reg.Get( "filesystem", "HtmlBaseFile" ); auto_ptr<CHTMLPage> page( new CHTMLPage( NcbiEmptyString, baseFile ) ); page->AddTagMap("QUICKSEARCH", CreateSpacer( ctx )); /* calls parent (CSeqBasicCommand) CreateViewi, * to add the "Advanced Search" table: allows * user to enter parameters for search. */ page->AddTagMap( "VIEW", CreateView( ctx ) ); /* actual page output */ ctx.GetResponse().WriteHeader(); page->Print(ctx.GetResponse().out(), CNCBINode::eHTML ); }
void CBlastHitMatrixCGIApplication::x_GetSeqAnnot(CCgiContext& ctx) { const CNcbiRegistry & reg = ctx.GetConfig(); string blastURL = reg.Get("NetParams", "BlastURL"); string url = (string)blastURL + "?CMD=Get&RID=" + m_RID + "&FORMAT_TYPE=ASN.1&FORMAT_OBJECT=Alignment"; SConnNetInfo* net_info = ConnNetInfo_Create(NULL); // create HTTP connection CConn_HttpStream inHttp(url,net_info); try { m_Annot.Reset(new CSeq_annot); auto_ptr<CObjectIStream> is (CObjectIStream::Open(eSerial_AsnText, inHttp)); *is >> *m_Annot; } catch (CException& e) { m_Annot.Reset(); NCBI_THROW(CBlastHitMatrixCGIException, eInvalidSeqAnnot, "Exception reading SeqAnnot via url " + url + ", exception message: " + e.GetMsg()); } }