-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from geosolutions-it/master
Description
- Loading branch information
Showing
401 changed files
with
16,442 additions
and
2,515 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
future-release=2017.05.00 | ||
since-tag=2017.04.00 | ||
future-release=2018.01.00 | ||
since-tag=v2017.05.00 |
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,47 @@ | ||
FROM tomcat:7.0.75 | ||
MAINTAINER geosolutions<info@geo-solutions.it> | ||
|
||
RUN export DEBIAN_FRONTEND=noninteractive | ||
ENV DEBIAN_FRONTEND noninteractive | ||
RUN dpkg-divert --local --rename --add /sbin/initctl | ||
|
||
# Set JAVA_HOME to /usr/lib/jvm/default-java and link it to OpenJDK installation | ||
RUN ln -s /usr/lib/jvm/java-1.7.0-openjdk-amd64/ /usr/lib/jvm/default-java | ||
ENV JAVA_HOME /usr/lib/jvm/default-java | ||
|
||
# Install utilities | ||
RUN apt-get -y update \ | ||
&& apt-get -y install vim \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV RESOURCES_DIR="/tmp/resources/" | ||
ADD docker/* "$RESOURCES_DIR" | ||
|
||
# Tomcat specific stuff | ||
ENV CATALINA_BASE "$CATALINA_HOME" | ||
ENV JAVA_OPTS="${JAVA_OPTS} -Xms512m -Xmx512m -XX:MaxPermSize=128m" | ||
|
||
# Optionally remove Tomcat manager, docs, and examples | ||
ARG TOMCAT_EXTRAS=false | ||
RUN if [ "$TOMCAT_EXTRAS" = false ]; then \ | ||
find "${CATALINA_BASE}/webapps/" -type f | xargs -L1 rm -f \ | ||
;fi | ||
|
||
# Customize Tomcat | ||
ARG INCLUDE_MS_WAR="false" | ||
ENV INCLUDE_MS_WAR "${INCLUDE_MS_WAR}" | ||
ARG APP_NAME=mapstore | ||
RUN if [ "$INCLUDE_MS_WAR" = true ]; then \ | ||
mv "${RESOURCES_DIR}/mapstore.war" \ | ||
"${CATALINA_BASE}/webapps/${APP_NAME}.war"; \ | ||
fi; | ||
|
||
# Geostore externalization template. Disabled by default | ||
ADD docker/geostore-datasource-ovr.properties "${CATALINA_BASE}/conf/" | ||
ARG GEOSTORE_OVR_OPT="" | ||
ENV JAVA_OPTS="${JAVA_OPTS} ${GEOSTORE_OVR_OPT}" | ||
|
||
# Set variable to better handle terminal commands | ||
ENV TERM xterm | ||
|
||
EXPOSE 8080 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
geostoreDataSource.url=jdbc:h2:./test | ||
geostoreEntityManagerFactory.jpaPropertyMap[hibernate.hbm2ddl.auto]=update |
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,24 @@ | ||
#Default Postgres Connection values, uncomment for using postgres | ||
geostoreDataSource.driverClassName=org.postgresql.Driver | ||
geostoreDataSource.url=jdbc:postgresql://postgres:5432/geostore | ||
geostoreDataSource.username=geostore | ||
geostoreDataSource.password=geostore | ||
geostoreVendorAdapter.databasePlatform=org.hibernate.dialect.PostgreSQLDialect | ||
geostoreEntityManagerFactory.jpaPropertyMap[hibernate.hbm2ddl.auto]=validate | ||
geostoreEntityManagerFactory.jpaPropertyMap[hibernate.default_schema]=geostore | ||
geostoreVendorAdapter.generateDdl=true | ||
geostoreVendorAdapter.showSql=false | ||
|
||
### USERS INITIALIZAZITION | ||
|
||
## Sample users are "admin" and "user" (this is DEFAULT configuration, already set in the applicatioContext) | ||
#geostoreInitializer.categoryListInitFile=classpath:sample_users.xml | ||
## Use this form to point to an absoluthe file path | ||
#geostoreInitializer.userListInitFile=file://path/to/your/file | ||
|
||
### CATEGORIES INITIALIZATION | ||
|
||
# A couple of sample categories. Use this XML file as template for yours. (this is DEFAULT configuration, already set in the applicatioContext) | ||
#geostoreInitializer.categoryListInitFile=classpath:sample_categories.xml | ||
## Use this form to point to an absoluthe file path | ||
#geostoreInitializer.categoryListInitFile=file://path/to/your/file |
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,24 @@ | ||
#Default Postgres Connection values, uncomment for using postgres | ||
geostoreDataSource.driverClassName=org.postgresql.Driver | ||
geostoreDataSource.url=jdbc:postgresql://postgres:5432/geostore | ||
geostoreDataSource.username=geostore | ||
geostoreDataSource.password=geostore | ||
geostoreVendorAdapter.databasePlatform=org.hibernate.dialect.PostgreSQLDialect | ||
geostoreEntityManagerFactory.jpaPropertyMap[hibernate.hbm2ddl.auto]=validate | ||
geostoreEntityManagerFactory.jpaPropertyMap[hibernate.default_schema]=geostore | ||
geostoreVendorAdapter.generateDdl=true | ||
geostoreVendorAdapter.showSql=false | ||
|
||
### USERS INITIALIZAZITION | ||
|
||
## Sample users are "admin" and "user" (this is DEFAULT configuration, already set in the applicatioContext) | ||
#geostoreInitializer.categoryListInitFile=classpath:sample_users.xml | ||
## Use this form to point to an absoluthe file path | ||
#geostoreInitializer.userListInitFile=file://path/to/your/file | ||
|
||
### CATEGORIES INITIALIZATION | ||
|
||
# A couple of sample categories. Use this XML file as template for yours. (this is DEFAULT configuration, already set in the applicatioContext) | ||
#geostoreInitializer.categoryListInitFile=classpath:sample_categories.xml | ||
## Use this form to point to an absoluthe file path | ||
#geostoreInitializer.categoryListInitFile=file://path/to/your/file |
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,26 @@ | ||
#!/bin/bash | ||
# wait-for-postgres.sh | ||
|
||
set -e | ||
|
||
host="$1" | ||
shift | ||
port="$1" | ||
shift | ||
user="$1" | ||
shift | ||
password="$1" | ||
shift | ||
cmd="$@" | ||
|
||
export PGPASSWORD="$password" | ||
|
||
set -x | ||
until psql -h "$host" -p "$port" -U "$user" -c '\l'; do | ||
>&2 echo "Postgres is unavailable - sleeping" | ||
sleep 1 | ||
done | ||
|
||
>&2 echo "Postgres is up - executing command" | ||
exec $cmd | ||
|
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 was deleted.
Oops, something went wrong.
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,72 @@ | ||
# Introduction | ||
MapStore2 offers the support for internationalization (I18N). To provide this functionality MapStore2 uses [react-intl](https://github.com/yahoo/react-intl). | ||
In this section you can find which configuration and JS files are involved in the I18N system. | ||
|
||
## How MapStore2 chooses the current language | ||
MapStore2 first checks the browser's language. If it is not supported, MapStore2 will be visible in english, if present, or the first language available. | ||
Anyway the locale can be forced using a flag locale=codeLang where codeLang can be one en,it,de... | ||
e.g. | ||
``` | ||
localhost:8081/?locale=en#/ | ||
``` | ||
A user can change the selected language from UI. MapStore2 will load the proper files to update the page localized in the selected language. | ||
|
||
## Configuration files | ||
To provide support to a specific language MapStore2 need to have the necessary setup in the LocaleUtils.js file (see below [section for details about to configure this file]). | ||
In addition you need the proper translations files. | ||
|
||
Let's imagine that the variable code is 'en', CODE is 'EN' standing for english. For each language you need to have **messages file** containing the localized strings, a **flag image** to identify the language and some **html fragments** (optional) for some specific plugins. | ||
- Messages: located in `web\client\translations` folder. For each language there is a json file named data.code-CODE. e.g. `data.en-EN`. | ||
- Flags: located in `web\client\components\I18N\images\flags` folder. For each language flag image named code-CODE.png of 16px x 11px is required. | ||
- Fragments: actually only for cookies policy .... (required only if the Cookie plugin is present) located in `web\client\translations\fragments\cookie` folder and named cookieDetails-code-CODE.html. We recommend to add it for any language you want to support at least by copying the english version. | ||
|
||
# How to configure supported languages in MapStore2 | ||
You can configure MapStore2 to provide to the user only a restricted list of selectable languages by setting "initialState.defaultState.locales" variable in `localConfig.json`. e.g : | ||
``` | ||
"defaultState": | ||
{ | ||
"locales": { | ||
"en": { | ||
code: "en-EN", | ||
description: "English" | ||
}, | ||
"it": { | ||
code: "it-IT", | ||
description: "Italiano" | ||
} | ||
} | ||
} | ||
``` | ||
Setting locales in localConfig.json file is doable only for supported locales present in LocaleUtils.js. | ||
The default behaviour is to use those already configured in "supportedLocales" object. | ||
You can customize the messages by editing the data.code-CODE files. | ||
|
||
# How to add a new language | ||
Let's say we want to add the russian language. | ||
In order to add a new language to MapStore2 you need to follow these steps: | ||
|
||
1. Update the localConfig.json file in `web\client` folder adding the new language entry | ||
- add the following in the "initialState.defaultState.locales" object | ||
``` | ||
"ru": { | ||
code: "ru-RU", | ||
description: "Pоссийский" | ||
} | ||
``` | ||
1. Update the LocaleUtils.js file in `web\client\utils` | ||
- add a param in the ensureIntl() function like and the relative require | ||
``` | ||
'intl/locale-data/jsonp/ru.js' | ||
... | ||
require('intl/locale-data/jsonp/ru.js'); | ||
``` | ||
- update the addLocaleData() call with the new locale obj i.e. | ||
``` | ||
const ru = require('react-intl/locale-data/ru'); | ||
addLocaleData([...en, ...it, ...fr, ...de, ...es, ...ru]); | ||
``` | ||
1. add the relative flag inside `web\client\components\I18N\images\flags` naming it ru-RU.png | ||
1. add the russian translations inside `web\client\translations` naming it data.ru-RU (remember to change the locale property of this file into ru-RU) | ||
1. create a fragment, related to the cookie module, inside `web\client\translations\fragments\cookie` naming it cookieDetails-ru-RU.html |
Oops, something went wrong.