Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 80f273e

Browse files
Merge remote-tracking branch 'origin/feature-3488-LabMessage_UI' into feature-3488-LabMessage_UI
# Conflicts: # sormas-backend/src/main/resources/sql/sormas_schema.sql
2 parents 22f7bd1 + 7240023 commit 80f273e

385 files changed

Lines changed: 8060 additions & 3267 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will build a Java project with Maven
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: Java CI with Maven
5+
6+
env:
7+
java: 11
8+
9+
on:
10+
push:
11+
branches: [ development, master ]
12+
pull_request:
13+
branches: [ development ]
14+
15+
jobs:
16+
test:
17+
name: mvn verify
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v2
23+
24+
- name: Set up JDK ${{ env.java }}
25+
uses: actions/setup-java@v1
26+
with:
27+
java-version: ${{ env.java }}
28+
29+
- name: Cache Maven packages
30+
# FIXME(@JonasCir) #3733 remove '**/*.pom' once serverlib pom is renamed
31+
uses: actions/cache@v2
32+
with:
33+
path: ~/.m2
34+
key: ${{ runner.os }}-java-${{ env.java }}-m2-${{ hashFiles('**/pom.xml', '**/*.pom') }}
35+
restore-keys: ${{ runner.os }}-java-${{ env.java }}-m2
36+
37+
- name: Run mvn verify
38+
# FIXME(@JonasCir) see https://github.com/hzi-braunschweig/SORMAS-Project/issues/3730#issuecomment-745165678
39+
working-directory: ./sormas-base
40+
run: mvn verify -B -ntp

.travis.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

DEVELOPMENT_ENVIRONMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
- **Windows**: For testing and development environments we suggest to download and run the installer of the Java 11 **JDK** for 32 or 64 bit client systems (depending on your system).
2323

2424
## Eclipse
25-
- Install the latest Eclipse version
25+
- Install the latest Eclipse version, best fit is [Eclipse IDE for Enterprise Java Developers](https://www.eclipse.org/downloads/packages).
2626
- Set the default JRE of Eclipse to the installed Zulu Java SDK: [Assigning the default JRE for the workbench ](https://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-assign_default_jre.htm)
2727
- Clone the SORMAS-Open repository and import the projects to Eclipse
2828
- If you're using Eclipse to clone, choose "File -> Import -> Git -> Projects from Git" and continue until you're asked to create a new project from the cloned repository; click cancel instead and use "File -> Import -> Maven -> Existing Maven Projects" to import the separate projects into your workspace

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/>
88
</a>
99
<br/>
10-
<a href="https://github.com/hzi-braunschweig/SORMAS-Project/blob/development/LICENSE"><img alt="License" src="https://img.shields.io/badge/license-GPL%20v3-blue"/></a> <a href="https://github.com/hzi-braunschweig/SORMAS-Project/releases/latest"><img alt="Latest Release" src="https://img.shields.io/github/v/release/hzi-braunschweig/SORMAS-Project"/></a> <img alt="Development Build Status" src="https://travis-ci.com/hzi-braunschweig/SORMAS-Project.svg?branch=development"/> <a href="https://gitter.im/SORMAS-Project"><img alt="Gitter" src="https://badges.gitter.im/SORMAS-Project/dev-support.svg"/></a>
10+
<a href="https://github.com/hzi-braunschweig/SORMAS-Project/blob/development/LICENSE"><img alt="License" src="https://img.shields.io/badge/license-GPL%20v3-blue"/></a> <a href="https://github.com/hzi-braunschweig/SORMAS-Project/releases/latest"><img alt="Latest Release" src="https://img.shields.io/github/v/release/hzi-braunschweig/SORMAS-Project"/></a> <img alt="Development Build Status" src="https://github.com/hzi-braunschweig/SORMAS-Project/workflows/Java%20CI%20with%20Maven/badge.svg?branch=development"/> <a href="https://gitter.im/SORMAS-Project"><img alt="Gitter" src="https://badges.gitter.im/SORMAS-Project/dev-support.svg"/></a>
1111
</p>
1212
<br/>
1313

SERVER_CUSTOMIZATION.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ The following properties are currently configurable:
3030
* **Archiving thresholds** `daysAfterCaseGetsArchived` and `daysAfterEventGetsArchived`: The number of days without any changes after which cases/events are automatically archived (i.e. they will no longer be displayed in the normal directories, but still count towards statistics or counts on the dashboard and can still be viewed by users with the respective user right). If set to 0, automatic archiving is disabled.
3131
* **Rscript executable** `rscript.executable`: The location of the Rscript executable. If you've installed Rscript on your server and specify the path here (the default should work for Linux systems as long as you've used the default install path), network diagrams for transmission chains will be shown in the web app.
3232
* **Symptom journal interface**: Properties used to connect to an external symptom journal service. `interface.symptomjournal.url` is the URL to the website that SORMAS should connect to; `interface.symptomjournal.authurl` is the URL used to authenticate SORMAS at the external service; `interface.symptomjournal.clientid` and `interface.symptomjournal.secret` are the credentials used for the authentication process. A default user can be created automatically at startup by using `interface.symptomjournal.defaultuser.username` and `interface.symptomjournal.defaultuser.password`. This user can be used by the Symptom Journal system to connect to SORMAS.
33-
* **Patient diary interface** Properties used to connect to an external patient diary service. `interface.patientdiary.url` is the URL to the website that SORMAS should connect to; `interface.patientdiary.externaldataurl` is the URL to the website that SORMAS can send notifications; `interface.patientdiary.authurl` is the URL trough which SORMAS can obtain an authorization to the external patient diary; `interface.patientdiary.email` and `interface.patientdiary.password` are the credentials used by SORMAS to authenticate in the external patient diary; A default user can be created automatically at startup by using `interface.patientdiary.defaultuser.username` and `interface.patientdiary.defaultuser.password`. This user can be used by the Patient Diary system to connect to SORMAS.
33+
* **Patient diary interface** Properties used to connect to an external patient diary service. `interface.patientdiary.url` is the URL to the website that SORMAS should connect to; `interface.patientdiary.probandsurl` is the URL to the website that SORMAS can send notifications; `interface.patientdiary.authurl` is the URL trough which SORMAS can obtain an authorization to the external patient diary; `interface.patientdiary.email` and `interface.patientdiary.password` are the credentials used by SORMAS to authenticate in the external patient diary; A default user can be created automatically at startup by using `interface.patientdiary.defaultuser.username` and `interface.patientdiary.defaultuser.password`. This user can be used by the Patient Diary system to connect to SORMAS.
3434
* **Custom branding**: Properties used to apply a custom branding to SORMAS that overrides its name and default logo. Using these properties also alters the sidebar and adds another customizable area to it. If you want to use this feature, set `custombranding` to true. `custombranding.name` is the name that you want to use, `custombranding.logo.path` is the path to the logo that should be used.
3535
* **Geocoding** Properties used to integrate an external geocoding service for obtaining the geo coordinates of addresses.
36-
*geocodingServiceUrlTemplate* is the url for searching for address details, *${street}*, *${houseNumber}*, *${postalCode}*, and *${city}* placeholders will be replaced with the actual address fields when searching;
37-
*geocodingLongitudeJsonPath* and *geocodingLatitudeJsonPath* are used to obtain the longitude and latitude of the address in the result of the geocoding service request
38-
36+
* `geocodingServiceUrlTemplate` is the url for searching for address details, `${street}`, `${houseNumber}`, `${postalCode}`, and `${city}` placeholders will be replaced with the actual address fields when searching;
37+
* `geocodingLongitudeJsonPath` and `geocodingLatitudeJsonPath` are used to obtain the longitude and latitude of the address in the result of the geocoding service request
38+
* **Authentication Provider**: Allows the user to choose the way of authentication for SORMAS and all it's third party clients. Supported values `SORMAS` (default) and `KEYCLOAK`
3939
## Importing Infrastructure Data
4040
When you start a SORMAS server for the first time, some default infrastructure data is generated to ensure that the server is usable and the default users can be created. It is recommended (and, unless you're working on a demo server, necessary) to archive this default data and import the official infrastructure data of the country or part of the country that you intend to use SORMAS in instead.
4141

SERVER_SETUP.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@
7575

7676
## Keycloak Server
7777

78-
By default Keycloak is run as a Docker container, which can be set up in two ways:
79-
* As a Docker container
80-
* As a Standalone installation
78+
Keycloak can be set up in two ways:
79+
* as a Docker container (for just using Keycloak approach)
80+
* as a Standalone installation (for doing development in Keycloak like themes, SPIs)
8181

8282
### Keycloak as a Docker container
8383
*To be done only in the situation when SORMAS is already installed on the machine as a standalone installation.*
@@ -88,7 +88,7 @@ By default Keycloak is run as a Docker container, which can be set up in two way
8888
* SORMAS Server is installed
8989
* PostgreSQL is installed
9090
* Docker is installed
91-
* Open and edit [keycloak-setup.sh](sormas-base/setup/keycloak/keycloak-setup.sh) with your system's actual values
91+
* Open and edit [keycloak-setup.sh](sormas-base/setup/keycloak/keycloak-setup.sh) with your system's actual values *(on Windows use Git Bash)*.
9292

9393
**Setup**
9494
* Run [keycloak-setup.sh](sormas-base/setup/keycloak/keycloak-setup.sh)
@@ -105,8 +105,10 @@ By default Keycloak is run as a Docker container, which can be set up in two way
105105

106106
Setting Keycloak up as a standalone installation [Server Installation and Configuration Guide](https://www.keycloak.org/docs/11.0/server_installation/#installation)
107107
* Make sure to configure Keycloak with PostgreSQL Database [Relational Database Setup](https://www.keycloak.org/docs/11.0/server_installation/#_database)
108-
* Setup an Admin User
108+
* Set up an Admin User
109109
* Copy the `themes` folder content to `${KEYCLOAK_HOME}/themes` [Deploying Themes](https://www.keycloak.org/docs/11.0/server_development/#deploying-themes)
110+
* Deploy the `sormas-keycloak-service-provider` [Using Keycloak Deployer](https://www.keycloak.org/docs/11.0/server_development/#using-the-keycloak-deployer)
111+
* Update the [SORMAS.json](sormas-base/setup/keycloak/SORMAS.json) file by replacing the following placeholders: `${SORMAS_SERVER_URL}`, `${KEYCLOAK_SORMAS_UI_SECRET}`, `${KEYCLOAK_SORMAS_BACKEND_SECRET}`, `${KEYCLOAK_SORMAS_REST_SECRET}`
110112
* Create the SORMAS Realm by importing [SORMAS.json](sormas-base/setup/keycloak/SORMAS.json) see [Create a New Realm](https://www.keycloak.org/docs/11.0/server_admin/#_create-realm)
111113
* Update the `sormas-*` clients by generating new secrets for them
112114
* Update the realm's email settings to allow sending emails to users
@@ -124,11 +126,20 @@ where:
124126
* `${ASADMIN}` - represents the location to `${PAYARA_HOME}\bin\asadmin`
125127
* `${KEYCLOAK_PORT}` - the port on which keycloak will run
126128
* `${KEYCLOAK_SORMAS_UI_SECRET}` - is the secret generated in Keycloak for the `sormas-ui` client
127-
* `${KEYCLOAK_SORMAS_REST_SECRET}` - is the secret generated in Keycloack for the `sormas-rest` client
128-
* `${KEYCLOAK_SORMAS_BACKEND_SECRET}` - is the secret generated in Keycloack for the `sormas-backend` client
129+
* `${KEYCLOAK_SORMAS_REST_SECRET}` - is the secret generated in Keycloak for the `sormas-rest` client
130+
* `${KEYCLOAK_SORMAS_BACKEND_SECRET}` - is the secret generated in Keycloak for the `sormas-backend` client
129131

130132
Then update `sormas.properties` file in the SORMAS domain with the property `authentication.provider=KEYCLOAK`
131133

134+
### Connect Keycloak to an already running instance of SORMAS
135+
136+
*after setting up Keycloak as one of the described options above*
137+
138+
In case Keycloak is set up alongside an already running instance of SORMAS, these are the steps to follow to make sure already existing users can access the system:
139+
1. Manually create an admin user in Keycloak for the SORMAS realm [Creating a user](https://www.keycloak.org/docs/11.0/getting_started/index.html#creating-a-user) *(username has to be the same as admin's username in SORMAS)*
140+
2. Login to SORMAS and trigger the **Sync Users** button from the **Users** page
141+
3. This will sync users to Keycloak keeping their original password - see [SORMAS Keycloak Service Provider](sormas-keycloak-service-provider/README.md) for more information about this
142+
132143
## Web Server Setup
133144

134145
### Apache Web Server

sormas-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<parent>
33
<groupId>de.symeda.sormas</groupId>
44
<artifactId>sormas-base</artifactId>
5-
<version>1.53.0-SNAPSHOT</version>
5+
<version>1.54.0-SNAPSHOT</version>
66
<relativePath>../sormas-base</relativePath>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>

sormas-api/src/main/java/de/symeda/sormas/api/AuthProvider.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ public class AuthProvider {
3939

4040
private final boolean isUsernameCaseSensitive;
4141

42-
private final boolean isEmailRequired;
43-
4442
private final boolean isDefaultProvider;
4543

44+
private final boolean isUserSyncSupported;
45+
4646
private AuthProvider() {
4747
String configuredProvider = FacadeProvider.getConfigFacade().getAuthenticationProvider();
4848
isUsernameCaseSensitive = SORMAS.equalsIgnoreCase(configuredProvider);
49-
isEmailRequired = KEYCLOAK.equalsIgnoreCase(configuredProvider);
5049
isDefaultProvider = SORMAS.equalsIgnoreCase(configuredProvider);
50+
isUserSyncSupported = KEYCLOAK.equalsIgnoreCase(configuredProvider);
5151
}
5252

5353
public static AuthProvider getProvider() {
@@ -69,16 +69,17 @@ public boolean isUsernameCaseSensitive() {
6969
}
7070

7171
/**
72-
* Authentication Provider requires emails to be required or optional.
72+
* Current Authentication Provider is the SORMAS default one.
7373
*/
74-
public boolean isEmailRequired() {
75-
return isEmailRequired;
74+
public boolean isDefaultProvider() {
75+
return isDefaultProvider;
7676
}
7777

7878
/**
79-
* Current Authentication Provider is the SORMAS default one.
79+
* Authentication Provider enables users to be synced from the default provider.
8080
*/
81-
public boolean isDefaultProvider() {
82-
return isDefaultProvider;
81+
public boolean isUserSyncSupported() {
82+
return isUserSyncSupported;
8383
}
84+
8485
}

sormas-api/src/main/java/de/symeda/sormas/api/action/ActionFacade.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import javax.ejb.Remote;
2424

25+
import de.symeda.sormas.api.event.EventActionExportDto;
2526
import de.symeda.sormas.api.event.EventActionIndexDto;
2627
import de.symeda.sormas.api.event.EventCriteria;
2728
import de.symeda.sormas.api.utils.SortProperty;
@@ -47,5 +48,7 @@ public interface ActionFacade {
4748

4849
List<EventActionIndexDto> getEventActionList(EventCriteria criteria, Integer first, Integer max, List<SortProperty> sortProperties);
4950

51+
List<EventActionExportDto> getEventActionExportList(EventCriteria criteria, Integer first, Integer max);
52+
5053
long countEventAction(EventCriteria criteria);
5154
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package de.symeda.sormas.api.campaign;
2+
3+
import de.symeda.sormas.api.i18n.I18nProperties;
4+
import de.symeda.sormas.api.user.JurisdictionLevel;
5+
6+
public enum CampaignJurisdictionLevel {
7+
8+
AREA,
9+
REGION,
10+
DISTRICT,
11+
COMMUNITY;
12+
13+
public static CampaignJurisdictionLevel getByJurisdictionLevel(JurisdictionLevel jurisdictionLevel) {
14+
switch (jurisdictionLevel) {
15+
16+
case NATION:
17+
case NONE:
18+
return AREA;
19+
case REGION:
20+
return REGION;
21+
case DISTRICT:
22+
return DISTRICT;
23+
case COMMUNITY:
24+
return COMMUNITY;
25+
default:
26+
throw new UnsupportedOperationException();
27+
}
28+
}
29+
30+
public String toString() {
31+
return I18nProperties.getEnumCaption(this);
32+
}
33+
}

0 commit comments

Comments
 (0)