Skip to content

Commit

Permalink
Add API for having many metadataUrl on a layer
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Sep 16, 2021
1 parent 5ea353b commit 21c3f3f
Show file tree
Hide file tree
Showing 20 changed files with 585 additions and 50 deletions.
40 changes: 32 additions & 8 deletions python/core/auto_generated/qgsmaplayer.sip.in
Expand Up @@ -376,70 +376,94 @@ Attribution indicates the provider of a layer or collection of layers.
%End



virtual QgsMapLayerServerProperties *serverProperties();
%Docstring
Returns QGIS Server Properties for the map layer

.. versionadded:: 3.22
%End



void setMetadataUrl( const QString &metaUrl );
%Docstring
Sets the metadata URL of the layer
used by QGIS Server in GetCapabilities request.
MetadataUrl is a a link to the detailed, standardized metadata about the data.
Since QGIS 3.22, it edits the first metadata URL link. You should use setServerProperties.

:return: the layer metadata URL
.. seealso:: :py:func:`setServerProperties`

.. seealso:: :py:func:`metadataUrl`
.. deprecated:: QGIS 3.22
%End

QString metadataUrl() const;
%Docstring
Returns the metadata URL of the layer
used by QGIS Server in GetCapabilities request.
MetadataUrl is a a link to the detailed, standardized metadata about the data.
Since QGIS 3.22, it returns the first metadata URL link. You should use setServerProperties.

:return: the layer metadata URL

.. seealso:: :py:func:`setMetadataUrl`
.. seealso:: :py:func:`mapLayerServerProperties`

.. deprecated:: QGIS 3.22
%End

void setMetadataUrlType( const QString &metaUrlType );
%Docstring
Set the metadata type of the layer
used by QGIS Server in GetCapabilities request
MetadataUrlType indicates the standard to which the metadata complies.
Since QGIS 3.22, it edits the first metadata URL type. You should use setServerProperties.

:return: the layer metadata type

.. seealso:: :py:func:`metadataUrlType`
.. seealso:: :py:func:`mapLayerServerProperties`

.. deprecated:: QGIS 3.22
%End

QString metadataUrlType() const;
%Docstring
Returns the metadata type of the layer
used by QGIS Server in GetCapabilities request.
MetadataUrlType indicates the standard to which the metadata complies.
Since QGIS 3.22, it returns the first metadata URL type. You should use setServerProperties.

:return: the layer metadata type

.. seealso:: :py:func:`setMetadataUrlType`
.. seealso:: :py:func:`mapLayerServerProperties`

.. deprecated:: QGIS 3.22
%End

void setMetadataUrlFormat( const QString &metaUrlFormat );
%Docstring
Sets the metadata format of the layer
used by QGIS Server in GetCapabilities request.
MetadataUrlType indicates how the metadata is structured.
Since QGIS 3.22, it edits the first metadata URL format. You should use setServerProperties.

:return: the layer metadata format
.. seealso:: :py:func:`mapLayerServerProperties`

.. seealso:: :py:func:`metadataUrlFormat`
.. deprecated:: QGIS 3.22
%End

QString metadataUrlFormat() const;
%Docstring
Returns the metadata format of the layer
used by QGIS Server in GetCapabilities request.
MetadataUrlType indicates how the metadata is structured.
Since QGIS 3.22, it returns the first metadata URL format. You should use setServerProperties.

:return: the layer metadata format

.. seealso:: :py:func:`setMetadataUrlFormat`
.. seealso:: :py:func:`mapLayerServerProperties`

.. deprecated:: QGIS 3.22
%End

void setBlendMode( QPainter::CompositionMode blendMode );
Expand Down
96 changes: 96 additions & 0 deletions python/core/auto_generated/qgsmaplayerserverproperties.sip.in
@@ -0,0 +1,96 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaplayerserverproperties.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/






class QgsMapLayerServerProperties
{
%Docstring(signature="appended")
Manages QGIS Server properties for a map layer

.. versionadded:: 3.22
%End

%TypeHeaderCode
#include "qgsmaplayerserverproperties.h"
%End
public:
static const QMetaObject staticMetaObject;

public:

struct MetadataUrl
{

MetadataUrl( const QString &url = QString(), const QString &type = QString(), const QString &format = QString() );
%Docstring
Constructor for MetadataUrl.
%End

QString url;

QString type;

QString format;


bool operator==( const QgsMapLayerServerProperties::MetadataUrl &other ) const;
};

QgsMapLayerServerProperties( QgsMapLayer *layer = 0 );
%Docstring
Constructor - Creates a Map Layer QGIS Server Properties

:param layer: The map layer
%End

QList <QgsMapLayerServerProperties::MetadataUrl> metadataUrls() const;
%Docstring
Returns a list of metadataUrl resources associated for the layer.

:return: the list of metadata URLs

.. seealso:: :py:func:`setMetadataUrls`
%End

void setMetadataUrls( const QList<QgsMapLayerServerProperties::MetadataUrl> &metaUrls );
%Docstring
Sets a the list of metadata URL for the layer

.. seealso:: :py:func:`metadataUrls`

.. seealso:: :py:func:`addMetadataUrl`
%End
void addMetadataUrl( const MetadataUrl &metaUrl );
%Docstring
Add a metadataUrl for the layer

.. seealso:: :py:func:`setMetadataUrls`
%End
void writeXml( QDomNode &layer_node, QDomDocument &document ) const;
%Docstring
Saves server properties to xml under the layer node
%End

void readXml( const QDomNode &layer_node );
%Docstring
Reads server properties from project file.
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaplayerserverproperties.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2 changes: 1 addition & 1 deletion python/core/auto_generated/vector/qgsvectorlayer.sip.in
Expand Up @@ -616,7 +616,7 @@ which is used by the layer, so any changes are immediately applied.
%End


QgsVectorLayerServerProperties *serverProperties() const;
QgsMapLayerServerProperties *serverProperties() const;
%Docstring
Returns QGIS Server Properties of the vector layer

Expand Down
Expand Up @@ -11,7 +11,7 @@



class QgsVectorLayerServerProperties
class QgsVectorLayerServerProperties : QgsMapLayerServerProperties
{
%Docstring(signature="appended")
Manages QGIS Server properties for a vector layer
Expand Down
1 change: 1 addition & 0 deletions python/core/core_auto.sip
Expand Up @@ -101,6 +101,7 @@
%Include auto_generated/qgsmaplayermodel.sip
%Include auto_generated/qgsmaplayerproxymodel.sip
%Include auto_generated/qgsmaplayerrenderer.sip
%Include auto_generated/qgsmaplayerserverproperties.sip
%Include auto_generated/qgsmaplayerstore.sip
%Include auto_generated/qgsmaplayerstyle.sip
%Include auto_generated/qgsmaplayerstylemanager.sip
Expand Down
2 changes: 2 additions & 0 deletions src/core/CMakeLists.txt
Expand Up @@ -400,6 +400,7 @@ set(QGIS_CORE_SRCS
qgsmaplayermodel.cpp
qgsmaplayerproxymodel.cpp
qgsmaplayerrenderer.cpp
qgsmaplayerserverproperties.cpp
qgsmaplayerstore.cpp
qgsmaplayerstyle.cpp
qgsmaplayerstylemanager.cpp
Expand Down Expand Up @@ -1034,6 +1035,7 @@ set(QGIS_CORE_HDRS
qgsmaplayerproxymodel.h
qgsmaplayerref.h
qgsmaplayerrenderer.h
qgsmaplayerserverproperties.h
qgsmaplayerstore.h
qgsmaplayerstyle.h
qgsmaplayerstylemanager.h
Expand Down

0 comments on commit 21c3f3f

Please sign in to comment.