QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
QgsProjectServerValidator Class Reference

Validates the server specific parts of the configuration of a QGIS project. More...

#include <qgsprojectservervalidator.h>

Classes

struct  ValidationResult
 Contains the parameters describing a project validation failure. More...
 

Public Types

enum  ValidationError {
  DuplicatedNames = 0 , LayerShortName = 1 , LayerEncoding = 2 , ProjectShortName = 3 ,
  ProjectRootNameConflict = 4
}
 Errors that might be raised by the validation process. More...
 

Public Member Functions

 QgsProjectServerValidator ()=default
 Constructor for QgsProjectServerValidator. More...
 

Static Public Member Functions

static QString displayValidationError (QgsProjectServerValidator::ValidationError error)
 Returns a human readable string for a given error. More...
 
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. More...
 

Detailed Description

Validates the server specific parts of the configuration of a QGIS project.

Since
QGIS 3.14

Definition at line 33 of file qgsprojectservervalidator.h.

Member Enumeration Documentation

◆ ValidationError

Errors that might be raised by the validation process.

Enumerator
DuplicatedNames 

A duplicated layer/group name in the layer tree.

LayerShortName 

Layer/group short name is not valid.

LayerEncoding 

Encoding is not correctly set on a vector layer.

ProjectShortName 

The project short name is not valid.

ProjectRootNameConflict 

The project root name is already used by a layer or a group.

Definition at line 46 of file qgsprojectservervalidator.h.

Constructor & Destructor Documentation

◆ QgsProjectServerValidator()

QgsProjectServerValidator::QgsProjectServerValidator ( )
default

Constructor for QgsProjectServerValidator.

Member Function Documentation

◆ displayValidationError()

QString QgsProjectServerValidator::displayValidationError ( QgsProjectServerValidator::ValidationError  error)
static

Returns a human readable string for a given error.

Parameters
errorthe error.
Returns
the human readable error.

Definition at line 26 of file qgsprojectservervalidator.cpp.

◆ validate()

bool QgsProjectServerValidator::validate ( QgsProject project,
QList< QgsProjectServerValidator::ValidationResult > &  results 
)
static

Validates a project to detect problems on QGIS Server, and returns true if it's considered valid.

If validation fails, the results list will be filled with a list of items describing why the validation failed and what needs to be rectified

Parameters
projectinput project to check
resultsresults of the validation
Returns
bool

Definition at line 83 of file qgsprojectservervalidator.cpp.


The documentation for this class was generated from the following files: