Other Configurations
Other configurations that affect the viewer’s behavior.
Toolbox
The processes and reports of the Giswater toolbox can be configured in their respective database tables config_toolbox and config_report. This configuration is shared by the desktop plugin, so for an entry to appear in QWC2 you must add the device number 5 in the device column.
Giswater Search
We can configure which fields the search in the Giswater search provider will be performed on. To do this, look for the corresponding tab in the config_param_system table. The parameter to search is basic_search_v2_tab%; for example, pipes would be basic_search_v2_tab_network_arc.
In the value column, the configuration is stored in JSON format. For example:
{
"sys_display_name": "concat(node_id, ' : ', nodecat_id)",
"sys_tablename": "v_edit_node",
"sys_pk": "node_id",
"sys_fct": "gw_fct_getinfofromid",
"sys_filter": "",
}
Where: - - sys_display_name: Field to display in the search. - sys_tablename: Table or view used in the search. - sys_pk: Primary key of the table. - sys_fct: Function to use for the search. - sys_filter: Optional filter for the search.
Custom SearchProvider
To configure the Custom provider, you must create a table or view in the database that contains the information about the elements you want to search. That table has to have exactly the following format:
CREATE TABLE cadastre.searchtable
(
searchstring text, -- la cadena de búsqueda (toda en minúsculas), p. ej. "zürichstrasse 46, 8610 uster"
displaytext text NOT NULL, -- el texto mostrado en el cuadro combinado de búsqueda, p. ej. "Zürichstrasse 46, 8610 Uster (address)"
search_category text, -- debe comenzar con un número de dos dígitos, p. ej.
-- "03_parcels", donde 03 es el orden de las categorías de búsqueda;
-- el número debe ser único entre todas las tablas de búsqueda
the_geom geometry, -- la geometría correspondiente
geometry_type text, -- el tipo de geometría tal como lo devuelve ST_GeometryType(the_geom)
searchstring_tsvector tsvector, -- asegúrate de rellenarlo con to_tsvector()
showlayer varchar(256), -- contiene el nombre de la capa que debe hacerse visible si el usuario elige ese resultado
CONSTRAINT searchtable_pkey PRIMARY KEY (displaytext)
)
WITH (
OIDS=FALSE
);
Next, add the configuration for the provider in each theme you want to use, under themes in the tenantConfig.json file.
"searchProviders": [
...
{
"provider": "custom",
"params": {
"tables": [<table1>, <table2>, ...]
}
},
...
]
Finally, regenerate service configurations.
Printing
QWC2 supports printing to PDF through the GetPrint request of QGIS Server.
The basic steps for adding a new print layout are:
Create the print layouts in the published QGIS project (composition administrator) as needed. The layouts must contain a Map type element.
Generate the themes configuration.
The available print layouts will then appear in the QWC2 print plugin.
You can select the output format for the print layout. The default values are: application/pdf, image/jpeg, image/png and image/svg.