Skip to content

Commit

Permalink
Revert "SORMAS-Foundation#10404 - Occupation types let contact and ev…
Browse files Browse the repository at this point in the history
…ent participant imports fail (SORMAS-Foundation#10478)" (SORMAS-Foundation#10487)

This reverts commit c4e79a8.
  • Loading branch information
ChristopherRiedel authored Sep 29, 2022
1 parent c4e79a8 commit e363419
Showing 1 changed file with 2 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package de.symeda.sormas.ui.importer;

import de.symeda.sormas.api.importexport.ImportCellData;
import de.symeda.sormas.api.importexport.ImportErrorException;
import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.io.BufferedReader;
Expand Down Expand Up @@ -27,7 +29,6 @@
import java.util.function.Function;
import java.util.stream.Collectors;

import javax.ejb.EJBException;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
Expand All @@ -48,13 +49,10 @@

import de.symeda.sormas.api.FacadeProvider;
import de.symeda.sormas.api.caze.CaseDataDto;
import de.symeda.sormas.api.customizableenum.CustomizableEnumType;
import de.symeda.sormas.api.i18n.Captions;
import de.symeda.sormas.api.i18n.I18nProperties;
import de.symeda.sormas.api.i18n.Strings;
import de.symeda.sormas.api.i18n.Validations;
import de.symeda.sormas.api.importexport.ImportCellData;
import de.symeda.sormas.api.importexport.ImportErrorException;
import de.symeda.sormas.api.importexport.ImportExportUtils;
import de.symeda.sormas.api.importexport.ImportLineResultDto;
import de.symeda.sormas.api.importexport.InvalidColumnException;
Expand All @@ -66,7 +64,6 @@
import de.symeda.sormas.api.infrastructure.region.RegionDto;
import de.symeda.sormas.api.infrastructure.region.RegionReferenceDto;
import de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentReferenceDto;
import de.symeda.sormas.api.person.OccupationType;
import de.symeda.sormas.api.person.PersonDto;
import de.symeda.sormas.api.person.SimilarPersonDto;
import de.symeda.sormas.api.user.UserDto;
Expand Down Expand Up @@ -426,23 +423,6 @@ protected boolean executeDefaultInvoke(PropertyDescriptor pd, Object element, St

return true;
}

if (propertyType.isAssignableFrom(OccupationType.class)) {
OccupationType occupationType = null;
try {
occupationType = FacadeProvider.getCustomizableEnumFacade().getEnumValue(CustomizableEnumType.OCCUPATION_TYPE, entry);
} catch (EJBException e) {
//ignore, occupationType will remain null
}

if (occupationType == null) {
throw new IllegalArgumentException();
}
pd.getWriteMethod().invoke(element, occupationType);

return true;
}

if (propertyType.isAssignableFrom(Date.class)) {
try {
pd.getWriteMethod().invoke(element, DateHelper.parseDateWithException(entry, I18nProperties.getUserLanguage()));
Expand Down

0 comments on commit e363419

Please sign in to comment.