Do not update map tiemstamp on map metadata modification.

This commit is contained in:
Paulo Gustavo Veiga 2012-11-17 21:28:23 -03:00
parent dbbe8901b7
commit 032df5fdf4

View File

@ -130,7 +130,7 @@ public class MindmapController extends BaseController {
if (mindmapHistory.size() > 0) { if (mindmapHistory.size() > 0) {
final MindMapHistory mindMapHistory = mindmapHistory.get(0); final MindMapHistory mindMapHistory = mindmapHistory.get(0);
mindmap.setXml(mindMapHistory.getXml()); mindmap.setXml(mindMapHistory.getXml());
saveMindmap(true, mindmap, user); saveMindmapDocument(true, mindmap, user);
} }
} else { } else {
mindmapService.revertChange(mindmap, Integer.parseInt(hid)); mindmapService.revertChange(mindmap, Integer.parseInt(hid));
@ -165,7 +165,7 @@ public class MindmapController extends BaseController {
mindmap.setXmlStr(xml); mindmap.setXmlStr(xml);
// Update map ... // Update map ...
saveMindmap(minor, mindmap, user); saveMindmapDocument(minor, mindmap, user);
// Update edition timeout ... // Update edition timeout ...
final LockManager lockManager = mindmapService.getLockManager(); final LockManager lockManager = mindmapService.getLockManager();
@ -243,7 +243,7 @@ public class MindmapController extends BaseController {
} }
// Update map ... // Update map ...
saveMindmap(minor, mindmap, user); saveMindmapDocument(minor, mindmap, user);
} }
@ -263,7 +263,7 @@ public class MindmapController extends BaseController {
// Update map ... // Update map ...
final Mindmap mindmap = mindmapService.findMindmapById(id); final Mindmap mindmap = mindmapService.findMindmapById(id);
mindmap.setTitle(title); 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"}) @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 ... // Update map ...
final Mindmap mindmap = mindmapService.findMindmapById(id); final Mindmap mindmap = mindmapService.findMindmapById(id);
mindmap.setDescription(description); 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"}) @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 ... // Update map status ...
mindMap.setPublic(Boolean.parseBoolean(value)); mindMap.setPublic(Boolean.parseBoolean(value));
saveMindmap(true, mindMap, user); mindmapService.updateMindmap(mindMap, !true);
} }
@RequestMapping(method = RequestMethod.DELETE, value = "/maps/{id}") @RequestMapping(method = RequestMethod.DELETE, value = "/maps/{id}")
@ResponseStatus(value = HttpStatus.NO_CONTENT) @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 User user = Utils.getUser();
final Mindmap mindmap = mindmapService.findMindmapById(id); final Mindmap mindmap = mindmapService.findMindmapById(id);
mindmapService.removeMindmap(mindmap, user); mindmapService.removeMindmap(mindmap, user);
@ -489,7 +489,7 @@ public class MindmapController extends BaseController {
response.setHeader("ResourceId", Integer.toString(clonedMap.getId())); 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(); final Calendar now = Calendar.getInstance();
mindMap.setLastModificationTime(now); mindMap.setLastModificationTime(now);
mindMap.setLastEditor(user); mindMap.setLastEditor(user);