Mercurial > lada > lada-server
comparison src/main/java/de/intevation/lada/rest/stamm/OrtService.java @ 1250:75692dc7077f
Make transformed coordinates available for validation.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Fri, 16 Dec 2016 16:20:19 +0100 |
parents | e49c006b9076 |
children | 9dfb52db6a0f |
comparison
equal
deleted
inserted
replaced
1249:f094aca05cf2 | 1250:75692dc7077f |
---|---|
269 Ort.class) | 269 Ort.class) |
270 ) { | 270 ) { |
271 return new Response(false, 699, ort); | 271 return new Response(false, 699, ort); |
272 } | 272 } |
273 | 273 |
274 ortFactory.transformCoordinates(ort); | |
275 if (ortFactory.hasErrors()) { | |
276 Violation factoryErrs = new Violation(); | |
277 for (ReportItem err : ortFactory.getErrors()) { | |
278 factoryErrs.addError(err.getKey(), err.getCode()); | |
279 } | |
280 Response response = new Response(false, 604, ort); | |
281 response.setErrors(factoryErrs.getErrors()); | |
282 return response; | |
283 } | |
284 | |
274 Violation violation = validator.validate(ort); | 285 Violation violation = validator.validate(ort); |
275 if (violation.hasErrors()) { | 286 if (violation.hasErrors()) { |
276 Response response = new Response(false, 604, ort); | 287 Response response = new Response(false, 604, ort); |
277 response.setErrors(violation.getErrors()); | 288 response.setErrors(violation.getErrors()); |
278 response.setWarnings(violation.getWarnings()); | 289 response.setWarnings(violation.getWarnings()); |
279 return response; | 290 return response; |
280 } | 291 } |
281 | 292 |
282 ortFactory.transformCoordinates(ort); | |
283 if (ortFactory.hasErrors()) { | |
284 Violation factoryErrs = new Violation(); | |
285 for (ReportItem err : ortFactory.getErrors()) { | |
286 factoryErrs.addError(err.getKey(), err.getCode()); | |
287 } | |
288 Response response = new Response(false, 604, ort); | |
289 response.setErrors(factoryErrs.getErrors()); | |
290 return response; | |
291 } | |
292 Response response = repository.create(ort, "stamm"); | 293 Response response = repository.create(ort, "stamm"); |
293 if(violation.hasWarnings()) { | 294 if(violation.hasWarnings()) { |
294 response.setWarnings(violation.getWarnings()); | 295 response.setWarnings(violation.getWarnings()); |
295 } | 296 } |
296 | 297 |
339 Ort.class) | 340 Ort.class) |
340 ) { | 341 ) { |
341 return new Response(false, 699, ort); | 342 return new Response(false, 699, ort); |
342 } | 343 } |
343 | 344 |
345 ortFactory.transformCoordinates(ort); | |
346 if (ortFactory.hasErrors()) { | |
347 Violation factoryErrs = new Violation(); | |
348 for (ReportItem err : ortFactory.getErrors()) { | |
349 factoryErrs.addError(err.getKey(), err.getCode()); | |
350 } | |
351 Response response = new Response(false, 604, ort); | |
352 response.setErrors(factoryErrs.getErrors()); | |
353 return response; | |
354 } | |
355 | |
344 Violation violation = validator.validate(ort); | 356 Violation violation = validator.validate(ort); |
345 if (violation.hasErrors()) { | 357 if (violation.hasErrors()) { |
346 Response response = new Response(false, 604, ort); | 358 Response response = new Response(false, 604, ort); |
347 response.setErrors(violation.getErrors()); | 359 response.setErrors(violation.getErrors()); |
348 response.setWarnings(violation.getWarnings()); | 360 response.setWarnings(violation.getWarnings()); |
349 return response; | 361 return response; |
350 } | 362 } |
351 | 363 |
352 ortFactory.transformCoordinates(ort); | |
353 if (ortFactory.hasErrors()) { | |
354 Violation factoryErrs = new Violation(); | |
355 for (ReportItem err : ortFactory.getErrors()) { | |
356 factoryErrs.addError(err.getKey(), err.getCode()); | |
357 } | |
358 Response response = new Response(false, 604, ort); | |
359 response.setErrors(factoryErrs.getErrors()); | |
360 return response; | |
361 } | |
362 Response response = repository.update(ort, "stamm"); | 364 Response response = repository.update(ort, "stamm"); |
363 if(violation.hasWarnings()) { | 365 if(violation.hasWarnings()) { |
364 response.setWarnings(violation.getWarnings()); | 366 response.setWarnings(violation.getWarnings()); |
365 } | 367 } |
366 | 368 |