QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgsprojectservervalidator.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprojectservervalidator.h
3 ---------------------------
4 begin : March 2020
5 copyright : (C) 2020 by Etienne Trimaille
6 email : etienne dot trimaille at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSPROJECTSERVERVALIDATOR_H
19#define QGSPROJECTSERVERVALIDATOR_H
20
21#include "qgis_core.h"
22#include "qgis_sip.h"
23#include "qgslayertree.h"
24#include "qgslayertreegroup.h"
25
33{
34
35 public:
36
38
51
57 static QString displayValidationError( QgsProjectServerValidator::ValidationError error );
58
83
92 static bool validate( QgsProject *project, QList< QgsProjectServerValidator::ValidationResult > &results SIP_OUT );
93
94 private:
95 static void browseLayerTree( QgsLayerTreeGroup *treeGroup, QStringList &owsNames, QStringList &encodingMessages, QStringList &layerNames, QStringList &maptipTemplates );
96 static bool isOnlyMaptipEnabled( QgsProject *project );
97
98};
99
100#endif // QGSPROJECTSERVERVALIDATOR_H
Layer tree group node serves as a container for layers and further groups.
QgsProjectServerValidator()=default
ValidationError
Errors that might be raised by the validation process.
@ LayerEncoding
Encoding is not correctly set on a vector layer.
@ ProjectRootNameConflict
The project root name is already used by a layer or a group.
@ ProjectShortName
The project short name is not valid.
@ DuplicatedNames
A duplicated layer/group name in the layer tree.
@ OnlyMaptipTrueButEmptyMaptip
Use only maptip for HTML GetFeatureInfo response is enabled but HTML maptip is empty.
@ LayerShortName
Layer/group short name is not valid.
static bool validate(QgsProject *project, QList< QgsProjectServerValidator::ValidationResult > &results)
Validates a project to detect problems on QGIS Server, and returns true if it's considered valid.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:109
#define SIP_OUT
Definition qgis_sip.h:58
ValidationResult(const QgsProjectServerValidator::ValidationError error, const QVariant &identifier)
Constructor for ValidationResult.
QVariant identifier
Identifier related to the error.
QgsProjectServerValidator::ValidationError error
Error which occurred during the validation process.