[Mapbender-commits] r1646 - trunk/mapbender/resources/db/update

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Aug 9 09:05:34 EDT 2007


Author: astrid_emde
Date: 2007-08-09 09:05:34 -0400 (Thu, 09 Aug 2007)
New Revision: 1646

Modified:
   trunk/mapbender/resources/db/update/update_postgresql_db.sql
Log:
database changes for version 2.5

Modified: trunk/mapbender/resources/db/update/update_postgresql_db.sql
===================================================================
--- trunk/mapbender/resources/db/update/update_postgresql_db.sql	2007-08-09 09:11:26 UTC (rev 1645)
+++ trunk/mapbender/resources/db/update/update_postgresql_db.sql	2007-08-09 13:05:34 UTC (rev 1646)
@@ -1,3 +1,53 @@
 --
--- no changes in version 2.4.2
---
\ No newline at end of file
+-- database changes in version 2.5
+--
+-- notice lnguage plpgsql has to be installed
+-- 
+
+
+-- How to install plpgsql? 
+-- createlang plpgsql mapbender
+
+-- change in WFS configuration: access to geometries may now be restricted
+
+ALTER TABLE wfs_conf_element ADD COLUMN f_auth_varname VARCHAR(50);
+
+-- new column for translation
+
+ALTER TABLE gui_element ADD COLUMN e_title VARCHAR(255);
+
+--new table for translations
+
+CREATE TABLE translations
+(
+  trs_id serial PRIMARY KEY not null,
+  locale varchar(8),
+  msgid varchar(512),
+  msgstr varchar(512)
+);
+
+CREATE INDEX msgid_idx ON translations(msgid);
+
+--new function for easy translations
+
+CREATE OR REPLACE FUNCTION gettext(locale_arg "text", string "text")
+RETURNS "varchar" AS
+$BODY$
+DECLARE
+    msgstr varchar(512);
+    trl RECORD;
+BEGIN
+    -- RAISE NOTICE '>%<', locale_arg;
+
+    SELECT INTO trl * FROM translations
+    WHERE trim(from locale) = trim(from locale_arg) AND msgid = string;
+    -- we return the original string, if no translation is found.
+    -- this is consistent with gettext's behaviour
+    IF NOT FOUND THEN
+        RETURN string;
+    ELSE
+        RETURN trl.msgstr;
+    END IF; 
+END;
+$BODY$
+  LANGUAGE 'plpgsql' VOLATILE;



More information about the Mapbender_commits mailing list