QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
|
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. | |
QStringList | allowedExtraSqlTokens () const |
Returns the list of strings that represent the allowed extra SQL tokens accepted as components of a feature filter. | |
QString | apiResourcesDirectory () const |
Returns the server-wide base directory where HTML templates and static assets (e.g. | |
qlonglong | apiWfs3MaxLimit () const |
Returns the server-wide maximum allowed value for "limit" in a features request. | |
QString | applicationName () const |
Returns the QGIS Server application name. | |
QString | cacheDirectory () const |
Returns the cache directory. | |
qint64 | cacheSize () const |
Returns the cache size. | |
int | capabilitiesCacheSize () const |
Returns the maximum number of project capabilities to cache. | |
bool | forceReadOnlyLayers () const |
Returns true if the reading flag force layer read only is activated. | |
bool | getPrintDisabled () const |
Returns true if WMS GetPrint request is disabled and the project's reading flag QgsProject::ReadFlag::FlagDontLoadLayouts is activated. | |
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. | |
QString | iniFile () const |
Returns the ini file loaded by QSetting. | |
QString | landingPageBaseUrlPrefix () const |
Returns the landing page base URL regular expression, defaults to / . | |
QString | landingPageProjectsDirectories () const |
Returns the directories used by the landing page service to find .qgs and .qgz projects. | |
QString | landingPageProjectsPgConnections () const |
Returns the PostgreSQL connection strings used by the landing page service to find projects. | |
void | load () |
Load settings according to current environment variables. | |
bool | load (const QString &envVarName) |
Load setting for a specific environment variable name. | |
QString | logFile () const |
Returns the log file. | |
Qgis::MessageLevel | logLevel () const |
Returns the log level. | |
bool | logProfile () const |
Returns true if profile information has to be added to the logs, default value is false . | |
bool | logStderr () const |
Returns whether logging to stderr is activated. | |
void | logSummary () const |
Log a summary of settings currently loaded. | |
int | maxThreads () const |
Returns the maximum number of threads to use. | |
QString | overrideSystemLocale () const |
Overrides system locale. | |
bool | parallelRendering () const |
Returns parallel rendering setting. | |
int | projectCacheCheckInterval () const |
Returns the config cache check interval (in ms) for the 'periodic' strategy. | |
QString | projectCacheStrategy () const |
Returns the project's cache strategy The default value is 'filesystem', the value can be changed by setting the environment variable QGIS_SERVER_PROJECT_CACHE_STRATEGY. | |
QString | projectFile () const |
Returns the QGS project file to use. | |
QString | serviceUrl (const QString &service) const |
Returns the service URL from the setting. | |
bool | showGroupSeparator () const |
Show group (thousand) separator. | |
bool | trustLayerMetadata () const |
Returns true if the reading flag trust layer metadata is activated. | |
int | wmsMaxHeight () const |
Returns the server-wide max height of a WMS GetMap request. | |
int | wmsMaxWidth () const |
Returns the server-wide max width of a WMS GetMap request. | |
Static Public Member Functions | |
static QString | name (QgsServerSettingsEnv::EnvVar env) |
Returns the string representation of a setting. | |
Provides a way to retrieve settings by prioritizing according to environment variables, ini file and default values.
Definition at line 94 of file qgsserversettings.h.
QgsServerSettings::QgsServerSettings | ( | ) |
Constructor.
Definition at line 26 of file qgsserversettings.cpp.
QStringList QgsServerSettings::allowedExtraSqlTokens | ( | ) | const |
Returns the list of strings that represent the allowed extra SQL tokens accepted as components of a feature filter.
The default value is an empty string, the value can be changed by setting the environment variable QGIS_SERVER_ALLOWED_EXTRA_SQL_TOKENS.
Definition at line 707 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 626 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 631 of file qgsserversettings.cpp.
QString QgsServerSettings::applicationName | ( | ) | const |
Returns the QGIS Server application name.
The default value is the concatenation of QgsApplication::applicationName() and QgsApplication::platform() separated by a space, the value can be changed by setting the environment variable QGIS_SERVER_APPLICATION_NAME.
Definition at line 717 of file qgsserversettings.cpp.
QString QgsServerSettings::cacheDirectory | ( | ) | const |
Returns the cache directory.
Definition at line 586 of file qgsserversettings.cpp.
qint64 QgsServerSettings::cacheSize | ( | ) | const |
Returns the cache size.
Definition at line 581 of file qgsserversettings.cpp.
int QgsServerSettings::capabilitiesCacheSize | ( | ) | const |
Returns the maximum number of project capabilities to cache.
The default value is 40 and the value can be changed by setting the environment variable QGIS_SERVER_CAPABILITIES_CACHE_SIZE.
Definition at line 722 of file qgsserversettings.cpp.
bool QgsServerSettings::forceReadOnlyLayers | ( | ) | const |
Returns true
if the reading flag force layer read only is activated.
The default value is false
, this value can be changed by setting the environment variable QGIS_SERVER_FORCE_READONLY_LAYERS.
Definition at line 646 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 651 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 636 of file qgsserversettings.cpp.
QString QgsServerSettings::iniFile | ( | ) | const |
Returns the ini file loaded by QSetting.
Definition at line 546 of file qgsserversettings.cpp.
QString QgsServerSettings::landingPageBaseUrlPrefix | ( | ) | const |
Returns the landing page base URL regular expression, defaults to /
.
Definition at line 621 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 611 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 616 of file qgsserversettings.cpp.
void QgsServerSettings::load | ( | ) |
Load settings according to current environment variables.
Definition at line 403 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 419 of file qgsserversettings.cpp.
QString QgsServerSettings::logFile | ( | ) | const |
Returns the log file.
Definition at line 561 of file qgsserversettings.cpp.
Qgis::MessageLevel QgsServerSettings::logLevel | ( | ) | const |
bool QgsServerSettings::logProfile | ( | ) | const |
Returns true
if profile information has to be added to the logs, default value is false
.
Definition at line 656 of file qgsserversettings.cpp.
bool QgsServerSettings::logStderr | ( | ) | const |
Returns whether logging to stderr is activated.
true
if logging to stderr is activated, false
otherwise. Definition at line 566 of file qgsserversettings.cpp.
void QgsServerSettings::logSummary | ( | ) | const |
Log a summary of settings currently loaded.
Definition at line 524 of file qgsserversettings.cpp.
int QgsServerSettings::maxThreads | ( | ) | const |
Returns the maximum number of threads to use.
Definition at line 556 of file qgsserversettings.cpp.
|
static |
Returns the string representation of a setting.
Definition at line 518 of file qgsserversettings.cpp.
QString QgsServerSettings::overrideSystemLocale | ( | ) | const |
Overrides system locale.
Definition at line 591 of file qgsserversettings.cpp.
bool QgsServerSettings::parallelRendering | ( | ) | const |
Returns parallel rendering setting.
true
if parallel rendering is activated, false
otherwise. Definition at line 551 of file qgsserversettings.cpp.
int QgsServerSettings::projectCacheCheckInterval | ( | ) | const |
Returns the config cache check interval (in ms) for the 'periodic' strategy.
Definition at line 689 of file qgsserversettings.cpp.
QString QgsServerSettings::projectCacheStrategy | ( | ) | const |
Returns the project's cache strategy The default value is 'filesystem', the value can be changed by setting the environment variable QGIS_SERVER_PROJECT_CACHE_STRATEGY.
Possible values are:
Definition at line 694 of file qgsserversettings.cpp.
QString QgsServerSettings::projectFile | ( | ) | const |
Returns the QGS project file to use.
Definition at line 576 of file qgsserversettings.cpp.
QString QgsServerSettings::serviceUrl | ( | const QString & | service | ) | const |
Returns the service URL from the setting.
Definition at line 661 of file qgsserversettings.cpp.
bool QgsServerSettings::showGroupSeparator | ( | ) | const |
Show group (thousand) separator.
false
. Definition at line 596 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 641 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 601 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 606 of file qgsserversettings.cpp.