comparison src/main/java/de/intevation/lada/importer/laf/LafObjectMapper.java @ 1229:1965e26ef8b5

Report errors in importing Ort as warning. Failing to import an Ort object does not mean the Probe object will not be imported, thus only a warning.
author Tom Gottfried <tom@intevation.de>
date Fri, 09 Dec 2016 17:15:21 +0100
parents 22d2123e1d2a
children 75692dc7077f
comparison
equal deleted inserted replaced
1228:22d2123e1d2a 1229:1965e26ef8b5
852 } 852 }
853 if (violation.hasErrors()) { 853 if (violation.hasErrors()) {
854 for (Entry<String, List<Integer>> err : 854 for (Entry<String, List<Integer>> err :
855 violation.getErrors().entrySet()) { 855 violation.getErrors().entrySet()) {
856 for (Integer code : err.getValue()) { 856 for (Integer code : err.getValue()) {
857 currentErrors.add( 857 // Add to warnings because Probe object might be imported
858 currentWarnings.add(
858 new ReportItem("validation", err.getKey(), code)); 859 new ReportItem("validation", err.getKey(), code));
859 } 860 }
860 } 861 }
861 return null; 862 return null;
862 } 863 }
865 if (hasKoord && !hasGem) { 866 if (hasKoord && !hasGem) {
866 logger.debug("find Verwaltungseinheit"); 867 logger.debug("find Verwaltungseinheit");
867 ortFactory.findVerwaltungseinheit(ort); 868 ortFactory.findVerwaltungseinheit(ort);
868 } 869 }
869 if (ortFactory.hasErrors()) { 870 if (ortFactory.hasErrors()) {
870 currentErrors.addAll(ortFactory.getErrors()); 871 // Add to warnings because Probe object might be imported
872 currentWarnings.addAll(ortFactory.getErrors());
871 return null; 873 return null;
872 } 874 }
873 875
874 repository.create(ort, "stamm"); 876 repository.create(ort, "stamm");
875 return ort; 877 return ort;
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)