Wexus2 0.20
|
#include <Application.h>
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) |
SessionManager & | sessionManager (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 |
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.
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 /
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.
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.
const QString& wexus::Application::mountPoint | ( | void | ) | const [inline] |
Returns the mount point. Mount points always end in /
virtual void wexus::Application::setMountPoint | ( | const QString & | mountPoint | ) | [virtual] |
Called by wexus::Site during addApplication
Decendants may overide this to add additional functionality.
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