#include <CGIApplicationUnauthenticated.h>
Inheritance diagram for ClearSilver::CGIApplicationUnauthenticated:

Public Types | |
Pointer types | |
|
typedef boost::shared_ptr< CGIApplication > | Ptr |
Public Member Functions | |
| void | swap (TraceObject &) throw () |
| void | operator() () |
| CGI application entry point. | |
Constructors and assignment operators | |
| CGIApplicationUnauthenticated () | |
| Default constructor. | |
| CGIApplicationUnauthenticated (const char *) | |
| Construct from the name of an HDF file. | |
| CGIApplicationUnauthenticated (const std::string &) | |
| Construct from the name of an HDF file. | |
| CGIApplicationUnauthenticated (const ClearSilver::HDF &) | |
| Construct from an existing HDF dataset. | |
| CGIApplicationUnauthenticated (const CGIApplicationUnauthenticated &) | |
| Copy constructor. | |
| virtual | ~CGIApplicationUnauthenticated () throw () |
| Destructor. | |
| CGIApplicationUnauthenticated & | operator= (const CGIApplicationUnauthenticated &) |
| Assignment operator. | |
| void | swap (CGIApplicationUnauthenticated &) throw () |
| Swap contents with another object. | |
Constructors and assignment operators | |
| void | swap (CGIApplication &) throw () |
| Swap contents with another object. | |
Access to ClearSilver data structures | |
| CGI | cgi () const |
| ClearSilver CGI data structure. | |
| HDF | hdf () |
| ClearSilver HDF dataset. | |
Static Public Member Functions | |
| static bool & | debug () |
| Access the debug flag. | |
Protected Member Functions | |
| virtual bool | authenticate () |
| Verify authentication of query. | |
| virtual void | execute_unauthenticated () |
| Execute the CGI program after authentication fails. | |
| virtual void | display_unauthenticated () |
| Display CGI output in absence of authentication. | |
CGI application hooks | |
Derived classes are expected to provide their own implementations of these methods. The CGI application provided by the default version of these methods is a NOP. | |
| virtual void | initialize () |
| Initial setup of data structures. | |
| virtual void | execute () |
| Execute main CGI program. | |
| virtual void | display () |
| Display CGI output. | |
| virtual void | terminate () |
| Final cleanup of data structures. | |
| virtual void | handle_exception (const std::string &) |
| Handle exceptions appropriately. | |
The class provides a template for constructing unauthenticated CGI applications. The function call operator (operator ()) provides the underlying CGI application logic, while the protected CGI application hooks provide means for derived classes to provide application-specific code. This class differs from the CGIApplication class from which it is derived by always accepting the request.
This class follows the Template Method pattern described in the following reference.
Definition at line 72 of file CGIApplicationUnauthenticated.h.
|
|
Verify authentication of query. This method determines whether or not to authenticate each request. The implementation provided by this class always returns true and therefore accepts all requests. Implements ClearSilver::CGIApplication. Definition at line 84 of file CGIApplicationUnauthenticated.cc. |
|
|
Access the debug flag. If the debug flag is true, syslog(3) messages with priority LOG_DEBUG will be logged. Definition at line 299 of file CGIApplication.cc. Referenced by ClearSilver::CGIApplication::display(), ClearSilver::CGIApplication::display_unauthenticated(), ClearSilver::CGIApplication::operator()(), and ClearSilver::CGIApplication::operator=(). |
|
|
Display CGI output. This is the main output method for a CGI application. It is expected to only create output, not modify data structures or satisfy requests. By default, this method takes the name of the ClearSilver template from the HDF dataset associated with the CGIApplication. The value of the following HDF variables are searched in order:
Definition at line 232 of file CGIApplication.cc. References ClearSilver::CGIApplication::cgi(), ClearSilver::CGIApplication::debug(), ClearSilver::CGI::display(), ClearSilver::HDF::find(), ClearSilver::CGIApplication::hdf(), and ClearSilver::ConstHDFNode::value(). Referenced by ClearSilver::CGIApplication::operator()(). |
|
|
Display CGI output in absence of authentication. This method is analogous to display() when authentication was unsuccessful (i.e., when authenticate() returns false). In this case, however, it should never be called, as authenticate() always returns true. To guard against misuse of this class, this method throws an exception. Reimplemented from ClearSilver::CGIApplication. Definition at line 95 of file CGIApplicationUnauthenticated.cc. |
|
|
Execute main CGI program. This is the main execution path for CGI applications. It is expected that this method will perform the following operations.
Definition at line 229 of file CGIApplication.cc. Referenced by ClearSilver::CGIApplication::operator()(). |
|
|
Execute the CGI program after authentication fails. This method is analogous to execute() when authentication was unsuccessful (i.e., when authenticate() returns false). In this case, however, it should never be called, as authenticate() always returns true. To guard against misuse of this class, this method throws an exception. Reimplemented from ClearSilver::CGIApplication. Definition at line 87 of file CGIApplicationUnauthenticated.cc. |
|
|
Handle exceptions appropriately. This method allows CGI applications to handle the messages generated by exceptions. Be default, a message is rethrown as a ClearSilverException object. Referenced by ClearSilver::CGIApplication::operator()(). |
|
|
CGI application entry point. This method is the main entry point for CGI applications. Essentially, it executes the following application logic.
initialize (); if (authenticate ()) { execute (); display (); } else { execute_unauthenticated (); display_unauthenticated (); } terminate (); Definition at line 147 of file CGIApplication.cc. References ClearSilver::CGIApplication::authenticate(), std::basic_string< _CharT, _Traits, _Alloc >::c_str(), ClearSilver::CGIApplication::debug(), ClearSilver::CGIApplication::display(), ClearSilver::CGIApplication::display_unauthenticated(), ClearSilver::CGIApplication::execute(), ClearSilver::CGIApplication::execute_unauthenticated(), ClearSilver::CGIApplication::handle_exception(), ClearSilver::CGI::hdf(), ClearSilver::CGIApplication::initialize(), ClearSilver::CGIApplication::terminate(), std::runtime_error::what(), std::logic_error::what(), and ClearSilver::ClearSilverException::what(). |
|
|
Final cleanup of data structures. This method is responsible for returning the HDF data structure to the state it was in prior to handling a request. The CGI data structures will automatically be removed from the dataset (see HDFNode::remove_cgi()); however, any other modifications made during the request processing must be reversed here. Definition at line 288 of file CGIApplication.cc. Referenced by ClearSilver::CGIApplication::operator()(). |
1.4.5