-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To be able to integrate interface that not be build with the GeoMapGish build chain. Also be able to configure some static files: favicon.ico, robot.txt, api.js, api.js.map, api.css, apihelp.html.
- Loading branch information
Showing
6 changed files
with
169 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
.. _integrator_interface: | ||
|
||
Introduction | ||
------------ | ||
|
||
This chapter describes how to integrate a new ``custom`` interface in a c2cgeoportal application. | ||
|
||
``custom`` means that the interface can be based on other frontend than ngeo event if at the end of this | ||
document we will speak about how to integrate a ngeo as custom interface with a simple build chain. | ||
|
||
Review | ||
------ | ||
|
||
In the c2cgeoportal application we have by default 3 interfaces: desktop, mobile and iframe. | ||
|
||
c2cgeoportal provide different things around the interface but they are not hard linked: | ||
|
||
- The interface in the admin interface is a way to define the layers visible in the interface. | ||
- The ``interfaces_config`` in the ``vars.yaml`` is a way to define the interface configuration. | ||
- The ``interface`` in the ``vars.yaml`` is a way to configure the interfaces route in c2cgeoportal: ``/``, | ||
``/theme/<theme>``, ``/<interface>`` and ``/<interface>/theme/<theme_name>``. | ||
|
||
Configuration | ||
------------- | ||
|
||
Here we will describe how to add a new ``custom`` interface in a c2cgeoportal application, | ||
for that we should add a new entry in the ``interface_config`` with the ``type`` set to ``custom``. | ||
|
||
.. code:: yaml | ||
vars: | ||
interfaces_config: | ||
custom: | ||
type: custom | ||
name: my_interface | ||
We can also add an optional ``file`` attribute in the config to specify the file that should be used for the interface, | ||
with relative (from ``/etc/static-frontend``) or absolute file name. | ||
|
||
Interface integration | ||
--------------------- | ||
|
||
To publish the interfaces que should provide the interfaces files (HTML, CSS, JavaScript, images, ...) in | ||
the ``/etc/static-frontend/`` directory. | ||
|
||
The interface files should be in a directory named with the interface name suffixed by ``.html``. | ||
|
||
Note that this folder is also available on the ``/static-frontend/`` endpoint with cache headers without | ||
any cash bustering, then the files (other than the interfaces HTML files) should contains an hash. | ||
|
||
If you need cache bustering you should put your files in the ``geoportal/geomapfish_geoportal/static/`` | ||
directory (``/etc/geomapfish/static`` in the container). | ||
|
||
The interface HTML file is considered as mako template and he can use the following variables: | ||
- ``request``: the Pyramid request object. | ||
- ``dynamicUrl``: the URL to get the interface configuration. | ||
- ``interface``: the interface name. | ||
- ``staticFrontend``: the URL to the static frontend directory. | ||
- ``staticCashBuster``: the URL to the static cash buster directory. | ||
|
||
For that you should create a Docker image that provide a ``/etc/static-frontend/`` volume (``VOLUME /etc/static-frontend``). | ||
|
||
And include it in the ``docker-compose.yaml`` file with something like: | ||
|
||
.. code:: yaml | ||
services: | ||
my_interface: | ||
image: my_interface | ||
user: www-data | ||
geoportal: | ||
volumes_from: | ||
- my_interface:ro | ||
Ngeo integration | ||
---------------- | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters