diff --git a/CONST_create_template/Dockerfile b/CONST_create_template/Dockerfile index 5ec313911..2314d0bbe 100644 --- a/CONST_create_template/Dockerfile +++ b/CONST_create_template/Dockerfile @@ -5,7 +5,7 @@ ENV VARS_FILE=vars.yaml ENV CONFIG_VARS sqlalchemy.url sqlalchemy.pool_recycle sqlalchemy.pool_size sqlalchemy.max_overflow \ sqlalchemy.use_batch_mode sqlalchemy_slave.url sqlalchemy_slave.pool_recycle sqlalchemy_slave.pool_size \ sqlalchemy_slave.max_overflow sqlalchemy_slave.use_batch_mode schema schema_static enable_admin_interface \ - default_locale_name servers layers available_locale_names cache admin_interface functionalities \ + default_locale_name servers layers available_locale_names cache admin_interface getitfixed functionalities \ raster shortener hide_capabilities tinyowsproxy resourceproxy print_url print_get_redirect \ checker check_collector default_max_age package srid \ reset_password fulltextsearch global_headers headers authorized_referers hooks stats db_chooser \ diff --git a/CONST_create_template/build b/CONST_create_template/build index e6937e0bf..24858bfc4 100755 --- a/CONST_create_template/build +++ b/CONST_create_template/build @@ -52,11 +52,12 @@ for env_file in args.env_files: # Ignore lines that don't have a '=' pass +base = env['DOCKER_BASE'] if 'DOCKER_BASE' in env else "camptocamp/geomapfish" tag = ":" + env['DOCKER_TAG'] if 'DOCKER_TAG' in env else "" if auto or args.config: subprocess.check_call( - ["docker", "build", "--tag=camptocamp/geomapfish-config" + tag, "--build-arg=PGSCHEMA=" + args.pgschema, "."] + ["docker", "build", "--tag={}-config{}".format(base, tag), "--build-arg=PGSCHEMA=" + args.pgschema, "."] ) if auto or args.geoportal: git_hash = subprocess.check_output(["git", "rev-parse", "HEAD"]).strip().decode() @@ -64,7 +65,7 @@ if auto or args.geoportal: [ "docker", "build", - "--tag=camptocamp/geomapfish-geoportal" + tag, + "--tag={}-geoportal{}".format(base, tag), "--build-arg=PGSCHEMA=" + args.pgschema, "--build-arg=GIT_HASH=" + git_hash, "geoportal", @@ -75,7 +76,7 @@ if auto or args.geoportal: "docker", "build", "--target=builder", - "--tag=camptocamp/geomapfish-geoportal-dev" + tag, + "--tag={}-geoportal-dev{}".format(base, tag), "--build-arg=PGSCHEMA=" + args.pgschema, "--build-arg=GIT_HASH=" + git_hash, "geoportal", diff --git a/CONST_create_template/geoportal/vars.yaml b/CONST_create_template/geoportal/vars.yaml index 204884402..79b26554e 100644 --- a/CONST_create_template/geoportal/vars.yaml +++ b/CONST_create_template/geoportal/vars.yaml @@ -51,12 +51,18 @@ vars: params: ogcserver: QGIS server - admin_interface: # Default values for the admin interface's maps. - map_x: 740000 - map_y: 5860000 - map_zoom: 10 + map: + baseLayers: + - type_: "OSM" + view: + projection: 'EPSG:3857' + center: [829170, 5933942] + zoom: 7 + fitSource: false + fitMaxZoom: 14 + focusOnly: false functionalities: # Functionalities that are made available to Mako templates. diff --git a/Dockerfile b/Dockerfile index 5ec313911..2314d0bbe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ ENV VARS_FILE=vars.yaml ENV CONFIG_VARS sqlalchemy.url sqlalchemy.pool_recycle sqlalchemy.pool_size sqlalchemy.max_overflow \ sqlalchemy.use_batch_mode sqlalchemy_slave.url sqlalchemy_slave.pool_recycle sqlalchemy_slave.pool_size \ sqlalchemy_slave.max_overflow sqlalchemy_slave.use_batch_mode schema schema_static enable_admin_interface \ - default_locale_name servers layers available_locale_names cache admin_interface functionalities \ + default_locale_name servers layers available_locale_names cache admin_interface getitfixed functionalities \ raster shortener hide_capabilities tinyowsproxy resourceproxy print_url print_get_redirect \ checker check_collector default_max_age package srid \ reset_password fulltextsearch global_headers headers authorized_referers hooks stats db_chooser \ diff --git a/build b/build index 03bc4dcc2..245026b23 100755 --- a/build +++ b/build @@ -5,6 +5,7 @@ import os import re import stat import subprocess +import sys import urllib.request parser = argparse.ArgumentParser(description="Build the project,") @@ -30,14 +31,14 @@ if args.upgrade: if result.code != 200: print("ERROR:") print(result.read()) - exit(1) + sys.exit(1) f.write(result.read().decode()) os.chmod("upgrade", os.stat("upgrade").st_mode | stat.S_IXUSR) try: subprocess.check_call(["./upgrade", full_version]) except subprocess.CalledProcessError: - exit(1) - exit(0) + sys.exit(1) + sys.exit(0) auto = not (args.config or args.geoportal or args.env) env = {} @@ -52,12 +53,12 @@ for env_file in args.env_files: # Ignore lines that don't have a '=' pass -base = env['DOCKER_BASE'] if 'DOCKER_BASE' in env else "camptocamp/geomapfish-config" +base = env['DOCKER_BASE'] if 'DOCKER_BASE' in env else "camptocamp/geomapfish" tag = ":" + env['DOCKER_TAG'] if 'DOCKER_TAG' in env else "" if auto or args.config: subprocess.check_call( - ["docker", "build", "--tag=" + base + "-config" + tag, "--build-arg=PGSCHEMA=" + args.pgschema, "."] + ["docker", "build", "--tag={}-config{}".format(base, tag), "--build-arg=PGSCHEMA=" + args.pgschema, "."] ) if auto or args.geoportal: git_hash = subprocess.check_output(["git", "rev-parse", "HEAD"]).strip().decode() @@ -65,7 +66,7 @@ if auto or args.geoportal: [ "docker", "build", - "--tag=" + base + "-geoportal" + tag, + "--tag={}-geoportal{}".format(base, tag), "--build-arg=PGSCHEMA=" + args.pgschema, "--build-arg=GIT_HASH=" + git_hash, "geoportal", @@ -76,7 +77,7 @@ if auto or args.geoportal: "docker", "build", "--target=builder", - "--tag=" + base + "-geoportal-dev" + tag, + "--tag={}-geoportal-dev{}".format(base, tag), "--build-arg=PGSCHEMA=" + args.pgschema, "--build-arg=GIT_HASH=" + git_hash, "geoportal", diff --git a/geoportal/CONST_config-schema.yaml b/geoportal/CONST_config-schema.yaml index f157403a2..e4cd50a57 100644 --- a/geoportal/CONST_config-schema.yaml +++ b/geoportal/CONST_config-schema.yaml @@ -284,19 +284,52 @@ mapping: mapping: layer_tree_max_nodes: type: int - map_base_layer: - type: str - map_x: - type: int - required: True - map_y: - type: int - required: True - map_zoom: - type: int - required: True - map_fit_max_zoom: - type: int + map: &map_config + type: map + mapping: + baseLayers: + type: seq + sequence: + - type: map + mapping: + regex;.+: + type: any + fitSource: + type: bool + fitMaxZoom: + type: int + focusOnly: + type: bool + projections: + type: seq + sequence: + - type: map + mapping: + code: + type: str + required: True + definition: + type: str + required: True + srid: + type: int + view: + type: map + mapping: + center: + type: seq + sequence: + - type: int + initialExtent: + type: seq + sequence: + - type: int + projection: + type: str + zoom: + type: int + regex;.+: + type: any available_metadata: type: seq required: True @@ -331,6 +364,19 @@ mapping: type: str single: type: bool + + getitfixed: + type: map + required: True + mapping: + enabled: + type: bool + required: True + map: + <<: *map_config + regex;.+: + type: any + layers: type: map required: True diff --git a/geoportal/CONST_vars.yaml b/geoportal/CONST_vars.yaml index bc6b2100e..1e56991a0 100644 --- a/geoportal/CONST_vars.yaml +++ b/geoportal/CONST_vars.yaml @@ -202,10 +202,6 @@ vars: backend: dogpile.cache.memory admin_interface: - # Default values for the admin interface's maps. - map_x: 740000 - map_y: 5860000 - map_zoom: 10 layer_tree_max_nodes: 1000 @@ -288,6 +284,9 @@ vars: - name: open_panel single: true + getitfixed: + enabled: false + functionalities: # Functionalities that are made available to Mako templates and loginuser. available_in_templates: diff --git a/geoportal/vars.yaml b/geoportal/vars.yaml index 72b756d13..3c8adb4b8 100644 --- a/geoportal/vars.yaml +++ b/geoportal/vars.yaml @@ -117,9 +117,16 @@ vars: admin_interface: # Default values for the admin interface's maps. - map_x: 740000 - map_y: 5860000 - map_zoom: 10 + map: + baseLayers: + - type_: "OSM" + view: + projection: 'EPSG:3857' + center: [740000, 5860000] + zoom: 10 + fitSource: false + fitMaxZoom: 14 + focusOnly: false # The list of functionalities that can be configured # through the admin interface.