From 032df5fdf4ba3ee4783a9aec90a60de748a83433 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 17 Nov 2012 21:28:23 -0300 Subject: [PATCH] Do not update map tiemstamp on map metadata modification. --- .../com/wisemapping/rest/MindmapController.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 48043210..441e9d1c 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -130,7 +130,7 @@ public class MindmapController extends BaseController { if (mindmapHistory.size() > 0) { final MindMapHistory mindMapHistory = mindmapHistory.get(0); mindmap.setXml(mindMapHistory.getXml()); - saveMindmap(true, mindmap, user); + saveMindmapDocument(true, mindmap, user); } } else { mindmapService.revertChange(mindmap, Integer.parseInt(hid)); @@ -165,7 +165,7 @@ public class MindmapController extends BaseController { mindmap.setXmlStr(xml); // Update map ... - saveMindmap(minor, mindmap, user); + saveMindmapDocument(minor, mindmap, user); // Update edition timeout ... final LockManager lockManager = mindmapService.getLockManager(); @@ -243,7 +243,7 @@ public class MindmapController extends BaseController { } // Update map ... - saveMindmap(minor, mindmap, user); + saveMindmapDocument(minor, mindmap, user); } @@ -263,7 +263,7 @@ public class MindmapController extends BaseController { // Update map ... final Mindmap mindmap = mindmapService.findMindmapById(id); mindmap.setTitle(title); - saveMindmap(true, mindMap, user); + mindmapService.updateMindmap(mindMap, !true); } @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/collabs", consumes = {"application/json", "application/xml"}, produces = {"application/json", "text/html", "application/xml"}) @@ -334,7 +334,7 @@ public class MindmapController extends BaseController { // Update map ... final Mindmap mindmap = mindmapService.findMindmapById(id); mindmap.setDescription(description); - saveMindmap(true, mindMap, user); + mindmapService.updateMindmap(mindMap, !true); } @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/publish", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"}) @@ -350,13 +350,13 @@ public class MindmapController extends BaseController { // Update map status ... mindMap.setPublic(Boolean.parseBoolean(value)); - saveMindmap(true, mindMap, user); + mindmapService.updateMindmap(mindMap, !true); } @RequestMapping(method = RequestMethod.DELETE, value = "/maps/{id}") @ResponseStatus(value = HttpStatus.NO_CONTENT) - public void updateMap(@PathVariable int id) throws IOException, WiseMappingException { + public void deleteMapById(@PathVariable int id) throws IOException, WiseMappingException { final User user = Utils.getUser(); final Mindmap mindmap = mindmapService.findMindmapById(id); mindmapService.removeMindmap(mindmap, user); @@ -489,7 +489,7 @@ public class MindmapController extends BaseController { response.setHeader("ResourceId", Integer.toString(clonedMap.getId())); } - private void saveMindmap(boolean minor, @NotNull final Mindmap mindMap, @NotNull final User user) throws WiseMappingException { + private void saveMindmapDocument(boolean minor, @NotNull final Mindmap mindMap, @NotNull final User user) throws WiseMappingException { final Calendar now = Calendar.getInstance(); mindMap.setLastModificationTime(now); mindMap.setLastEditor(user);