Wexus2 0.20
wexus::Application Class Reference

#include <Application.h>

Inheritance diagram for wexus::Application:

List of all members.

Classes

class  RouteBuilder

Public Member Functions

virtual ~Application ()
 destructor
virtual void setMountPoint (const QString &mountPoint)
const QString & mountPoint (void) const
virtual void init (const QVariantMap &settings)
void initBasic (const QVariantMap &settings)
const QVariantMap & settings (void) const
virtual void handleApplicationRequest (QString &filteredRequest, wexus::HTTPRequest &req, wexus::HTTPReply &reply)
SessionManagersessionManager (void)
QSqlDatabase & database (void)
std::shared_ptr
< Registry::AppInfo
appInfo (void)

Protected Member Functions

 Application (void)
 inherited constructor
void openDB (void)
 called by initSettings to open (or reopen) the db

Detailed Description

Controllers are groupped into applications. Applications are the installed, at a certain mount point (prefix) into a Site.

Each user application decends from this class, registers the application subclass via. The application then registers controllers in its constructor via registerController.

Author:
Aleksander Demko

Member Function Documentation

virtual void wexus::Application::handleApplicationRequest ( QString &  filteredRequest,
wexus::HTTPRequest req,
wexus::HTTPReply reply 
) [virtual]

A enhanced handleApplicationRequest() call from the wexus::Site to wexus::Application. This implements the controll-handler system. This method is not typically overriden, but can be if you want to layer over the default controller-handler system.

filteredRequest contains just the action call. It always starts with atleast a /

Author:
Aleksander Demko

Reimplemented in wexus::FileApp, and wexus::RedirectApp.

virtual void wexus::Application::init ( const QVariantMap &  settings) [virtual]

Called shortly after creation. This saves a copy of the settings reference (acceisble via settings()) and also opens the database.

Decendants may overide this to add additional functionality. They should call this version, first, however.

Author:
Aleksander Demko

Reimplemented in wexus::FileApp, and wexus::RedirectApp.

void wexus::Application::initBasic ( const QVariantMap &  settings)

This minimalist version of init() can be called by decendant's init functions if instead of Application::init(). This version simply sets the settings variable and does not perform any other functions, like database initialization.

Author:
Aleksander Demko
const QString& wexus::Application::mountPoint ( void  ) const [inline]

Returns the mount point. Mount points always end in /

Author:
Aleksander Demko
virtual void wexus::Application::setMountPoint ( const QString &  mountPoint) [virtual]

Called by wexus::Site during addApplication

Decendants may overide this to add additional functionality.

Author:
Aleksander Demko
const QVariantMap& wexus::Application::settings ( void  ) const [inline]

Returns the current settings

Some interesting fields, assigned at boot: app= the appname of the started class mountpoint= the url mount point, same as mountPoint() sitedir= the directory (on disk) of the site appdir= the directory (on disk) of the app within the site

Author:
Aleksander Demko

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Enumerator