- Remove old ExportController

- Add support for simple REST transformation
This commit is contained in:
Paulo Gustavo Veiga
2012-02-19 21:07:24 -03:00
parent e033e8552c
commit 81538f049b
11 changed files with 115 additions and 422 deletions

View File

@@ -4,9 +4,8 @@ package com.wisemapping.rest;
import com.wisemapping.model.MindMap;
import com.wisemapping.model.MindmapUser;
import com.wisemapping.model.User;
import com.wisemapping.rest.model.RestMindMap;
import com.wisemapping.rest.model.RestMindmap;
import com.wisemapping.service.MindmapService;
import com.wisemapping.validator.Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
@@ -16,21 +15,18 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
public class MindmapController {
@Autowired
private MindmapService mindmapService;
@RequestMapping(method = RequestMethod.GET, value = "/map/{id}")
@RequestMapping(method = RequestMethod.GET, value = "/map/{id}", produces = {"text/xml", "application/json", "text/html"})
@ResponseBody
public ModelAndView getMindmap(@PathVariable int id) throws IOException {
final MindMap mindMap = mindmapService.getMindmapById(id);
final RestMindMap map = new RestMindMap(mindMap);
final RestMindmap map = new RestMindmap(mindMap);
return new ModelAndView("mapView", "map", map);
}
@@ -39,7 +35,7 @@ public class MindmapController {
final User user = com.wisemapping.security.Utils.getUser();
final List<MindmapUser> list = mindmapService.getMindmapUserByUser(user);
// final RestMindMap map = new RestMindMap(mindMap);
// final RestMindMap map = new RestMindmap(mindMap);
// return new ModelAndView("mapView", "map", map);
return null;
}