QGIS API Documentation
3.22.4-Białowieża (ce8e65e95e)
|
Request handler for GeoNode servers. More...
#include <qgsgeonoderequest.h>
Classes | |
struct | ServiceLayerDetail |
Service layer details for an individual layer from a GeoNode connection. More... | |
Public Types | |
enum class | BackendServer { Unknown , QgisServer , Geoserver } |
GeoNode backend server type. More... | |
Public Slots | |
void | abort () |
Aborts any active network request immediately. More... | |
Signals | |
void | layersFetched (const QList< QgsGeoNodeRequest::ServiceLayerDetail > &layers) |
Emitted when the result of a fetchLayers call has been received and processed. More... | |
void | requestFinished () |
Emitted when the existing request has been completed. More... | |
void | statusChanged (const QString &statusQString) |
Emitted when the status of an ongoing request is changed. More... | |
Public Member Functions | |
QgsGeoNodeRequest (const QString &baseUrl, bool forceRefresh, QObject *parent=nullptr) | |
Constructor for QgsGeoNodeRequest. More... | |
~QgsGeoNodeRequest () override | |
QgsGeoNodeStyle | fetchDefaultStyleBlocking (const QString &layerName) |
Requests the default style for the layer with matching layerName from the server. More... | |
void | fetchLayers () |
Triggers a new request to fetch the list of available layers from the server. More... | |
QList< QgsGeoNodeRequest::ServiceLayerDetail > | fetchLayersBlocking () |
Requests the list of available layers from the server. More... | |
QgsStringMap | fetchServiceUrlDataBlocking (const QString &serviceType) |
Obtains a map of layer name to URL for available services with matching serviceType from the server. More... | |
QStringList | fetchServiceUrlsBlocking (const QString &serviceType) |
Requests the list of unique URLs for available services with matching serviceType from the server. More... | |
QgsGeoNodeStyle | fetchStyleBlocking (const QString &styleId) |
Requests the details for the style with matching styleId from the server. More... | |
QList< QgsGeoNodeStyle > | fetchStylesBlocking (const QString &layerName) |
Requests the list of available styles for the layer with matching layerName from the server. More... | |
QString | lastError () const |
Returns the most recent error string for any encountered errors, or an empty string if no errors have been encountered. More... | |
QByteArray | lastResponse () const |
Returns the most recent response obtained from the server. More... | |
QgsGeoNodeRequest::ServiceLayerDetail | parseOwsUrl (QgsGeoNodeRequest::ServiceLayerDetail &layerStruct, const QVariantList &layerLinks) |
Returns the updated ServiceLayerDetail struct with WMS/WFS/XYZ url. More... | |
QString | protocol () const |
Returns the network protocol (e.g. More... | |
void | request (const QString &endPoint) |
Triggers a new request to the GeoNode server, with the requested endPoint. More... | |
bool | requestBlocking (const QString &endPoint) |
Triggers a new request to the GeoNode server, with the requested endPoint. More... | |
void | setProtocol (const QString &protocol) |
Sets the network protocol (e.g. More... | |
Request handler for GeoNode servers.
QgsGeoNodeRequest handles requesting and parsing service details from a GeoNode server instance, for instance requesting all available layers or layer styles.
Definition at line 65 of file qgsgeonoderequest.h.
|
strong |
GeoNode backend server type.
Enumerator | |
---|---|
Unknown | Unknown backend. |
QgisServer | QGIS server used as backend. |
Geoserver | Geoserver used as backend. |
Definition at line 73 of file qgsgeonoderequest.h.
QgsGeoNodeRequest::QgsGeoNodeRequest | ( | const QString & | baseUrl, |
bool | forceRefresh, | ||
QObject * | parent = nullptr |
||
) |
Constructor for QgsGeoNodeRequest.
If forceRefresh is false
, then cached copies of the request may be reused.
Definition at line 31 of file qgsgeonoderequest.cpp.
|
override |
Definition at line 39 of file qgsgeonoderequest.cpp.
|
slot |
Aborts any active network request immediately.
Definition at line 44 of file qgsgeonoderequest.cpp.
QgsGeoNodeStyle QgsGeoNodeRequest::fetchDefaultStyleBlocking | ( | const QString & | layerName | ) |
Requests the default style for the layer with matching layerName from the server.
This method is blocking and will wait for results from the server before returning. Accordingly it should not be used from any code which potentially blocks operation in the main GUI thread.
Definition at line 93 of file qgsgeonoderequest.cpp.
void QgsGeoNodeRequest::fetchLayers | ( | ) |
Triggers a new request to fetch the list of available layers from the server.
When complete, the layersFetched() signal will be emitted with the result.
This method is non-blocking and returns immediately.
Definition at line 54 of file qgsgeonoderequest.cpp.
QList< QgsGeoNodeRequest::ServiceLayerDetail > QgsGeoNodeRequest::fetchLayersBlocking | ( | ) |
Requests the list of available layers from the server.
This method is blocking and will wait for results from the server before returning. Accordingly it should not be used from any code which potentially blocks operation in the main GUI thread.
Definition at line 76 of file qgsgeonoderequest.cpp.
QgsStringMap QgsGeoNodeRequest::fetchServiceUrlDataBlocking | ( | const QString & | serviceType | ) |
Obtains a map of layer name to URL for available services with matching serviceType from the server.
This method is blocking and will wait for results from the server before returning. Accordingly it should not be used from any code which potentially blocks operation in the main GUI thread.
Definition at line 484 of file qgsgeonoderequest.cpp.
QStringList QgsGeoNodeRequest::fetchServiceUrlsBlocking | ( | const QString & | serviceType | ) |
Requests the list of unique URLs for available services with matching serviceType from the server.
This method is blocking and will wait for results from the server before returning. Accordingly it should not be used from any code which potentially blocks operation in the main GUI thread.
Definition at line 437 of file qgsgeonoderequest.cpp.
QgsGeoNodeStyle QgsGeoNodeRequest::fetchStyleBlocking | ( | const QString & | styleId | ) |
Requests the details for the style with matching styleId from the server.
This method is blocking and will wait for results from the server before returning. Accordingly it should not be used from any code which potentially blocks operation in the main GUI thread.
Definition at line 145 of file qgsgeonoderequest.cpp.
QList< QgsGeoNodeStyle > QgsGeoNodeRequest::fetchStylesBlocking | ( | const QString & | layerName | ) |
Requests the list of available styles for the layer with matching layerName from the server.
This method is blocking and will wait for results from the server before returning. Accordingly it should not be used from any code which potentially blocks operation in the main GUI thread.
Definition at line 117 of file qgsgeonoderequest.cpp.
|
inline |
Returns the most recent error string for any encountered errors, or an empty string if no errors have been encountered.
Definition at line 213 of file qgsgeonoderequest.h.
|
inline |
Returns the most recent response obtained from the server.
Definition at line 218 of file qgsgeonoderequest.h.
|
signal |
Emitted when the result of a fetchLayers call has been received and processed.
QgsGeoNodeRequest::ServiceLayerDetail QgsGeoNodeRequest::parseOwsUrl | ( | QgsGeoNodeRequest::ServiceLayerDetail & | layerStruct, |
const QVariantList & | layerLinks | ||
) |
Returns the updated ServiceLayerDetail struct with WMS/WFS/XYZ url.
Definition at line 358 of file qgsgeonoderequest.cpp.
QString QgsGeoNodeRequest::protocol | ( | ) | const |
Returns the network protocol (e.g.
'http') used for connecting with the server.
Definition at line 159 of file qgsgeonoderequest.cpp.
void QgsGeoNodeRequest::request | ( | const QString & | endPoint | ) |
Triggers a new request to the GeoNode server, with the requested endPoint.
Any existing request will be aborted.
Calling this method does not block while waiting for a result.
Definition at line 533 of file qgsgeonoderequest.cpp.
bool QgsGeoNodeRequest::requestBlocking | ( | const QString & | endPoint | ) |
Triggers a new request to the GeoNode server, with the requested endPoint.
Any existing request will be aborted.
Calling this method will block while waiting for a result. It should not be used from any code which potentially blocks operation in the main GUI thread.
Definition at line 551 of file qgsgeonoderequest.cpp.
|
signal |
Emitted when the existing request has been completed.
void QgsGeoNodeRequest::setProtocol | ( | const QString & | protocol | ) |
Sets the network protocol (e.g.
'http') used for connecting with the server.
Definition at line 164 of file qgsgeonoderequest.cpp.
|
signal |
Emitted when the status of an ongoing request is changed.