Skip to content

Commit

Permalink
[GITFLOW]merging 'release-1.78.0' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed Dec 21, 2022
2 parents fe7de3e + 27ea397 commit aae9f89
Show file tree
Hide file tree
Showing 453 changed files with 5,054 additions and 5,100 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ If you want to learn more about the development and contribution process, settin

If you want to set up a SORMAS instance for production, testing or development purposes, please refer to the following guides:
* [Installing a SORMAS Server](docs/SERVER_SETUP.md)
* [Installing a SORMAS Server for Development](docs/SERVER_DEV_SETUP.md)
* [Updating a SORMAS Server](docs/SERVER_UPDATE.md)
* [Setup Development environment](docs/DEVELOPMENT_ENVIRONMENT.md)
* [Creating a Demo Android App](docs/DEMO_APP.md)

## Project Structure
Expand Down
28 changes: 20 additions & 8 deletions docs/DEVELOPMENT_ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,33 @@ This step-by-step guide explains how to set up your development environment, usi

**Please note that these instructions are optimized for Windows and Linux systems.** If you're developing on a Mac and, we would be glad to get your feedback about how this guide can be extended with OS-specific instructions in our developer chat on [Gitter](https://gitter.im/SORMAS-Project).

## Step 1: Install a Local SORMAS Server
Please follow the [Server Setup Instructions](SERVER_SETUP.md) to set up a local SORMAS instance that you will use to test your code. Alternatively, you can also use [Maven Cargo](../sormas-cargoserver/README.md), or a [Docker installation](SERVER_DEV_SETUP.md) (not recommended at this time).

## Step 2: Check Out the SORMAS Repository
## Step 1: Check Out the SORMAS Repository
- [Download and install the latest Git version](https://git-scm.com/downloads) for your operating system
- *Optional:* Install a Git client such as [TortoiseGit](https://tortoisegit.org/) or [GitHub Desktop](https://desktop.github.com/) if you don't want to handle version control from the command line or within your IDE
- *Optional:* Clone the SORMAS-Project repository with `git clone https://github.com/hzi-braunschweig/SORMAS-Project.git`; if you want to use Git from within your IDE, you can also clone the repository in Step 4
- Open Git Bash and execute the following command to ensure that rebase is used when pulling the development branch rather than merge: `git config --global branch.development.rebase true`

## Step 3: Install Java
## Step 2: Install Java
Download and install the **Java 11 JDK** (not JRE) for your operating system.
We suggest using [Zulu OpenJDK](https://www.azul.com/downloads/?version=java-11-lts&package=jdk). If you're running Linux, please refer to the [official documentation](https://docs.azul.com/zulu/zuludocs/ZuluUserGuide/PrepareZuluPlatform/AttachAPTRepositoryUbuntuOrDebianSys.htm) on how to install Zulu OpenJDK on your system.
If you plan to work on the Android App as well, you will also need the **Java 8 JDK** to use with Android Studio.

## Step 4: Install and Configure Your IDE
## Step 3: Install Maven & Ant
Download and install Maven for your operating system, see [binaries](https://dlcdn.apache.org/maven/maven-3/3.6.3/binaries/)
*IMPORTANT*: M2_HOME environment variable needs to be set. By default, for newer version, it is set to MAVEN_HOME. But Ant script is looking for M2_HOME, please refer to the [official documentation](https://maven.apache.org/install.html)

Download and install Ant, it can be done from [Ant site](https://ant.apache.org/bindownload.cgi) or with packages from your Linux distribution.

## Step 4: Install a Local SORMAS Server
Please follow the [Server Installation Instructions](../docs/SERVER_SETUP.md#sormas-installation) to set up a local SORMAS instance that you will use to test your code. Alternatively, you can also use [Maven Cargo](../sormas-cargoserver/README.md), or a [Docker installation](SERVER_DOCKER_SETUP.md) (not recommended at this time).

## Step 5: Install and Configure Your IDE

### IntelliJ
- Download and install the latest [IntelliJ IDEA Ultimate](https://www.jetbrains.com/lp/intellij-frameworks/); (newer than version of 2020-04-15 to enable debugging, see <https://youtrack.jetbrains.com/issue/IDEA-216528>)
- Set the project SDK to the installed JDK
- *Optional:* Clone the SORMAS-Project repository if you haven't done so already
- Open the project in IntelliJ. Make sure the project is recognized by IntelliJ as a `maven project`; if not, right-click the `pom.xml` file in sormas-base and select `Add as maven project`.
- Open the project in IntelliJ. Make sure the project is recognized by IntelliJ as a `maven project`; if not, right-click the `pom.xml` file in `sormas-base` and select `Add as maven project`.
- Make sure that under `File -> Project Structure -> Modules` all modules EXCEPT sormas-app are recognized; if not, add the missing modules with the `+` button
- Navigate to `File -> Settings -> Plugins` and make sure that Glassfish & Ant integrations are enabled
- Install the [Vaadin 6-8 plugin](https://plugins.jetbrains.com/plugin/13199-vaadin-6-8); the commercial Vaadin Designer is not needed
Expand All @@ -45,6 +51,7 @@ If you plan to work on the Android App as well, you will also need the **Java 8
- Open the Ant window, click on the `+` icon and select the `sormas-base/build.xml` file
- Execute the `install` and `deploy-serverlibs` Ant scripts
- Set the default working directory for run configurations by navigating to `Run -> Edit Configurations -> Templates -> Application` and setting `Working directory` to `$MODULE_WORKING_DIR$`
- *Optional:* Setup database access from Intellij: Open View -> Tool View -> Database, click on + icon and select DataSource -> PostgreSQL and configure the database (set user and password and download the missing driver files if needed)

#### Known issues
- The first time you build the project in IntelliJ, you have to switch the java compiler to "Eclipse" to workarround a dependency resolution problem in sormas-api.
Expand Down Expand Up @@ -80,7 +87,7 @@ If you plan to work on the Android App as well, you will also need the **Java 8

**Important:** Whenever you do or pull changes in the `sormas-api` project that you want to use in the mobile app or that are referenced there already, you need to execute the `install` Ant script to notify the `sormas-app` project of the changes.

## Step 5: Configure Code Formatting and Import Settings
## Step 6: Configure Code Formatting and Import Settings
In order to ensure a consistent code style and prevent so-called edit wars, we have set up custom configuration files for automatic code formatting and import ordering. Please make sure to adhere to the following steps for your IDE(s) before you start developing.

### IntelliJ and Android Studio Settings
Expand Down Expand Up @@ -127,6 +134,11 @@ Optional, but strongly recommended:

7. For eclipse formatted plugin, there is an issue for Idea: <https://plugins.jetbrains.com/plugin/6546-eclipse-code-formatter> - `cannot save settings Path to custom eclipse folder is not valid` - it works only when settings were saved from down to up. And not vice versa.

If something is still not working:
-> Stop the payara domain, run Ant deploy-serverlibs to update libs
-> clean up (delete all from domains/sormas/autodeploy, domains/sormas/applications, domains/sormas/generated, and domains/sormas/osgi-cache) try to build again by executing `mvn clean install -DskipTests` on the `sormas-base` module
-> start the domain and deploy again

## Avoid redeployment problems

**Problem**: Due to currently a not mitigated problem, it is only possible to deploy the `sormas-ear.ear` (contains `sormas-backend`) once without problems. If you undeploy it and deploy `sormas-ear.ear` again, the other artifacts `sormas-ui`and `sormas-rest` cannot successfully call the backend.
Expand Down
File renamed without changes.
26 changes: 13 additions & 13 deletions docs/SERVER_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@ You can check your Java version from the shell/command line using: ``java -versi
* Install PostgreSQL (currently 9.5, 9.6 or 10) on your system (manuals for all OS can be found here: <https://www.postgresql.org/download>)
* Set **max_connections = 288** and **max_prepared_transactions = 256** (at least, sum of all connection pools) in ``postgresql.conf`` (e.g. ``/etc/postgresql/10.0/main/postgresql.conf``; ``C:/Program Files/PostgreSQL/10.0/data``) - make sure the property is uncommented and restart the service to apply the changes.
* Install the "temporal tables" extension for Postgres (<https://github.com/arkhipov/temporal_tables>)
* **Windows**: Download the latest version for your Postgres version: <https://github.com/arkhipov/temporal_tables/releases/latest>, then copy the DLL from the project into the PostgreSQL's lib directory and the .sql and .control files into the directory share\extension.
* **Windows**: Download the latest version for your Postgres version:
* <https://github.com/arkhipov/temporal_tables/releases/latest>, then copy the DLL from the project into the PostgreSQL's lib directory and the .sql and .control files into the directory share\extension.
* **Linux** (see <https://github.com/arkhipov/temporal_tables#installation)>

```bash
sudo apt-get install libpq-dev
sudo apt-get install postgresql-server-dev-all
sudo apt install pgxnclient
#Check for GCC:
gcc --version # and install if missing
sudo pgxn install temporal_tables
# The packages can be removed afterward
```

```bash
sudo apt-get install libpq-dev
sudo apt-get install postgresql-server-dev-all
sudo apt install pgxnclient
#Check for GCC:
gcc --version # and install if missing
sudo pgxn install temporal_tables
# The packages can be removed afterward
```
* Add the PostgreSQL path (/etc/PostgreSQL/10/bin) to Environment Variables

## SORMAS Server

Expand Down Expand Up @@ -106,7 +106,7 @@ chmod +x $(date +%F)/server-setup.sh
### Auditing
You can configure the audit logger of SORMAS by providing a Logback [configuration file](https://logback.qos.ch/manual/configuration.html) and setting the `audit.logger.config` property accordingly. An example is provided in `sormas-base/setup/audit-logback.xml`. Not specifying a value for the property will effectively disable the audit log.

### Post-Installation Configuration
### Sormas installation

* Optional: Open ``server-setup.sh`` in a text editor to customize the install paths, database access and ports for the server. The default ports are 6080 (HTTP), 6081 (HTTPS) and 6048 (admin). **Important:** Do not change the name of the database user. The pre-defined name is used in the statements executed in the database.
* Set up the database and a Payara domain for SORMAS by executing the setup script: ``sudo -s ./server-setup.sh`` Press enter whenever asked for it
Expand Down
Loading

0 comments on commit aae9f89

Please sign in to comment.