NOTE: To avoid bad detection:
* diff --git a/wise-webapp/src/main/java/com/wisemapping/ncontroller/ExtensionsController.java b/wise-webapp/src/main/java/com/wisemapping/ncontroller/ExtensionsController.java index cb2a06cf..356282a2 100644 --- a/wise-webapp/src/main/java/com/wisemapping/ncontroller/ExtensionsController.java +++ b/wise-webapp/src/main/java/com/wisemapping/ncontroller/ExtensionsController.java @@ -28,7 +28,6 @@ import org.springframework.web.servlet.ModelAndView; import java.io.IOException; @Controller -@RequestMapping("/c/") public class ExtensionsController { @Autowired private MindmapService mindmapService; diff --git a/wise-webapp/src/main/java/com/wisemapping/ncontroller/MindmapController.java b/wise-webapp/src/main/java/com/wisemapping/ncontroller/MindmapController.java index 3dff6c34..db8a3d56 100644 --- a/wise-webapp/src/main/java/com/wisemapping/ncontroller/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/ncontroller/MindmapController.java @@ -22,17 +22,22 @@ import java.util.ArrayList; import java.util.List; @Controller -@RequestMapping("/c/") public class MindmapController { @Autowired private MindmapService mindmapService; @RequestMapping(value = "maps/{id}/export") - public ModelAndView export(@PathVariable int id) throws IOException { + public ModelAndView showExportPage(@PathVariable int id) throws IOException { final MindMapBean modelObject = findMindmapBean(id); return new ModelAndView("mindmapExport", "mindmap", modelObject); } + @RequestMapping(value = "maps/{id}/exportf") + public ModelAndView showExportPageFull(@PathVariable int id) throws IOException { + final MindMapBean modelObject = findMindmapBean(id); + return new ModelAndView("mindmapExportFull", "mindmap", modelObject); + } + @RequestMapping(value = "maps/{id}/details") public ModelAndView showDetails(@PathVariable int id) { final MindMapBean modelObject = findMindmapBean(id); @@ -47,6 +52,18 @@ public class MindmapController { return new ModelAndView("mindmapPrint", "mindmap", mindmap); } + @RequestMapping(value = "maps/{id}/share") + public ModelAndView showSharePage(@PathVariable int id) { + final MindMap mindmap = findMindmap(id); + return new ModelAndView("mindmapShare", "mindmap", mindmap); + } + + @RequestMapping(value = "maps/{id}/sharef") + public ModelAndView showSharePageFull(@PathVariable int id) { + final MindMap mindmap = findMindmap(id); + return new ModelAndView("mindmapShareFull", "mindmap", mindmap); + } + @RequestMapping(value = "maps/{id}/publish") public ModelAndView showPublishPage(@PathVariable int id) { final MindMap mindmap = findMindmap(id); @@ -59,6 +76,7 @@ public class MindmapController { return new ModelAndView("mindmapPublishFull", "mindmap", mindmap); } + @RequestMapping(value = "maps/{id}/edit") public ModelAndView editMap(@PathVariable int id, @NotNull HttpServletRequest request) { ModelAndView view; @@ -99,7 +117,7 @@ public class MindmapController { return new ModelAndView("mindmapDetail", "wisemapDetail", new MindMapBean(mindmap)); } - @RequestMapping(value = "mymaps") + @RequestMapping(value = "maps/") public ModelAndView list(@NotNull HttpServletRequest request) { final HttpSession session = request.getSession(false); diff --git a/wise-webapp/src/main/java/com/wisemapping/ncontroller/PublicPagesController.java b/wise-webapp/src/main/java/com/wisemapping/ncontroller/PublicPagesController.java index 70acad43..e207d1ef 100644 --- a/wise-webapp/src/main/java/com/wisemapping/ncontroller/PublicPagesController.java +++ b/wise-webapp/src/main/java/com/wisemapping/ncontroller/PublicPagesController.java @@ -26,7 +26,6 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; @Controller -@RequestMapping("/c/") public class PublicPagesController { @Autowired private MindmapService mindmapService; diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java index 0b7fa7b5..8e7439b9 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -20,6 +20,7 @@ package com.wisemapping.rest; import com.wisemapping.exceptions.WiseMappingException; +import com.wisemapping.exporter.ExportFormat; import com.wisemapping.model.MindMap; import com.wisemapping.model.MindmapUser; import com.wisemapping.model.User; @@ -30,6 +31,7 @@ import com.wisemapping.security.Utils; import com.wisemapping.service.MindmapService; import com.wisemapping.validator.MapInfoValidator; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Controller; @@ -38,11 +40,10 @@ import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.List; +import java.util.*; @Controller @@ -50,17 +51,43 @@ public class MindmapController extends BaseController { @Autowired private MindmapService mindmapService; - @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/json", "text/html", "application/xml"}) + + @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/json", "application/xml", "text/html"}) @ResponseBody - public ModelAndView getMindmap(@PathVariable int id) throws IOException { + public ModelAndView retrieve(@PathVariable int id) throws IOException { final User user = com.wisemapping.security.Utils.getUser(); final MindMap mindMap = mindmapService.getMindmapById(id); final RestMindmap map = new RestMindmap(mindMap, user); + return new ModelAndView("mapView", "map", map); } + @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/wisemapping+xml"}, params = {"download=wxml"}) + @ResponseBody + public ModelAndView retrieveAsWise(@PathVariable int id) throws IOException { + final MindMap mindMap = mindmapService.getMindmapById(id); + final Map