[Mapbender-commits] r4704 - trunk/mapbender/resources/db/pgsql/UTF-8/update

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sat Sep 26 07:50:58 EDT 2009


Author: astrid_emde
Date: 2009-09-26 07:50:57 -0400 (Sat, 26 Sep 2009)
New Revision: 4704

Added:
   trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.6_to_2.7rc1_pgsql_UTF-8.sql
Log:
moved from /db/update to this directory and renamed

Added: trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.6_to_2.7rc1_pgsql_UTF-8.sql
===================================================================
--- trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.6_to_2.7rc1_pgsql_UTF-8.sql	                        (rev 0)
+++ trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.6_to_2.7rc1_pgsql_UTF-8.sql	2009-09-26 11:50:57 UTC (rev 4704)
@@ -0,0 +1,322 @@
+-- remove event handlers, are now in the script
+UPDATE gui_element SET e_attributes = '' WHERE e_id = 'selArea1';
+UPDATE gui_element SET e_attributes = '' WHERE e_id = 'pan1';
+UPDATE gui_element SET e_attributes = '' WHERE e_id = 'featureInfo1';
+UPDATE gui_element SET e_content = '' WHERE e_id = 'navFrame';
+
+
+-- 
+-- new definition of addWMSfromfilteredList_ajax due to i18n
+UPDATE gui_element set e_attributes = '', e_js_file = 'mod_addWmsFromFilteredList_button.php' where e_id = 'addWMSfromfilteredList_ajax';
+
+
+-- 
+-- polish entries for translations table
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Pan', 'Przesuń');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Display complete map', 'Pokaż calą mapę');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Zoom in', 'Powiększ');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Zoom out', 'Pomniejsz');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Back', 'Wróć');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Forward', 'Do przodu');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Coordinates', 'Współrzędne');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Zoom by rectangle', 'Wybierz fragment mapy');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Redraw', 'Załaduj ponownie');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Query', 'Szukaj danych');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Logout', 'Wymelduj');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'WMS preferences', 'Ustawienia WMS');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Adding WMS from filtered list', 'Dodaj WMS z listy');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Set map center', 'Zaznacz środek mapy');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Help', 'Pomoc');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Show WMS infos', 'Informacje WMS');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Save workspace as web map context document', 'Zapisz widok jako web map context dokument');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Resize Mapsize', 'Zmień rozmiar mapy');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Rubber', 'Usuń szkic');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Get Area', 'Oblicz powierzchnię');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Close Polygon', 'Zamknij poligon');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Move back to your GUI list', 'Z powrotem do listy GUI');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Legend', 'Legenda');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Print', 'Drukuj');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Imprint', 'Imprint');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Maps', 'Mapy');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Search', 'Szukaj');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Meetingpoint', 'Miejsce spotkań');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Metadatasearch', 'Wyszukiwanie metadanych');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Adding WMS', 'Dodaj WMS');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Adding WMS from List', 'Dodaj WMS z listy');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Info', 'Informacja');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Change Projection', 'Zmień układ współrzędnych');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Copyright', 'Copyright');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Digitize', 'Dygitalizacja');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Overview', 'Mapa przeglądowa');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Drag Mapsize', 'Powiększ');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Mapframe', 'Okno mapy');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Navigation Frame', 'Pasek narzędzi');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Scale Select', 'Wybierz skalę');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Scale Text', 'Wpisz skalę');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Scalebar', 'Podziałka');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Set Background', 'Wybierz mapę tematyczną jako tło');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Zoom to Coordinates', 'Powiększ według współrzędnych');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Change Password', 'Zmień hasło');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Load a web map context document', 'Załaduj web map context dokument');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Logo', 'Logo');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Measure distance', 'Zmierz odległość');
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Set language', 'Wybierz język');
+
+
+--
+-- update wfs conf module
+UPDATE gui_element SET
+e_attributes = 'href = "../php/mod_wfs_conf_client.php" target="AdminFrame"'
+WHERE e_id = 'wfs_conf' AND fkey_gui_id IN ('admin1', 'admin_de_services', 'admin_en_services');
+
+ALTER TABLE wfs_conf ADD COLUMN
+wfs_conf_type int4 NOT NULL DEFAULT 0;
+--
+-- new wfs conf columns
+ALTER TABLE wfs_conf_element ADD COLUMN
+f_helptext text;
+
+ALTER TABLE wfs_conf_element ADD COLUMN
+f_category_name varchar(255) NOT NULL DEFAULT '';
+
+-- reload uses Mapbender API
+UPDATE gui_element SET e_attributes = '' WHERE e_id = 'reload';
+
+-- init event is now triggered by jQuery
+UPDATE gui_element SET e_attributes = '' WHERE e_id = 'body';
+
+-- mapframe layers are now added dynamically by the modules
+UPDATE gui_element SET e_content = '' WHERE e_id = 'mapframe1';
+
+-- file extension is now .js
+UPDATE gui_element SET e_js_file = 'mod_log.js' WHERE e_id = 'log';
+
+-- file extension is now .js
+UPDATE gui_element SET e_js_file = 'mod_resize_mapsize.js' WHERE e_id = 'resizeMapsize';
+
+-- file extension is now .js
+UPDATE gui_element SET e_js_file = 'mod_sandclock.js' WHERE e_id = 'sandclock';
+
+-- init event is now triggered by jQuery
+UPDATE gui_element SET e_attributes = '' WHERE e_id = 'zoomFull';
+
+-- file extension is now .js
+UPDATE gui_element SET e_attributes = '', e_js_file = 'mod_zoomFull.js' WHERE e_id = 'zoomFull';
+
+-- file extension is now .js
+UPDATE gui_element SET e_attributes = '', e_js_file = 'mod_repaint.js' WHERE e_id = 'repaint';
+
+-- file extension is now .js
+UPDATE gui_element SET e_js_file = 'mod_changeEPSG.js' WHERE e_id = 'changeEPSG';
+
+-- file extension is now .js
+UPDATE gui_element SET e_js_file = 'mod_scalebar.js' WHERE e_id = 'scalebar';
+
+-- parameter: skip WMS request if current SRS is not supported
+-- I'm not sure how to insert this dynamically into all applications that have either mapframe1 or overview
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES( 'gui', 'mapframe1', 'skipWmsIfSrsNotSupported', '0', 'if set to 1, it skips the WMS request if the current SRS is not supported by the WMS; if set to 0, the WMS is always queried. Default is 0, because of backwards compatibility' ,'var');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES( 'gui1', 'mapframe1', 'skipWmsIfSrsNotSupported', '0', 'if set to 1, it skips the WMS request if the current SRS is not supported by the WMS; if set to 0, the WMS is always queried. Default is 0, because of backwards compatibility' ,'var');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES( 'gui2', 'mapframe1', 'skipWmsIfSrsNotSupported', '0', 'if set to 1, it skips the WMS request if the current SRS is not supported by the WMS; if set to 0, the WMS is always queried. Default is 0, because of backwards compatibility' ,'var');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES( 'gui_digitize', 'mapframe1', 'skipWmsIfSrsNotSupported', '0', 'if set to 1, it skips the WMS request if the current SRS is not supported by the WMS; if set to 0, the WMS is always queried. Default is 0, because of backwards compatibility' ,'var');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES( 'gui', 'overview', 'skipWmsIfSrsNotSupported', '0', 'if set to 1, it skips the WMS request if the current SRS is not supported by the WMS; if set to 0, the WMS is always queried. Default is 0, because of backwards compatibility' ,'var');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES( 'gui1', 'overview', 'skipWmsIfSrsNotSupported', '0', 'if set to 1, it skips the WMS request if the current SRS is not supported by the WMS; if set to 0, the WMS is always queried. Default is 0, because of backwards compatibility' ,'var');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES( 'gui2', 'overview', 'skipWmsIfSrsNotSupported', '0', 'if set to 1, it skips the WMS request if the current SRS is not supported by the WMS; if set to 0, the WMS is always queried. Default is 0, because of backwards compatibility' ,'var');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES( 'gui_digitize', 'overview', 'skipWmsIfSrsNotSupported', '0', 'if set to 1, it skips the WMS request if the current SRS is not supported by the WMS; if set to 0, the WMS is always queried. Default is 0, because of backwards compatibility' ,'var');
+
+
+---------------------------------------------MONITORING BEGIN
+-- Index: idx_mb_monitor_status
+
+-- DROP INDEX idx_mb_monitor_status;
+
+CREATE INDEX idx_mb_monitor_status
+  ON mb_monitor
+  USING btree
+  (status);
+
+-- Index: idx_mb_monitor_upload_id
+
+-- DROP INDEX idx_mb_monitor_upload_id;
+
+CREATE INDEX idx_mb_monitor_upload_id
+  ON mb_monitor
+  USING btree
+  (upload_id);
+
+
+-- Table: mb_wms_availability
+
+-- DROP TABLE mb_wms_availability;
+
+CREATE TABLE mb_wms_availability
+(
+  fkey_wms_id integer,
+  fkey_upload_id character varying,
+  last_status integer,
+  availability real,
+  image integer,
+  status_comment character varying,
+  average_resp_time real,
+  upload_url character varying,
+  map_url character varying,
+  CONSTRAINT mb_wms_availability_fkey_wms_id_wms_id FOREIGN KEY (fkey_wms_id)
+      REFERENCES wms (wms_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE
+)
+WITH OIDS;
+
+-- Function: mb_monitor_after()
+
+-- DROP FUNCTION mb_monitor_after();
+
+CREATE OR REPLACE FUNCTION mb_monitor_after()
+  RETURNS "trigger" AS
+$BODY$DECLARE
+   availability_new REAL;
+   average_res_cap REAL;
+   count_monitors REAL;
+    BEGIN
+     IF TG_OP = 'UPDATE' THEN
+     
+     count_monitors := count(fkey_wms_id) from mb_monitor where fkey_wms_id=NEW.fkey_wms_id;
+      --the following should be adopted if the duration of storing is changed!!!
+      average_res_cap := ((select average_resp_time from mb_wms_availability where fkey_wms_id=NEW.fkey_wms_id)*count_monitors+(NEW.timestamp_end-NEW.timestamp_begin))/(count_monitors+1);
+
+     IF NEW.status > -1 THEN --service gives caps
+      availability_new := round(cast(((select availability from mb_wms_availability where fkey_wms_id=NEW.fkey_wms_id)*count_monitors + 100)/(count_monitors+1) as numeric),2);
+     ELSE --service has problems with caps
+      availability_new := round(cast(((select availability from mb_wms_availability where fkey_wms_id=NEW.fkey_wms_id)*count_monitors)/(count_monitors+1) as numeric),2);
+     END IF;
+
+      UPDATE mb_wms_availability SET average_resp_time=average_res_cap,last_status=NEW.status, availability=availability_new, image=NEW.image, status_comment=NEW.status_comment,upload_url=NEW.upload_url,map_url=NEW.map_url WHERE mb_wms_availability.fkey_wms_id=NEW.fkey_wms_id;
+      RETURN NEW;
+     END IF;
+     IF TG_OP = 'INSERT' THEN
+
+	IF (select count(fkey_wms_id) from mb_wms_availability where fkey_wms_id=NEW.fkey_wms_id) > 0  then -- service is not new
+			UPDATE mb_wms_availability set fkey_upload_id=NEW.upload_id,last_status=NEW.status,status_comment=NEW.status_comment,upload_url=NEW.upload_url where fkey_wms_id=NEW.fkey_wms_id;
+		else --service has not yet been monitored
+			INSERT INTO mb_wms_availability (fkey_upload_id,fkey_wms_id,last_status,status_comment,upload_url,map_url,average_resp_time,availability) VALUES (NEW.upload_id,NEW.fkey_wms_id,NEW.status,NEW.status_comment,NEW.upload_url::text,NEW.map_url,0,100);
+		end if;
+
+      RETURN NEW;
+     END IF;
+    END;
+$BODY$
+  LANGUAGE 'plpgsql' VOLATILE;
+
+
+-- Trigger: mb_monitor_after on mb_monitor
+
+-- DROP TRIGGER mb_monitor_after ON mb_monitor;
+
+CREATE TRIGGER mb_monitor_after
+  AFTER INSERT OR UPDATE
+  ON mb_monitor
+  FOR EACH ROW
+  EXECUTE PROCEDURE mb_monitor_after();
+
+
+-- Table: mb_user_abo_ows
+
+-- DROP TABLE mb_user_abo_ows;
+
+CREATE TABLE mb_user_abo_ows
+(
+  fkey_mb_user_id integer,
+  fkey_wms_id integer,
+  fkey_wfs_id integer,
+  CONSTRAINT mb_user_abo_ows_user_id_fkey FOREIGN KEY (fkey_mb_user_id)
+      REFERENCES mb_user (mb_user_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE,
+  CONSTRAINT mb_user_abo_ows_wfs_fkey FOREIGN KEY (fkey_wfs_id)
+      REFERENCES wfs (wfs_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE,
+  CONSTRAINT mb_user_abo_ows_wms_fkey FOREIGN KEY (fkey_wms_id)
+      REFERENCES wms (wms_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE
+)
+WITHOUT OIDS;  
+
+  
+-- Index: idx_wms_id
+
+-- DROP INDEX idx_wms_id;
+
+CREATE INDEX idx_wms_id
+  ON wms
+  USING btree
+  (wms_id);
+  
+
+
+-- add monitor subscriber notification to admin1
+INSERT INTO gui_element (fkey_gui_id, e_id, e_pos, e_public, e_comment, e_title, e_element, e_src, e_attributes, e_left, e_top, e_width, e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file, e_mb_mod, e_target, e_requires, e_url) VALUES('admin1','monitor_abo_show',2,1,'monitoring','Show subscriptions','a','','href = "../php/mod_abo_show.php?sessionID" target = "AdminFrame" ',8,1080,190,20,10,'font-family: Arial, Helvetica, sans-serif; font-size : 12px; text-decoration : none; color: #808080;','Manage monitoring subscriptions','a','','','','AdminFrame','http://www.mapbender.org/');
+
+-- add monitor results to admin1
+INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment, e_title, e_element, e_src, e_attributes, e_left, e_top, e_width, e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file, e_mb_mod, e_target, e_requires, e_url) VALUES('admin1','monitor_results',2,1,'monitoring results','Monitoring results','a','','href = "../php/mod_monitorCapabilities_read.php?sessionID" target = "AdminFrame" ',8,1110,190,20,10,'font-family: Arial, Helvetica, sans-serif; font-size : 12px; text-decoration : none; color: #808080;','View monitoring results','a','','','','AdminFrame','http://www.mapbender.org/');
+
+---------------------------------------------MONITORING END
+
+---------------------------
+-- OWS Proxy log
+CREATE TABLE mb_proxy_log (
+    
+    proxy_log_timestamp timestamp default now(),
+    fkey_wms_id integer NOT NULL,
+    fkey_mb_user_id integer NOT NULL,
+    request varchar(4096),
+    pixel bigint,
+    price real
+    
+)
+with oids;
+ALTER TABLE wms ADD COLUMN wms_proxylog integer;
+ALTER TABLE wms ALTER COLUMN wms_proxylog SET STORAGE PLAIN;
+ALTER TABLE wms ADD COLUMN wms_pricevolume integer;
+ALTER TABLE wms ALTER COLUMN wms_pricevolume SET STORAGE PLAIN;
+---------------------------
+
+---------------------------
+-- http auth
+ALTER TABLE wms ADD COLUMN wms_username VARCHAR(255) NOT NULL DEFAULT '';
+ALTER TABLE wms ADD COLUMN wms_password VARCHAR(255) NOT NULL DEFAULT '';
+ALTER TABLE wms ADD COLUMN wms_auth_type VARCHAR(255) NOT NULL DEFAULT '';
+
+-- Column: mb_user_digest
+-- ALTER TABLE mb_user DROP COLUMN mb_user_digest;
+ALTER TABLE mb_user ADD COLUMN mb_user_digest text;
+ALTER TABLE mb_user ALTER COLUMN mb_user_digest SET STORAGE EXTENDED;
+
+--Initial filling with empty strings
+UPDATE mb_user set mb_user_digest='';
+
+--howto set up the http_auth digest hash
+--update mb_user set mb_user_digest=md5(mb_user_name || ';' || mb_user_email || ':' || '<realm_name>' || ':' || 'password') where mb_user_id = <ID>;
+ 
+---------------------------
+-- http://www.mapbender.org/FeatureInfo#considerScalehints --
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('gui', 'featureInfo1', 'considerScalehints', '0', '' ,'var');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('gui1', 'featureInfo1', 'considerScalehints', '0', '' ,'var');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('gui2', 'featureInfo1', 'considerScalehints', '0', '' ,'var'); 
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('gui_digitize', 'featureInfo1', 'considerScalehints', '0', '' ,'var');
+
+
+------------------------------
+-- greek updates for translations table
+update translations set msgstr = 'Περίγραμμα/Κορνίζα πλοήγησης' where msgid = 'Navigation Frame' and locale = 'gr';
+update translations set msgstr = 'Φόρτωση κειμένου διαδυκτιακού χάρτη' where msgid = 'Load a web map context document' and locale = 'gr';
+update translations set msgstr = 'Αποθήκευση χώρου εργασίας με μορφή κείμενου διαδυκτιακού χάρτη' where msgid = 'Save workspace as web map context document' and locale = 'gr';
+
+-- file extension is now .js
+UPDATE gui_element SET e_js_file = 'mod_selArea.js' WHERE e_id = 'selArea1';
+
+-- file extension is now .js
+UPDATE gui_element SET e_js_file = 'mod_zoomIn1.js' WHERE e_id = 'zoomIn1';
+
+-- file extension is now .js
+UPDATE gui_element SET e_js_file = 'mod_overview.js' WHERE e_id = 'overview';
+
+-- file extension is now .js
+UPDATE gui_element SET e_js_file = 'mod_zoomOut1.js' WHERE e_id = 'zoomOut1';
+ 
\ No newline at end of file



More information about the Mapbender_commits mailing list