Skip to content

Commit bea89b3

Browse files
myarjunarnyalldawson
authored andcommitted
[FEATURE] QGIS - GeoNode Integration: Integrate with QGIS Browser Panel (#4816)
* add Geonode connection menu to the toolbar * add header files for geonode-qgis client * add action to launch geonode connection dialog from menubar * Move to proper directory * Add geonodeconnection class. * Add unit test for geonode connection. * Use const static to avoid typo. * Get list layers from geonode. * Add get maps method. * Geonode connection dialog (#13) * add new geonode connection dialog * apply functionality to the geonode connection manager dialog * add save and load geonode connection functionality * edit baseKey and credentialBaseKey * remove auto-connect slots * Add unit test for geonode connection. * Add wms url getter. * Add uuid and layer name in the table. * Add handler for the list layer clicked. WIP. * Use new style connect, better hacky to get wms url. * update gitignore * Make QGIS able to add WMS layer from geonode. With hacky code. * Fix Docstring. * Show web service type (WMS/WFS) in layer table. * fix http and toolbar menu * add geonode data item to the browser panel as an extention of ows provider * [WIP] Add WFS. * Add geonode get service url. * combobox functionality and test geonode connection * Add WFS. * Disable add button if it's a map. Currently we can't do anything for map. * Add busy cursor when add layer. * get service uri capabilitites * add available layers to the geonode browser panel * remove debugging footprint and replace old style connect * add actions (new, edit, delete) to geonode browser panel * fix getLayers by WMS url * add Geonode connection menu to the toolbar * Filter out invalid layer / map. * Fix service url method. * Add service url for XYZ for GeoNode QGIS Server backend. * Add XYZ url to geonode connection dialog. * Add XYZ layer to QGIS. * fix double geonode submenu * add wfs/wms layers from browser panel using its native provider * comply with qgis3 new class naming * Handle different prefix for layer in GeoNode QGIS Server backend. * base class for cms connection * make geonode connection as a derived class from cms connection * update cmakelists * move geonode connection to geocms dir * update CMakeLists * Handle geonode 2.7 with new API. * Handle multiple geoserver url in one geonode. * Fix add xyz for qgis server. Fix add wms, wfs, xyz for geoserver in geonode 2.7 * Refactor serviceURL to return QStringList. * add 'add geonode layer' icon * add geonode to the data source manager dialog * [GeoNode-Client] Fix add WFS layer. * fix wms url parameter * add xyz dataitems * Use new style connect. * [GeoNode Client] Handle qgis server specific typename to make add WFS works. * Code improvement. * [GeoNode Client] Make geonode dialog in add universal layer can add layer. * Open universal add layer when click Add GeoNode layer. * Make sure the geonode url has protocol. * Handle geonode version in a better way. * make sure the serviceUrl method has scheme in its urls * add services option to the dialog * remove version label if not wfs * construct wms url with parameters for geonode connection * handle layer from multi service urls for every wfs, wms, & xyz services * fix new style connect using static_cast * hode close button if dialog is in embedded mode * fix xyz layer naming in the browser tree * create base class for geocms dataitems * fix compiling warning * Use struct instead QVariantMap. * tidy up code * Tidy up code, use QgsStringMap instead QVariantMap. * Add spellok for catalogue. * update sip * update sip * Use naming convention for QgsGeoCmsConnection and use QUuid. * Async by using GeoNodeRequest class. * Move geonode to src/gui. * Use stack not heap. * Remove unused includes. * Use signal to handle request. * Use QStringLiteral. * Switch to use Q_FOREACH. * Use Q_FOREACH and addressing PR's review. * Set private for data members. * update sip * Update sip. * Update sip. * Fix sip problem to make it buildable again. * Remove geocms * Tidy up code. * Use QgsSetting Scope::Provider. * Fix missing zip.h
1 parent 5614df4 commit bea89b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3898
-19
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/CMakeLists.txt.user
2424
/CMakeLists.txt.user.*
2525
api_doc
26-
build*
26+
*build*
2727
debian/*.debhelper
2828
debian/*.substvars
2929
desktop.ini

images/images.qrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
<file>themes/default/mActionAddWcsLayer.svg</file>
136136
<file>themes/default/mActionAddWfsLayer.svg</file>
137137
<file>themes/default/mActionAddWmsLayer.svg</file>
138+
<file>themes/default/mActionAddGeonodeLayer.svg</file>
138139
<file>themes/default/mActionAddDelimitedTextLayer.svg</file>
139140
<file>themes/default/mActionAddVirtualLayer.svg</file>
140141
<file>themes/default/mActionAlignBottom.svg</file>
@@ -359,6 +360,7 @@
359360
<file>themes/default/mIconFieldInteger.svg</file>
360361
<file>themes/default/mIconFieldText.svg</file>
361362
<file>themes/default/mIconFieldTime.svg</file>
363+
<file>themes/default/mIconGeonode.svg</file>
362364
<file>themes/default/mIconInfo.svg</file>
363365
<file>themes/default/mIconImport.gif</file>
364366
<file>themes/default/mIconLabelQuadrantCenter.svg</file>

images/themes/default/mActionAddGeonodeLayer.svg

Lines changed: 407 additions & 0 deletions
Loading
Lines changed: 13 additions & 0 deletions
Loading

python/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ INCLUDE_DIRECTORIES(
112112
${CMAKE_SOURCE_DIR}/src/core/fieldformatter
113113
${CMAKE_SOURCE_DIR}/src/core/dxf
114114
${CMAKE_SOURCE_DIR}/src/core/geometry
115+
${CMAKE_SOURCE_DIR}/src/core/geonode
115116
${CMAKE_SOURCE_DIR}/src/core/gps
116117
${CMAKE_SOURCE_DIR}/src/core/layertree
117118
${CMAKE_SOURCE_DIR}/src/core/layout
@@ -141,6 +142,7 @@ IF (WITH_GUI)
141142
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets
142143
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets/core
143144
${CMAKE_SOURCE_DIR}/src/gui/effects
145+
${CMAKE_SOURCE_DIR}/src/gui/geonode
144146
${CMAKE_SOURCE_DIR}/src/gui/layertree
145147
${CMAKE_SOURCE_DIR}/src/gui/layout
146148
${CMAKE_SOURCE_DIR}/src/gui/locator

python/core/core_auto.sip

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@
284284
%Include fieldformatter/qgsrelationreferencefieldformatter.sip
285285
%Include fieldformatter/qgsvaluemapfieldformatter.sip
286286
%Include fieldformatter/qgsvaluerelationfieldformatter.sip
287+
%Include geonode/qgsgeonodeconnection.sip
288+
%Include geonode/qgsgeonoderequest.sip
287289
%Include gps/qgsqtlocationconnection.sip
288290
%Include gps/qgsgpsconnectionregistry.sip
289291
%Include qgsapplication.sip

python/core/geonode/qgsdataitemprovider.sip

Whitespace-only changes.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/geonode/qgsgeonodeconnection.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
class QgsGeoNodeConnection : QObject
13+
{
14+
%Docstring
15+
!
16+
GeoNode Connections management
17+
%End
18+
19+
%TypeHeaderCode
20+
#include "qgsgeonodeconnection.h"
21+
%End
22+
public:
23+
explicit QgsGeoNodeConnection( const QString &connName );
24+
%Docstring
25+
Constructor
26+
%End
27+
28+
~QgsGeoNodeConnection();
29+
%Docstring
30+
Destructor
31+
%End
32+
33+
QString connName() const;
34+
%Docstring
35+
:rtype: str
36+
%End
37+
void setConnName( const QString &connName );
38+
39+
QgsDataSourceUri uri();
40+
%Docstring
41+
:rtype: QgsDataSourceUri
42+
%End
43+
void setUri( const QgsDataSourceUri &uri );
44+
45+
static QStringList connectionList();
46+
%Docstring
47+
Retrieve all geonode connection
48+
:rtype: list of str
49+
%End
50+
51+
static void deleteConnection( const QString &name );
52+
%Docstring
53+
Delete connection with name, name
54+
%End
55+
56+
static QString selectedConnection();
57+
%Docstring
58+
Get selected connection
59+
:rtype: str
60+
%End
61+
62+
static void setSelectedConnection( const QString &name );
63+
%Docstring
64+
Set selected connection
65+
%End
66+
67+
static QString pathGeoNodeConnection();
68+
%Docstring
69+
:rtype: str
70+
%End
71+
72+
static QString pathGeoNodeConnectionDetails();
73+
%Docstring
74+
:rtype: str
75+
%End
76+
77+
};
78+
79+
80+
/************************************************************************
81+
* This file has been generated automatically from *
82+
* *
83+
* src/core/geonode/qgsgeonodeconnection.h *
84+
* *
85+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
86+
************************************************************************/
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/geonode/qgsgeonoderequest.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
struct QgsServiceLayerDetail
13+
{
14+
%TypeHeaderCode
15+
#include <qgsgeonoderequest.h>
16+
%End
17+
QUuid uuid;
18+
QString name;
19+
QString typeName;
20+
QString title;
21+
QString wmsURL;
22+
QString wfsURL;
23+
QString xyzURL;
24+
};
25+
26+
class QgsGeoNodeRequest : QObject
27+
{
28+
29+
%TypeHeaderCode
30+
#include "qgsgeonoderequest.h"
31+
%End
32+
public:
33+
explicit QgsGeoNodeRequest( bool forceRefresh, QObject *parent = 0 );
34+
QgsGeoNodeRequest( const QString &baseUrl, /*const QgsWmsAuthorization &auth,*/ bool forceRefresh, QObject *parent = 0 );
35+
virtual ~QgsGeoNodeRequest();
36+
37+
bool request( QString endPoint );
38+
%Docstring
39+
:rtype: bool
40+
%End
41+
42+
bool getLayers();
43+
%Docstring
44+
:rtype: bool
45+
%End
46+
47+
QList<QgsServiceLayerDetail> parseLayers( QByteArray layerResponse );
48+
%Docstring
49+
:rtype: list of QgsServiceLayerDetail
50+
%End
51+
52+
QStringList serviceUrls( QString serviceType );
53+
%Docstring
54+
:rtype: list of str
55+
%End
56+
57+
QgsStringMap serviceUrlData( QString serviceType );
58+
%Docstring
59+
:rtype: QgsStringMap
60+
%End
61+
62+
QString lastError() const;
63+
%Docstring
64+
:rtype: str
65+
%End
66+
67+
QByteArray response() const;
68+
%Docstring
69+
:rtype: QByteArray
70+
%End
71+
72+
QNetworkReply *reply() const;
73+
%Docstring
74+
:rtype: QNetworkReply
75+
%End
76+
77+
void abort();
78+
%Docstring
79+
Abort network request immediately
80+
%End
81+
82+
QString getProtocol() const;
83+
%Docstring
84+
:rtype: str
85+
%End
86+
void setProtocol( const QString &protocol );
87+
88+
signals:
89+
void statusChanged( const QString &statusQString );
90+
%Docstring
91+
emit a signal to be caught by qgisapp and display a statusQString on status bar
92+
%End
93+
94+
void requestFinished();
95+
%Docstring
96+
emit a signal once the request is finished
97+
%End
98+
99+
protected slots:
100+
void replyFinished();
101+
void replyProgress( qint64, qint64 );
102+
103+
protected:
104+
105+
106+
107+
108+
109+
110+
111+
112+
113+
};
114+
115+
/************************************************************************
116+
* This file has been generated automatically from *
117+
* *
118+
* src/core/geonode/qgsgeonoderequest.h *
119+
* *
120+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
121+
************************************************************************/

python/core/qgsdataitemprovider.sip

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ Caller takes responsibility of deleting created items.
4949
:rtype: QgsDataItem
5050
%End
5151

52+
virtual QVector<QgsDataItem *> createDataItems( const QString &path, QgsDataItem *parentItem );
53+
%Docstring
54+
Caller takes responsibility of deleting created items.
55+
:rtype: list of QgsDataItem
56+
%End
5257
};
5358

5459
/************************************************************************

0 commit comments

Comments
 (0)