diff --git a/wise-webapp/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java b/wise-webapp/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java index b7f3e110..b8cd3522 100644 --- a/wise-webapp/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java @@ -27,6 +27,7 @@ import org.hibernate.criterion.Junction; import org.hibernate.criterion.Order; import org.hibernate.Criteria; +import java.io.IOException; import java.util.List; import java.util.Calendar; @@ -234,10 +235,10 @@ public class MindmapManagerImpl getHibernateTemplate().delete(mindMap); } - private void saveHistory(@NotNull final Mindmap mindMap) { + private void saveHistory(@NotNull final Mindmap mindMap) throws IOException { final MindMapHistory history = new MindMapHistory(); - history.setXml(mindMap.getXml()); + history.setZippedXml(mindMap.getZippedXml()); history.setCreationTime(Calendar.getInstance()); history.setEditor(mindMap.getLastEditor()); history.setMindmapId(mindMap.getId()); diff --git a/wise-webapp/src/main/java/com/wisemapping/model/MindMapHistory.java b/wise-webapp/src/main/java/com/wisemapping/model/MindMapHistory.java index c6b6f319..d33c9be3 100755 --- a/wise-webapp/src/main/java/com/wisemapping/model/MindMapHistory.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/MindMapHistory.java @@ -29,7 +29,7 @@ public class MindMapHistory { private int id; private Calendar creationTime; private User editor; - private byte[] xml; + private byte[] zippedXml; private int mindmapId; public MindMapHistory() { @@ -69,15 +69,15 @@ public class MindMapHistory { this.editor = editor; } - public byte[] getXml() { - return xml; + public byte[] getZippedXml() { + return zippedXml; } - public void setXml(byte[] value) { - xml = value; + public void setZippedXml(byte[] value) { + zippedXml = value; } public byte[] getUnzipXml() throws IOException { - return ZipUtils.zipToBytes(getXml()); + return ZipUtils.zipToBytes(getZippedXml()); } } diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java index 757d5396..87044cfa 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -172,7 +172,7 @@ public class MindmapController extends BaseController { List mindmapHistory = mindmapService.findMindmapHistory(id); if (mindmapHistory.size() > 0) { final MindMapHistory mindMapHistory = mindmapHistory.get(0); - mindmap.setZippedXml(mindMapHistory.getXml()); + mindmap.setZippedXml(mindMapHistory.getZippedXml()); saveMindmapDocument(true, mindmap, user); } } else { diff --git a/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java b/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java index 70b2a83b..f624a324 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java @@ -263,7 +263,7 @@ public class MindmapServiceImpl public void revertChange(@NotNull Mindmap mindmap, int historyId) throws WiseMappingException, IOException { final MindMapHistory history = mindmapManager.getHistory(historyId); - mindmap.setZippedXml(history.getXml()); + mindmap.setZippedXml(history.getZippedXml()); updateMindmap(mindmap, true); } diff --git a/wise-webapp/src/main/resources/com/wisemapping/model/MindMapHistory.hbm.xml b/wise-webapp/src/main/resources/com/wisemapping/model/MindMapHistory.hbm.xml index 29e9e836..cf83813a 100755 --- a/wise-webapp/src/main/resources/com/wisemapping/model/MindMapHistory.hbm.xml +++ b/wise-webapp/src/main/resources/com/wisemapping/model/MindMapHistory.hbm.xml @@ -11,7 +11,7 @@ - +