P5EEx-Blue-0.01

P5EEx::Blue::Request::CGI


NAME

P5EEx::Blue::Request::CGI - the request


SYNOPSIS

   # ... official way to get a Request object ...
   use P5EEx::Blue::P5EE;
   $context = P5EEx::Blue::P5EE->context();
   $request = $context->request();  # get the request
   # ... alternative way (used internally) ...
   use P5EEx::Blue::Request::CGI;
   $request = P5EEx::Blue::Request::CGI->new();


DESCRIPTION

A Request class implemented using the CGI class.


Protected Methods:

The following methods are intended to be called by subclasses of the current class (or environmental, ``main'' code).

init()

The init() method is called from within the standard Request constructor. The init() method in this class does nothing. It allows subclasses of the Request to customize the behavior of the constructor by overriding the init() method.

    * Signature: $request->init()
    * Param:     void
    * Return:    void
    * Throws:    P5EEx::Blue::Exception
    * Since:     0.01
    Sample Usage:
    $request->init();


Public Methods

process_request()

The process_request() method executes the events within a single CGI request. It has no display functionality.

It is called primarily from the event loop handler, dispatch_events(). However, it may be called from external software if that code manages the event loop itself. i.e. it instantiates the CGI object outside of the Context and passes it in, never calling dispatch_events(). Instead, it would call process_request().

    * Signature: $request->process_request()
    * Signature: $request->process_request($cgi)
    * Param:     $cgi            (CGI)
    * Return:    void
    * Throws:    P5EEx::Blue::Exception
    * Since:     0.01
    Sample Usage:
    $request->process_request();

get_default_widget()

The get_default_widget() method returns the current widget of the authenticated user. The special name, ``guest'', refers to the unauthenticated (anonymous) user.

    * Signature: $current_widget = $request->get_default_widget();
    * Param:  void
    * Return: $current_widget   string
    * Throws: <none>
    * Since:  0.01
    Sample Usage:
    $current_widget = $request->get_default_widget();

user()

The user() method returns the username of the authenticated user. The special name, ``guest'', refers to the unauthenticated (anonymous) user.

    * Signature: $username = $request->user();
    * Param:  void
    * Return: string
    * Throws: <none>
    * Since:  0.01
    Sample Usage:
    $username = $request->user();

header()

The header() method returns the specified HTTP header from the request.

    * Signature: $header_value = $request->header($header_name);
    * Param:  $header_name    string
    * Return: $header_value   string
    * Throws: <none>
    * Since:  0.01
    Sample Usage:
    $header_value = $request->header("Accept-Encoding");