Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge pull request #7514 from rldhont/server-cache-manager
[Server][Feature][needs-docs] Server cache manager and WMTS service
- Loading branch information
Showing
with
7,507 additions
and 1,694 deletions.
- +133 −0 python/server/auto_generated/qgsservercachefilter.sip.in
- +143 −0 python/server/auto_generated/qgsservercachemanager.sip.in
- +17 −0 python/server/auto_generated/qgsserverinterface.sip.in
- +11 −0 python/server/auto_generated/qgsserverprojectutils.sip.in
- +6 −0 python/server/server_auto.sip
- +164 −0 src/app/qgsprojectproperties.cpp
- +8 −0 src/app/qgsprojectproperties.h
- +2 −0 src/server/CMakeLists.txt
- +1 −1 src/server/qgsaccesscontrol.cpp
- +1 −1 src/server/qgsrequesthandler.cpp
- +89 −0 src/server/qgsservercachefilter.cpp
- +136 −0 src/server/qgsservercachefilter.h
- +218 −0 src/server/qgsservercachemanager.cpp
- +143 −0 src/server/qgsservercachemanager.h
- +18 −0 src/server/qgsserverinterface.h
- +13 −2 src/server/qgsserverinterfaceimpl.cpp
- +19 −1 src/server/qgsserverinterfaceimpl.h
- +1 −1 src/server/qgsserverplugins.cpp
- +5 −0 src/server/qgsserverprojectutils.cpp
- +141 −133 src/server/qgsserverprojectutils.h
- +1 −1 src/server/qgsservicenativeloader.cpp
- +1 −0 src/server/services/CMakeLists.txt
- +1 −1 src/server/services/wcs/qgswcs.cpp
- +1 −1 src/server/services/wcs/qgswcsdescribecoverage.cpp
- +23 −4 src/server/services/wcs/qgswcsgetcapabilities.cpp
- +1 −3 src/server/services/wcs/qgswcsgetcoverage.cpp
- +3 −5 src/server/services/wcs/qgswcsutils.cpp
- +2 −2 src/server/services/wcs/qgswcsutils.h
- +23 −6 src/server/services/wfs/qgswfsgetcapabilities.cpp
- +22 −3 src/server/services/wfs/qgswfsgetcapabilities_1_0_0.cpp
- +14 −22 src/server/services/wfs/qgswfsgetfeature.cpp
- +1 −1 src/server/services/wfs/qgswfsutils.cpp
- +1 −1 src/server/services/wms/qgslayerrestorer.cpp
- +2 −2 src/server/services/wms/qgswmsdescribelayer.cpp
- +50 −36 src/server/services/wms/qgswmsgetcapabilities.cpp
- +3 −5 src/server/services/wms/qgswmsgetcontext.cpp
- +2 −2 src/server/services/wms/qgswmsgetstyles.cpp
- +32 −33 src/server/services/wms/qgswmsrenderer.cpp
- +65 −0 src/server/services/wmts/CMakeLists.txt
- +131 −0 src/server/services/wmts/qgswmts.cpp
- +571 −0 src/server/services/wmts/qgswmtsgetcapabilities.cpp
- +62 −0 src/server/services/wmts/qgswmtsgetcapabilities.h
- +52 −0 src/server/services/wmts/qgswmtsgetfeatureinfo.cpp
- +28 −0 src/server/services/wmts/qgswmtsgetfeatureinfo.h
- +84 −0 src/server/services/wmts/qgswmtsgettile.cpp
- +28 −0 src/server/services/wmts/qgswmtsgettile.h
- +310 −0 src/server/services/wmts/qgswmtsparameters.cpp
- +328 −0 src/server/services/wmts/qgswmtsparameters.h
- +105 −0 src/server/services/wmts/qgswmtsserviceexception.h
- +719 −0 src/server/services/wmts/qgswmtsutils.cpp
- +145 −0 src/server/services/wmts/qgswmtsutils.h
- +86 −0 src/ui/qgsprojectpropertiesbase.ui
- +2 −0 tests/src/python/CMakeLists.txt
- +420 −0 tests/src/python/test_qgsserver_cachemanager.py
- +2 −0 tests/src/python/test_qgsserver_wms.py
- +286 −0 tests/src/python/test_qgsserver_wmts.py
- BIN ...tdata/control_images/qgis_server/WMS_GetMap_ContextRendering/WMS_GetMap_ContextRendering_mask.png
- BIN ...tdata/control_images/qgis_server/WMS_GetMap_LabelingSettings/WMS_GetMap_LabelingSettings_mask.png
- BIN tests/testdata/control_images/qgis_server/WMS_GetPrint_Highlight/WMS_GetPrint_Highlight_mask.png
- BIN .../control_images/qgis_server/WMTS_GetTile_CountryGroup_3857_0/WMTS_GetTile_CountryGroup_3857_0.png
- BIN .../control_images/qgis_server/WMTS_GetTile_CountryGroup_4326_0/WMTS_GetTile_CountryGroup_4326_0.png
- BIN tests/testdata/control_images/qgis_server/WMTS_GetTile_Hello_3857_0/WMTS_GetTile_Hello_3857_0.png
- BIN tests/testdata/control_images/qgis_server/WMTS_GetTile_Hello_4326_0/WMTS_GetTile_Hello_4326_0.png
- BIN ...s/testdata/control_images/qgis_server/WMTS_GetTile_Project_3857_0/WMTS_GetTile_Project_3857_0.png
- BIN ...s/testdata/control_images/qgis_server/WMTS_GetTile_Project_4326_0/WMTS_GetTile_Project_4326_0.png
- +246 −0 tests/testdata/qgis_server/getcapabilities_without_map_param.txt
- +869 −0 tests/testdata/qgis_server/wmts_getcapabilities.txt
- +1,492 −1,426 tests/testdata/qgis_server_accesscontrol/project.qgs
- +24 −1 tests/testdata/qgis_server_accesscontrol/project_groups.qgs
@@ -0,0 +1,133 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/server/qgsservercachefilter.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
class QgsServerCacheFilter | ||
{ | ||
%Docstring | ||
Class defining cache interface for QGIS Server plugins. | ||
|
||
.. versionadded:: 3.4 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsservercachefilter.h" | ||
%End | ||
public: | ||
|
||
QgsServerCacheFilter( const QgsServerInterface *serverInterface ); | ||
%Docstring | ||
Constructor | ||
QgsServerInterface passed to plugins constructors | ||
and must be passed to QgsServerCacheFilter instances. | ||
%End | ||
|
||
virtual ~QgsServerCacheFilter(); | ||
|
||
virtual QByteArray getCachedDocument( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const; | ||
%Docstring | ||
Returns cached document (or 0 if document not in cache) like capabilities | ||
|
||
:param project: the project used to generate the document to provide path | ||
:param request: the request used to generate the document to provider parameters or data | ||
:param key: the key provided by the access control to identify different documents for the same request | ||
|
||
:return: QByteArray of the cached document or an empty one if no corresponding document found | ||
%End | ||
|
||
virtual bool setCachedDocument( const QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, const QString &key ) const; | ||
%Docstring | ||
Updates or inserts the document in cache like capabilities | ||
|
||
:param doc: the document to cache | ||
:param project: the project used to generate the document to provide path | ||
:param request: the request used to generate the document to provider parameters or data | ||
:param key: the key provided by the access control to identify different documents for the same request | ||
|
||
:return: true if the document has been cached | ||
%End | ||
|
||
virtual bool deleteCachedDocument( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const; | ||
%Docstring | ||
Deletes the cached document | ||
|
||
:param project: the project used to generate the document to provide path | ||
:param request: the request used to generate the document to provider parameters or data | ||
:param key: the key provided by the access control to identify different documents for the same request | ||
|
||
:return: true if the document has been deleted | ||
%End | ||
|
||
virtual bool deleteCachedDocuments( const QgsProject *project ) const; | ||
%Docstring | ||
Deletes all cached documents for a QGIS project | ||
|
||
:param project: the project used to generate the documents to provide path | ||
|
||
:return: true if the documents have been deleted | ||
%End | ||
|
||
virtual QByteArray getCachedImage( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const; | ||
%Docstring | ||
Returns cached image (or 0 if document not in cache) like tiles | ||
|
||
:param project: the project used to generate the image to provide path | ||
:param request: the request used to generate the image to provider parameters or data | ||
:param key: the key provided by the access control to identify different images for the same request | ||
|
||
:return: QByteArray of the cached image or an empty one if no corresponding image found | ||
%End | ||
|
||
virtual bool setCachedImage( const QByteArray *img, const QgsProject *project, const QgsServerRequest &request, const QString &key ) const; | ||
%Docstring | ||
Updates or inserts the image in cache like tiles | ||
|
||
:param img: the document to cache | ||
:param project: the project used to generate the image to provide path | ||
:param request: the request used to generate the image to provider parameters or data | ||
:param key: the key provided by the access control to identify different images for the same request | ||
|
||
:return: true if the image has been cached | ||
%End | ||
|
||
virtual bool deleteCachedImage( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const; | ||
%Docstring | ||
Deletes the cached image | ||
|
||
:param project: the project used to generate the image to provide path | ||
:param request: the request used to generate the image to provider parameters or data | ||
:param key: the key provided by the access control to identify different images for the same request | ||
|
||
:return: true if the image has been deleted | ||
%End | ||
|
||
virtual bool deleteCachedImages( const QgsProject *project ) const; | ||
%Docstring | ||
Deletes all cached images for a QGIS project | ||
|
||
:param project: the project used to generate the images to provide path | ||
|
||
:return: true if the images have been deleted | ||
%End | ||
|
||
}; | ||
|
||
typedef QMultiMap<int, QgsServerCacheFilter *> QgsServerCacheFilterMap; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/server/qgsservercachefilter.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
@@ -0,0 +1,143 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/server/qgsservercachemanager.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
|
||
class QgsServerCacheManager | ||
{ | ||
%Docstring | ||
A helper class that centralizes caches accesses given by all the server cache filter plugins. | ||
|
||
.. versionadded:: 3.4 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsservercachemanager.h" | ||
#include "qgsservercachefilter.h" | ||
%End | ||
public: | ||
QgsServerCacheManager(); | ||
%Docstring | ||
Constructor | ||
%End | ||
|
||
QgsServerCacheManager( const QgsServerCacheManager © ); | ||
%Docstring | ||
Copy constructor | ||
%End | ||
|
||
|
||
~QgsServerCacheManager(); | ||
|
||
bool getCachedDocument( QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const; | ||
%Docstring | ||
Returns cached document (or 0 if document not in cache) like capabilities | ||
|
||
:param doc: the document to update by content found in cache | ||
:param project: the project used to generate the document to provide path | ||
:param request: the request used to generate the document to provider parameters or data | ||
:param accessControl: the access control to identify different documents for the same request provided by server interface | ||
|
||
:return: true if the document has been found in cache and the document's content set | ||
%End | ||
|
||
bool setCachedDocument( const QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const; | ||
%Docstring | ||
Updates or inserts the document in cache like capabilities | ||
|
||
:param doc: the document to cache | ||
:param project: the project used to generate the document to provide path | ||
:param request: the request used to generate the document to provider parameters or data | ||
:param accessControl: the access control to identify different documents for the same request provided by server interface | ||
|
||
:return: true if the document has been cached | ||
%End | ||
|
||
bool deleteCachedDocument( const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const; | ||
%Docstring | ||
Deletes the cached document | ||
|
||
:param project: the project used to generate the document to provide path | ||
:param request: the request used to generate the document to provider parameters or data | ||
:param accessControl: the access control to identify different documents for the same request provided by server interface | ||
|
||
:return: true if the document has been deleted | ||
%End | ||
|
||
bool deleteCachedDocuments( const QgsProject *project ) const; | ||
%Docstring | ||
Deletes all cached documents for a QGIS project | ||
|
||
:param project: the project used to generate the document to provide path | ||
|
||
:return: true if the document has been deleted | ||
%End | ||
|
||
QByteArray getCachedImage( const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const; | ||
%Docstring | ||
Returns cached image (or 0 if image not in cache) like tiles | ||
|
||
:param project: the project used to generate the image to provide path | ||
:param request: the request used to generate the image to provider parameters or data | ||
:param accessControl: the access control to identify different documents for the same request provided by server interface | ||
|
||
:return: the cached image or 0 if no corresponding image found | ||
%End | ||
|
||
bool setCachedImage( const QByteArray *img, const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const; | ||
%Docstring | ||
Updates or inserts the image in cache like tiles | ||
|
||
:param img: the image to cache | ||
:param project: the project used to generate the image to provide path | ||
:param request: the request used to generate the image to provider parameters or data | ||
:param accessControl: the access control to identify different documents for the same request provided by server interface | ||
|
||
:return: true if the image has been cached | ||
%End | ||
|
||
bool deleteCachedImage( const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const; | ||
%Docstring | ||
Deletes the cached image | ||
|
||
:param project: the project used to generate the image to provide path | ||
:param request: the request used to generate the image to provider parameters or data | ||
:param accessControl: the access control to identify different documents for the same request provided by server interface | ||
|
||
:return: true if the image has been deleted | ||
%End | ||
|
||
bool deleteCachedImages( const QgsProject *project ) const; | ||
%Docstring | ||
Deletes all cached images for a QGIS project | ||
|
||
:param project: the project used to generate the images to provide path | ||
|
||
:return: true if the images have been deleted | ||
%End | ||
|
||
void registerServerCache( QgsServerCacheFilter *serverCache, int priority = 0 ); | ||
%Docstring | ||
Register a server cache filter | ||
|
||
:param serverCache: the server cache to add | ||
:param priority: the priority used to define the order | ||
%End | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/server/qgsservercachemanager.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
Oops, something went wrong.