Skip to content

Commit

Permalink
[GITFLOW]merging 'release-1.89.0' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed Sep 28, 2023
2 parents 1c7fe47 + 22a676c commit 71625a6
Show file tree
Hide file tree
Showing 538 changed files with 20,054 additions and 5,442 deletions.
26 changes: 4 additions & 22 deletions docs/EXTERNAL_MESSAGES_ADAPTER.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ A minimal maven project structure for an external message adapter module is show
| | | | |-- MyExternalMessageFacadeEjb.java
| | |-- resources
| | | |-- version.txt
| | |-- webapp
| | | |-- META-INF
| | | | |-- context.xml
| |-- test
| | |-- java
| | | |-- my.project
Expand Down Expand Up @@ -90,14 +87,6 @@ Example:
${project.name} ${project.version}
```

### context.xml
This xml is used to configure the context path of your external message adapter module.
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<Context antiJARLocking="true" path="${myProject.apiRoot}"/>
```

### pom.xml
This is the maven project configuration file.

Expand All @@ -114,7 +103,7 @@ Example with default dependencies for java-ee, sormas-api, logging and testing:

<properties>
<sormas.version>1.85.0</sormas.version>
<myProject.apiRoot>/my-message-adapter</myProject.apiRoot>
<warName>my-message-adapter</warName>

<javaee.version>8.0</javaee.version>
<slf4j.version>1.7.30</slf4j.version>
Expand Down Expand Up @@ -171,7 +160,7 @@ Example with default dependencies for java-ee, sormas-api, logging and testing:

<properties>
<sormas.version>1.85.0</sormas.version>
<myProject.apiRoot>/my-message-adapter</myProject.apiRoot>
<warName>my-message-adapter</warName>

<junit.version>4.13.1</junit.version>
<mockito.version>3.6.0</mockito.version>
Expand Down Expand Up @@ -297,22 +286,15 @@ Example with default dependencies for java-ee, sormas-api, logging and testing:
</resources>

<plugins>
<!-- Provide WebApp context path via value of `myProject.apiRoot` property -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<warName>${warName}</warName>

<filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
<webResources>
<resource>
<directory>src/main/webapp/META-INF</directory>
<includes>
<include>context.xml</include>
</includes>
<targetPath>/META-INF</targetPath>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/webapp</directory>
<targetPath>/</targetPath>
Expand Down
4 changes: 2 additions & 2 deletions docs/SERVER_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ You can check your Java version from the shell/command-line using: ``java -versi

### Postgres Database

* Install PostgreSQL (currently 9.5, 9.6 or 10 to 15) 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 PostgreSQL (currently 14 to 15) 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/14.0/main/postgresql.conf``; ``C:/Program Files/PostgreSQL/14.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.
Expand Down
5 changes: 4 additions & 1 deletion docs/SERVER_UPDATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ DROP EXTENSION IF EXISTS temporal_tables;
Payara is updated from 5.2021.10 to 5.2022.5.
If you are **not** using [SORMAS-Docker](https://github.com/SORMAS-Foundation/SORMAS-Docker), please follow the [Payara migration guide](SERVER_UPDATE.md#how-to-migrate-to-new-payara-server).

### 1.89.0
When installing this version on new systems or upgrading postgres version on Ubuntu make sure you have at least Ubuntu LTS 20 with postgres 14 (or 18 with postgres 12 from APT).

## Automatic Server Update
* Navigate to the folder containing the unzipped deploy files:
``cd /root/deploy/sormas/$(date +%F)``
Expand Down Expand Up @@ -155,4 +158,4 @@ For minor updates of the payara version, you will most often be able to keep the
2. Undeploy all sormas modules from the payara domain and stop the domain.
3. Replace your payara server in ``/opt/payara5`` (default path) with the downloaded one. Remove the default domain in ``opt/payara5/glassfish/domains`` as it is not needed.
4. Replace the application server in your IDE with the new server. See [IDE setup guide](DEVELOPMENT_ENVIRONMENT.md#step-5-install-and-configure-your-ide)
5. If you are facing any problems, restart your IDE and clean all generated files from the sormas domain.
5. If you are facing any problems, restart your IDE and clean all generated files from the sormas domain.
2 changes: 1 addition & 1 deletion sormas-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>de.symeda.sormas</groupId>
<artifactId>sormas-base</artifactId>
<version>1.88.1</version>
<version>1.89.0</version>
<relativePath>../sormas-base</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@

import java.util.List;

import de.symeda.sormas.api.common.progress.ProcessedEntity;

public interface ArchivableFacade {

void archive(String uuid);
ProcessedEntity archive(String uuid);

void dearchive(String uuid);
ProcessedEntity dearchive(String uuid);

List<String> archive(List<String> entityUuid);
List<ProcessedEntity> archive(List<String> entityUuid);

List<String> dearchive(List<String> entityUuids);
List<ProcessedEntity> dearchive(List<String> entityUuids);

boolean isArchived(String uuid);
}
15 changes: 5 additions & 10 deletions sormas-api/src/main/java/de/symeda/sormas/api/CoreFacade.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import java.util.Date;
import java.util.List;

import de.symeda.sormas.api.common.progress.ProcessedEntity;
import de.symeda.sormas.api.deletionconfiguration.DeletionInfoDto;
import de.symeda.sormas.api.externalsurveillancetool.ExternalSurveillanceToolException;
import de.symeda.sormas.api.utils.criteria.BaseCriteria;

public interface CoreFacade<DTO extends EntityDto, INDEX_DTO extends Serializable, REF_DTO extends ReferenceDto, CRITERIA extends BaseCriteria>
Expand All @@ -34,19 +34,14 @@ public interface CoreFacade<DTO extends EntityDto, INDEX_DTO extends Serializabl

DeletionInfoDto getManuallyDeletionInfo(String uuid);

void archive(String entityUuid, Date endOfProcessingDate);
ProcessedEntity archive(String entityUuid, Date endOfProcessingDate);

void archive(List<String> entityUuid);
List<ProcessedEntity> archive(List<String> entityUuid);

void dearchive(List<String> entityUuids, String dearchiveReason);
List<ProcessedEntity> dearchive(List<String> entityUuids, String dearchiveReason);

List<String> getArchivedUuidsSince(Date since);

default void setArchiveInExternalSurveillanceToolForEntity(String uuid, boolean archived) throws ExternalSurveillanceToolException {
}

default void setArchiveInExternalSurveillanceToolForEntities(List<String> uuid, boolean archived) throws ExternalSurveillanceToolException {
}

Date calculateEndOfProcessingDate(String entityUuids);

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
import java.util.List;

import de.symeda.sormas.api.common.DeletionDetails;
import de.symeda.sormas.api.common.progress.ProcessedEntity;

public interface DeletableFacade {

void delete(String uuid, DeletionDetails deletionDetails);

List<String> delete(List<String> uuids, DeletionDetails deletionDetails);
List<ProcessedEntity> delete(List<String> uuids, DeletionDetails deletionDetails);

void restore(String uuid);

List<String> restore(List<String> uuids);
List<ProcessedEntity> restore(List<String> uuids);

boolean isDeleted(String uuid);
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import de.symeda.sormas.api.docgeneneration.QuarantineOrderFacade;
import de.symeda.sormas.api.document.DocumentFacade;
import de.symeda.sormas.api.environment.EnvironmentFacade;
import de.symeda.sormas.api.environment.EnvironmentImportFacade;
import de.symeda.sormas.api.environment.environmentsample.EnvironmentSampleFacade;
import de.symeda.sormas.api.epidata.EpiDataFacade;
import de.symeda.sormas.api.event.EventFacade;
Expand Down Expand Up @@ -509,6 +510,10 @@ public static EnvironmentSampleFacade getEnvironmentSampleFacade() {
return get().lookupEjbRemote(EnvironmentSampleFacade.class);
}

public static EnvironmentImportFacade getEnvironmentImportFacade() {
return get().lookupEjbRemote(EnvironmentImportFacade.class);
}

@SuppressWarnings("unchecked")
public <P> P lookupEjbRemote(Class<P> clazz) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import java.util.List;

import de.symeda.sormas.api.common.progress.ProcessedEntity;

public interface PermanentlyDeletableFacade {

void delete(String uuid);

void delete(List<String> uuids);
List<ProcessedEntity> delete(List<String> uuids);
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import de.symeda.sormas.api.MergeFacade;
import de.symeda.sormas.api.common.DeletionDetails;
import de.symeda.sormas.api.common.Page;
import de.symeda.sormas.api.common.progress.ProcessedEntity;
import de.symeda.sormas.api.contact.ContactReferenceDto;
import de.symeda.sormas.api.event.EventParticipantReferenceDto;
import de.symeda.sormas.api.externaldata.ExternalDataDto;
Expand Down Expand Up @@ -176,7 +177,7 @@ Page<CaseFollowUpDto> getCaseFollowUpIndexPage(

List<String> getUuidsNotShareableWithExternalReportingTools(List<String> caseUuids);

Integer saveBulkCase(
List<ProcessedEntity> saveBulkCase(
List<String> caseUuidList,
@Valid CaseBulkEditData updatedCaseBulkEditData,
boolean diseaseChange,
Expand All @@ -186,7 +187,7 @@ Integer saveBulkCase(
boolean outcomeChange,
boolean surveillanceOfficerChange);

Integer saveBulkEditWithFacilities(
List<ProcessedEntity> saveBulkEditWithFacilities(
List<String> caseUuidList,
@Valid CaseBulkEditData updatedCaseBulkEditData,
boolean diseaseChange,
Expand Down Expand Up @@ -215,11 +216,13 @@ Integer saveBulkEditWithFacilities(

PreviousCaseDto getMostRecentPreviousCase(PersonReferenceDto person, Disease disease, Date startDate);

void archive(String entityUuid, Date endOfProcessingDate, boolean includeContacts);
ProcessedEntity archive(String entityUuid, Date endOfProcessingDate, boolean includeContacts);

void archive(List<String> entityUuids, boolean includeContacts);
List<ProcessedEntity> archive(List<String> entityUuids, boolean includeContacts);

void dearchive(List<String> entityUuids, String dearchiveReason, boolean includeContacts);
ProcessedEntity dearchive(String entityUuid, String dearchiveReason, boolean includeContacts);

List<ProcessedEntity> dearchive(List<String> entityUuids, String dearchiveReason, boolean includeContacts);

void setResultingCase(EventParticipantReferenceDto eventParticipantReferenceDto, CaseReferenceDto caseReferenceDto);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

package de.symeda.sormas.api.common;

public enum CoreEntityType {
public enum DeletableEntityType {

//ENTITY LIST
CASE,
Expand All @@ -25,5 +25,8 @@ public enum CoreEntityType {
IMMUNIZATION,
TRAVEL_ENTRY,
CAMPAIGN,
ENVIRONMENT;
SAMPLE,
PATHOGEN_TEST,
ENVIRONMENT,
ENVIRONMENT_SAMPLE;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package de.symeda.sormas.api.common.progress;

import java.io.Serializable;

import de.symeda.sormas.api.audit.AuditedClass;

@AuditedClass
public class ProcessedEntity implements Serializable {

String entityUuid;

ProcessedEntityStatus processedEntityStatus;

public ProcessedEntity(String entityUuid, ProcessedEntityStatus processedEntityStatus) {
this.entityUuid = entityUuid;
this.processedEntityStatus = processedEntityStatus;
}

public String getEntityUuid() {
return entityUuid;
}

public void setEntityUuid(String entityUuid) {
this.entityUuid = entityUuid;
}

public ProcessedEntityStatus getProcessedEntityStatus() {
return processedEntityStatus;
}

public void setProcessedEntityStatus(ProcessedEntityStatus processedEntityStatus) {
this.processedEntityStatus = processedEntityStatus;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package de.symeda.sormas.api.common.progress;

public enum ProcessedEntityStatus {

SUCCESS,
/**
* The entity does not corresponds to the criterias needed in order to be processed (e.g. Events with Participants can not be deleted)
*/
NOT_ELIGIBLE,
/**
* ExternalSurveillanceToolRuntimeException was thrown during the processing of the entity
*/
EXTERNAL_SURVEILLANCE_FAILURE,
/**
* SormasToSormasRuntimeException was thrown during the processing of the entity
*/
SORMAS_TO_SORMAS_FAILURE,
/**
* AccessDeniedException was thrown during the processing of the entity
*/
ACCESS_DENIED_FAILURE,
/**
* An internal exception was thrown during the processing of the entity
*/
INTERNAL_FAILURE;

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import de.symeda.sormas.api.caze.CaseReferenceDto;
import de.symeda.sormas.api.caze.CoreAndPersonDto;
import de.symeda.sormas.api.common.Page;
import de.symeda.sormas.api.common.progress.ProcessedEntity;
import de.symeda.sormas.api.dashboard.DashboardContactDto;
import de.symeda.sormas.api.externaldata.ExternalDataDto;
import de.symeda.sormas.api.externaldata.ExternalDataUpdateException;
Expand Down Expand Up @@ -146,7 +147,7 @@ List<MergeContactIndexDto[]> getContactsForDuplicateMerging(

void updateExternalData(@Valid List<ExternalDataDto> externalData) throws ExternalDataUpdateException;

Integer saveBulkContacts(
List<ProcessedEntity> saveBulkContacts(
List<String> contactUuidlist,
@Valid ContactBulkEditData updatedContacBulkEditData,
boolean classificationChange,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
import de.symeda.sormas.api.person.SymptomJournalStatus;
import de.symeda.sormas.api.utils.PersonalData;
import de.symeda.sormas.api.utils.pseudonymization.PseudonymizableIndexDto;
import de.symeda.sormas.api.uuid.HasUuid;

public class ContactIndexDto extends PseudonymizableIndexDto implements Serializable, Cloneable {
public class ContactIndexDto extends PseudonymizableIndexDto implements HasUuid, Serializable, Cloneable {

private static final long serialVersionUID = 7511900591141885152L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

import de.symeda.sormas.api.CoreFacade;

import java.util.List;

@Remote
public interface EnvironmentFacade extends CoreFacade<EnvironmentDto, EnvironmentIndexDto, EnvironmentReferenceDto, EnvironmentCriteria> {

List<String> getAllActiveUuids();
}
Loading

0 comments on commit 71625a6

Please sign in to comment.