[Mapbender-users] SQL 2.5
"Jäger, Frank (KRZ)"
F.Jaeger at KRZ.DE
Wed Nov 19 11:01:14 EST 2008
Hallo,
after upgrading from Mapbender 2.4.5 to 2.5 you have to set some new options.
It's a hard way to do the "Loop" ....
Edit GUI elemets
/ select GUI
/ select elements
/ click element vars
/ select var
/ fill 4 Filds
/ save
/ return
/ select next gui ....
... for nearly 100 GUIs first in Test and then same in Stable.
To quickly set unified options in a big number of GUIs you can use the following SQL:
**(1)**
-- Set element-var "handlesublayer=true" for all treeGDE which has't this option yet
-- This don't change 'false' to 'true'
INSERT INTO gui_element_vars
(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
( SELECT fkey_gui_id, 'treeGDE', 'handlesublayer', 'true' , 'show grouped layer', 'var'
FROM gui_element
WHERE e_id = 'treeGDE'
AND NOT EXISTS
(SELECT *
FROM gui_element_vars
WHERE fkey_e_id = 'treeGDE'
AND var_name = 'handlesublayer'
AND gui_element_vars.fkey_gui_id = gui_element.fkey_gui_id)
);
**(2)**
-- enable all menues on TreeGDE (on WMS and Layer)
UPDATE gui_element_vars
SET var_value = 'opacity_up,opacity_down,zoom,metainfo,hide,wms_up,wms_down,layer_up,layer_down,remove'
WHERE var_value = ''
AND var_name = 'menu'
;
**(3)**
-- Search GUIs with printPDF but without css for printPDF
SELECT gui_id
FROM gui
INNER JOIN gui_element
ON gui.gui_id = gui_element.fkey_gui_id
WHERE gui_element.e_id = 'printPDF'
AND gui_id NOT IN
(SELECT fkey_gui_id
FROM gui_element_vars
WHERE fkey_e_id = 'printPDF'
AND var_name = 'cssfilePrint')
ORDER BY gui_id;
**(4)**
-- Insert Stylesheet for each printPDF, that hasn't one.
INSERT INTO gui_element_vars
(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
(SELECT gui_id, 'printPDF', 'cssfilePrint', '../css/print.css', 'cssfile for print', 'file/css'
FROM gui
INNER JOIN gui_element
ON gui.gui_id = gui_element.fkey_gui_id
WHERE gui_element.e_id = 'printPDF'
AND gui_id NOT IN
(SELECT fkey_gui_id
FROM gui_element_vars
WHERE fkey_e_id = 'printPDF'
AND var_name = 'cssfilePrint')
);
See also: http://www.mapbender.org/Template:Print#css_Style_for_printPDF where i put (3) and (4).
Frank Jäger
Kommunales Rechenzentrum
Minden-Ravensberg/Lippe
More information about the Mapbender_users
mailing list