Finish export dialog.

This commit is contained in:
Paulo Gustavo Veiga
2012-06-06 01:42:24 -03:00
parent 4d3e371d05
commit 907f31c030
7 changed files with 21 additions and 21 deletions

View File

@@ -293,12 +293,17 @@ public class MindmapController extends BaseController {
@RequestMapping(method = RequestMethod.POST, value = "/maps", consumes = {"application/freemind"})
@ResponseStatus(value = HttpStatus.CREATED)
public void createMapFromFreemind(@RequestBody byte[] freemindXml, @RequestParam(required = true) String title, @RequestParam(required = false) String description, @NotNull HttpServletResponse response) throws IOException, WiseMappingException, ImporterException {
public void createMapFromFreemind(@RequestBody byte[] freemindXml, @RequestParam(required = true) String title, @RequestParam(required = false) String description, @NotNull HttpServletResponse response) throws IOException, WiseMappingException {
// Convert map ...
final Importer importer = ImporterFactory.getInstance().getImporter(ImportFormat.FREEMIND);
final ByteArrayInputStream stream = new ByteArrayInputStream(freemindXml);
final MindMap mindMap = importer.importMap(title, "", stream);
final MindMap mindMap;
try {
final Importer importer = ImporterFactory.getInstance().getImporter(ImportFormat.FREEMIND);
final ByteArrayInputStream stream = new ByteArrayInputStream(freemindXml);
mindMap = importer.importMap(title, "", stream);
} catch (ImporterException e) {
throw buildValidationException("xml", "The selected file does not seems to be a valid Freemind or WiseMapping file. Contact support in case the problem persists.");
}
// Save new map ...
final User user = Utils.getUser();