Download "user manual"
Transcript
New Plugins
$this->cartoForm =
$this->httpRequestHandler->handleHttpRequest(
$this->clientSession,
$this->cartoForm);
$request = new FilterRequestModifier($_REQUEST);
$this->callPluginsImplementing('FilterProvider',
'filterPostRequest', $request);
$this->callPluginsImplementing('GuiProvider',
'handleHttpPostRequest',
$request->getRequest());
} else {
$request = new FilterRequestModifier($_REQUEST);
$this->callPluginsImplementing('FilterProvider',
'filterGetRequest', $request);
$this->callPluginsImplementing('GuiProvider',
'handleHttpGetRequest',
$request->getRequest());
}
$mapRequest = $this->getMapRequest();
$this->callPluginsImplementing('ServerCaller', 'buildRequest',
$mapRequest);
$this->mapResult = $this->getMapResultFromRequest($mapRequest);
$this->callPluginsImplementing('ServerCaller', 'initializeResult',
$this->mapResult);
$this->callPluginsImplementing('ServerCaller', 'handleResult',
$this->mapResult);
$this->formRenderer->showForm($this);
$this->callPluginsImplementing('Sessionable', 'saveSession');
$this->saveSession($this->clientSession);
}
callPluginsImplementing($interfaceName, $methodName, $argument) is run
at various points of the program and make plugins implementing given
<interfaceName> interface execute given <methodName> with given <argument>
argument.
Of course interface-defined methods must be implemented in the matching plugins.
Plugins can implements one or more CartoWeb interfaces.
Implementing interfaces is not mandatory when writing a plugin but not doing so will
keep plugins from being implicitely called by the main program. As a result, methods
from plugins with no interface implementation - also called "service plugins" - must
be explicitely called by another piece of code (generally an other plugin).
class ClientYourPlugin extends ClientPlugin
implements Sessionable, GuiProvider {
/* here comes your plugin client class definition */
}
For a comprehensive list of available client and server interfaces, see /client/
196