[Mapbender-commits] r7874 -
branches/2.7/resources/db/pgsql/UTF-8/update
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Jun 16 03:22:40 EDT 2011
Author: verenadiewald
Date: 2011-06-16 00:22:40 -0700 (Thu, 16 Jun 2011)
New Revision: 7874
Modified:
branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7rc1_to_2.7rc2_pgsql_UTF-8.sql
Log:
cleaned up sqls for compatibility with postgres version 8.1, merged with 2.7
Modified: branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7rc1_to_2.7rc2_pgsql_UTF-8.sql
===================================================================
--- branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7rc1_to_2.7rc2_pgsql_UTF-8.sql 2011-06-16 07:14:28 UTC (rev 7873)
+++ branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7rc1_to_2.7rc2_pgsql_UTF-8.sql 2011-06-16 07:22:40 UTC (rev 7874)
@@ -1772,6 +1772,144 @@
--
UPDATE gui_element SET e_target = 'pan1' WHERE e_id = 'toggleModule';
+-- Table: mb_metadata
+DROP TABLE mb_metadata CASCADE;
+DROP TABLE content_metadata CASCADE; -- exchanged with md_metadata
+CREATE TABLE mb_metadata
+(
+ metadata_id serial NOT NULL, --mapbender
+ uuid character varying(100), --mapbender/orig
+ origin character varying(100), --mapbender - capabilities, metador, external
+ includeincaps BOOLEAN DEFAULT TRUE, --mapbender include this metadataUrl in new capabilities
+ "schema" character varying(32), --mapbender/orig/ see geonetwork - maybe iso19139
+ createdate timestamp, --metadata
+ changedate timestamp, --metadata
+ lastchanged timestamp NOT NULL DEFAULT now(), --mapbender
+ data text, --metadata
+ link character varying(250), --link from capabilities/registry/metador
+ linktype character varying(100), -- from ows caps - metadataUrl type attribute
+ md_format character varying(100), -- from ows caps - metadataUrl format tag
+ title character varying(250), --metadata
+ abstract text, --metadata
+ searchtext text, --concatenate search strings
+ status character varying(50), --metadator
+ "type" character varying(50), --from iso19115 - service/dataset/application ...
+ harvestresult integer, --when getting information from caps
+ harvestexception text, --if mimetype from link result is not the expected format
+ export2csw boolean, -- can be set to show if an added link should be harvested and this metadata should be published again
+ tmp_reference_1 timestamp, --metadata
+ tmp_reference_2 timestamp, --metadata
+ spatial_res_type integer, --metadata
+ spatial_res_value character varying(20), --metadata
+ ref_system character varying(20), --metadata
+ format character varying(100), --metadata
+ inspire_charset character varying(10), --metadata
+ inspire_top_consistence boolean, --metadata
+ fkey_mb_user_id integer NOT NULL DEFAULT 1, -- from metador
+ responsible_party integer, --what is this? --fkey_mb_group_id will be better
+ individual_name integer, --what is this?
+ visibility character varying(12), --from metador
+ locked boolean DEFAULT false, --from metador
+ copyof character varying(100), --from metador
+ -- fkey_metadata_id integer,
+ -- fkey_layer_id integer,
+ -- fkey_featuretype_id integer,
+ -- mb_user_mb_group integer,
+ -- mb_user_mb_group_type integer,
+ "constraints" text, --metadata/metador?
+ fees character varying(2500), --metadata/metador?
+ classification character varying(100), --metadata/metador?
+ browse_graphic character varying(255), --metadata/metador?
+ inspire_conformance boolean, --metadata/metador?
+ preview_image text, --metadata/metador?
+ the_geom geometry, --metador
+ CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2),
+ CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL),
+ CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 4326),
+ CONSTRAINT metadata_pkey PRIMARY KEY (metadata_id)
+-- CONSTRAINT metadata_uuid_key UNIQUE (uuid) -- not used cause this could happen!
+);
+ALTER TABLE mb_metadata OWNER TO postgres;
+
+-- Table: ows_relation_metadata
+
+DROP TABLE ows_relation_metadata CASCADE;
+
+CREATE TABLE ows_relation_metadata
+(
+ fkey_metadata_id integer NOT NULL,
+ fkey_layer_id integer,
+ fkey_featuretype_id integer,
+ CONSTRAINT ows_relation_metadata_fkey_featuretype_id_fkey FOREIGN KEY (fkey_featuretype_id)
+ REFERENCES wfs_featuretype (featuretype_id) MATCH SIMPLE
+ ON UPDATE CASCADE ON DELETE CASCADE,
+ CONSTRAINT ows_relation_metadata_fkey_layer_id_fkey FOREIGN KEY (fkey_layer_id)
+ REFERENCES layer (layer_id) MATCH SIMPLE
+ ON UPDATE CASCADE ON DELETE CASCADE,
+ CONSTRAINT ows_relation_metadata_fkey_metadata_id_fkey FOREIGN KEY (fkey_metadata_id)
+ REFERENCES mb_metadata (metadata_id) MATCH SIMPLE
+ ON UPDATE CASCADE ON DELETE CASCADE
+);
+ALTER TABLE ows_relation_metadata OWNER TO postgres;
+
+
+
+CREATE OR REPLACE FUNCTION update_lastchanged_column()
+RETURNS TRIGGER AS $$
+BEGIN
+ NEW.lastchanged = now();
+ RETURN NEW;
+END;
+$$ language 'plpgsql';
+
+CREATE TRIGGER update_mb_metadata_lastchanged BEFORE UPDATE
+ ON mb_metadata FOR EACH ROW EXECUTE PROCEDURE
+ update_lastchanged_column();
+
+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('admin_wms_metadata','mb_md_showMetadataAddon',2,1,'Show addon editor for metadata','Metadata Addon Editor','div','','',NULL ,NULL ,NULL ,NULL ,NULL ,'display:none;','','div','../plugins/mb_metadata_showMetadataAddon.js','','','jq_ui_dialog','');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('admin_wms_metadata', 'mb_md_showMetadataAddon', 'differentFromOriginalCss', '.differentFromOriginal{
+background-color:#FFFACD;
+}', 'css for class differentFromOriginal' ,'text/css');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('admin_wms_metadata', 'mb_md_showMetadataAddon', 'inputs', '[
+ {
+ "method": "init",
+ "title": "initialize",
+ "linkedTo": [
+ {
+ "id": "mb_md_edit",
+ "event": "showOriginalMetadata",
+ "attr": "data"
+ }
+ ]
+ },
+ {
+ "method": "initLayer",
+ "title": "initialize",
+ "linkedTo": [
+ {
+ "id": "mb_md_layer",
+ "event": "showOriginalLayerMetadata",
+ "attr": "data"
+ }
+ ]
+ }
+]', '' ,'var');
+
+-- add column for mb_metadata
+ALTER TABLE mb_metadata ADD COLUMN lineage text;
+ALTER TABLE mb_metadata ALTER COLUMN spatial_res_type TYPE varchar(20);
+ALTER TABLE mb_metadata ADD COLUMN datasetid text; --needed for service data coupling!
+ALTER TABLE mb_metadata ADD COLUMN randomid character varying(100); --needed to identify inserted record!
+ALTER TABLE mb_metadata ALTER COLUMN randomid SET STORAGE EXTENDED;
+
+-- activate datepicker for forms
+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('admin_wms_metadata','jq_ui_datepicker',5,1,'Datepicker from jQuery UI framework','','','','',NULL ,NULL ,NULL ,NULL ,NULL ,'','','','../plugins/jq_ui_datepicker.js','../extensions/jquery-ui-1.8.1.custom/development-bundle/ui/jquery.ui.datepicker.js','','jq_ui','');
+-- activate upload functions
+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('admin_wms_metadata','mb_metadata_xml_import',1,1,'','','div','','',NULL ,NULL ,NULL ,NULL ,NULL ,'','','div','../plugins/mb_metadata_xml_import.js','','','','');
+
+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('admin_wms_metadata','jq_upload',1,1,'Allows to upload files into Mapbender''s temporary files folder','','','','',NULL ,NULL ,NULL ,NULL ,NULL ,'','','','','../plugins/jq_upload.js','','','');
+
+
More information about the Mapbender_commits
mailing list