Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FEATURE] QGIS - GeoNode Integration: Integrate with QGIS Browser Pan…
…el (#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
  • Loading branch information
myarjunar authored and nyalldawson committed Sep 12, 2017
1 parent 5614df4 commit bea89b3
Show file tree
Hide file tree
Showing 51 changed files with 3,898 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -23,7 +23,7 @@
/CMakeLists.txt.user
/CMakeLists.txt.user.*
api_doc
build*
*build*
debian/*.debhelper
debian/*.substvars
desktop.ini
Expand Down
2 changes: 2 additions & 0 deletions images/images.qrc
Expand Up @@ -135,6 +135,7 @@
<file>themes/default/mActionAddWcsLayer.svg</file>
<file>themes/default/mActionAddWfsLayer.svg</file>
<file>themes/default/mActionAddWmsLayer.svg</file>
<file>themes/default/mActionAddGeonodeLayer.svg</file>
<file>themes/default/mActionAddDelimitedTextLayer.svg</file>
<file>themes/default/mActionAddVirtualLayer.svg</file>
<file>themes/default/mActionAlignBottom.svg</file>
Expand Down Expand Up @@ -359,6 +360,7 @@
<file>themes/default/mIconFieldInteger.svg</file>
<file>themes/default/mIconFieldText.svg</file>
<file>themes/default/mIconFieldTime.svg</file>
<file>themes/default/mIconGeonode.svg</file>
<file>themes/default/mIconInfo.svg</file>
<file>themes/default/mIconImport.gif</file>
<file>themes/default/mIconLabelQuadrantCenter.svg</file>
Expand Down
407 changes: 407 additions & 0 deletions images/themes/default/mActionAddGeonodeLayer.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions images/themes/default/mIconGeonode.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions python/CMakeLists.txt
Expand Up @@ -112,6 +112,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core/fieldformatter
${CMAKE_SOURCE_DIR}/src/core/dxf
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/core/geonode
${CMAKE_SOURCE_DIR}/src/core/gps
${CMAKE_SOURCE_DIR}/src/core/layertree
${CMAKE_SOURCE_DIR}/src/core/layout
Expand Down Expand Up @@ -141,6 +142,7 @@ IF (WITH_GUI)
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets/core
${CMAKE_SOURCE_DIR}/src/gui/effects
${CMAKE_SOURCE_DIR}/src/gui/geonode
${CMAKE_SOURCE_DIR}/src/gui/layertree
${CMAKE_SOURCE_DIR}/src/gui/layout
${CMAKE_SOURCE_DIR}/src/gui/locator
Expand Down
2 changes: 2 additions & 0 deletions python/core/core_auto.sip
Expand Up @@ -284,6 +284,8 @@
%Include fieldformatter/qgsrelationreferencefieldformatter.sip
%Include fieldformatter/qgsvaluemapfieldformatter.sip
%Include fieldformatter/qgsvaluerelationfieldformatter.sip
%Include geonode/qgsgeonodeconnection.sip
%Include geonode/qgsgeonoderequest.sip
%Include gps/qgsqtlocationconnection.sip
%Include gps/qgsgpsconnectionregistry.sip
%Include qgsapplication.sip
Expand Down
Empty file.
86 changes: 86 additions & 0 deletions python/core/geonode/qgsgeonodeconnection.sip
@@ -0,0 +1,86 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/geonode/qgsgeonodeconnection.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/




class QgsGeoNodeConnection : QObject
{
%Docstring
!
GeoNode Connections management
%End

%TypeHeaderCode
#include "qgsgeonodeconnection.h"
%End
public:
explicit QgsGeoNodeConnection( const QString &connName );
%Docstring
Constructor
%End

~QgsGeoNodeConnection();
%Docstring
Destructor
%End

QString connName() const;
%Docstring
:rtype: str
%End
void setConnName( const QString &connName );

QgsDataSourceUri uri();
%Docstring
:rtype: QgsDataSourceUri
%End
void setUri( const QgsDataSourceUri &uri );

static QStringList connectionList();
%Docstring
Retrieve all geonode connection
:rtype: list of str
%End

static void deleteConnection( const QString &name );
%Docstring
Delete connection with name, name
%End

static QString selectedConnection();
%Docstring
Get selected connection
:rtype: str
%End

static void setSelectedConnection( const QString &name );
%Docstring
Set selected connection
%End

static QString pathGeoNodeConnection();
%Docstring
:rtype: str
%End

static QString pathGeoNodeConnectionDetails();
%Docstring
:rtype: str
%End

};


/************************************************************************
* This file has been generated automatically from *
* *
* src/core/geonode/qgsgeonodeconnection.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
121 changes: 121 additions & 0 deletions python/core/geonode/qgsgeonoderequest.sip
@@ -0,0 +1,121 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/geonode/qgsgeonoderequest.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/




struct QgsServiceLayerDetail
{
%TypeHeaderCode
#include <qgsgeonoderequest.h>
%End
QUuid uuid;
QString name;
QString typeName;
QString title;
QString wmsURL;
QString wfsURL;
QString xyzURL;
};

class QgsGeoNodeRequest : QObject
{

%TypeHeaderCode
#include "qgsgeonoderequest.h"
%End
public:
explicit QgsGeoNodeRequest( bool forceRefresh, QObject *parent = 0 );
QgsGeoNodeRequest( const QString &baseUrl, /*const QgsWmsAuthorization &auth,*/ bool forceRefresh, QObject *parent = 0 );
virtual ~QgsGeoNodeRequest();

bool request( QString endPoint );
%Docstring
:rtype: bool
%End

bool getLayers();
%Docstring
:rtype: bool
%End

QList<QgsServiceLayerDetail> parseLayers( QByteArray layerResponse );
%Docstring
:rtype: list of QgsServiceLayerDetail
%End

QStringList serviceUrls( QString serviceType );
%Docstring
:rtype: list of str
%End

QgsStringMap serviceUrlData( QString serviceType );
%Docstring
:rtype: QgsStringMap
%End

QString lastError() const;
%Docstring
:rtype: str
%End

QByteArray response() const;
%Docstring
:rtype: QByteArray
%End

QNetworkReply *reply() const;
%Docstring
:rtype: QNetworkReply
%End

void abort();
%Docstring
Abort network request immediately
%End

QString getProtocol() const;
%Docstring
:rtype: str
%End
void setProtocol( const QString &protocol );

signals:
void statusChanged( const QString &statusQString );
%Docstring
emit a signal to be caught by qgisapp and display a statusQString on status bar
%End

void requestFinished();
%Docstring
emit a signal once the request is finished
%End

protected slots:
void replyFinished();
void replyProgress( qint64, qint64 );

protected:









};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/geonode/qgsgeonoderequest.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
5 changes: 5 additions & 0 deletions python/core/qgsdataitemprovider.sip
Expand Up @@ -49,6 +49,11 @@ Caller takes responsibility of deleting created items.
:rtype: QgsDataItem
%End

virtual QVector<QgsDataItem *> createDataItems( const QString &path, QgsDataItem *parentItem );
%Docstring
Caller takes responsibility of deleting created items.
:rtype: list of QgsDataItem
%End
};

/************************************************************************
Expand Down
51 changes: 51 additions & 0 deletions python/gui/geonode/qgsgeonodenewconnection.sip
@@ -0,0 +1,51 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/geonode/qgsgeonodenewconnection.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/




class QgsGeoNodeNewConnection : QDialog
{
%Docstring
*************************************************************************
*
This program is free software; you can redistribute it and/or modify *
it under the terms of the GNU General Public License as published by *
the Free Software Foundation; either version 2 of the License, or *
(at your option) any later version. *
*
**************************************************************************
%End

%TypeHeaderCode
#include "qgsgeonodenewconnection.h"
%End
public:
QgsGeoNodeNewConnection( QWidget *parent = 0, const QString &connName = QString::null, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
%Docstring
Constructor
%End

public slots:
virtual void accept();

void okButtonBehavior( const QString & );
void testConnection();
%Docstring
Test the connection using the parameters supplied
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/geonode/qgsgeonodenewconnection.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

0 comments on commit bea89b3

Please sign in to comment.