![]() |
Home · Modules · Classes · Namespaces · Functions |
The QxtWebServiceDirectory class provides Path-based web service dispatcher More...
#include <QxtWebServiceDirectory>
Inherits QxtAbstractWebService.
The QxtWebServiceDirectory class provides Path-based web service dispatcher
QxtWebServiceDirectory allows multiple services to be associated with a single session. Selection between services is determined by the first path component in the URL. For example, the URL "/site/request?param=true" would relay the URL "/request?param=true" to the service named "site".
This class can be used recursively to declare a hierarchy of services. For example:
QxtWebServiceDirectory* top = new QxtWebServiceDirectory(sm, sm); QxtWebServiceDirectory* service1 = new QxtWebServiceDirectory(sm, top); QxtWebServiceDirectory* service2 = new QxtWebServiceDirectory(sm, top); QxtWebServiceDirectory* service1a = new QxtWebServiceDirectory(sm, service1); QxtWebServiceDirectory* service1b = new QxtWebServiceDirectory(sm, service1); top->addService("1", service1); top->addService("2", service2); service1->addService("a", service1a); service1->addService("b", service1b);
This accepts the URLs "/1/a/", "/1/b/", and "/2/".
Constructs a QxtWebServiceDirectory object with the specified session manager sm and parent.
Often, the session manager will also be the parent, but this is not a requirement.
Adds a service to the directory at the given path.
See also removeService() and service().
Returns the path that will be used by default by the indexRequested event.
See also indexRequested() and setDefaultRedirect().
This event handler is called whenever the URL does not contain a path, that is, the URL is "/" or empty.
The default implementation redirects to the service specified by setDefaultRedirect(), or invokes unknownServiceRequested() if no default redirect has been set.
Removes the service at the given path.
Note that the service object is not destroyed.
Returns the service at the given path.
Sets the path that will be used by default by the indexRequested event.
See also indexRequested() and defaultRedirect().
This event handler is called whenever the URL requests a service with name that has not been added to the directory.
The default implementation returns a 404 "Service not known" error. Subclasses may reimplement this event handler to customize this behavior.
Copyright © 2007-2011 Qxt Foundation |
Qxt 0.6.2 |