Add new files.

This commit is contained in:
Paulo Gustavo Veiga 2013-02-13 22:46:45 -03:00
parent 9360a27f15
commit d1dfb48be5
3 changed files with 11 additions and 7 deletions

View File

@ -182,6 +182,15 @@ public class MindmapController extends BaseController {
return mindmap.getXmlStr().getBytes("UTF-8");
}
@RequestMapping(method = RequestMethod.GET, value = { "/maps/{id}/{hid}/document/xml"},consumes = {"text/plain"}, produces = {"application/xml"})
@ResponseBody
public byte[] retrieveDocument(@PathVariable int id, @PathVariable int hid,@NotNull HttpServletResponse response) throws WiseMappingException, IOException {
// I should not return byte, but there is some encoding issue here. Further research needed.
response.setCharacterEncoding("UTF-8");
final MindMapHistory mindmapHistory = mindmapService.findMindmapHistory(id, hid);
return mindmapHistory.getXml();
}
private void verifyLock(@NotNull Mindmap mindmap, @NotNull User user, long session, long timestamp) throws WiseMappingException {

View File

@ -194,12 +194,7 @@ public class MindmapController {
final String result = showMindmapEditorPage(id, model);
model.addAttribute("readOnlyMode", true);
// Change map XML ....
final MindMapBean mindmapBean = (MindMapBean) model.asMap().get("mindmap");
final MindMapHistory mindmapHistory = mindmapService.findMindmapHistory(id, hid);
mindmapBean.getDelegated().setXml(mindmapHistory.getXml());
model.addAttribute("hid",hid);
return result;
}

View File

@ -45,7 +45,7 @@
);
</c:if>
<c:if test="${memoryPersistence || readOnlyMode}">
options.persistenceManager = new mindplot.LocalStorageManager("c/restful/maps/{id}/document/xml${principal!=null?'':'-pub'}");
options.persistenceManager = new mindplot.LocalStorageManager("c/restful/maps/{id}${hid!=null?'/'+hid:''}/document/xml${principal!=null?'':'-pub'}");
</c:if>
var userOptions = ${mindmap.properties};