Mercurial > lada > lada-server
comparison src/main/java/de/intevation/lada/rest/importer/LafImportService.java @ 1069:fdc752cd17fe schema-update
Removed old importer stuff and added new Importer based on antlr4 grammar.
WIP! Currently only the parser without mapping to objects
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 30 Sep 2016 14:05:28 +0200 |
parents | 5bdd1631a451 |
children | 7683c4162746 |
comparison
equal
deleted
inserted
replaced
1052:21ab4d35135a | 1069:fdc752cd17fe |
---|---|
32 /** | 32 /** |
33 * This class produces a RESTful service to interact with probe objects. | 33 * This class produces a RESTful service to interact with probe objects. |
34 * | 34 * |
35 * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a> | 35 * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a> |
36 */ | 36 */ |
37 @Path("data/laf/import") | 37 @Path("data/import") |
38 @RequestScoped | 38 @RequestScoped |
39 public class LafImportService { | 39 public class LafImportService { |
40 | 40 |
41 /** | 41 /** |
42 * The importer | 42 * The importer |
63 @Path("/laf") | 63 @Path("/laf") |
64 @Produces(MediaType.APPLICATION_JSON) | 64 @Produces(MediaType.APPLICATION_JSON) |
65 @Consumes(MediaType.TEXT_PLAIN) | 65 @Consumes(MediaType.TEXT_PLAIN) |
66 public Response upload( | 66 public Response upload( |
67 String content, | 67 String content, |
68 @Context HttpServletRequest request) { | 68 @Context HttpServletRequest request |
69 ) { | |
69 UserInfo userInfo = authorization.getInfo(request); | 70 UserInfo userInfo = authorization.getInfo(request); |
70 | 71 |
71 importer.doImport(content, userInfo); | 72 importer.doImport(content, userInfo); |
72 Map<String, Object> respData = new HashMap<String,Object>(); | 73 Map<String, Object> respData = new HashMap<String,Object>(); |
73 respData.put("errors", importer.getErrors()); | 74 respData.put("errors", importer.getErrors()); |