Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

mpcl::net::cgi::TAbstractApplication Class Reference

#include <abstract_application.hh>

Inheritance diagram for mpcl::net::cgi::TAbstractApplication:

mpcl::TAbstractApplication List of all members.

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< TCookietSession
 Session instance.


Detailed Description

CGI application.

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

See also:
TBasePage, TConfigProcessor. , getSourcePage(), getSourceForm(), setResponse(), redirect().

Definition at line 79 of file net/cgi/abstract_application.hh.


Constructor & Destructor Documentation

mpcl::net::cgi::TAbstractApplication::TAbstractApplication const char *    pkcNAME,
const char *    pkcRELEASE,
int    iPARAMETER_COUNT,
const char **    ppkcPARAMETERS
[inline]
 

Builds a new instance.

Parameters:
pkcNAME  Application name.
pkcRELEASE  Application release.
iPARAMETER_COUNT  Parameter count.
ppkcPARAMETERS  Parameter array.

Definition at line 135 of file net/cgi/abstract_application.hh.

References mpcl::util::prefs::TConfigProcessor::environmentValue(), ptTargetOstream, and mpcl::text::TString.


Member Function Documentation

virtual QTBasePage mpcl::net::cgi::TAbstractApplication::buildPage const TString &    rkyPAGE_IDENTIFIER [pure virtual]
 

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.

Parameters:
rkyPAGE_IDENTIFIER  Page identifier.
Returns:
The built page.

TString mpcl::net::cgi::TAbstractApplication::fullName void    const [inline]
 

Gets the CGI path and the CGI name (see the CGI environment variable SCRIPT_NAME).

Returns:
CGI path and CGI name.

Definition at line 302 of file net/cgi/abstract_application.hh.

References mpcl::util::prefs::TConfigProcessor::environmentValue(), and mpcl::text::TString.

QTBasePage mpcl::net::cgi::TAbstractApplication::getResponsePage void    const [inline]
 

Gets the response page, this is the page that the CGI will show (if it is not redirected).

Returns:
The response page.
See also:
setResponse(), redirect().

Definition at line 292 of file net/cgi/abstract_application.hh.

References mpcl::text::html::QTBasePage.

const TForm& mpcl::net::cgi::TAbstractApplication::getSourceForm void    const [inline]
 

Gets the source form from where another instance of this CGI has been called.

Returns:
The source form.

Definition at line 277 of file net/cgi/abstract_application.hh.

QKTBasePage mpcl::net::cgi::TAbstractApplication::getSourcePage void    const [inline]
 

Gets the source page from where another instance of this CGI has been called.

Returns:
The source page.

Definition at line 267 of file net/cgi/abstract_application.hh.

References mpcl::text::html::QKTBasePage.

bool mpcl::net::cgi::TAbstractApplication::hasSourcePage void    const [inline, protected]
 

Checks if the CGI has been called from another instance of this CGI.

Returns:
True if there is a source page.

Definition at line 250 of file net/cgi/abstract_application.hh.

void mpcl::net::cgi::TAbstractApplication::initialize void    [pure virtual]
 

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.

See also:
buildSourcePage(), start().

Implements mpcl::TAbstractApplication.

virtual void mpcl::net::cgi::TAbstractApplication::processRequest void    [pure virtual]
 

Processes the request and sets the response (using setResponse()) or redirects to another URL (using redirect()).

See also:
setResponse(), redirect().

Referenced by start().

void mpcl::net::cgi::TAbstractApplication::redirect const TString &    rkyTARGET_URL [inline]
 

Redirects the output of the CGI to this URL.

Parameters:
rkyTARGET_URL  Target URL.

Definition at line 190 of file net/cgi/abstract_application.hh.

References mpcl::text::TString.

void mpcl::net::cgi::TAbstractApplication::setOutput std::basic_ostream< char > &    rtTARGET_OSTREAM [inline]
 

Sets output stream for writting HTML objects.

Parameters:
rtTARGET_OSTREAM  Target stream.

Definition at line 200 of file net/cgi/abstract_application.hh.

References ptTargetOstream.

void mpcl::net::cgi::TAbstractApplication::setResponse const QTBasePage &    rkqtTARGET_PAGE [inline]
 

Sets response document page.

Parameters:
rkqtTARGET_PAGE  Target page.

Definition at line 209 of file net/cgi/abstract_application.hh.

References mpcl::text::html::QTBasePage.

int mpcl::net::cgi::TAbstractApplication::start void    [inline, virtual]
 

Parse input form data, preprocess using preprocess() member function (that returns a HTML page), and then process the page with process() member function.

Returns:
Application exit status.

Implements mpcl::TAbstractApplication.

Definition at line 221 of file net/cgi/abstract_application.hh.

References processRequest().


The documentation for this class was generated from the following files:
Generated on Mon Oct 13 02:35:25 2003 for MPCL by doxygen1.2.18