Add revert and view actions.

This commit is contained in:
Paulo Gustavo Veiga 2012-06-17 19:16:39 -03:00
parent 26766fdbc6
commit c73934aadf
10 changed files with 95 additions and 46 deletions

View File

@ -53,7 +53,7 @@ public class TagsController
throws ServletException, WiseMappingException, ImporterException throws ServletException, WiseMappingException, ImporterException
{ {
final TagBean bean = (TagBean) command; final TagBean bean = (TagBean) command;
final MindMap mindmap = getMindmapService().getMindmapById(bean.getMindmapId()); final MindMap mindmap = getMindmapService().findMindmapById(bean.getMindmapId());
getMindmapService().addTags(mindmap, bean.getMindmapTags()); getMindmapService().addTags(mindmap, bean.getMindmapTags());
return new ModelAndView(getSuccessView()); return new ModelAndView(getSuccessView());
} }

View File

@ -37,7 +37,7 @@ public class ExtensionsController {
@RequestMapping(value = "try") @RequestMapping(value = "try")
public ModelAndView tryEditor() throws IOException { public ModelAndView tryEditor() throws IOException {
final MindMap mindmap = mindmapService.getMindmapById(TRY_EXAMPLE_MINDMAP_ID); final MindMap mindmap = mindmapService.findMindmapById(TRY_EXAMPLE_MINDMAP_ID);
ModelAndView view = new ModelAndView("mindmapEditor", "mindmap", mindmap); ModelAndView view = new ModelAndView("mindmapEditor", "mindmap", mindmap);
final String xmlMap = mindmap.getXmlAsJsLiteral(); final String xmlMap = mindmap.getXmlAsJsLiteral();

View File

@ -19,9 +19,10 @@
package com.wisemapping.ncontroller; package com.wisemapping.ncontroller;
import com.wisemapping.filter.UserAgent; import com.wisemapping.exceptions.WiseMappingException;
import com.wisemapping.model.CollaborationRole; import com.wisemapping.model.CollaborationRole;
import com.wisemapping.model.MindMap; import com.wisemapping.model.MindMap;
import com.wisemapping.model.MindMapHistory;
import com.wisemapping.security.Utils; import com.wisemapping.security.Utils;
import com.wisemapping.service.MindmapService; import com.wisemapping.service.MindmapService;
import com.wisemapping.view.MindMapBean; import com.wisemapping.view.MindMapBean;
@ -33,8 +34,8 @@ import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.util.List;
@Controller @Controller
public class MindmapController { public class MindmapController {
@ -141,10 +142,22 @@ public class MindmapController {
return "mindmapEditor"; return "mindmapEditor";
} }
@RequestMapping(value = "maps/{id}/{hid}/view", method = RequestMethod.GET)
public String showMindmapViewerRevPage(@PathVariable int id, @PathVariable int hid, @NotNull Model model) throws WiseMappingException {
final MindMapBean mindmapBean = findMindmapBean(id);
final MindMapHistory mindmapHistory = mindmapService.findMindmapHistory(id, hid);
mindmapBean.getDelegated().setXml(mindmapHistory.getXml());
model.addAttribute("mindmap", mindmapBean);
model.addAttribute("readOnlyMode", true);
return "mindmapEditor";
}
@RequestMapping(value = "maps/{id}/embed") @RequestMapping(value = "maps/{id}/embed")
public ModelAndView embeddedView(@PathVariable int id, @RequestParam(required = false) Float zoom) { public ModelAndView embeddedView(@PathVariable int id, @RequestParam(required = false) Float zoom) {
ModelAndView view; ModelAndView view;
final MindMap mindmap = mindmapService.getMindmapById(id); final MindMap mindmap = mindmapService.findMindmapById(id);
view = new ModelAndView("mindmapEmbedded", "mindmap", mindmap); view = new ModelAndView("mindmapEmbedded", "mindmap", mindmap);
view.addObject("user", Utils.getUser()); view.addObject("user", Utils.getUser());
view.addObject("zoom", zoom == null ? 1 : zoom); view.addObject("zoom", zoom == null ? 1 : zoom);
@ -153,7 +166,7 @@ public class MindmapController {
private MindMap findMindmap(long mapId) { private MindMap findMindmap(long mapId) {
final MindMap mindmap = mindmapService.getMindmapById((int) mapId); final MindMap mindmap = mindmapService.findMindmapById((int) mapId);
if (mindmap == null) { if (mindmap == null) {
throw new IllegalArgumentException("Mindmap could not be found"); throw new IllegalArgumentException("Mindmap could not be found");
} }

View File

@ -56,7 +56,7 @@ public class MindmapController extends BaseController {
@ResponseBody @ResponseBody
public ModelAndView retrieve(@PathVariable int id) throws IOException { public ModelAndView retrieve(@PathVariable int id) throws IOException {
final User user = Utils.getUser(); final User user = Utils.getUser();
final MindMap mindMap = mindmapService.getMindmapById(id); final MindMap mindMap = mindmapService.findMindmapById(id);
final RestMindmap map = new RestMindmap(mindMap, user); final RestMindmap map = new RestMindmap(mindMap, user);
return new ModelAndView("mapView", "map", map); return new ModelAndView("mapView", "map", map);
@ -65,7 +65,7 @@ public class MindmapController extends BaseController {
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/wisemapping+xml"}, params = {"download=wxml"}) @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/wisemapping+xml"}, params = {"download=wxml"})
@ResponseBody @ResponseBody
public ModelAndView retrieveAsWise(@PathVariable int id) throws IOException { public ModelAndView retrieveAsWise(@PathVariable int id) throws IOException {
final MindMap mindMap = mindmapService.getMindmapById(id); final MindMap mindMap = mindmapService.findMindmapById(id);
final Map<String, Object> values = new HashMap<String, Object>(); final Map<String, Object> values = new HashMap<String, Object>();
final User user = Utils.getUser(); final User user = Utils.getUser();
@ -77,7 +77,7 @@ public class MindmapController extends BaseController {
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/freemind"}, params = {"download=mm"}) @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/freemind"}, params = {"download=mm"})
@ResponseBody @ResponseBody
public ModelAndView retrieveDocumentAsFreemind(@PathVariable int id) throws IOException { public ModelAndView retrieveDocumentAsFreemind(@PathVariable int id) throws IOException {
final MindMap mindMap = mindmapService.getMindmapById(id); final MindMap mindMap = mindmapService.findMindmapById(id);
final Map<String, Object> values = new HashMap<String, Object>(); final Map<String, Object> values = new HashMap<String, Object>();
values.put("content", mindMap.getXmlStr()); values.put("content", mindMap.getXmlStr());
values.put("filename", mindMap.getTitle()); values.put("filename", mindMap.getTitle());
@ -89,7 +89,7 @@ public class MindmapController extends BaseController {
final User user = Utils.getUser(); final User user = Utils.getUser();
final MindmapFilter filter = MindmapFilter.parse(q); final MindmapFilter filter = MindmapFilter.parse(q);
final List<Collaboration> collaborations = mindmapService.getCollaborationsBy(user); final List<Collaboration> collaborations = mindmapService.findCollaborationsBy(user);
final List<MindMap> mindmaps = new ArrayList<MindMap>(); final List<MindMap> mindmaps = new ArrayList<MindMap>();
for (Collaboration collaboration : collaborations) { for (Collaboration collaboration : collaborations) {
@ -105,7 +105,7 @@ public class MindmapController extends BaseController {
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/history", produces = {"application/json", "text/html", "application/xml"}) @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/history", produces = {"application/json", "text/html", "application/xml"})
public ModelAndView retrieveHistory(@PathVariable int id) throws IOException { public ModelAndView retrieveHistory(@PathVariable int id) throws IOException {
final List<MindMapHistory> histories = mindmapService.getMindMapHistory(id); final List<MindMapHistory> histories = mindmapService.findMindmapHistory(id);
final RestMindmapHistoryList result = new RestMindmapHistoryList(); final RestMindmapHistoryList result = new RestMindmapHistoryList();
for (MindMapHistory history : histories) { for (MindMapHistory history : histories) {
result.addHistory(new RestMindmapHistory(history)); result.addHistory(new RestMindmapHistory(history));
@ -113,11 +113,19 @@ public class MindmapController extends BaseController {
return new ModelAndView("historyView", "list", result); return new ModelAndView("historyView", "list", result);
} }
@RequestMapping(value = "maps/{id}/history/{hid}", method = RequestMethod.POST)
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateRevertMindmap(@PathVariable int id, @PathVariable int hid) throws IOException, WiseMappingException {
final MindMap mindmap = mindmapService.findMindmapById(id);
mindmapService.revertChange(mindmap, hid);
}
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/document", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"}) @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/document", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT) @ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateDocument(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor) throws IOException, WiseMappingException { public void updateDocument(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor) throws IOException, WiseMappingException {
final MindMap mindMap = mindmapService.getMindmapById(id); final MindMap mindMap = mindmapService.findMindmapById(id);
final User user = Utils.getUser(); final User user = Utils.getUser();
// Validate arguments ... // Validate arguments ...
@ -145,7 +153,7 @@ public class MindmapController extends BaseController {
@ResponseStatus(value = HttpStatus.NO_CONTENT) @ResponseStatus(value = HttpStatus.NO_CONTENT)
public void update(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor) throws IOException, WiseMappingException { public void update(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor) throws IOException, WiseMappingException {
final MindMap mindMap = mindmapService.getMindmapById(id); final MindMap mindMap = mindmapService.findMindmapById(id);
final User user = Utils.getUser(); final User user = Utils.getUser();
// Update document properties ... // Update document properties ...
@ -187,7 +195,7 @@ public class MindmapController extends BaseController {
@ResponseStatus(value = HttpStatus.NO_CONTENT) @ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateTitle(@RequestBody String title, @PathVariable int id) throws WiseMappingException { public void updateTitle(@RequestBody String title, @PathVariable int id) throws WiseMappingException {
final MindMap mindMap = mindmapService.getMindmapById(id); final MindMap mindMap = mindmapService.findMindmapById(id);
final User user = Utils.getUser(); final User user = Utils.getUser();
// Is there a map with the same name ? // Is there a map with the same name ?
@ -197,7 +205,7 @@ public class MindmapController extends BaseController {
} }
// Update map ... // Update map ...
final MindMap mindmap = mindmapService.getMindmapById(id); final MindMap mindmap = mindmapService.findMindmapById(id);
mindmap.setTitle(title); mindmap.setTitle(title);
saveMindmap(true, mindMap, user); saveMindmap(true, mindMap, user);
} }
@ -205,7 +213,7 @@ public class MindmapController extends BaseController {
@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"})
@ResponseStatus(value = HttpStatus.NO_CONTENT) @ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateCollabs(@PathVariable int id, @NotNull @RequestBody RestCollaborationList restCollabs) throws CollaborationException { public void updateCollabs(@PathVariable int id, @NotNull @RequestBody RestCollaborationList restCollabs) throws CollaborationException {
final MindMap mindMap = mindmapService.getMindmapById(id); final MindMap mindMap = mindmapService.findMindmapById(id);
// Only owner can change collaborators... // Only owner can change collaborators...
final User user = Utils.getUser(); final User user = Utils.getUser();
@ -245,7 +253,7 @@ public class MindmapController extends BaseController {
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/collabs", produces = {"application/json", "text/html", "application/xml"}) @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/collabs", produces = {"application/json", "text/html", "application/xml"})
public ModelAndView retrieveList(@PathVariable int id) { public ModelAndView retrieveList(@PathVariable int id) {
final MindMap mindMap = mindmapService.getMindmapById(id); final MindMap mindMap = mindmapService.findMindmapById(id);
final Set<Collaboration> collaborations = mindMap.getCollaborations(); final Set<Collaboration> collaborations = mindMap.getCollaborations();
final List<RestCollaboration> collabs = new ArrayList<RestCollaboration>(); final List<RestCollaboration> collabs = new ArrayList<RestCollaboration>();
@ -264,11 +272,11 @@ public class MindmapController extends BaseController {
@ResponseStatus(value = HttpStatus.NO_CONTENT) @ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateDescription(@RequestBody String description, @PathVariable int id) throws WiseMappingException { public void updateDescription(@RequestBody String description, @PathVariable int id) throws WiseMappingException {
final MindMap mindMap = mindmapService.getMindmapById(id); final MindMap mindMap = mindmapService.findMindmapById(id);
final User user = Utils.getUser(); final User user = Utils.getUser();
// Update map ... // Update map ...
final MindMap mindmap = mindmapService.getMindmapById(id); final MindMap mindmap = mindmapService.findMindmapById(id);
mindmap.setDescription(description); mindmap.setDescription(description);
saveMindmap(true, mindMap, user); saveMindmap(true, mindMap, user);
} }
@ -277,7 +285,7 @@ public class MindmapController extends BaseController {
@ResponseStatus(value = HttpStatus.NO_CONTENT) @ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updatePublishState(@RequestBody String value, @PathVariable int id) throws WiseMappingException { public void updatePublishState(@RequestBody String value, @PathVariable int id) throws WiseMappingException {
final MindMap mindMap = mindmapService.getMindmapById(id); final MindMap mindMap = mindmapService.findMindmapById(id);
final User user = Utils.getUser(); final User user = Utils.getUser();
if (!!mindMap.hasPermissions(user, CollaborationRole.OWNER)) { if (!!mindMap.hasPermissions(user, CollaborationRole.OWNER)) {
@ -294,7 +302,7 @@ public class MindmapController extends BaseController {
@ResponseStatus(value = HttpStatus.NO_CONTENT) @ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateStarredState(@RequestBody String value, @PathVariable int id) throws WiseMappingException { public void updateStarredState(@RequestBody String value, @PathVariable int id) throws WiseMappingException {
final MindMap mindMap = mindmapService.getMindmapById(id); final MindMap mindMap = mindmapService.findMindmapById(id);
final User user = Utils.getUser(); final User user = Utils.getUser();
// Update map status ... // Update map status ...
@ -306,7 +314,7 @@ public class MindmapController extends BaseController {
@ResponseStatus(value = HttpStatus.NO_CONTENT) @ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateMap(@PathVariable int id) throws IOException, WiseMappingException { public void updateMap(@PathVariable int id) throws IOException, WiseMappingException {
final User user = Utils.getUser(); final User user = Utils.getUser();
final MindMap mindmap = mindmapService.getMindmapById(id); final MindMap mindmap = mindmapService.findMindmapById(id);
mindmapService.removeMindmap(mindmap, user); mindmapService.removeMindmap(mindmap, user);
} }
@ -316,7 +324,7 @@ public class MindmapController extends BaseController {
final User user = Utils.getUser(); final User user = Utils.getUser();
final String[] mapsIds = ids.split(","); final String[] mapsIds = ids.split(",");
for (final String mapId : mapsIds) { for (final String mapId : mapsIds) {
final MindMap mindmap = mindmapService.getMindmapById(Integer.parseInt(mapId)); final MindMap mindmap = mindmapService.findMindmapById(Integer.parseInt(mapId));
mindmapService.removeMindmap(mindmap, user); mindmapService.removeMindmap(mindmap, user);
} }
} }
@ -391,7 +399,7 @@ public class MindmapController extends BaseController {
final User user = Utils.getUser(); final User user = Utils.getUser();
// Create a shallowCopy of the map ... // Create a shallowCopy of the map ...
final MindMap mindMap = mindmapService.getMindmapById(id); final MindMap mindMap = mindmapService.findMindmapById(id);
final MindMap clonedMap = mindMap.shallowClone(); final MindMap clonedMap = mindMap.shallowClone();
clonedMap.setTitle(restMindmap.getTitle()); clonedMap.setTitle(restMindmap.getTitle());
clonedMap.setDescription(restMindmap.getDescription()); clonedMap.setDescription(restMindmap.getDescription());

View File

@ -18,6 +18,7 @@
package com.wisemapping.security.aop; package com.wisemapping.security.aop;
import com.wisemapping.model.Collaborator;
import com.wisemapping.model.MindMap; import com.wisemapping.model.MindMap;
import com.wisemapping.model.User; import com.wisemapping.model.User;
import com.wisemapping.exceptions.AccessDeniedSecurityException; import com.wisemapping.exceptions.AccessDeniedSecurityException;
@ -40,6 +41,9 @@ public abstract class BaseSecurityAdvice {
isAllowed = isAllowed(user, (MindMap) argument); isAllowed = isAllowed(user, (MindMap) argument);
} else if (argument instanceof Integer) { } else if (argument instanceof Integer) {
isAllowed = isAllowed(user, ((Integer) argument)); isAllowed = isAllowed(user, ((Integer) argument));
} else if (argument instanceof Collaborator) {
// Read operation find on the user are allowed ...
isAllowed = user.equals(argument);
} else { } else {
throw new UnexpectedArgumentException("Argument " + argument); throw new UnexpectedArgumentException("Argument " + argument);
} }

View File

@ -30,11 +30,11 @@ public interface MindmapService {
public static final String TAG_SEPARATOR = " "; public static final String TAG_SEPARATOR = " ";
public MindMap getMindmapById(int mindmapId); public MindMap findMindmapById(int mindmapId);
public MindMap getMindmapByTitle(String title, User user); public MindMap getMindmapByTitle(String title, User user);
public List<Collaboration> getCollaborationsBy(@NotNull User user); public List<Collaboration> findCollaborationsBy(@NotNull User user);
public void updateMindmap(MindMap mindMap, boolean saveHistory) throws WiseMappingException; public void updateMindmap(MindMap mindMap, boolean saveHistory) throws WiseMappingException;
@ -45,13 +45,13 @@ public interface MindmapService {
public void removeCollaboration(@NotNull MindMap mindmap, @NotNull Collaboration collaboration) throws CollaborationException; public void removeCollaboration(@NotNull MindMap mindmap, @NotNull Collaboration collaboration) throws CollaborationException;
public void addTags(MindMap mindmap, String tags); public void addTags(@NotNull MindMap mindmap, String tags);
public void removeMindmap(@NotNull final MindMap mindmap, @NotNull final User user) throws WiseMappingException; public void removeMindmap(@NotNull final MindMap mindmap, @NotNull final User user) throws WiseMappingException;
public List<MindMap> search(MindMapCriteria criteria); public List<MindMap> search(MindMapCriteria criteria);
public List<MindMapHistory> getMindMapHistory(int mindmapId); public List<MindMapHistory> findMindmapHistory(int mindmapId);
public boolean hasPermissions(@Nullable User user, MindMap map, CollaborationRole allowedRole); public boolean hasPermissions(@Nullable User user, MindMap map, CollaborationRole allowedRole);
@ -59,5 +59,7 @@ public interface MindmapService {
public void addWelcomeMindmap(User user) throws WiseMappingException; public void addWelcomeMindmap(User user) throws WiseMappingException;
public void revertMapToHistory(MindMap map, int historyId) throws IOException, WiseMappingException; public void revertChange(@NotNull MindMap map, int historyId) throws WiseMappingException;
MindMapHistory findMindmapHistory(int id, int hid) throws WiseMappingException;
} }

View File

@ -28,7 +28,6 @@ import org.jetbrains.annotations.Nullable;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import java.io.IOException;
import java.util.*; import java.util.*;
@ -74,17 +73,17 @@ public class MindmapServiceImpl
} }
@Override @Override
public MindMap getMindmapById(int mindmapId) { public MindMap findMindmapById(int mindmapId) {
return mindmapManager.getMindmapById(mindmapId); return mindmapManager.getMindmapById(mindmapId);
} }
@Override @Override
public List<Collaboration> getCollaborationsBy(@NotNull User user) { public List<Collaboration> findCollaborationsBy(@NotNull User user) {
return mindmapManager.getMindmapUserByCollaborator(user.getId()); return mindmapManager.getMindmapUserByCollaborator(user.getId());
} }
@Override @Override
public void updateMindmap(MindMap mindMap, boolean saveHistory) throws WiseMappingException { public void updateMindmap(@NotNull MindMap mindMap, boolean saveHistory) throws WiseMappingException {
if (mindMap.getTitle() == null || mindMap.getTitle().length() == 0) { if (mindMap.getTitle() == null || mindMap.getTitle().length() == 0) {
throw new WiseMappingException("The tile can not be empty"); throw new WiseMappingException("The tile can not be empty");
} }
@ -221,7 +220,7 @@ public class MindmapServiceImpl
} }
public void addWelcomeMindmap(User user) throws WiseMappingException { public void addWelcomeMindmap(User user) throws WiseMappingException {
final MindMap savedWelcome = getMindmapById(Constants.WELCOME_MAP_ID); final MindMap savedWelcome = findMindmapById(Constants.WELCOME_MAP_ID);
// Is there a welcomed map configured ? // Is there a welcomed map configured ?
if (savedWelcome != null) { if (savedWelcome != null) {
@ -234,15 +233,32 @@ public class MindmapServiceImpl
} }
} }
public List<MindMapHistory> getMindMapHistory(int mindmapId) { public List<MindMapHistory> findMindmapHistory(int mindmapId) {
return mindmapManager.getHistoryFrom(mindmapId); return mindmapManager.getHistoryFrom(mindmapId);
} }
public void revertMapToHistory(MindMap map, int historyId) public void revertChange(@NotNull MindMap mindmap, int historyId)
throws IOException, WiseMappingException { throws WiseMappingException {
final MindMapHistory history = mindmapManager.getHistory(historyId); final MindMapHistory history = mindmapManager.getHistory(historyId);
map.setXml(history.getXml()); mindmap.setXml(history.getXml());
updateMindmap(map, false); updateMindmap(mindmap, true);
}
@Override
public MindMapHistory findMindmapHistory(int id, int hid) throws WiseMappingException {
final List<MindMapHistory> mindmapHistory = this.findMindmapHistory(id);
MindMapHistory result = null;
for (MindMapHistory history : mindmapHistory) {
if (history.getId() == hid) {
result = history;
break;
}
}
if (result == null) {
throw new WiseMappingException("History could not be found for mapid=" + id + ",hid" + hid);
}
return result;
} }
private Collaboration getCollaborationBy(String email, Set<Collaboration> collaborations) { private Collaboration getCollaborationBy(String email, Set<Collaboration> collaborations) {

View File

@ -12,6 +12,8 @@
<list> <list>
<value>getMindmapUserBy</value> <value>getMindmapUserBy</value>
<value>getMindmapById</value> <value>getMindmapById</value>
<value>find*</value>
<value>filter*</value>
</list> </list>
</property> </property>
</bean> </bean>
@ -27,6 +29,7 @@
<value>update*</value> <value>update*</value>
<value>add*</value> <value>add*</value>
<value>remove*</value> <value>remove*</value>
<value>revert*</value>
</list> </list>
</property> </property>
</bean> </bean>

View File

@ -8,7 +8,7 @@
<%@ include file="/jsp/init.jsp" %> <%@ include file="/jsp/init.jsp" %>
<html> <html>
<head> <head>
<base href="../../../"/> <base href="${pageContext.request.contextPath}/"/>
<title><spring:message code="SITE.TITLE"/> - ${mindmap.title} </title> <title><spring:message code="SITE.TITLE"/> - ${mindmap.title} </title>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
@ -63,10 +63,10 @@
<div id="headerActions"> <div id="headerActions">
<spring:message code="WELCOME"/>, ${principal.firstname}|<span><a <spring:message code="WELCOME"/>, ${principal.firstname}|<span><a
href="${pageContext.request.contextPath}/c/maps/"><spring:message code="MY_WISEMAPS"/></a></span> | href="c/maps/"><spring:message code="MY_WISEMAPS"/></a></span> |
<span><a id="settings" href="${pageContext.request.contextPath}/c/settings" <span><a id="settings" href="c/settings"
title="<spring:message code="SETTINGS_DETAIL"/>"><spring:message code="SETTINGS"/></a></span> title="<spring:message code="SETTINGS_DETAIL"/>"><spring:message code="SETTINGS"/></a></span>
| <span><a href="${pageContext.request.contextPath}/c/logout" title="<spring:message code="LOGOUT"/>"> | <span><a href="c/logout" title="<spring:message code="LOGOUT"/>">
<spring:message code="LOGOUT"/> <spring:message code="LOGOUT"/>
</a></span> </a></span>
</div> </div>

View File

@ -43,13 +43,16 @@
tableElem.find('tr a.view').each(function() { tableElem.find('tr a.view').each(function() {
$(this).click(function(event) { $(this).click(function(event) {
window.open("/c/maps/${mindmapId}/view"); window.open("/c/maps/${mindmapId}/" + $(this).closest("tr").attr("data-history-id") + "/view");
event.preventDefault(); event.preventDefault();
}); });
}); });
tableElem.find('tr a.revert').each(function() { tableElem.find('tr a.revert').each(function() {
$(this).click(function(event) { $(this).click(function(event) {
window.location = "/c/maps/${mindmapId}/edit"; var url = "service/maps/${mindmapId}/history/" + $(this).closest("tr").attr("data-history-id");
jQuery.post(url, function(data) {
window.parent.location = "c/maps/${mindmapId}/edit";
});
event.preventDefault(); event.preventDefault();
}); });
}); });