From c4021bf3c45e1f8ecfbd00ade5fb2e04fa2f14cf Mon Sep 17 00:00:00 2001 From: Pablo Luna Date: Thu, 31 Mar 2011 15:16:45 +0100 Subject: [PATCH] removing svg from save operation --- .../src/main/javascript/MindmapDesigner.js | 3 +- .../src/main/javascript/PersistanceManager.js | 5 ++- .../controller/EmbeddedViewController.java | 3 +- .../controller/NewMindmapController.java | 3 -- .../com/wisemapping/dwr/MapEditorService.java | 13 +------- .../importer/freemind/FreemindImporter.java | 2 -- .../java/com/wisemapping/model/MindMap.java | 33 +++---------------- .../service/MindmapServiceImpl.java | 6 ---- .../WEB-INF/classes/messages.properties | 2 ++ .../main/webapp/WEB-INF/defs/definitions.xml | 1 + .../src/main/webapp/jsp/embeddedViewImg.jsp | 2 +- .../webapp/jsp/embeddedViewNotSupported.jsp | 18 ++++++++++ .../wisemapping/test/export/ExportTest.java | 4 --- 13 files changed, 32 insertions(+), 63 deletions(-) create mode 100644 wise-webapp/src/main/webapp/jsp/embeddedViewNotSupported.jsp diff --git a/mindplot/src/main/javascript/MindmapDesigner.js b/mindplot/src/main/javascript/MindmapDesigner.js index f9d14362..03624b08 100644 --- a/mindplot/src/main/javascript/MindmapDesigner.js +++ b/mindplot/src/main/javascript/MindmapDesigner.js @@ -352,9 +352,8 @@ mindplot.MindmapDesigner.prototype.save = function(onSavedHandler, saveHistory) var persistantManager = mindplot.PersistanceManager; var mindmap = this._mindmap; - var xmlChart = this._workspace.dumpNativeChart(); var properties = {zoom:this._zoom}; - persistantManager.save(mindmap, xmlChart, properties, onSavedHandler, saveHistory); + persistantManager.save(mindmap, properties, onSavedHandler, saveHistory); this._fireEvent("save", {type:saveHistory}); // Refresh undo state... diff --git a/mindplot/src/main/javascript/PersistanceManager.js b/mindplot/src/main/javascript/PersistanceManager.js index af8b4517..eae8c24c 100644 --- a/mindplot/src/main/javascript/PersistanceManager.js +++ b/mindplot/src/main/javascript/PersistanceManager.js @@ -18,10 +18,9 @@ mindplot.PersistanceManager = {}; -mindplot.PersistanceManager.save = function(mindmap, xmlChart, editorProperties, onSavedHandler,saveHistory) +mindplot.PersistanceManager.save = function(mindmap, editorProperties, onSavedHandler,saveHistory) { core.assert(mindmap, "mindmap can not be null"); - core.assert(xmlChart, "xmlChart can not be null"); core.assert(editorProperties, "editorProperties can not be null"); var mapId = mindmap.getId(); @@ -31,7 +30,7 @@ mindplot.PersistanceManager.save = function(mindmap, xmlChart, editorProperties, var xmlMapStr = core.Utils.innerXML(xmlMap); var pref = Json.toString(editorProperties); - window.MapEditorService.saveMap(mapId, xmlMapStr, xmlChart, pref,saveHistory, + window.MapEditorService.saveMap(mapId, xmlMapStr, pref,saveHistory, { callback:function(response) { diff --git a/wise-webapp/src/main/java/com/wisemapping/controller/EmbeddedViewController.java b/wise-webapp/src/main/java/com/wisemapping/controller/EmbeddedViewController.java index abb308c0..1f949153 100644 --- a/wise-webapp/src/main/java/com/wisemapping/controller/EmbeddedViewController.java +++ b/wise-webapp/src/main/java/com/wisemapping/controller/EmbeddedViewController.java @@ -64,8 +64,7 @@ public class EmbeddedViewController extends BaseMultiActionController { } else { - view = new ModelAndView("embeddedViewImg"); - view.addObject("mindmap", mindmap); + view = new ModelAndView("embeddedViewNotSupported"); } view.addObject("fullView", fullView); diff --git a/wise-webapp/src/main/java/com/wisemapping/controller/NewMindmapController.java b/wise-webapp/src/main/java/com/wisemapping/controller/NewMindmapController.java index 98aaf8ef..6c0188da 100644 --- a/wise-webapp/src/main/java/com/wisemapping/controller/NewMindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/controller/NewMindmapController.java @@ -20,7 +20,6 @@ package com.wisemapping.controller; import com.wisemapping.exceptions.WiseMappingException; import com.wisemapping.model.MindMap; -import com.wisemapping.model.MindMapNative; import com.wisemapping.model.User; import com.wisemapping.security.Utils; import com.wisemapping.service.MindmapService; @@ -55,8 +54,6 @@ public class NewMindmapController final String defaultNativeMap = getDefaultMindmapXml(title); mindmap.setNativeXml(defaultNativeMap); - final MindMapNative nativeBrowser = new MindMapNative(); - mindmap.setNativeBrowser(nativeBrowser); final User dbUSer = getUserService().getUserBy(user.getId()); service.addMindmap(mindmap, dbUSer); diff --git a/wise-webapp/src/main/java/com/wisemapping/dwr/MapEditorService.java b/wise-webapp/src/main/java/com/wisemapping/dwr/MapEditorService.java index 067b6c54..a2ea2fe0 100644 --- a/wise-webapp/src/main/java/com/wisemapping/dwr/MapEditorService.java +++ b/wise-webapp/src/main/java/com/wisemapping/dwr/MapEditorService.java @@ -32,7 +32,6 @@ import java.util.Calendar; import java.util.Date; import com.wisemapping.model.MindMap; -import com.wisemapping.model.MindMapNative; import com.wisemapping.model.User; import com.wisemapping.service.MindmapService; import com.wisemapping.exceptions.WiseMappingException; @@ -50,22 +49,12 @@ public class MapEditorService } public ResponseMessage saveMap(final int mapId, final String nativeXml, - String chartXml, final String editorProperties,boolean saveHistory) + final String editorProperties,boolean saveHistory) throws IOException, WiseMappingException { final MindmapService serservice = getMindmapService(); final MindMap mindMap = serservice.getMindmapById(mapId); final User user = this.getUser(); - MindMapNative nativeBrowser = mindMap.getNativeBrowser(); - - if (nativeBrowser == null) { - nativeBrowser = new MindMapNative(); - } - - nativeBrowser.setSvgXml(chartXml); - nativeBrowser.setVmlXml((byte[]) null); - - mindMap.setNativeBrowser(nativeBrowser); mindMap.setProperties(editorProperties); final Calendar now = Calendar.getInstance(); diff --git a/wise-webapp/src/main/java/com/wisemapping/importer/freemind/FreemindImporter.java b/wise-webapp/src/main/java/com/wisemapping/importer/freemind/FreemindImporter.java index ddd2db6a..a136e6fa 100755 --- a/wise-webapp/src/main/java/com/wisemapping/importer/freemind/FreemindImporter.java +++ b/wise-webapp/src/main/java/com/wisemapping/importer/freemind/FreemindImporter.java @@ -23,7 +23,6 @@ import com.wisemapping.importer.Importer; import com.wisemapping.importer.ImporterException; import com.wisemapping.model.MindMap; import com.wisemapping.model.ShapeStyle; -import com.wisemapping.model.MindMapNative; import com.wisemapping.util.JAXBUtils; import com.wisemapping.xml.freemind.*; import com.wisemapping.xml.freemind.Map; @@ -93,7 +92,6 @@ public class FreemindImporter map.setNativeXml(new String(out.toByteArray(), Charset.forName("UTF-8"))); map.setTitle(mapName); map.setDescription(description); - map.setNativeBrowser(new MindMapNative()); } catch (JAXBException e) { throw new ImporterException(e); diff --git a/wise-webapp/src/main/java/com/wisemapping/model/MindMap.java b/wise-webapp/src/main/java/com/wisemapping/model/MindMap.java index c16c4bd2..a8823d1f 100644 --- a/wise-webapp/src/main/java/com/wisemapping/model/MindMap.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/MindMap.java @@ -64,7 +64,7 @@ public class MindMap { private String lastModifierUser; private Set mindmapUsers = new HashSet(); - private MindMapNative nativeBrowser; + private MindMapNative nativeBrowser = new MindMapNative(); private User owner; private String properties; private String tags; @@ -218,38 +218,15 @@ public class MindMap { public char[] generateSvgXml(String mapSvg) throws IOException, JAXBException { String svgText = mapSvg; - final MindMapNative mindmapNativeBrowser = this.getNativeBrowser(); - if(svgText==null){ - svgText = mindmapNativeBrowser.getUnzippedSvgXml(); - } - if (svgText == null || svgText.length() == 0) { - // The map must be saved using IE. Convert VML to SVG. - // Add namespace to the converter ... - String vmlXml = mindmapNativeBrowser.getUnzippedVmlXml(); - vmlXml = vmlXml.replaceFirst("]+)>", ""); - return result.toCharArray(); - } + return result.toCharArray(); } public String getDescription() { 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 44dc1040..744aaff1 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java @@ -229,12 +229,6 @@ public class MindmapServiceImpl welcomeMap.setDescription(savedWelcome.getDescription()); welcomeMap.setXml(savedWelcome.getXml()); - final MindMapNative mindmapNative = new MindMapNative(); - mindmapNative.setSvgXml(savedWelcome.getNativeBrowser().getSvgXml()); - mindmapNative.setVmlXml(savedWelcome.getNativeBrowser().getVmlXml()); - - welcomeMap.setNativeBrowser(mindmapNative); - addMindmap(welcomeMap, user); } } diff --git a/wise-webapp/src/main/webapp/WEB-INF/classes/messages.properties b/wise-webapp/src/main/webapp/WEB-INF/classes/messages.properties index 3b5b480c..b36cb68f 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/classes/messages.properties +++ b/wise-webapp/src/main/webapp/WEB-INF/classes/messages.properties @@ -329,3 +329,5 @@ INSTALL_CFG_BROWSERS=This plug in is not necessary for Internet Explorer 9, or a INSTALL_CFG_CLICK_HERE=To download click here INVALID_EMAIL_ERROR = The e-mail was not verified +BROWSER_NOT_SUPPOERTED= Current Browser is not supported. +CHECK_BROWSERS= You can check supported browser at \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml b/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml index a60aef69..1e5f317d 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml @@ -10,6 +10,7 @@ + diff --git a/wise-webapp/src/main/webapp/jsp/embeddedViewImg.jsp b/wise-webapp/src/main/webapp/jsp/embeddedViewImg.jsp index a6200458..fa613b7f 100644 --- a/wise-webapp/src/main/webapp/jsp/embeddedViewImg.jsp +++ b/wise-webapp/src/main/webapp/jsp/embeddedViewImg.jsp @@ -17,7 +17,7 @@
-
+
diff --git a/wise-webapp/src/main/webapp/jsp/embeddedViewNotSupported.jsp b/wise-webapp/src/main/webapp/jsp/embeddedViewNotSupported.jsp new file mode 100644 index 00000000..211bf5a3 --- /dev/null +++ b/wise-webapp/src/main/webapp/jsp/embeddedViewNotSupported.jsp @@ -0,0 +1,18 @@ + + +<%@ include file="/jsp/init.jsp" %> + + + + + + + + + + + + diff --git a/wise-webapp/src/test/java/com/wisemapping/test/export/ExportTest.java b/wise-webapp/src/test/java/com/wisemapping/test/export/ExportTest.java index 7d0de138..0a6993a7 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/export/ExportTest.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/export/ExportTest.java @@ -6,7 +6,6 @@ import com.wisemapping.exporter.ExportProperties; import com.wisemapping.importer.ImporterException; import com.wisemapping.model.MindMap; -import com.wisemapping.model.MindMapNative; import org.apache.batik.transcoder.TranscoderException; import org.jetbrains.annotations.NotNull; import org.testng.Assert; @@ -47,9 +46,6 @@ public class ExportTest { // Write content ... MindMap mindMap = new MindMap(); - MindMapNative nativeBrowser = new MindMapNative(); - nativeBrowser.setSvgXml(svgXml); - mindMap.setNativeBrowser(nativeBrowser); if(pngFile.exists()){ // Export mile content ...