[Mapbender-commits] r10012 - trunk/mapbender/resources/db
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Dec 13 08:57:41 PST 2018
Author: armin11
Date: 2018-12-13 08:57:41 -0800 (Thu, 13 Dec 2018)
New Revision: 10012
Modified:
trunk/mapbender/resources/db/install_geoportal_mb28.sh
Log:
More fixes
Modified: trunk/mapbender/resources/db/install_geoportal_mb28.sh
===================================================================
--- trunk/mapbender/resources/db/install_geoportal_mb28.sh 2018-12-13 16:40:47 UTC (rev 10011)
+++ trunk/mapbender/resources/db/install_geoportal_mb28.sh 2018-12-13 16:57:41 UTC (rev 10012)
@@ -46,7 +46,7 @@
############################################################
#
############################################################
-#
+# define the extent and default srs for the main gui/mapviewer
minx="289000"
miny="5423000"
maxx="465000"
@@ -53,6 +53,13 @@
maxy="5647000"
epsg="EPSG:25832"
############################################################
+# define name of the default gui
+default_gui_name="Geoportal-RLP"
+extended_search_default_gui_name="Geoportal-RLP_erwSuche2"
+#default_gui_name="Geoportal-RLP"
+#extended_search_default_gui_name="Geoportal-RLP_erwSuche2"
+
+############################################################
bbox_wgs84="6.05,48.9,8.6,50.96"
############################################################
############################################################
@@ -93,12 +100,12 @@
wms_4_url="'https://gis.mffjiv.rlp.de/cgi-bin/mapserv?map=/data/mapserver/mapfiles/institutions_0601.map&REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS'"
############################################################
##################### Geoportal-RLP
-wms_1_register_cmd="/usr/bin/php -f ${installation_folder}mapbender/tools/registerOwsCli.php userId=1 guiId='Geoportal-RLP' serviceType='wms' serviceAccessUrl=$wms_1_url"
-wms_2_register_cmd="/usr/bin/php -f ${installation_folder}mapbender/tools/registerOwsCli.php userId=1 guiId='Geoportal-RLP' serviceType='wms' serviceAccessUrl=$wms_2_url"
-wms_3_register_cmd="/usr/bin/php -f ${installation_folder}mapbender/tools/registerOwsCli.php userId=1 guiId='Geoportal-RLP' serviceType='wms' serviceAccessUrl=$wms_3_url"
+wms_1_register_cmd="/usr/bin/php -f ${installation_folder}mapbender/tools/registerOwsCli.php userId=1 guiId='$default_gui_name' serviceType='wms' serviceAccessUrl=$wms_1_url"
+wms_2_register_cmd="/usr/bin/php -f ${installation_folder}mapbender/tools/registerOwsCli.php userId=1 guiId='$default_gui_name' serviceType='wms' serviceAccessUrl=$wms_2_url"
+wms_3_register_cmd="/usr/bin/php -f ${installation_folder}mapbender/tools/registerOwsCli.php userId=1 guiId='$default_gui_name' serviceType='wms' serviceAccessUrl=$wms_3_url"
##################### Geoportal-RLP_erwSuche2
-wms_4_register_cmd="/usr/bin/php -f ${installation_folder}mapbender/tools/registerOwsCli.php userId=1 guiId='Geoportal-RLP_erwSuche2' serviceType='wms' serviceAccessUrl=$wms_1_url"
-wms_5_register_cmd="/usr/bin/php -f ${installation_folder}mapbender/tools/registerOwsCli.php userId=1 guiId='Geoportal-RLP_erwSuche2' serviceType='wms' serviceAccessUrl=$wms_2_url"
+wms_4_register_cmd="/usr/bin/php -f ${installation_folder}mapbender/tools/registerOwsCli.php userId=1 guiId='$extended_search_default_gui_name' serviceType='wms' serviceAccessUrl=$wms_1_url"
+wms_5_register_cmd="/usr/bin/php -f ${installation_folder}mapbender/tools/registerOwsCli.php userId=1 guiId='$extended_search_default_gui_name' serviceType='wms' serviceAccessUrl=$wms_2_url"
############################################################
##################### demo service -
wms_6_register_cmd="/usr/bin/php -f ${installation_folder}mapbender/tools/registerOwsCli.php userId=3 guiId='service_container1_free' serviceType='wms' serviceAccessUrl=$wms_4_url"
@@ -205,7 +212,7 @@
sed -i "s/error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT/error_reporting = E_ERROR/g" /etc/php5/apache2/php.ini
sed -i "s/;error_log = php_errors.log/error_log = \/tmp\/php5_apache_errors\.log/g" /etc/php5/apache2/php.ini
-error_log = syslogsed -i "s/error_log = syslog/;error_log = syslog/g" /etc/php5/apache2/php.ini
+sed -i "s/error_log = syslog/;error_log = syslog/g" /etc/php5/apache2/php.ini
# set some environment variables
@@ -493,22 +500,22 @@
INSERT INTO gui (gui_id, gui_name, gui_description, gui_public) VALUES ('service_container1_free', 'service_container1_free', 'service_container1_free', 1);
--guis: Geoportal-RLP, Administration_DE, Owsproxy_csv, admin_metadata, .....
-DELETE FROM gui WHERE gui_id IN ('Geoportal-RLP', 'Owsproxy_csv', 'admin_wms_metadata', 'admin_wfs_metadata', 'admin_wmc_metadata', 'admin_metadata', 'admin_ows_scheduler', 'PortalAdmin_DE', 'Administration_DE', 'Geoportal-RLP_erwSuche2');
+DELETE FROM gui WHERE gui_id IN ('${default_gui_name}', 'Owsproxy_csv', 'admin_wms_metadata', 'admin_wfs_metadata', 'admin_wmc_metadata', 'admin_metadata', 'admin_ows_scheduler', 'PortalAdmin_DE', 'Administration_DE', '${extended_search_default_gui_name}');
EOF
#####################
# sql for beeing executed after recreating of the guis
#####################
cat << EOF > ${installation_folder}geoportal_database_adoption_2.sql
-INSERT INTO gui_gui_category (fkey_gui_id, fkey_gui_category_id) VALUES ('Geoportal-RLP', 2);
+INSERT INTO gui_gui_category (fkey_gui_id, fkey_gui_category_id) VALUES ('${default_gui_name}', 2);
INSERT INTO gui_gui_category (fkey_gui_id, fkey_gui_category_id) VALUES ('Administration_DE', 2);
INSERT INTO gui_gui_category (fkey_gui_id, fkey_gui_category_id) VALUES ('PortalAdmin_DE', 2);
INSERT INTO gui_mb_user (fkey_gui_id, fkey_mb_user_id, mb_user_type) VALUES ('PortalAdmin_DE', 1, 'owner');
-INSERT INTO gui_mb_user (fkey_gui_id, fkey_mb_user_id, mb_user_type) VALUES ('Geoportal-RLP', 1, 'owner');
+INSERT INTO gui_mb_user (fkey_gui_id, fkey_mb_user_id, mb_user_type) VALUES ('${default_gui_name}', 1, 'owner');
INSERT INTO gui_mb_user (fkey_gui_id, fkey_mb_user_id, mb_user_type) VALUES ('Administration_DE', 1, 'owner');
INSERT INTO gui_mb_user (fkey_gui_id, fkey_mb_user_id, mb_user_type) VALUES ('Owsproxy_csv', 1, 'owner');
-INSERT INTO gui_mb_user (fkey_gui_id, fkey_mb_user_id, mb_user_type) VALUES ('Geoportal-RLP_erwSuche2', 1, 'owner');
+INSERT INTO gui_mb_user (fkey_gui_id, fkey_mb_user_id, mb_user_type) VALUES ('${extended_search_default_gui_name}', 1, 'owner');
INSERT INTO gui_mb_user (fkey_gui_id, fkey_mb_user_id, mb_user_type) VALUES ('admin_wms_metadata', 1, 'owner');
INSERT INTO gui_mb_user (fkey_gui_id, fkey_mb_user_id, mb_user_type) VALUES ('admin_wfs_metadata', 1, 'owner');
@@ -531,8 +538,8 @@
--INSERT INTO gui_mb_group (fkey_gui_id, fkey_mb_group_id) VALUES ('admin1', ${mapbender_subadmin_group_id});
-INSERT INTO gui_mb_group (fkey_gui_id, fkey_mb_group_id) VALUES ('Geoportal-RLP', ${mapbender_guest_group_id});
-INSERT INTO gui_mb_group (fkey_gui_id, fkey_mb_group_id) VALUES ('Geoportal-RLP_erwSuche2', ${mapbender_guest_group_id});
+INSERT INTO gui_mb_group (fkey_gui_id, fkey_mb_group_id) VALUES ('${default_gui_name}', ${mapbender_guest_group_id});
+INSERT INTO gui_mb_group (fkey_gui_id, fkey_mb_group_id) VALUES ('${extended_search_default_gui_name}', ${mapbender_guest_group_id});
INSERT INTO gui_mb_group (fkey_gui_id, fkey_mb_group_id) VALUES ('service_container1_free', ${mapbender_guest_group_id});
--alter views to integrate real subadmin and guest user ids
@@ -657,11 +664,22 @@
#####################
sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -f ${installation_folder}geoportal_database_adoption_1.sql
#####################
-
-# recreate the guis via psql
-sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -f ${installation_folder}mapbender/resources/db/gui_Geoportal-RLP.sql # -- maybe a problem: too long entry ...
+# alter the name of the default gui in the gui definition
+cp ${installation_folder}mapbender/resources/db/gui_Geoportal-RLP.sql ${installation_folder}gui_${default_gui_name}.sql
+# exchange all occurences of old default gui name in sql
+sed -i "s/Geoportal-RLP/${default_gui_name}/g" ${installation_folder}gui_${default_gui_name}.sql
+# recreate the guis via psql - default gui definition is in installation folder!
+sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -f ${installation_folder}gui_${default_gui_name}.sql
+# do the same for extended search gui
+# alter the name of the default extended search gui in the gui definition
+cp ${installation_folder}mapbender/resources/db/gui_Geoportal-RLP_erwSuche2.sql ${installation_folder}gui_${extended_search_default_gui_name}.sql
+# exchange all occurences of old default gui name in sql
+sed -i "s/Geoportal-RLP_erwSuche2/${extended_search_default_gui_name}/g" ${installation_folder}gui_${extended_search_default_gui_name}.sql
+# recreate the guis via psql - default gui definition is in installation folder!
+sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -f ${installation_folder}gui_${extended_search_default_gui_name}.sql
+#####################
# fix invocation of javascript functions for digitize module
-sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -c "UPDATE gui_element SET e_pos = '3' where e_id = 'kml' AND fkey_gui_id = 'Geoportal-RLP'"
+sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -c "UPDATE gui_element SET e_pos = '3' where e_id = 'kml' AND fkey_gui_id = '${default_gui_name}'"
#
sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -f ${installation_folder}mapbender/resources/db/gui_Owsproxy_csv.sql
sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -f ${installation_folder}mapbender/resources/db/gui_admin_wms_metadata.sql
@@ -671,7 +689,7 @@
sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -f ${installation_folder}mapbender/resources/db/gui_admin_ows_scheduler.sql
sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -f ${installation_folder}mapbender/resources/db/gui_PortalAdmin_DE.sql
sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -f ${installation_folder}mapbender/resources/db/gui_Administration_DE.sql
-sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -f ${installation_folder}mapbender/resources/db/gui_Geoportal-RLP_erwSuche2.sql
+
#####################
#####################
@@ -799,9 +817,16 @@
##################### demo service
eval $wms_6_register_cmd
#####################
+# qualify the main gui
# update database to set initial extent and epsg for Main GUI: TODO: maybe use a hidden layer !
- sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -c "UPDATE gui_wms SET gui_wms_epsg = '$epsg' WHERE fkey_gui_id = 'Geoportal-RLP'"
- sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -c "UPDATE layer_epsg SET minx = '$minx', miny = '$miny', maxx = '$maxx', maxy = '$maxy' WHERE fkey_layer_id IN (SELECT layer_id FROM layer WHERE fkey_wms_id IN (SELECT fkey_wms_id FROM gui_wms WHERE fkey_gui_id = 'Geoportal-RLP' AND gui_wms_position = 0) AND layer_parent='') AND epsg = '$epsg'"
+ sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -c "UPDATE gui_wms SET gui_wms_epsg = '$epsg' WHERE fkey_gui_id = '${default_gui_name}'"
+ sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -c "UPDATE layer_epsg SET minx = '$minx', miny = '$miny', maxx = '$maxx', maxy = '$maxy' WHERE fkey_layer_id IN (SELECT layer_id FROM layer WHERE fkey_wms_id IN (SELECT fkey_wms_id FROM gui_wms WHERE fkey_gui_id = '${default_gui_name}' AND gui_wms_position = 0) AND layer_parent='') AND epsg = '$epsg'"
+
+
+# set first wms to be seen in the overview mapframe
+sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -c "UPDATE gui_element_vars SET var_value = '0' WHERE fkey_gui_id='${default_gui_name}' AND fkey_e_id='overview' AND var_name = 'overview_wms'"
+
+
#####################
fi
@@ -857,9 +882,19 @@
sed -i "s/dbname=geoportal /dbname=$mapbender_database_name /g" ${installation_folder}conf/extents_geoportal_rlp.map
sed -i "s/user=postgres /user=$mapbender_database_user password=$mapbender_database_password /g" ${installation_folder}conf/extents_geoportal_rlp.map
sed -i "s/port=5436 /port=$mapbender_database_port /g" ${installation_folder}conf/extents_geoportal_rlp.map
- sed -i "s/%%http_proxy_host%%/$http_proxy_host/g" ${installation_folder}conf/extents_geoportal_rlp.map
- sed -i "s/%%http_proxy_port%%/$http_proxy_port/g" ${installation_folder}conf/extents_geoportal_rlp.map
sed -i "s/%%BBOXWGS84SPACE%%/$bbox_wgs84_space/g" ${installation_folder}conf/extents_geoportal_rlp.map
+
+ sed -i "s/\"wms_proxy_host\" \"%%PROXYHOST%%\"/#\"wms_proxy_host\" \"%%PROXYHOST%%\"/g" ${installation_folder}conf/extents_geoportal_rlp.map
+ sed -i "s/\"wms_proxy_port\" \"%%PROXYPORT%%\"/#\"wms_proxy_port\" \"%%PROXYPORT%%\"/g" ${installation_folder}conf/extents_geoportal_rlp.map
+
+ if [ $use_proxy_mb = 'true' ]; then
+ #####################
+ # integrated mapserver mapfile for metadata footprints
+ #####################
+ sed -i "s/#\"wms_proxy_host\" \"%%PROXYHOST%%\"/\"wms_proxy_host\" \"${http_proxy_host}\"/g" ${installation_folder}conf/extents_geoportal_rlp.map
+ sed -i "s/#\"wms_proxy_port\" \"%%PROXYPORT%%\"/\"wms_proxy_port\" \"${http_proxy_port}\"/g" ${installation_folder}conf/extents_geoportal_rlp.map
+ fi
+
cp ${installation_folder}conf/extents_geoportal_rlp.map ${installation_folder}mapbender/tools/wms_extent/extents.map
# conf file for invocation of metadata wms
sed -i "s#%%INSTALLATIONFOLDER%%#${installation_folder}#g" ${installation_folder}conf/extent_service_geoportal_rlp.conf
@@ -985,6 +1020,14 @@
############################################################
mysql --user=debian-sys-maint --password=$mysql_debian_password ${typo3_database_name} < typo3_db.sql
+############################################################
+# download typo3 upload folder
+############################################################
+cd /data/
+wget http://www.geoportal.rlp.de/metadata/uploads.tar.gz
+tar -xzvf uploads.tar.gz
+############################################################
+
fi
#configure files for db connect:
@@ -1004,6 +1047,25 @@
cp ${installation_folder}conf/localconf.php ${installation_folder}portal/typo3conf/
+ # alter name of extended search gui in typo3 config file
+ sed -i "s/Geoportal-RLP_erwSuche2/${extended_search_default_gui}/g" ${installation_folder}portal/fileadmin/function/config.php
+
+ # alter connection definition for calling keywordlist - super ugly ;-)
+ # sed -i "s/localhost//g" ${installation_folder}portal/fileadmin/scripts/keywordliste.php TODO - not always use localhost!
+ sed -i "s/5433/$mapbender_database_port/g" ${installation_folder}portal/fileadmin/scripts/keywordliste.php
+ sed -i "s/postgres/$mapbender_database_user/g" ${installation_folder}portal/fileadmin/scripts/keywordliste.php
+ sed -i "s/postgrespassword/$mapbender_database_password/g" ${installation_folder}portal/fileadmin/scripts/keywordliste.php
+ sed -i "s/geoportal/$mapbender_database_name/g" ${installation_folder}portal/fileadmin/scripts/keywordliste.php
+
+ # exchange path of logos
+ # left:
+ sed -i "s#fileadmin/design/logo_gdi-rp.png#../mapbender/img/OSGeo_logo.png#g" ${installation_folder}portal/fileadmin/design/content_noright.html
+ sed -i "s#fileadmin/design/logo_gdi-rp.png#../mapbender/img/OSGeo_logo.png#g" ${installation_folder}portal/fileadmin/design/content_noimage.html
+ sed -i "s#fileadmin/design/logo_gdi-rp.png#../mapbender/img/OSGeo_logo.png#g" ${installation_folder}portal/fileadmin/design/content.html
+ # right:
+ sed -i "s#fileadmin/design/logo_rlp.png#../mapbender/img/fossgis_2019_smal.png#g" ${installation_folder}portal/fileadmin/design/content_noright.html
+ sed -i "s#fileadmin/design/logo_rlp.png#../mapbender/img/fossgis_2019_smal.png#g" ${installation_folder}portal/fileadmin/design/content_noimage.html
+ sed -i "s#fileadmin/design/logo_rlp.png#../mapbender/img/fossgis_2019_smal.png#g" ${installation_folder}portal/fileadmin/design/content.html
fi
if [ $configure_apache = 'true' ]; then
############################################################
More information about the Mapbender_commits
mailing list