#include <abstract_application.hh>
Inheritance diagram for mpcl::net::cgi::TAbstractApplication:
Public Methods | |
TAbstractApplication (const char *pkcNAME, const char *pkcRELEASE, int iPARAMETER_COUNT, const char **ppkcPARAMETERS) | |
virtual QTBasePage | buildPage (const TString &rkyPAGE_IDENTIFIER)=0 |
void | initialize (void)=0 |
virtual void | processRequest (void)=0 |
void | redirect (const TString &rkyTARGET_URL) |
void | setOutput (std::basic_ostream< char > &rtTARGET_OSTREAM) |
void | setResponse (const QTBasePage &rkqtTARGET_PAGE) |
int | start (void) |
QKTBasePage | getSourcePage (void) const |
const TForm & | getSourceForm (void) const |
QTBasePage | getResponsePage (void) const |
TString | fullName (void) const |
TString | programFileName (void) const |
Get application binary file name. | |
Protected Methods | |
bool | hasSourcePage (void) const |
Protected Attributes | |
std::basic_ostream< char > * | ptTargetOstream |
Target OSTREAM instance. | |
TConfigProcessor | tConfigProcessor |
Configuration handler. | |
TSession< TCookie > | tSession |
Session instance. |
Modus operandi: 1. It parses form data in every kind of input (GET, POST). 2. If the CGI was called from a form inside a build-able page, then the this page is built and its form is filled with the old values taken from input form data. To get the source page or form, you must use getSourcePage() or getSourceForm(). 3. Nevertheless, the application must make a response, that can be another page or a redirection. This must be done in processRequest(), using setResponse() or redirect().
It uses variable PATH_INFO to know from which page it has been called. Example:
/page-identifier/form-identifier
Definition at line 79 of file net/cgi/abstract_application.hh.
|
Builds a new instance.
Definition at line 135 of file net/cgi/abstract_application.hh. References mpcl::util::prefs::TConfigProcessor::environmentValue(), ptTargetOstream, and mpcl::text::TString. |
|
Builds the document named rkyDOCUMENT_IDENTIFIER. It returns the unique tag called rkyTAG_IDENTIFIER. If the tag doesn't exists, it creates it else returns the existent one.
|
|
Gets the CGI path and the CGI name (see the CGI environment variable SCRIPT_NAME).
Definition at line 302 of file net/cgi/abstract_application.hh. References mpcl::util::prefs::TConfigProcessor::environmentValue(), and mpcl::text::TString. |
|
Gets the response page, this is the page that the CGI will show (if it is not redirected).
Definition at line 292 of file net/cgi/abstract_application.hh. References mpcl::text::html::QTBasePage. |
|
Gets the source form from where another instance of this CGI has been called.
Definition at line 277 of file net/cgi/abstract_application.hh. |
|
Gets the source page from where another instance of this CGI has been called.
Definition at line 267 of file net/cgi/abstract_application.hh. References mpcl::text::html::QKTBasePage. |
|
Checks if the CGI has been called from another instance of this CGI.
Definition at line 250 of file net/cgi/abstract_application.hh. |
|
Initializes application. In a console application, this means that no output can be done (other than exceptions or errors). It processes command-line options and read the configuration files (if any). To start the application, this method must be called before.
Implements mpcl::TAbstractApplication. |
|
Processes the request and sets the response (using setResponse()) or redirects to another URL (using redirect()).
Referenced by start(). |
|
Redirects the output of the CGI to this URL.
Definition at line 190 of file net/cgi/abstract_application.hh. References mpcl::text::TString. |
|
Sets output stream for writting HTML objects.
Definition at line 200 of file net/cgi/abstract_application.hh. References ptTargetOstream. |
|
Sets response document page.
Definition at line 209 of file net/cgi/abstract_application.hh. References mpcl::text::html::QTBasePage. |
|
Parse input form data, preprocess using preprocess() member function (that returns a HTML page), and then process the page with process() member function.
Implements mpcl::TAbstractApplication. Definition at line 221 of file net/cgi/abstract_application.hh. References processRequest(). |