QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Provides a way to retrieve settings by prioritizing according to environment variables, ini file and default values. More...
#include <qgsserversettings.h>
Classes | |
struct | Setting |
Public Member Functions | |
QgsServerSettings () | |
Constructor. More... | |
QString | apiResourcesDirectory () const |
Returns the server-wide base directory where HTML templates and static assets (e.g. More... | |
qlonglong | apiWfs3MaxLimit () const |
Returns the server-wide maximum allowed value for "limit" in a features request. More... | |
QString | cacheDirectory () const |
Returns the cache directory. More... | |
qint64 | cacheSize () const |
Returns the cache size. More... | |
bool | getPrintDisabled () const |
Returns true if WMS GetPrint request is disabled and the project's reading flag QgsProject::ReadFlag::FlagDontLoadLayouts is activated. More... | |
bool | ignoreBadLayers () const |
Returns true if the bad layers are ignored and false when the presence of a bad layers invalidates the whole project making it unavailable. More... | |
QString | iniFile () const |
Returns the ini file loaded by QSetting. More... | |
QString | landingPageProjectsDirectories () const |
Returns the directories used by the landing page service to find .qgs and .qgz projects. More... | |
QString | landingPageProjectsPgConnections () const |
Returns the PostgreSQL connection strings used by the landing page service to find projects. More... | |
void | load () |
Load settings according to current environment variables. More... | |
bool | load (const QString &envVarName) |
Load setting for a specific environment variable name. More... | |
QString | logFile () const |
Returns the log file. More... | |
Qgis::MessageLevel | logLevel () const |
Returns the log level. More... | |
bool | logStderr () const |
Returns whether logging to stderr is activated. More... | |
void | logSummary () const |
Log a summary of settings currently loaded. More... | |
int | maxCacheLayers () const |
Returns the maximum number of cached layers. More... | |
int | maxThreads () const |
Returns the maximum number of threads to use. More... | |
QString | overrideSystemLocale () const |
Overrides system locale. More... | |
bool | parallelRendering () const |
Returns parallel rendering setting. More... | |
QString | projectFile () const |
Returns the QGS project file to use. More... | |
bool | showGroupSeparator () const |
Show group (thousand) separator. More... | |
bool | trustLayerMetadata () const |
Returns true if the reading flag trust layer metadata is activated. More... | |
int | wmsMaxHeight () const |
Returns the server-wide max height of a WMS GetMap request. More... | |
int | wmsMaxWidth () const |
Returns the server-wide max width of a WMS GetMap request. More... | |
Static Public Member Functions | |
static QString | name (QgsServerSettingsEnv::EnvVar env) |
Returns the string representation of a setting. More... | |
Provides a way to retrieve settings by prioritizing according to environment variables, ini file and default values.
Definition at line 84 of file qgsserversettings.h.
QgsServerSettings::QgsServerSettings | ( | ) |
Constructor.
Definition at line 25 of file qgsserversettings.cpp.
QString QgsServerSettings::apiResourcesDirectory | ( | ) | const |
Returns the server-wide base directory where HTML templates and static assets (e.g.
images, js and css files) are searched for.
The default path is calculated by joining QgsApplication::pkgDataPath() with "resources/server/api", this path can be changed by setting the environment variable QGIS_SERVER_API_RESOURCES_DIRECTORY.
Definition at line 492 of file qgsserversettings.cpp.
qlonglong QgsServerSettings::apiWfs3MaxLimit | ( | ) | const |
Returns the server-wide maximum allowed value for "limit" in a features request.
The default value is 10000, this value can be changed by setting the environment variable QGIS_SERVER_API_WFS3_MAX_LIMIT.
Definition at line 497 of file qgsserversettings.cpp.
QString QgsServerSettings::cacheDirectory | ( | ) | const |
Returns the cache directory.
Definition at line 457 of file qgsserversettings.cpp.
qint64 QgsServerSettings::cacheSize | ( | ) | const |
Returns the cache size.
Definition at line 452 of file qgsserversettings.cpp.
bool QgsServerSettings::getPrintDisabled | ( | ) | const |
Returns true
if WMS GetPrint request is disabled and the project's reading flag QgsProject::ReadFlag::FlagDontLoadLayouts is activated.
The default value is false
, this value can be changed by setting the environment variable QGIS_SERVER_DISABLE_GETPRINT.
Definition at line 512 of file qgsserversettings.cpp.
bool QgsServerSettings::ignoreBadLayers | ( | ) | const |
Returns true
if the bad layers are ignored and false
when the presence of a bad layers invalidates the whole project making it unavailable.
The default value is true
, this value can be changed by setting the environment variable QGIS_SERVER_IGNORE_BAD_LAYERS.
Definition at line 502 of file qgsserversettings.cpp.
QString QgsServerSettings::iniFile | ( | ) | const |
Returns the ini file loaded by QSetting.
Definition at line 412 of file qgsserversettings.cpp.
QString QgsServerSettings::landingPageProjectsDirectories | ( | ) | const |
Returns the directories used by the landing page service to find .qgs and .qgz projects.
Multiple directories can be specified by separating them with '||'.
Definition at line 482 of file qgsserversettings.cpp.
QString QgsServerSettings::landingPageProjectsPgConnections | ( | ) | const |
Returns the PostgreSQL connection strings used by the landing page service to find projects.
Multiple connections can be specified by separating them with '||'.
Definition at line 487 of file qgsserversettings.cpp.
void QgsServerSettings::load | ( | ) |
Load settings according to current environment variables.
Definition at line 270 of file qgsserversettings.cpp.
bool QgsServerSettings::load | ( | const QString & | envVarName | ) |
Load setting for a specific environment variable name.
true
if loading is successful, false
in case of an invalid name. Definition at line 286 of file qgsserversettings.cpp.
QString QgsServerSettings::logFile | ( | ) | const |
Returns the log file.
Definition at line 427 of file qgsserversettings.cpp.
Qgis::MessageLevel QgsServerSettings::logLevel | ( | ) | const |
bool QgsServerSettings::logStderr | ( | ) | const |
Returns whether logging to stderr is activated.
true
if logging to stderr is activated, false
otherwise. Definition at line 432 of file qgsserversettings.cpp.
void QgsServerSettings::logSummary | ( | ) | const |
Log a summary of settings currently loaded.
Definition at line 390 of file qgsserversettings.cpp.
int QgsServerSettings::maxCacheLayers | ( | ) | const |
Returns the maximum number of cached layers.
Definition at line 442 of file qgsserversettings.cpp.
int QgsServerSettings::maxThreads | ( | ) | const |
Returns the maximum number of threads to use.
Definition at line 422 of file qgsserversettings.cpp.
|
static |
Returns the string representation of a setting.
Definition at line 384 of file qgsserversettings.cpp.
QString QgsServerSettings::overrideSystemLocale | ( | ) | const |
Overrides system locale.
Definition at line 462 of file qgsserversettings.cpp.
bool QgsServerSettings::parallelRendering | ( | ) | const |
Returns parallel rendering setting.
true
if parallel rendering is activated, false
otherwise. Definition at line 417 of file qgsserversettings.cpp.
QString QgsServerSettings::projectFile | ( | ) | const |
Returns the QGS project file to use.
Definition at line 447 of file qgsserversettings.cpp.
bool QgsServerSettings::showGroupSeparator | ( | ) | const |
Show group (thousand) separator.
false
. Definition at line 467 of file qgsserversettings.cpp.
bool QgsServerSettings::trustLayerMetadata | ( | ) | const |
Returns true
if the reading flag trust layer metadata is activated.
The default value is false
, this value can be changed by setting the environment variable QGIS_SERVER_TRUST_LAYER_METADATA.
Definition at line 507 of file qgsserversettings.cpp.
int QgsServerSettings::wmsMaxHeight | ( | ) | const |
Returns the server-wide max height of a WMS GetMap request.
The lower one of this and the project configuration is used.
Definition at line 472 of file qgsserversettings.cpp.
int QgsServerSettings::wmsMaxWidth | ( | ) | const |
Returns the server-wide max width of a WMS GetMap request.
The lower one of this and the project configuration is used.
Definition at line 477 of file qgsserversettings.cpp.