support both export versions for freemind (old and new 1.0.1)
This commit is contained in:
@@ -114,13 +114,14 @@ public class MindmapController extends BaseController {
|
||||
return new ModelAndView("transformViewWise", values);
|
||||
}
|
||||
|
||||
@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","version"})
|
||||
@ResponseBody
|
||||
public ModelAndView retrieveDocumentAsFreemind(@PathVariable int id) throws IOException, MapCouldNotFoundException {
|
||||
public ModelAndView retrieveDocumentAsFreemind(@PathVariable int id, @RequestParam(value = "version") String version) throws IOException, MapCouldNotFoundException {
|
||||
final Mindmap mindMap = findMindmapById(id);
|
||||
final Map<String, Object> values = new HashMap<String, Object>();
|
||||
values.put("content", mindMap.getXmlStr());
|
||||
values.put("filename", mindMap.getTitle());
|
||||
values.put("version", version);
|
||||
return new ModelAndView("transformViewFreemind", values);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ public class TransformView extends AbstractView {
|
||||
|
||||
final String content = (String) viewMap.get("content");
|
||||
final String filename = (String) viewMap.get("filename");
|
||||
final String version = (String) viewMap.get("version");
|
||||
|
||||
// Build format properties ...
|
||||
final ExportProperties properties = ExportProperties.create(exportFormat);
|
||||
@@ -63,6 +64,9 @@ public class TransformView extends AbstractView {
|
||||
final ExportProperties.ImageProperties imageProperties = (ExportProperties.ImageProperties) properties;
|
||||
imageProperties.setSize(ExportProperties.ImageProperties.Size.LARGE);
|
||||
}
|
||||
if (version != null) {
|
||||
properties.setVersion(version);
|
||||
}
|
||||
|
||||
// Set format content type...
|
||||
final String contentType = exportFormat.getContentType();
|
||||
|
||||
Reference in New Issue
Block a user