CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CgiWriter Class Reference

#include <CgiWriter.h>

Public Member Functions

 CgiWriter (xgi::Output *the_out, std::string the_contextURL)
 
void output_finish ()
 
void output_head ()
 
void output_preamble ()
 
 ~CgiWriter ()
 

Private Attributes

std::string contextURL
 
xgi::Outputout
 

Detailed Description

Definition at line 5 of file CgiWriter.h.

Constructor & Destructor Documentation

CgiWriter::CgiWriter ( xgi::Output the_out,
std::string  the_contextURL 
)
inline

Definition at line 14 of file CgiWriter.h.

References contextURL, gather_cfg::cout, and out.

15  {
16  out = the_out;
17  contextURL = the_contextURL;
18  std::cout << "Created a CgiWriter! ContextURL=" << contextURL << std::endl;
19  }
std::string contextURL
Definition: CgiWriter.h:10
xgi::Output * out
Definition: CgiWriter.h:9
tuple cout
Definition: gather_cfg.py:121
CgiWriter::~CgiWriter ( )
inline

Definition at line 21 of file CgiWriter.h.

21 {}

Member Function Documentation

void CgiWriter::output_finish ( )

Definition at line 33 of file CgiWriter.cc.

References out.

Referenced by WebInterface::Default().

34 {
35  *out << "</html>" << std::endl;
36 }
xgi::Output * out
Definition: CgiWriter.h:9
void CgiWriter::output_head ( )

Definition at line 17 of file CgiWriter.cc.

References contextURL, link(), out, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by WebInterface::Default().

18 {
19  std::string js_file_url = contextURL + "/temporary/WebLib.js";
20  std::string css_file_url = contextURL + "/temporary/style.css";
21 
22  *out << cgicc::head() << std::endl;
23 
24  *out << cgicc::script().set("src", js_file_url.c_str()) << cgicc::script() << std::endl;
25 
26  *out << cgicc::link().set("type", "text/css").set("href", css_file_url.c_str()).set("rel", "stylesheet") << std::endl;
27 
28  *out << cgicc::meta().set("http-equiv", "pragma").set("content", "no-cache") << std::endl;
29 
30  *out << cgicc::head() << std::endl;
31 }
std::string contextURL
Definition: CgiWriter.h:10
std::string link(std::string &nm, std::string &ns)
Definition: hierarchy.cc:24
xgi::Output * out
Definition: CgiWriter.h:9
void CgiWriter::output_preamble ( )

Definition at line 3 of file CgiWriter.cc.

References packageDocSplitter::html, and out.

Referenced by WebInterface::Default().

4 {
5  out->getHTTPResponseHeader().addHeader("Content-Type", "text/html");
6  out->getHTTPResponseHeader().addHeader("Expires", "0");
7  out->getHTTPResponseHeader().addHeader("Cache-Control", "no-store, no-cache, must-revalidate, max-age=0");
8  out->getHTTPResponseHeader().addHeader("Cache-Control", "post-check=0, pre-check=0");
9  out->getHTTPResponseHeader().addHeader("Pragma", "no-cache");
10 
11  *out << cgicc::HTMLDoctype(cgicc::HTMLDoctype::eStrict) << std::endl;
12  // This is here for the sake of producing correct html:
13  // *out << cgicc::html() << std::endl;
14  *out << cgicc::html().set("lang", "en").set("dir","ltr") << std::endl;
15 }
xgi::Output * out
Definition: CgiWriter.h:9

Member Data Documentation

std::string CgiWriter::contextURL
private

Definition at line 10 of file CgiWriter.h.

Referenced by CgiWriter(), and output_head().

xgi::Output* CgiWriter::out
private

Definition at line 9 of file CgiWriter.h.

Referenced by CgiWriter(), output_finish(), output_head(), and output_preamble().