Skip to content

Commit 1596dd6

Browse files
authored
Merge pull request #13313 from SORMAS-Foundation/feature-13296_create_systemconfiguration_table_admin_ui
Feature 13296 create systemconfiguration table admin UI
2 parents b354d42 + 12d268a commit 1596dd6

File tree

58 files changed

+4551
-4
lines changed

Some content is hidden

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

58 files changed

+4551
-4
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@
106106
import de.symeda.sormas.api.survey.SurveyFacade;
107107
import de.symeda.sormas.api.survey.SurveyTokenFacade;
108108
import de.symeda.sormas.api.symptoms.SymptomsFacade;
109+
import de.symeda.sormas.api.systemconfiguration.SystemConfigurationCategoryFacade;
110+
import de.symeda.sormas.api.systemconfiguration.SystemConfigurationValueFacade;
109111
import de.symeda.sormas.api.systemevents.SystemEventFacade;
110112
import de.symeda.sormas.api.systemevents.sync.SyncFacade;
111113
import de.symeda.sormas.api.task.TaskFacade;
@@ -564,6 +566,14 @@ public static SurveyTokenFacade getSurveyTokenFacade() {
564566
return get().lookupEjbRemote(SurveyTokenFacade.class);
565567
}
566568

569+
public static SystemConfigurationValueFacade getSystemConfigurationValueFacade() {
570+
return get().lookupEjbRemote(SystemConfigurationValueFacade.class);
571+
}
572+
573+
public static SystemConfigurationCategoryFacade getSystemConfigurationCategoryFacade() {
574+
return get().lookupEjbRemote(SystemConfigurationCategoryFacade.class);
575+
}
576+
567577
@SuppressWarnings("unchecked")
568578
public <P> P lookupEjbRemote(Class<P> clazz) {
569579
try {

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,6 +2938,13 @@ public interface Captions {
29382938
String syncSuccessful = "syncSuccessful";
29392939
String syncUsers = "syncUsers";
29402940
String system = "system";
2941+
String SystemConfigurationValue_category = "SystemConfigurationValue.category";
2942+
String SystemConfigurationValue_categoryName = "SystemConfigurationValue.categoryName";
2943+
String SystemConfigurationValue_encrytp = "SystemConfigurationValue.encrytp";
2944+
String SystemConfigurationValue_General = "SystemConfigurationValue.General";
2945+
String SystemConfigurationValue_key = "SystemConfigurationValue.key";
2946+
String SystemConfigurationValue_pattern = "SystemConfigurationValue.pattern";
2947+
String SystemConfigurationValue_value = "SystemConfigurationValue.value";
29412948
String Task = "Task";
29422949
String Task_assignedByUser = "Task.assignedByUser";
29432950
String Task_assigneeReply = "Task.assigneeReply";
@@ -3250,6 +3257,8 @@ public interface Captions {
32503257
String View_configuration_regions_short = "View.configuration.regions.short";
32513258
String View_configuration_subcontinents = "View.configuration.subcontinents";
32523259
String View_configuration_subcontinents_short = "View.configuration.subcontinents.short";
3260+
String View_configuration_systemConfiguration = "View.configuration.systemConfiguration";
3261+
String View_configuration_systemConfiguration_short = "View.configuration.systemConfiguration.short";
32533262
String View_configuration_templates = "View.configuration.templates";
32543263
String View_configuration_templates_short = "View.configuration.templates.short";
32553264
String View_configuration_userrights = "View.configuration.userrights";

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,6 +1577,7 @@ public interface Strings {
15771577
String messageSymptomsHint = "messageSymptomsHint";
15781578
String messageSymptomsVisitHint = "messageSymptomsVisitHint";
15791579
String messageSyncUsersFromAuthProviderConfigurationError = "messageSyncUsersFromAuthProviderConfigurationError";
1580+
String messageSystemConfigurationValueSaved = "messageSystemConfigurationValueSaved";
15801581
String messageSystemFollowUpCanceled = "messageSystemFollowUpCanceled";
15811582
String messageSystemFollowUpCanceledByDropping = "messageSystemFollowUpCanceledByDropping";
15821583
String messageTaskArchived = "messageTaskArchived";
@@ -1833,6 +1834,7 @@ public interface Strings {
18331834
String promptSurveyFreeTextSearch = "promptSurveyFreeTextSearch";
18341835
String promptSurveyResponseStatus = "promptSurveyResponseStatus";
18351836
String promptSurveyTokenFreeTextSearch = "promptSurveyTokenFreeTextSearch";
1837+
String promptSystemConfigurationSearchField = "promptSystemConfigurationSearchField";
18361838
String promptTaskDateFrom = "promptTaskDateFrom";
18371839
String promptTaskDateTo = "promptTaskDateTo";
18381840
String promptTaskDateType = "promptTaskDateType";

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,14 @@ public interface Validations {
266266
String statisticsIncidenceOnlyNumbersAllowed = "statisticsIncidenceOnlyNumbersAllowed";
267267
String surveyDocumentTemplateMissingTokenVariable = "surveyDocumentTemplateMissingTokenVariable";
268268
String surveyOnlyCasesSupported = "surveyOnlyCasesSupported";
269+
String systemConfigurationValueInvalidKey = "systemConfigurationValueInvalidKey";
270+
String systemConfigurationValueInvalidValue = "systemConfigurationValueInvalidValue";
271+
String systemConfigurationValuePatternNotMatched = "systemConfigurationValuePatternNotMatched";
272+
String systemConfigurationValueValidationNotADirectory = "systemConfigurationValueValidationNotADirectory";
273+
String systemConfigurationValueValidationNotAFile = "systemConfigurationValueValidationNotAFile";
274+
String systemConfigurationValueValidationNotAIPAddr = "systemConfigurationValueValidationNotAIPAddr";
275+
String systemConfigurationValueValidationNotANumber = "systemConfigurationValueValidationNotANumber";
276+
String systemConfigurationValueValidationNotValid = "systemConfigurationValueValidationNotValid";
269277
String taskMissingCaseLink = "taskMissingCaseLink";
270278
String taskMissingContactLink = "taskMissingContactLink";
271279
String taskMissingEventLink = "taskMissingEventLink";

sormas-api/src/main/java/de/symeda/sormas/api/importexport/DatabaseTable.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ public enum DatabaseTable {
153153
FeatureType.CASE_FOLLOWUP)),
154154
FEATURE_CONFIGURATIONS(DatabaseTableType.CONFIGURATION, "feature_configurations", null),
155155
DISEASE_CONFIGURATIONS(DatabaseTableType.CONFIGURATION, "disease_configurations", null),
156-
DELETION_CONFIGURATIONS(DatabaseTableType.CONFIGURATION, "deletion_configurations", null);
156+
DELETION_CONFIGURATIONS(DatabaseTableType.CONFIGURATION, "deletion_configurations", null),
157+
158+
SYSTEM_CONFIGURATION_VALUES(DatabaseTableType.CONFIGURATION, "system_configuration_values", null),
159+
SYSTEM_CONFIGURATION_CATEGORIES(DatabaseTableType.CONFIGURATION, "system_configuration_categories", null);
157160

158161
private static BiFunction<List<FeatureConfigurationDto>, ConfigFacade, Boolean> dependingOnFeature(FeatureType... featureTypes) {
159162
return (featureConfigurations, configFacade) -> featureConfigurations.stream()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2026 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+
16+
package de.symeda.sormas.api.systemconfiguration;
17+
18+
import de.symeda.sormas.api.utils.criteria.BaseCriteria;
19+
20+
public class SystemConfigurationCategoryCriteria extends BaseCriteria {
21+
22+
private String freeTextFilter;
23+
24+
public String getFreeTextFilter() {
25+
return freeTextFilter;
26+
}
27+
28+
public SystemConfigurationCategoryCriteria freeTextFilter(String freeTextFilter) {
29+
this.freeTextFilter = freeTextFilter;
30+
return this;
31+
}
32+
}
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2026 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+
16+
package de.symeda.sormas.api.systemconfiguration;
17+
18+
import javax.validation.constraints.NotNull;
19+
import javax.validation.constraints.Size;
20+
21+
import de.symeda.sormas.api.EntityDto;
22+
import de.symeda.sormas.api.i18n.I18nProperties;
23+
import de.symeda.sormas.api.i18n.Validations;
24+
import de.symeda.sormas.api.utils.DataHelper;
25+
import de.symeda.sormas.api.utils.FieldConstraints;
26+
27+
/**
28+
* Data Transfer Object for System Configuration Category.
29+
* This class represents a category in the system configuration.
30+
*/
31+
public class SystemConfigurationCategoryDto extends EntityDto {
32+
33+
private static final long serialVersionUID = 1L;
34+
35+
public static final String I18N_PREFIX = "SystemConfigurationCategory";
36+
37+
public static final String NAME_PROPERTY_NAME = "name";
38+
public static final String DESCRIPTION_PROPERTY_NAME = "description";
39+
public static final String CAPTION_PROPERTY_NAME = "caption";
40+
41+
public static SystemConfigurationCategoryDto build() {
42+
final SystemConfigurationCategoryDto systemConfigurationCategory = new SystemConfigurationCategoryDto();
43+
systemConfigurationCategory.setUuid(DataHelper.createUuid());
44+
return systemConfigurationCategory;
45+
}
46+
47+
@NotNull(message = Validations.required)
48+
@Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong)
49+
private String name;
50+
51+
@Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong)
52+
private String description;
53+
54+
@Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong)
55+
private String caption;
56+
57+
/**
58+
* Default constructor.
59+
*/
60+
public SystemConfigurationCategoryDto() {
61+
// Default constructor
62+
}
63+
64+
/**
65+
* Constructor to initialize the fields.
66+
*
67+
* @param name the name of the system configuration category.
68+
* @param description the description of the system configuration category.
69+
* @param caption the caption of the system configuration category.
70+
*/
71+
public SystemConfigurationCategoryDto(String name, String description, String caption) {
72+
this.name = name;
73+
this.description = description;
74+
this.caption = caption;
75+
}
76+
77+
/**
78+
* Gets the name of the system configuration category.
79+
*
80+
* @return the name of the system configuration category.
81+
*/
82+
public String getName() {
83+
return name;
84+
}
85+
86+
/**
87+
* Sets the name of the system configuration category.
88+
*
89+
* @param name
90+
* the name to set.
91+
*/
92+
public void setName(String name) {
93+
this.name = name;
94+
}
95+
96+
/**
97+
* Gets the description of the system configuration category.
98+
*
99+
* @return the description of the system configuration category.
100+
*/
101+
public String getDescription() {
102+
return description;
103+
}
104+
105+
/**
106+
* Sets the description of the system configuration category.
107+
*
108+
* @param description
109+
* the description to set.
110+
*/
111+
public void setDescription(String description) {
112+
this.description = description;
113+
}
114+
115+
/**
116+
* Gets the caption of the system configuration category.
117+
*
118+
* @return the caption of the system configuration category.
119+
*/
120+
public String getCaption() {
121+
return caption;
122+
}
123+
124+
/**
125+
* Sets the caption of the system configuration category.
126+
*
127+
* @param caption
128+
* the caption to set.
129+
*/
130+
public void setCaption(String caption) {
131+
this.caption = caption;
132+
}
133+
134+
/**
135+
* Returns a string representation of the object.
136+
*
137+
* @return a string representation of the object.
138+
*/
139+
@Override
140+
public String toString() {
141+
return I18nProperties.getPrefixCaption(SystemConfigurationCategoryDto.I18N_PREFIX, this.getName(), this.getCaption());
142+
}
143+
144+
/**
145+
* Indicates whether some other object is "equal to" this one.
146+
*
147+
* @param o
148+
* the reference object with which to compare.
149+
* @return true if this object is the same as the obj argument; false otherwise.
150+
*/
151+
@Override
152+
public boolean equals(Object o) {
153+
return super.equals(o);
154+
}
155+
156+
/**
157+
* Returns a hash code value for the object.
158+
*
159+
* @return a hash code value for this object.
160+
*/
161+
@Override
162+
public int hashCode() {
163+
return super.hashCode();
164+
}
165+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2026 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+
16+
package de.symeda.sormas.api.systemconfiguration;
17+
18+
import java.util.List;
19+
20+
import javax.ejb.Remote;
21+
22+
import de.symeda.sormas.api.BaseFacade;
23+
24+
/**
25+
* Facade interface for managing System Configuration Categories.
26+
* Provides methods to perform CRUD operations and retrieve specific categories.
27+
*/
28+
@Remote
29+
public interface SystemConfigurationCategoryFacade
30+
extends
31+
BaseFacade<SystemConfigurationCategoryDto, SystemConfigurationCategoryIndexDto, SystemConfigurationCategoryReferenceDto, SystemConfigurationCategoryCriteria> {
32+
33+
/**
34+
* Get system configuration categories by their UUIDs.
35+
*
36+
* @param uuids the list of UUIDs
37+
* @return the list of matching system configuration category DTOs
38+
*/
39+
List<SystemConfigurationCategoryDto> getByUuids(List<String> uuids);
40+
41+
/**
42+
* Get the default system configuration category DTO.
43+
*
44+
* @return the default system configuration category DTO
45+
*/
46+
SystemConfigurationCategoryDto getDefaultCategoryDto();
47+
48+
/**
49+
* Get the default system configuration category reference DTO.
50+
*
51+
* @return the default system configuration category reference DTO
52+
*/
53+
SystemConfigurationCategoryReferenceDto getDefaultCategoryReferenceDto();
54+
55+
/**
56+
* Get a category DTO by category name.
57+
*
58+
* @param name the category name
59+
* @return the system configuration category DTO
60+
*/
61+
SystemConfigurationCategoryDto getCategoryDtoByName(String name);
62+
63+
/**
64+
* Get a category reference DTO by category name.
65+
*
66+
* @param name the category name
67+
* @return the system configuration category reference DTO
68+
*/
69+
SystemConfigurationCategoryReferenceDto getCategoryReferenceDtoByName(String name);
70+
71+
/**
72+
* Get all UUIDs of system configuration categories.
73+
*
74+
* @return the list of all UUIDs
75+
*/
76+
List<String> getAllUuids();
77+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2026 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+
16+
package de.symeda.sormas.api.systemconfiguration;
17+
18+
public class SystemConfigurationCategoryHelper {
19+
20+
private SystemConfigurationCategoryHelper() {
21+
}
22+
23+
public static final boolean isCategoryNameValid(final String name) {
24+
return name != null && !name.trim().isEmpty();
25+
}
26+
27+
public static final boolean isCategoryDescriptionValid(final String description) {
28+
return description != null;
29+
}
30+
}

0 commit comments

Comments
 (0)