Fix resources generation bug
Add support for try.
This commit is contained in:
@@ -34,19 +34,6 @@ public class ExtensionsController {
|
||||
@Autowired
|
||||
private MindmapService mindmapService;
|
||||
|
||||
@RequestMapping(value = "try")
|
||||
public ModelAndView tryEditor() throws IOException {
|
||||
|
||||
final Mindmap mindmap = mindmapService.findMindmapById(TRY_EXAMPLE_MINDMAP_ID);
|
||||
|
||||
ModelAndView view = new ModelAndView("mindmapEditor", "mindmap", mindmap);
|
||||
final String xmlMap = mindmap.getXmlAsJsLiteral();
|
||||
view.addObject(MAP_XML_PARAM, xmlMap);
|
||||
view.addObject("editorTryMode", true);
|
||||
view.addObject("showHelp", true);
|
||||
return view;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "privacyPolicy")
|
||||
public ModelAndView privacyPolicy() {
|
||||
return new ModelAndView("privacyPolicy");
|
||||
@@ -56,8 +43,4 @@ public class ExtensionsController {
|
||||
public ModelAndView faq() {
|
||||
return new ModelAndView("faq");
|
||||
}
|
||||
|
||||
public static final int TRY_EXAMPLE_MINDMAP_ID = 3;
|
||||
public static final String MAP_XML_PARAM = "mapXml";
|
||||
|
||||
}
|
||||
|
@@ -138,39 +138,43 @@ public class MindmapController {
|
||||
final MindMapBean mindmapBean = findMindmapBean(id);
|
||||
final Mindmap mindmap = mindmapBean.getDelegated();
|
||||
|
||||
String result;
|
||||
if (mindmap.hasPermissions(Utils.getUser(), CollaborationRole.EDITOR)) {
|
||||
model.addAttribute("mindmap", mindmapBean);
|
||||
model.addAttribute("mindmap", mindmapBean);
|
||||
|
||||
// Configure default locale for the editor ...
|
||||
final Locale locale = LocaleContextHolder.getLocale();
|
||||
model.addAttribute("locale", locale.toString().toLowerCase());
|
||||
model.addAttribute("principal", Utils.getUser());
|
||||
result = "mindmapEditor";
|
||||
} else {
|
||||
result = "redirect:view";
|
||||
}
|
||||
return result;
|
||||
// Configure default locale for the editor ...
|
||||
final Locale locale = LocaleContextHolder.getLocale();
|
||||
model.addAttribute("locale", locale.toString().toLowerCase());
|
||||
model.addAttribute("principal", Utils.getUser());
|
||||
model.addAttribute("readOnlyMode", !mindmap.hasPermissions(Utils.getUser(), CollaborationRole.EDITOR));
|
||||
|
||||
return "mindmapEditor";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "maps/{id}/view", method = RequestMethod.GET)
|
||||
public String showMindmapViewerPage(@PathVariable int id, @NotNull Model model) {
|
||||
final MindMapBean mindmapBean = findMindmapBean(id);
|
||||
model.addAttribute("mindmap", mindmapBean);
|
||||
final String result = showMindmapEditorPage(id, model);
|
||||
model.addAttribute("readOnlyMode", true);
|
||||
return "mindmapEditor";
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "maps/{id}/try", method = RequestMethod.GET)
|
||||
public String showMindmapTryPage(@PathVariable int id, @NotNull Model model) {
|
||||
final String result = showMindmapEditorPage(id, model);
|
||||
model.addAttribute("memoryPersistence", true);
|
||||
return result;
|
||||
}
|
||||
|
||||
@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);
|
||||
final String result = showMindmapEditorPage(id, model);
|
||||
model.addAttribute("readOnlyMode", true);
|
||||
|
||||
return "mindmapEditor";
|
||||
// Change map XML ....
|
||||
final MindMapBean mindmapBean = (MindMapBean) model.asMap().get("mindmap");
|
||||
final MindMapHistory mindmapHistory = mindmapService.findMindmapHistory(id, hid);
|
||||
mindmapBean.getDelegated().setXml(mindmapHistory.getXml());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "maps/{id}/embed")
|
||||
|
Reference in New Issue
Block a user