Lizmap Web Client Master

Project
in package

Tags
phpstan-import-type

MapLayerDef from QgisProject

phpstan-import-type

VectorLayerDef from QgisProject

Table of Contents

Properties

$appContext  : AppContextInterface
$cachedProperties  : array<string|int, mixed>
$cacheHandler  : ProjectCache
$cfg  : ProjectConfig
$editionLayersForCurrentUser  : null|array<string|int, object>
$file  : string
$key  : string
Lizmap project key.
$layersLabeledFieldsConfig  : null|array<string|int, object>
$layersOrder  : array<string|int, mixed>
$path  : mixed
$printCapabilities  : object
$qgis  : QgisProject
$repository  : Repository
$services  : lizmapServices
$spatialiteExt  : string

Methods

__construct()  : mixed
constructor.
checkAcl()  : bool
Check acl rights on the project.
checkAclByUser()  : bool
Check acl rights on the project by given user.
checkEditionLayerAcl()  : mixed
Indicate if the edition layer can be edit by the current user.
clearCache()  : mixed
findEditionLayerByLayerId()  : null|object
Return the given edition layer if it exists and if the current user can edit it.
findEditionLayerByName()  : null|object
Return the given edition layer if it exists and if the current user can edit it.
findLayerByAnyName()  : mixed
findLayerByLayerId()  : mixed
findLayerByName()  : mixed
findLayerByShortName()  : mixed
findLayerByTitle()  : mixed
findLayerByTypeName()  : mixed
findLayersByKeyword()  : array<string|int, qgisMapLayer>|array<string|int, qgisVectorLayer>
getAbstract()  : string
Get the abstract.
getAllProj4()  : mixed
getAppContext()  : AppContextInterface
getBbox()  : string
Get the bbox.
getBooleanOption()  : null|bool
Retrieve the given option as a boolean value.
getCacheHandler()  : ProjectCache
getCanvasColor()  : mixed
getCfgFileTime()  : mixed
getCustomProjectVariables()  : mixed
getData()  : null|mixed
getDatavizLayersConfig()  : array<string|int, mixed>
getDefaultBottomDockable()  : array<string|int, lizmapMapDockItem>
getDefaultDockable()  : array<string|int, lizmapMapDockItem>
getDefaultMiniDockable()  : array<string|int, lizmapMapDockItem>
getDefaultRightDockable()  : array<string|int, lizmapMapDockItem>
getEditionLayerByName()  : mixed
Return the given edition layer, whether the user has the right to edit or not.
getEditionLayerForCurrentUser()  : null|object
getEditionLayers()  : object
getEditionLayersForCurrentUser()  : mixed
getFileTime()  : mixed
getFormFilterLayersConfig()  : mixed
getFullCfg()  : object
access to configuration raw content.
getGoogleKey()  : string
getKey()  : mixed
getKeywordsList()  : array<string|int, mixed>
Get the keywords list.
getLastSaveDateTime()  : string
Get the last date saved in the QGIS file.
getLayer()  : null|qgisMapLayer|qgisVectorLayer
getLayerByKeyword()  : null|qgisMapLayer|qgisVectorLayer
getLayerCount()  : int
Get the number of layers.
getLayerDefinition()  : null|MapLayerDef|VectorLayerDef
getLayerNameByIdFromConfig()  : null|string
getLayerPolygonFilterConfig()  : null|array<string|int, mixed>
Get the configuration for the polygon filter of the given layer from the Lizmap JSON config file.
getLayers()  : mixed
getLayersLabeledFieldsConfig()  : array<string|int, mixed>
Get the configuration for the layers used in the UI for which some fields values must be replaced by the corresponding labels.
getLizmapPluginVersion()  : string
Get the version of the Lizmap plugin used by the project editor on QGIS Desktop.
getLizmapWebClientTargetVersion()  : int
Get the target version of Lizmap Web Client set in the QGIS desktop plugin.
getLoginFilter()  : array<string|int, mixed>
Get login filtered config with the build expression.
getLoginFilteredConfig()  : null|object
Get login filtered config.
getLoginFilters()  : array<string|int, mixed>
Get login filters, get expressions for layers based on login filtered config.
getMetadata()  : ProjectMetadata
Get the minimum needed project information for some pages (landing page, admin project listing).
getOgcServiceUrl()  : string
Get OGC service Url.
getOption()  : null|mixed
getOptions()  : object
getPath()  : mixed
getProj()  : string
Get proj.
getProj4()  : mixed
getProjectCfgWarnings()  : null|mixed
Project warnings in the CFG file.
getProperties()  : array<string|int, mixed>|array<string|int, string>
unknown purpose.
getQgisPath()  : mixed
getQgisProjectVersion()  : mixed
getRelationField()  : mixed
getRelations()  : mixed
getRelativeQgisPath()  : mixed
getRepository()  : Repository
getRepositoryKey()  : string
getThemes()  : mixed
getTitle()  : string
Get the project title.
getTooltipLayers()  : object
getUpdatedConfig()  : object
getWMSGetCapabilitiesUrl()  : string
Get the WMS GetCapabilities Url.
getWMSInformation()  : mixed
getWMSMaxHeight()  : int
WMS Max Height.
getWMSMaxWidth()  : int
WMS Max Width.
getWMTSGetCapabilitiesUrl()  : string
Get the WMTS GetCapabilities Url.
getXmlLayer()  : array<string|int, SimpleXMLElement>
hasAtlasEnabled()  : mixed
hasAttributeLayers()  : mixed
hasAttributeLayersForLayer()  : mixed
hasEditionLayers()  : bool
same as hasEditionLayersForCurrentUser.
hasEditionLayersForCurrentUser()  : mixed
hasFormFilterLayers()  : mixed
hasFtsSearches()  : mixed
hasLocateByLayer()  : mixed
hasLoginFilteredLayers()  : bool
hasPolygonFilteredLayers()  : bool
Checks if the project has a configuration and layers for the filter by polygon.
hasPrintEnabled()  : bool
Lizmap < 3.7: return true: - if print checkbox is checked and - if there is at least one print layout which is not an atlas Lizmap >= 3.7: return true: - if there is at least one print layout enabled which is not an atlas.
hasTimemanagerLayers()  : mixed
hasTooltipLayers()  : mixed
isPivotLayer()  : mixed
needsGoogle()  : bool
needsUpdateError()  : bool
Check if the project needs an update which lead to an error.
needsUpdateWarning()  : bool
Check if the project needs an update which lead to an warning.
parseDatavizPlotConfig()  : mixed
projectCfgWarnings()  : mixed
Project warnings in the CFG file.
projectCountCfgWarnings()  : int
Project warnings counts in the CFG file.
qgisLizmapPluginUpdateNeeded()  : bool
Project needs an update on plugin side.
_checkEditionLayerAcl()  : bool
getLayersWithLabels()  : array<string|int, mixed>
List of the layers configured in the tools Attribute table, form filter & dataviz.
objToArray()  : mixed
readAttributeLayers()  : mixed
readEditionLayers()  : mixed
readEditionLayersForCurrentUser()  : mixed
readLayersOrder()  : array<string|int, int>
readLocateByLayer()  : mixed
readPrintCapabilities()  : mixed
readProject()  : mixed
Read the qgis files.
getPropertyOrDefault()  : mixed
optionToBoolean()  : mixed

Properties

$cachedProperties

protected static array<string|int, mixed> $cachedProperties = array('layersOrder', 'printCapabilities', 'layersLabeledFieldsConfig')

List of cached properties

$editionLayersForCurrentUser

protected null|array<string|int, object> $editionLayersForCurrentUser

layer names => layers

$file

protected string $file

.qgs file path

$key

Lizmap project key.

protected string $key = ''

$layersLabeledFieldsConfig

protected null|array<string|int, object> $layersLabeledFieldsConfig

List of layers with labeled fields configuration: layer ids => fields

$layersOrder

protected array<string|int, mixed> $layersOrder = array()

list of layer orders: layer name => order

$printCapabilities

protected object $printCapabilities = array()

$spatialiteExt

private string $spatialiteExt

Methods

checkAcl()

Check acl rights on the project.

public checkAcl() : bool
Return values
bool

true if the current user as rights on the project

checkAclByUser()

Check acl rights on the project by given user.

public checkAclByUser(mixed $login) : bool
Parameters
$login : mixed

Login of the user to test access

Tags
since

Jelix 1.6.29

Return values
bool

true if the current user as rights on the project

checkEditionLayerAcl()

Indicate if the edition layer can be edit by the current user.

public checkEditionLayerAcl(object $eLayer) : mixed
Parameters
$eLayer : object

edition layer object

clearCache()

public clearCache() : mixed

findEditionLayerByLayerId()

Return the given edition layer if it exists and if the current user can edit it.

public findEditionLayerByLayerId(mixed $layerId) : null|object

notice: it checks all edition layers.

Parameters
$layerId : mixed
Return values
null|object

findEditionLayerByName()

Return the given edition layer if it exists and if the current user can edit it.

public findEditionLayerByName(mixed $name) : null|object

Similar to getEditionLayerForCurrentUser except that findEditionLayerByName loads alls edition layers if not already done. Use it in a layers loop instead of getEditionLayerForCurrentUser.

Parameters
$name : mixed
Return values
null|object

findLayerByAnyName()

public findLayerByAnyName(mixed $name) : mixed
Parameters
$name : mixed

findLayerByLayerId()

public findLayerByLayerId(mixed $layerId) : mixed
Parameters
$layerId : mixed

findLayerByName()

public findLayerByName(mixed $name) : mixed
Parameters
$name : mixed

findLayerByShortName()

public findLayerByShortName(mixed $shortName) : mixed
Parameters
$shortName : mixed

findLayerByTitle()

public findLayerByTitle(mixed $title) : mixed
Parameters
$title : mixed

findLayerByTypeName()

public findLayerByTypeName(mixed $typeName) : mixed
Parameters
$typeName : mixed

getAbstract()

Get the abstract.

public getAbstract() : string
Return values
string

abstract

getAllProj4()

public getAllProj4() : mixed

getBbox()

Get the bbox.

public getBbox() : string
Return values
string

getBooleanOption()

Retrieve the given option as a boolean value.

public getBooleanOption(string $name) : null|bool
Parameters
$name : string

the option name

Return values
null|bool

true if the option value is 'True', null if it does not exist

getCanvasColor()

public getCanvasColor() : mixed

getCfgFileTime()

public getCfgFileTime() : mixed

getCustomProjectVariables()

public getCustomProjectVariables() : mixed

getData()

public getData(string $key) : null|mixed
Parameters
$key : string
Return values
null|mixed

getDatavizLayersConfig()

public getDatavizLayersConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>

the dataviz layers config extended with locale

getEditionLayerByName()

Return the given edition layer, whether the user has the right to edit or not.

public getEditionLayerByName(mixed $layerName) : mixed
Parameters
$layerName : mixed

getEditionLayerForCurrentUser()

public getEditionLayerForCurrentUser(mixed $layerName) : null|object
Parameters
$layerName : mixed
Return values
null|object

the layer or null if does not exist

getEditionLayers()

public getEditionLayers() : object
Return values
object

getEditionLayersForCurrentUser()

public getEditionLayersForCurrentUser() : mixed

getFileTime()

public getFileTime() : mixed

getFormFilterLayersConfig()

public getFormFilterLayersConfig() : mixed

getFullCfg()

access to configuration raw content.

public getFullCfg() : object

Don't access directly to configuration, use Project methods

Return values
object

getGoogleKey()

public getGoogleKey() : string
Return values
string

getKeywordsList()

Get the keywords list.

public getKeywordsList() : array<string|int, mixed>
Return values
array<string|int, mixed>

list of keywords

getLastSaveDateTime()

Get the last date saved in the QGIS file.

public getLastSaveDateTime() : string
Return values
string

the last saved date contained in the QGS file

getLayerCount()

Get the number of layers.

public getLayerCount() : int
Return values
int

getLayerDefinition()

public getLayerDefinition(string $layerId) : null|MapLayerDef|VectorLayerDef
Parameters
$layerId : string
Return values
null|MapLayerDef|VectorLayerDef

getLayerNameByIdFromConfig()

public getLayerNameByIdFromConfig(string $layerId) : null|string
Parameters
$layerId : string
Return values
null|string

getLayerPolygonFilterConfig()

Get the configuration for the polygon filter of the given layer from the Lizmap JSON config file.

public getLayerPolygonFilterConfig(string $layerName[, bool $editingContext = false ]) : null|array<string|int, mixed>

If the polygon filter is configured for editing only and we are not in an editing context we return null to tell there is no filter in this context.

Parameters
$layerName : string

: the layer name

$editingContext : bool = false

: we are in editing context

Return values
null|array<string|int, mixed>

the configuration for the polygon filter the given layer

getLayers()

public getLayers() : mixed

getLayersLabeledFieldsConfig()

Get the configuration for the layers used in the UI for which some fields values must be replaced by the corresponding labels.

public getLayersLabeledFieldsConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>

The layers and fields configuration

getLizmapPluginVersion()

Get the version of the Lizmap plugin used by the project editor on QGIS Desktop.

public getLizmapPluginVersion() : string

Default to 3.1.8 if the CFG is too old.

Return values
string

Version of the lizmap plugin

getLizmapWebClientTargetVersion()

Get the target version of Lizmap Web Client set in the QGIS desktop plugin.

public getLizmapWebClientTargetVersion() : int
Return values
int

Target version of Lizmap Web Client. Default to 30200 if the CFG is too old.

getLoginFilter()

Get login filtered config with the build expression.

public getLoginFilter(string $layerName[, bool $edition = false ]) : array<string|int, mixed>
Parameters
$layerName : string

: layer's name

$edition : bool = false

: get login filters for edition

Return values
array<string|int, mixed>

the login filtered config with build expression

getLoginFilteredConfig()

Get login filtered config.

public getLoginFilteredConfig(string $layerName[, bool $edition = false ]) : null|object
Parameters
$layerName : string

: layer's name

$edition : bool = false

: get login filters for edition

Return values
null|object

the login filtered config

getLoginFilters()

Get login filters, get expressions for layers based on login filtered config.

public getLoginFilters(array<string|int, string> $layers[, bool $edition = false ]) : array<string|int, mixed>

NOTE: We could delegate this completely to the lizmap_server plugin for all requests. The only request needed to have the SQL filter is the WFS GetFeature request, if the layer is a PostgreSQL layer. It this particular case, we could use a similar approach that the one use with qgisVectorLayer::requestPolygonFilter which calls the server plugin with SERVICE=Lizmap&REQUEST=GetSubsetString

Parameters
$layers : array<string|int, string>

: layers' name list

$edition : bool = false

: get login filters for edition

Return values
array<string|int, mixed>

Array containing layers names as key and filter configuration and SQL filters as values. Array might be empty if no filter is configured for the layer.

getOgcServiceUrl()

Get OGC service Url.

public getOgcServiceUrl() : string
Return values
string

getOption()

public getOption(string $name) : null|mixed
Parameters
$name : string

the option name

Return values
null|mixed

getOptions()

public getOptions() : object

use getOption() or getBooleanOption() instead

Return values
object

getProj()

Get proj.

public getProj() : string
Return values
string

getProj4()

public getProj4(mixed $authId) : mixed
Parameters
$authId : mixed

getProjectCfgWarnings()

Project warnings in the CFG file.

public getProjectCfgWarnings() : null|mixed
Return values
null|mixed

getProperties()

unknown purpose.

public getProperties() : array<string|int, mixed>|array<string|int, string>
Return values
array<string|int, mixed>|array<string|int, string>

getQgisPath()

public getQgisPath() : mixed

getQgisProjectVersion()

public getQgisProjectVersion() : mixed

getRelationField()

public getRelationField(mixed $relationId) : mixed
Parameters
$relationId : mixed

getRelations()

public getRelations() : mixed

getRelativeQgisPath()

public getRelativeQgisPath() : mixed

getRepositoryKey()

public getRepositoryKey() : string
Return values
string

getThemes()

public getThemes() : mixed

getTitle()

Get the project title.

public getTitle() : string
Return values
string

the project title

getTooltipLayers()

public getTooltipLayers() : object
Return values
object

getUpdatedConfig()

public getUpdatedConfig() : object
Return values
object

the JSON object corresponding to the configuration

getWMSGetCapabilitiesUrl()

Get the WMS GetCapabilities Url.

public getWMSGetCapabilitiesUrl() : string
Return values
string

getWMSInformation()

public getWMSInformation() : mixed

getWMSMaxHeight()

WMS Max Height.

public getWMSMaxHeight() : int
Return values
int

getWMSMaxWidth()

WMS Max Width.

public getWMSMaxWidth() : int
Return values
int

getWMTSGetCapabilitiesUrl()

Get the WMTS GetCapabilities Url.

public getWMTSGetCapabilitiesUrl() : string
Return values
string

getXmlLayer()

public getXmlLayer(string $layerId) : array<string|int, SimpleXMLElement>
Parameters
$layerId : string
Return values
array<string|int, SimpleXMLElement>

hasAtlasEnabled()

public hasAtlasEnabled() : mixed

hasAttributeLayers()

public hasAttributeLayers([mixed $onlyDisplayedLayers = false ]) : mixed
Parameters
$onlyDisplayedLayers : mixed = false

hasAttributeLayersForLayer()

public hasAttributeLayersForLayer(mixed $layerName) : mixed
Parameters
$layerName : mixed

hasEditionLayers()

same as hasEditionLayersForCurrentUser.

public hasEditionLayers() : bool

will returns all edition layers, regarding ACL

Return values
bool

hasEditionLayersForCurrentUser()

public hasEditionLayersForCurrentUser() : mixed

hasFormFilterLayers()

public hasFormFilterLayers() : mixed

hasFtsSearches()

public hasFtsSearches() : mixed

hasLocateByLayer()

public hasLocateByLayer() : mixed

hasLoginFilteredLayers()

public hasLoginFilteredLayers() : bool
Return values
bool

hasPolygonFilteredLayers()

Checks if the project has a configuration and layers for the filter by polygon.

public hasPolygonFilteredLayers() : bool
Return values
bool

hasPrintEnabled()

Lizmap < 3.7: return true: - if print checkbox is checked and - if there is at least one print layout which is not an atlas Lizmap >= 3.7: return true: - if there is at least one print layout enabled which is not an atlas.

public hasPrintEnabled() : bool
Return values
bool

hasTimemanagerLayers()

public hasTimemanagerLayers() : mixed

hasTooltipLayers()

public hasTooltipLayers() : mixed

isPivotLayer()

public isPivotLayer(mixed $layerName) : mixed
Parameters
$layerName : mixed

needsGoogle()

public needsGoogle() : bool
Return values
bool

needsUpdateError()

Check if the project needs an update which lead to an error.

public needsUpdateError() : bool
Return values
bool

true if the project needs to be updated in the QGIS desktop plugin

needsUpdateWarning()

Check if the project needs an update which lead to an warning.

public needsUpdateWarning() : bool
Return values
bool

true if the project needs to be updated in the QGIS desktop plugin

parseDatavizPlotConfig()

public parseDatavizPlotConfig(mixed $config) : mixed
Parameters
$config : mixed

projectCfgWarnings()

Project warnings in the CFG file.

public projectCfgWarnings() : mixed
Tags
see
getProjectCfgWarnings()

for data structure

Return values
mixed

List of warnings in the project and their counts

projectCountCfgWarnings()

Project warnings counts in the CFG file.

public projectCountCfgWarnings() : int
Tags
see
getProjectCfgWarnings()

for data structure

Return values
int

qgisLizmapPluginUpdateNeeded()

Project needs an update on plugin side.

public qgisLizmapPluginUpdateNeeded() : bool

The check is done only if the QGIS file has been edited recently.

Return values
bool

true if the plugin needs to be updated

_checkEditionLayerAcl()

protected _checkEditionLayerAcl(object $eLayer, bool $isAdmin, array<string|int, string> $userGroups) : bool
Parameters
$eLayer : object

the edition layer

$isAdmin : bool
$userGroups : array<string|int, string>
Return values
bool

getLayersWithLabels()

List of the layers configured in the tools Attribute table, form filter & dataviz.

protected getLayersWithLabels() : array<string|int, mixed>

We use this list to find all the fields for which we need to replace the code by their corresponding labels

Return values
array<string|int, mixed>

Array of layer ids

objToArray()

protected objToArray(mixed $obj) : mixed
Parameters
$obj : mixed

readEditionLayersForCurrentUser()

protected readEditionLayersForCurrentUser() : mixed

readLayersOrder()

protected readLayersOrder(SimpleXMLElement $xml) : array<string|int, int>
Parameters
$xml : SimpleXMLElement
Return values
array<string|int, int>

readProject()

Read the qgis files.

protected readProject() : mixed

getPropertyOrDefault()

private getPropertyOrDefault(object $object, string $property[, mixed $default = null ]) : mixed
Parameters
$object : object

The configuration

$property : string

String about the property to request

$default : mixed = null

Default returned if the property is not found

optionToBoolean()

private optionToBoolean(mixed $configString) : mixed
Parameters
$configString : mixed

        
On this page

Search results