QGIS API Documentation 3.43.0-Master (c67cf405802)
qgsserversettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsserversettings.h
3 -------------------
4 begin : December 19, 2016
5 copyright : (C) 2016 by Paul Blottiere
6 email : paul dot blottiere at oslandia dot com
7
8***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19
20#ifndef QGSSERVERSETTINGS_H
21#define QGSSERVERSETTINGS_H
22
23#include <QObject>
24#include <QMetaEnum>
25
26#include "qgsmessagelog.h"
27#include "qgis_server.h"
28#include "qgis_sip.h"
29
89
95class SERVER_EXPORT QgsServerSettings
96{
97 public:
108
113
117 void load();
118
123 bool load( const QString &envVarName );
124
128 void logSummary() const;
129
134 QString iniFile() const;
135
140 bool parallelRendering() const;
141
146 int maxThreads() const;
147
152 Qgis::MessageLevel logLevel() const;
153
161 bool logProfile() const;
162
167 QString projectFile() const;
168
173 QString logFile() const;
174
180 bool logStderr() const;
181
186 qint64 cacheSize() const;
187
192 QString cacheDirectory() const;
193
199 QString overrideSystemLocale() const;
200
206 bool showGroupSeparator() const;
207
213 int wmsMaxHeight() const;
214
220 int wmsMaxWidth() const;
221
228 QString landingPageProjectsDirectories() const;
229
236 QString landingPageProjectsPgConnections() const;
237
242 QString landingPageBaseUrlPrefix() const;
243
252 QString apiResourcesDirectory() const;
253
262 qlonglong apiWfs3MaxLimit() const;
263
273 bool ignoreBadLayers() const;
274
283 bool trustLayerMetadata() const;
284
293 bool forceReadOnlyLayers() const;
294
304 bool getPrintDisabled() const;
305
310 QString serviceUrl( const QString &service ) const;
311
316 int projectCacheCheckInterval() const;
317
331 QString projectCacheStrategy() const;
332
340 int projectCacheSize() const;
341
350 QStringList allowedExtraSqlTokens() const;
351
360 QString applicationName() const;
361
366 static QString name( QgsServerSettingsEnv::EnvVar env );
367
375 int capabilitiesCacheSize() const;
376
377 private:
378 void initSettings();
379 QVariant value( QgsServerSettingsEnv::EnvVar envVar, bool actual = false ) const;
380 QMap<QgsServerSettingsEnv::EnvVar, QString> getEnv() const;
381 void loadQSettings( const QString &envOptPath ) const;
382 void prioritize( const QMap<QgsServerSettingsEnv::EnvVar, QString> &env );
383
384 QMap<QgsServerSettingsEnv::EnvVar, Setting> mSettings;
385};
386
387#endif
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition qgis.h:154
Provides some enum describing the environment currently supported for configuration.
Source
Source of the parameter used in the configuration.
EnvVar
Environment variables to configure the server.
@ QGIS_SERVER_WCS_SERVICE_URL
To set the WCS service URL if it's not present in the project.
@ QGIS_SERVER_PROJECT_CACHE_SIZE
Set the project cache size, in number of projects.
@ QGIS_SERVER_WMTS_SERVICE_URL
To set the WMTS service URL if it's not present in the project.
@ QGIS_SERVER_IGNORE_BAD_LAYERS
Do not consider the whole project unavailable if it contains bad layers.
@ QGIS_SERVER_ALLOWED_EXTRA_SQL_TOKENS
Adds these tokens to the list of allowed tokens that the services accept when filtering features.
@ QGIS_SERVER_CAPABILITIES_CACHE_SIZE
Define the QGIS Server capabilities cache size.
@ QGIS_SERVER_LANDING_PAGE_PREFIX
Prefix of the path component of the landing page base URL, default is empty.
@ QGIS_SERVER_TRUST_LAYER_METADATA
Trust layer metadata. Improves project read time.
@ QGIS_SERVER_WFS_SERVICE_URL
To set the WFS service URL if it's not present in the project.
@ QGIS_SERVER_OVERRIDE_SYSTEM_LOCALE
Override system locale.
@ QGIS_SERVER_LANDING_PAGE_PROJECTS_PG_CONNECTIONS
PostgreSQL connection strings used by the landing page service to find projects.
@ QGIS_SERVER_API_WFS3_MAX_LIMIT
Maximum value for "limit" in a features request, defaults to 10000.
@ QGIS_SERVER_API_RESOURCES_DIRECTORY
Base directory where HTML templates and static assets (e.g. images, js and css files) are searched fo...
@ QGIS_SERVER_WMS_MAX_WIDTH
Maximum width for a WMS request. The most conservative between this and the project one is used.
@ QGIS_SERVER_FORCE_READONLY_LAYERS
Force to open layers in read-only mode.
@ QGIS_SERVER_PROJECT_CACHE_STRATEGY
Set the project cache strategy. Possible values are 'filesystem', 'periodic' or 'off'.
@ QGIS_SERVER_APPLICATION_NAME
Define the QGIS Server application name.
@ QGIS_SERVER_WMS_MAX_HEIGHT
Maximum height for a WMS request. The most conservative between this and the project one is used.
@ QGIS_SERVER_WMS_SERVICE_URL
To set the WMS service URL if it's not present in the project.
@ QGIS_SERVER_DISABLE_GETPRINT
Disabled WMS GetPrint request and don't load layouts. Improves project read time.
@ QGIS_SERVER_PROJECT_CACHE_CHECK_INTERVAL
Set the interval in milliseconds for cache invalidation strategy 'interval', default to 0 which selec...
@ QGIS_SERVER_SHOW_GROUP_SEPARATOR
Show group (thousands) separator when formatting numeric values, defaults to false.
@ QGIS_SERVER_LANDING_PAGE_PROJECTS_DIRECTORIES
Directories used by the landing page service to find .qgs and .qgz projects.
@ QGIS_SERVER_LOG_PROFILE
When QGIS_SERVER_LOG_LEVEL is 0 this flag adds to the logs detailed information about the time taken ...
@ QGIS_SERVER_SERVICE_URL
To set the service URL if it's not present in the project.
Provides a way to retrieve settings by prioritizing according to environment variables,...
#define SIP_SKIP
Definition qgis_sip.h:126
QgsServerSettingsEnv::EnvVar envVar
QgsServerSettingsEnv::Source src