From 51f531f6b495c7c06e890f3641aa686a597f4853 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 13 Feb 2013 23:13:27 -0300 Subject: [PATCH] Fix revert on zip format. --- .../main/java/com/wisemapping/service/MindmapService.java | 3 ++- .../java/com/wisemapping/service/MindmapServiceImpl.java | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/service/MindmapService.java b/wise-webapp/src/main/java/com/wisemapping/service/MindmapService.java index b012c121..a78dd26d 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/MindmapService.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/MindmapService.java @@ -23,6 +23,7 @@ import com.wisemapping.exceptions.WiseMappingException; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.io.IOException; import java.util.List; public interface MindmapService { @@ -57,7 +58,7 @@ public interface MindmapService { boolean hasPermissions(@Nullable User user, int mapId, CollaborationRole allowedRole); - void revertChange(@NotNull Mindmap map, int historyId) throws WiseMappingException; + void revertChange(@NotNull Mindmap map, int historyId) throws WiseMappingException, IOException; MindMapHistory findMindmapHistory(int id, int hid) throws WiseMappingException; 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 e4fc70f8..05b6e1bf 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java @@ -28,6 +28,7 @@ import org.jetbrains.annotations.Nullable; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; +import java.io.IOException; import java.util.Calendar; import java.util.List; import java.util.Set; @@ -242,9 +243,9 @@ public class MindmapServiceImpl @Override public void revertChange(@NotNull Mindmap mindmap, int historyId) - throws WiseMappingException { + throws WiseMappingException, IOException { final MindMapHistory history = mindmapManager.getHistory(historyId); - mindmap.setXml(history.getXml()); + mindmap.setZippedXml(history.getXml()); updateMindmap(mindmap, true); }