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

Commit 3d2534f

Browse files
Merge branch 'development' of https://github.com/hzi-braunschweig/SORMAS-Project into development
2 parents 01f7735 + a7cb288 commit 3d2534f

38 files changed

Lines changed: 1369 additions & 49 deletions

SERVER_CUSTOMIZATION.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The following properties are currently configurable:
1919
* **EPID prefix** `country.epidprefix`: SORMAS automatically generates EPID numbers for new cases. This is the prefix your country is using for all of these numbers. Most of the time it will be some sort of country code and should be three characters long.
2020
* **Country center/zoom** `country.center.latitude`, `country.center.longitude` and `map.zoom`: These are the geo coordinates of the geographical center of the country or region you're using SORMAS in. Used to set the initial location of the maps used in dashboards and statistics.
2121
* **App URL** `app.url`: The directory on your server where the mobile .apk file is stored that is used to automatically update the Android app after a new release. You should be able to copy the example given in the properties file and only have to replace the SERVER-NAME placeholder.
22-
* **File paths** `temp.path`, `generated.path` and `custom.path`: The folders that SORMAS stores files in, either temporarily during case export or permanently like import templates. Files in temp.path are automatically deleted at midnight. Files in custom.path can be used to customize the login page, e.g. to provide default logins for demo servers or add additional contributors to the right sidebar.
22+
* **File paths** `documents.path`, `temp.path`, `generated.path` and `custom.path`: The folders that SORMAS stores files in, either temporarily during case export or permanently like import templates or documents. Files in temp.path are automatically deleted at midnight. Files in custom.path can be used to customize the login page, e.g. to provide default logins for demo servers or add additional contributors to the right sidebar.
2323
* **Automatic case classification** `feature.automaticcaseclassification`: Determines whether SORMAS automatically classifies cases based on a number of criteria that are defined in the code.
2424
* **Email settings** `email.sender.address` and `email.sender.name`: The email address and sender name that should be used when SORMAS is sending out emails, e.g. to notify users about specific events.
2525
* **SMS settings** `sms.sender.name, sms.auth.key and sms.auth.secret`: Besides emails, SORMAS also supports sending automatic SMS to users at the same time (e.g. when a case has been classified as confirmed). The SMS provider SORMAS is using is the Vonage SMS API (https://www.vonage.com/communications-apis/sms/). If you have an account there, you can use your key and secret here to enable sending out SMS. Leaving these properties empty will disable this feature.
@@ -87,3 +87,4 @@ The following features are currently configurable:
8787
* **Area Infrastructure** `INFRASTRUCTURE_TYPE_AREA`: Enables an additional infrastructure level above region that is called area by default. Currently only used in the campaigns module.
8888
* **Case Follow-Up** `CASE_FOLLOWUP`: Enables the contact follow-up module for cases as well to allow a more detailed daily documentation of symptoms.
8989
* **Line Listing** `LINE_LISTING`: Whether or not using line listing for case entry is enabled in the specified jurisdiction for the specified disease. Configurable from the UI, no database interaction needed.
90+
* **Documents** `DOCUMENTS`: Enables document storage.

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
/*******************************************************************************
1+
/*
22
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3-
* Copyright © 2016-2018 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4-
*
3+
* Copyright © 2016-2020 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
54
* This program is free software: you can redistribute it and/or modify
65
* it under the terms of the GNU General Public License as published by
76
* the Free Software Foundation, either version 3 of the License, or
87
* (at your option) any later version.
9-
*
108
* This program is distributed in the hope that it will be useful,
119
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1210
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1311
* GNU General Public License for more details.
14-
*
1512
* You should have received a copy of the GNU General Public License
1613
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17-
*******************************************************************************/
14+
*/
1815
package de.symeda.sormas.api;
1916

2017
import javax.ejb.Remote;
@@ -50,6 +47,8 @@ public interface ConfigFacade {
5047

5148
String getSmsAuthSecret();
5249

50+
String getDocumentFilesPath();
51+
5352
String getTempFilesPath();
5453

5554
String getGeneratedFilesPath();

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
/*******************************************************************************
1+
/*
22
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3-
* Copyright © 2016-2018 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4-
*
3+
* Copyright © 2016-2020 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
54
* This program is free software: you can redistribute it and/or modify
65
* it under the terms of the GNU General Public License as published by
76
* the Free Software Foundation, either version 3 of the License, or
87
* (at your option) any later version.
9-
*
108
* This program is distributed in the hope that it will be useful,
119
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1210
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1311
* GNU General Public License for more details.
14-
*
1512
* You should have received a copy of the GNU General Public License
1613
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17-
*******************************************************************************/
14+
*/
1815
package de.symeda.sormas.api;
1916

2017
import javax.naming.InitialContext;
@@ -37,6 +34,7 @@
3734
import de.symeda.sormas.api.disease.DiseaseConfigurationFacade;
3835
import de.symeda.sormas.api.disease.DiseaseFacade;
3936
import de.symeda.sormas.api.docgeneneration.QuarantineOrderFacade;
37+
import de.symeda.sormas.api.document.DocumentFacade;
4038
import de.symeda.sormas.api.epidata.EpiDataFacade;
4139
import de.symeda.sormas.api.event.EventFacade;
4240
import de.symeda.sormas.api.event.EventParticipantFacade;
@@ -314,11 +312,15 @@ public static QuarantineOrderFacade getQuarantineOrderFacade() {
314312
return get().lookupEjbRemote(QuarantineOrderFacade.class);
315313
}
316314

317-
public static ExternalJournalFacade getExternalJournalFacade() {
315+
public static ExternalJournalFacade getExternalJournalFacade() {
318316
return get().lookupEjbRemote(ExternalJournalFacade.class);
319-
}
317+
}
318+
319+
public static DocumentFacade getDocumentFacade() {
320+
return get().lookupEjbRemote(DocumentFacade.class);
321+
}
320322

321-
@SuppressWarnings("unchecked")
323+
@SuppressWarnings("unchecked")
322324
public <P> P lookupEjbRemote(Class<P> clazz) {
323325
try {
324326
return (P) get().ic.lookup(buildJndiLookupName(clazz));
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2020 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
* You should have received a copy of the GNU General Public License
13+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
14+
*/
15+
package de.symeda.sormas.api.document;
16+
17+
import de.symeda.sormas.api.user.UserReferenceDto;
18+
import de.symeda.sormas.api.utils.DataHelper;
19+
import de.symeda.sormas.api.utils.Required;
20+
import de.symeda.sormas.api.utils.pseudonymization.PseudonymizableDto;
21+
22+
public class DocumentDto extends PseudonymizableDto {
23+
24+
public static final String UPLOADING_USER = "uploadingUser";
25+
public static final String NAME = "name";
26+
public static final String CONTENT_TYPE = "contentType";
27+
public static final String SIZE = "size";
28+
public static final String RELATED_ENTITY_UUID = "relatedEntityUuid";
29+
public static final String RELATED_ENTITY_CLASS = "relatedEntityClass";
30+
31+
@Required
32+
private UserReferenceDto uploadingUser;
33+
@Required
34+
private String name;
35+
@Required
36+
private String mimeType;
37+
@Required
38+
private long size;
39+
@Required
40+
private String relatedEntityUuid;
41+
@Required
42+
private DocumentRelatedEntityType relatedEntityType;
43+
44+
public static DocumentDto build() {
45+
DocumentDto document = new DocumentDto();
46+
document.setUuid(DataHelper.createUuid());
47+
48+
return document;
49+
}
50+
51+
public UserReferenceDto getUploadingUser() {
52+
return uploadingUser;
53+
}
54+
55+
public void setUploadingUser(UserReferenceDto uploadingUser) {
56+
this.uploadingUser = uploadingUser;
57+
}
58+
59+
public String getName() {
60+
return name;
61+
}
62+
63+
public void setName(String name) {
64+
this.name = name;
65+
}
66+
67+
public String getMimeType() {
68+
return mimeType;
69+
}
70+
71+
public void setMimeType(String mimeType) {
72+
this.mimeType = mimeType;
73+
}
74+
75+
public long getSize() {
76+
return size;
77+
}
78+
79+
public void setSize(long size) {
80+
this.size = size;
81+
}
82+
83+
public String getRelatedEntityUuid() {
84+
return relatedEntityUuid;
85+
}
86+
87+
public void setRelatedEntityUuid(String relatedEntityUuid) {
88+
this.relatedEntityUuid = relatedEntityUuid;
89+
}
90+
91+
public DocumentRelatedEntityType getRelatedEntityType() {
92+
return relatedEntityType;
93+
}
94+
95+
public void setRelatedEntityType(DocumentRelatedEntityType relatedEntityType) {
96+
this.relatedEntityType = relatedEntityType;
97+
}
98+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2020 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
* You should have received a copy of the GNU General Public License
13+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
14+
*/
15+
package de.symeda.sormas.api.document;
16+
17+
import java.io.IOException;
18+
import java.util.List;
19+
20+
import javax.ejb.Remote;
21+
22+
@Remote
23+
public interface DocumentFacade {
24+
25+
DocumentDto getDocumentByUuid(String uuid);
26+
27+
DocumentDto saveDocument(DocumentDto dto, byte[] bytes) throws IOException;
28+
29+
void deleteDocument(String uuid);
30+
31+
List<DocumentDto> getDocumentsRelatedToEntity(DocumentRelatedEntityType type, String uuid);
32+
33+
String isExistingDocument(DocumentRelatedEntityType type, String uuid, String name);
34+
35+
byte[] read(String uuid) throws IOException;
36+
37+
void cleanupDeletedDocuments();
38+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2020 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
* You should have received a copy of the GNU General Public License
13+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
14+
*/
15+
package de.symeda.sormas.api.document;
16+
17+
import de.symeda.sormas.api.i18n.I18nProperties;
18+
19+
public enum DocumentRelatedEntityType {
20+
21+
EVENT;
22+
23+
public String toString() {
24+
return I18nProperties.getEnumCaption(this);
25+
}
26+
}

sormas-api/src/main/java/de/symeda/sormas/api/feature/FeatureType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ public enum FeatureType {
3535
INFRASTRUCTURE_TYPE_AREA(true, false, null),
3636
CASE_FOLLOWUP(true, false, null),
3737
TASK_NOTIFICATIONS(true, true, null),
38-
OTHER_NOTIFICATIONS(true, true, null);
38+
OTHER_NOTIFICATIONS(true, true, null),
39+
DOCUMENTS(true, false, null);
3940

4041
/**
4142
* Server feature means that the feature only needs to be configured once per server since they define the way the system

sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ public interface Captions {
716716
String districtAllDistricts = "districtAllDistricts";
717717
String districtArchivedDistricts = "districtArchivedDistricts";
718718
String districtName = "districtName";
719+
String documentNoDocuments = "documentNoDocuments";
719720
String DocumentTemplate = "DocumentTemplate";
720721
String DocumentTemplate_documentTemplateGuide = "DocumentTemplate.documentTemplateGuide";
721722
String DocumentTemplate_exampleTemplateLibreOffice = "DocumentTemplate.exampleTemplateLibreOffice";
@@ -725,6 +726,7 @@ public interface Captions {
725726
String DocumentTemplate_QuarantineOrder_create = "DocumentTemplate.QuarantineOrder.create";
726727
String DocumentTemplate_QuarantineOrder_templates = "DocumentTemplate.QuarantineOrder.templates";
727728
String DocumentTemplate_uploadTemplate = "DocumentTemplate.uploadTemplate";
729+
String documentUploadDocument = "documentUploadDocument";
728730
String EpiData = "EpiData";
729731
String EpiData_animalCondition = "EpiData.animalCondition";
730732
String EpiData_animalVaccinationStatus = "EpiData.animalVaccinationStatus";

sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ public interface Strings {
143143
String entityContacts = "entityContacts";
144144
String entityDistrict = "entityDistrict";
145145
String entityDistricts = "entityDistricts";
146+
String entityDocuments = "entityDocuments";
146147
String entityEvent = "entityEvent";
147148
String entityEventParticipant = "entityEventParticipant";
148149
String entityEvents = "entityEvents";
@@ -165,6 +166,7 @@ public interface Strings {
165166
String errorCampaignDiagramTotalsCalculationError = "errorCampaignDiagramTotalsCalculationError";
166167
String errorCaseDuplicateDeletion = "errorCaseDuplicateDeletion";
167168
String errorCaseMerging = "errorCaseMerging";
169+
String errorDeletingDocument = "errorDeletingDocument";
168170
String errorDeletingDocumentTemplate = "errorDeletingDocumentTemplate";
169171
String errorDocumentGeneration = "errorDocumentGeneration";
170172
String errorEntityOutdated = "errorEntityOutdated";
@@ -179,6 +181,7 @@ public interface Strings {
179181
String errorProblemOccurred = "errorProblemOccurred";
180182
String errorProcessingTemplate = "errorProcessingTemplate";
181183
String errorQuarantineOnlyCaseAndContacts = "errorQuarantineOnlyCaseAndContacts";
184+
String errorReadingDocument = "errorReadingDocument";
182185
String errorReadingTemplate = "errorReadingTemplate";
183186
String errorSetFeverRequired = "errorSetFeverRequired";
184187
String errorSormasToSormasCertNotGenerated = "errorSormasToSormasCertNotGenerated";
@@ -663,6 +666,7 @@ public interface Strings {
663666
String messageNoContactsSelected = "messageNoContactsSelected";
664667
String messageNoCsvFile = "messageNoCsvFile";
665668
String messageNoDocumentTemplateUploadFile = "messageNoDocumentTemplateUploadFile";
669+
String messageNoDocumentUploadFile = "messageNoDocumentUploadFile";
666670
String messageNoEndDate = "messageNoEndDate";
667671
String messageNoEventFound = "messageNoEventFound";
668672
String messageNoEventParticipantsSelected = "messageNoEventParticipantsSelected";

sormas-api/src/main/resources/captions.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,10 @@ EpiData.visitedAnimalMarket=Visited live animal market within the incubation per
858858
EpiData.camels=Camels
859859
EpiData.snakes=Snakes
860860

861+
# Documents
862+
documentUploadDocument=New document
863+
documentNoDocuments=There are no documents for this %s
864+
861865
# DocumentTemplate
862866
DocumentTemplate=Document Template
863867
DocumentTemplate.documentTemplateGuide=Document Template Guide

0 commit comments

Comments
 (0)