From 65de7403d76b8896a3cc855a0073c897963265f4 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Fri, 17 Feb 2012 21:00:41 -0300 Subject: [PATCH 01/45] Fix Firefox issue that causes that the map is not centered. --- Compiling-and-running.md | 8 +-- web2d/src/main/javascript/Workspace.js | 2 +- wise-editor/src/main/webapp/css/editor.less | 80 ++------------------- wise-editor/src/main/webapp/js/editor.js | 54 +++++++------- 4 files changed, 40 insertions(+), 104 deletions(-) diff --git a/Compiling-and-running.md b/Compiling-and-running.md index fda2addb..74a25a5c 100644 --- a/Compiling-and-running.md +++ b/Compiling-and-running.md @@ -5,7 +5,7 @@ The following products must be installed: * Java Development Kit 6 or higher (http://java.sun.com/javase/downloads/index.jsp) - * Maven 2.2.1 or higher (http://maven.apache.org/) + * Maven 3.x or higher (http://maven.apache.org/) ## Compiling @@ -14,13 +14,14 @@ WiseMapping uses Maven as packaging and project management. The project is compo * core-js: Utilities JavaScript libraries * web2d: JavaScript 2D VML/SVG abstraction library used by the mind map editor * mindplot: JavaScript mind map designer core + * wise-editor: Mindmap Editor standalone distribution * wise-webapp: J2EE web application Full compilation of the project can be done executing within : -`mvn install` +`mvn package` -Once this command is execute, the file /wise-webapp/target/wisemapping.war will be generated. +Once this command is execute, the file /wise-webapp/target/wisemapping*.war will be generated. ## Testing The previously generated war can be deployed locally executing within the directory /wise-webapp the following command: @@ -30,5 +31,4 @@ The previously generated war can be deployed locally executing within the direct This will start the application on the URL: http://localhost:8080/wise-webapp/. Additionally, a file based database is automatically populated with a test user. User: test@wisemapping.org - Password: test \ No newline at end of file diff --git a/web2d/src/main/javascript/Workspace.js b/web2d/src/main/javascript/Workspace.js index 8fe78d5c..158e1f5e 100644 --- a/web2d/src/main/javascript/Workspace.js +++ b/web2d/src/main/javascript/Workspace.js @@ -66,7 +66,7 @@ web2d.Workspace = new Class({ _createDivContainer : function(domElement) { var container = window.document.createElement("div"); container.id = "workspaceContainer"; - container.style.overflow = "hidden"; +// container.style.overflow = "hidden"; container.style.position = "relative"; container.style.top = "0px"; container.style.left = "0px"; diff --git a/wise-editor/src/main/webapp/css/editor.less b/wise-editor/src/main/webapp/css/editor.less index 17ce1982..5cff02f5 100644 --- a/wise-editor/src/main/webapp/css/editor.less +++ b/wise-editor/src/main/webapp/css/editor.less @@ -1,91 +1,21 @@ @import "compatibility.less"; @import "../css/libraries/moodialog/css/MooDialog.css"; - -/**********************************************************/ -/* Error Dialog ... */ -/**********************************************************/ - -#waitDialog { - position: absolute; - top: 10px; - left: 10px; - height: 200px; -} - -#waitingContainer, #errorContainer { - position: relative; - top: 80px; - height: 120px; /*background: whitesmoke;*/ - background: #FEFEFE; - opacity: .99; - padding: 15px; - width: 100%; - border: 1px solid; - border-color: #a9a9a9; - -} - -#errorContainer { - width: 400px; - border: 1px solid red; -} - -#waitingContainer .loadingText { - position: relative; - top: 50%; - margin-top: -35px; - font-size: 30px; - font-weight: bold; - vertical-align: text-bottom; - height: 30px; - float: left; -} - -#errorContainer .loadingText { - position: relative; - top: 50%; - margin-top: -80px; - font-size: 15px; - font-weight: bold; - vertical-align: text-bottom; - height: 30px; - float: right; - padding-left: 120px; -} - -#waitingContainer .loadingIcon { - position: relative; - background: url(../images/rebota.gif) no-repeat; - top: 50%; - margin-top: -65px; - height: 100px; - width: 121px; - float: left; - clear: both; -} - -#errorContainer .loadingIcon { - position: relative; - background: url(../images/errorIcon.png) no-repeat; - top: 50%; - margin-top: -65px; - height: 100px; - width: 121px; - float: left; - clear: both; -} - /********************************************************************************/ /* Header & Toolbar Styles */ /********************************************************************************/ @import "header.less"; +body { + overflow:hidden; +} + div#mindplot { position: relative; top: 0; left: 0; width: 100%; + height:100%; border: 0; } diff --git a/wise-editor/src/main/webapp/js/editor.js b/wise-editor/src/main/webapp/js/editor.js index 5b17f47d..94f361f3 100644 --- a/wise-editor/src/main/webapp/js/editor.js +++ b/wise-editor/src/main/webapp/js/editor.js @@ -90,6 +90,7 @@ function loadDesignerOptions(jsonConf) { }; result = {readOnly:false,zoom:0.85,saveOnLoad:true,size:containerSize,viewPort:viewPort,container:'mindplot'}; } + console.log("result:" + JSON.encode(result)); return result; } @@ -161,32 +162,37 @@ editor.WaitDialog = new Class({ }); editor.Help = { - buildHelp:function(panel){ + buildHelp:function(panel) { var container = new Element('div'); container.setStyles({width:'100%', textAlign:'center'}); - var content1 = Help.buildContentIcon('../images/black-keyboard.png', 'Keyboard Shortcuts', function(){MOOdalBox.open('keyboard.htm','KeyBoard Shortcuts', '500px 400px', false);panel.hidePanel();}); - var content2 = Help.buildContentIcon('../images/firstSteps.png', 'Editor First Steps', function(){ - var wOpen; - var sOptions; + var content1 = Help.buildContentIcon('../images/black-keyboard.png', 'Keyboard Shortcuts', function() { + MOOdalBox.open('keyboard.htm', 'KeyBoard Shortcuts', '500px 400px', false); + panel.hidePanel(); + }); + var content2 = Help.buildContentIcon('../images/firstSteps.png', 'Editor First Steps', function() { + var wOpen; + var sOptions; - sOptions = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes'; - sOptions = sOptions + ',width=' + (screen.availWidth - 10).toString(); - sOptions = sOptions + ',height=' + (screen.availHeight - 122).toString(); - sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0'; + sOptions = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes'; + sOptions = sOptions + ',width=' + (screen.availWidth - 10).toString(); + sOptions = sOptions + ',height=' + (screen.availHeight - 122).toString(); + sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0'; - wOpen = window.open("firststeps.htm", "WiseMapping", "width=100px, height=100px"); - wOpen.focus(); - wOpen.moveTo( 0, 0 ); - wOpen.resizeTo( screen.availWidth, screen.availHeight ); - panel.hidePanel(); + wOpen = window.open("firststeps.htm", "WiseMapping", "width=100px, height=100px"); + wOpen.focus(); + wOpen.moveTo(0, 0); + wOpen.resizeTo(screen.availWidth, screen.availHeight); + panel.hidePanel(); }); - container.addEvent('show', function(){ - content1.effect('opacity',{duration:800}).start(0,100); - var eff = function(){content2.effect('opacity',{duration:800}).start(0,100);}; + container.addEvent('show', function() { + content1.effect('opacity', {duration:800}).start(0, 100); + var eff = function() { + content2.effect('opacity', {duration:800}).start(0, 100); + }; eff.delay(150); }); - container.addEvent('hide', function(){ + container.addEvent('hide', function() { content1.effect('opacity').set(0); content2.effect('opacity').set(0) }); @@ -194,25 +200,25 @@ editor.Help = { content2.inject(container); return container; }, - buildContentIcon:function(image, text, onClickFn){ + buildContentIcon:function(image, text, onClickFn) { var container = new Element('div').setStyles({margin:'15px 0px 0px 0px', opacity:0, padding:'5px 0px', border: '1px solid transparent', cursor:'pointer'}); var icon = new Element('div'); - icon.addEvent('click',onClickFn); + icon.addEvent('click', onClickFn); var img = new Element('img'); - img.setProperty('src',image); + img.setProperty('src', image); img.inject(icon); icon.inject(container); var textContainer = new Element('div').setStyles({width:'100%', color:'white'}); - textContainer.innerHTML=text; + textContainer.innerHTML = text; textContainer.inject(container); - container.addEvent('mouseover', function(event){ + container.addEvent('mouseover', function() { $(this).setStyle('border-top', '1px solid #BBB4D6'); $(this).setStyle('border-bottom', '1px solid #BBB4D6'); }.bindWithEvent(container)); - container.addEvent('mouseout', function(event){ + container.addEvent('mouseout', function() { $(this).setStyle('border-top', '1px solid transparent'); $(this).setStyle('border-bottom', '1px solid transparent'); From 8fda11b34c8e56c09a5844c5af39d6f4c2bab151 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 19 Feb 2012 13:51:19 -0300 Subject: [PATCH 02/45] REmove out of date faq. --- Faq.textile | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 Faq.textile diff --git a/Faq.textile b/Faq.textile deleted file mode 100644 index ed01ff1e..00000000 --- a/Faq.textile +++ /dev/null @@ -1,11 +0,0 @@ -h1. FAQ - -h2. Which technology is being used to render the mind maps? - -We use SVG for Firefox and Safari, and VML for IE and Opera. - -SVG (Scalable Vectorial Graphics) allows straightforward and efficient vector graphics animation and VML (Vector Markup Language) supports the markup of vector graphic information in the same way that HTML supports the markup of textual information. - -h2. What's the source code License? - -http://www.wisemapping.org/license \ No newline at end of file From 5216f954107e8e769f8513eaaf53bf2972149e2e Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 19 Feb 2012 13:56:49 -0300 Subject: [PATCH 03/45] Minor doc fix. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b9d08a2..f93ca778 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The following products must be installed: WiseMapping uses Maven as packaging and project management. The project is composed of 4 maven sub-modules: * core-js: Utilities JavaScript libraries - * web2d: JavaScript 2D VML/SVG abstraction library used by the mind map editor + * web2d: JavaScript 2D SVG abstraction library used by the mind map editor * mindplot: JavaScript mind map designer core * wise-webapp: J2EE web application From e033e8552cff93154f4372e91c859dd9837c9dff Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 19 Feb 2012 18:05:33 -0300 Subject: [PATCH 04/45] Add support for menu base dir configuration. --- mindplot/src/main/javascript/widget/Menu.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mindplot/src/main/javascript/widget/Menu.js b/mindplot/src/main/javascript/widget/Menu.js index d7e56316..74ba58de 100644 --- a/mindplot/src/main/javascript/widget/Menu.js +++ b/mindplot/src/main/javascript/widget/Menu.js @@ -19,10 +19,11 @@ mindplot.widget.Menu = new Class({ Extends: mindplot.widget.IMenu, - initialize : function(designer, containerId, mapId, readOnly) { + initialize : function(designer, containerId, mapId, readOnly, baseUrl) { this.parent(designer, containerId, mapId); - var baseUrl = "../css/widget"; + baseUrl = !$defined(baseUrl) ? "../" : baseUrl; + var widgetsBaseUrl = baseUrl + "css/widget"; // Stop event propagation ... $(this._containerId).addEvent('click', function(event) { @@ -130,7 +131,7 @@ mindplot.widget.Menu = new Class({ designer.changeBackgroundColor(hex); } }; - this._toolbarElems.push(new mindplot.widget.ColorPalettePanel('topicColor', topicColorModel, baseUrl)); + this._toolbarElems.push(new mindplot.widget.ColorPalettePanel('topicColor', topicColorModel, widgetsBaseUrl)); // Border color item ... var borderColorModel = @@ -152,7 +153,7 @@ mindplot.widget.Menu = new Class({ designer.changeBorderColor(hex); } }; - this._toolbarElems.push(new mindplot.widget.ColorPalettePanel('topicBorder', borderColorModel, baseUrl)); + this._toolbarElems.push(new mindplot.widget.ColorPalettePanel('topicBorder', borderColorModel, widgetsBaseUrl)); // Font color item ... var fontColorModel = From 81538f049b9ffb334ba70258da3a16b3543b0203 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 19 Feb 2012 21:07:24 -0300 Subject: [PATCH 05/45] - Remove old ExportController - Add support for simple REST transformation --- .../src/main/webapp/icons/legacy/links.png | Bin 0 -> 957 bytes .../controller/ExportController.java | 214 ------------------ .../wisemapping/rest/MindmapController.java | 12 +- .../rest/TransformerController.java | 60 ++++- .../wisemapping/rest/model/RestMindmap.java | 6 +- .../wisemapping/rest/view/TransformView.java | 3 +- .../WEB-INF/wisemapping-acegi-security.xml | 167 -------------- .../main/webapp/WEB-INF/wisemapping-rest.xml | 18 +- .../webapp/WEB-INF/wisemapping-security.xml | 2 + .../webapp/WEB-INF/wisemapping-servlet.xml | 7 +- .../src/main/webapp/jsp/mindmapExport.jsp | 48 ++-- 11 files changed, 115 insertions(+), 422 deletions(-) create mode 100644 wise-editor/src/main/webapp/icons/legacy/links.png delete mode 100644 wise-webapp/src/main/java/com/wisemapping/controller/ExportController.java delete mode 100644 wise-webapp/src/main/webapp/WEB-INF/wisemapping-acegi-security.xml diff --git a/wise-editor/src/main/webapp/icons/legacy/links.png b/wise-editor/src/main/webapp/icons/legacy/links.png new file mode 100644 index 0000000000000000000000000000000000000000..b8edc1265db4bf69814875d1c10b8761f7009e23 GIT binary patch literal 957 zcmV;u148_XP)(^b;|pVbz=yzjpaJj$ zhrpuriKefui_0DvN;1Ymq&%nwWg*IrK!Xz^eJWuq3u2H~0ra?EC@ge%+`A>6mV z9{TYo{=G6 zt@5m|4G+Q2zKv;Ch@O;`PfWArmB5n3gvMsxV&Iu>97{a!2kL74wd@!f_AP^O%_&ND zm}1c*+F;TcH^{p$P_|akvD5o7vmT>HCkP;z;;&+8tDBI;koi9eX`W!oH4`pYaHlFZwV;$>vvfQTw zM-`m&R_SPIBa^FUasC0GCCh%{h`$~db`z&-lFX#%(f>H6JD6Z(sIW`RKE+xOL+?+uQ%q z){?+F%=6pqEH{6=NzusC-*<`PZYiLCGyKD}Z8^V8ul-K=AV@SE1t4~D2*b1(9UUc= zN-;Dv#Ngl{rd7e$ZUPXC##BFmV>$26ZQi?6Po#@{4gllsPbku3Vq${Y+FAf~T}OJb zGWEz9{(zcvI&CUaN&p7GcqMG4&7ULx##68M4k(F4l7Q+Xm&>uSv4N&(w6?a=)YOC{ zoYLN-J?7@-9xGBx007$C+kK7w_2Z$(k&l}jo2#`dO;J#Ipsbc$pS#^Dy3Q&nSeE5x fGMT)t>sS8=`naU3reLNz00000NkvXXu0mjf)bGN+ literal 0 HcmV?d00001 diff --git a/wise-webapp/src/main/java/com/wisemapping/controller/ExportController.java b/wise-webapp/src/main/java/com/wisemapping/controller/ExportController.java deleted file mode 100644 index c83346af..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/controller/ExportController.java +++ /dev/null @@ -1,214 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -package com.wisemapping.controller; - -import com.wisemapping.exporter.ExportException; -import com.wisemapping.exporter.ExportFormat; -import com.wisemapping.exporter.ExporterFactory; -import com.wisemapping.model.MindMap; -import com.wisemapping.service.MindmapService; -import com.wisemapping.view.MindMapBean; -import com.wisemapping.exporter.ExportProperties; -import com.wisemapping.filter.UserAgent; -import org.apache.batik.transcoder.TranscoderException; -import org.jetbrains.annotations.NotNull; -import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException; -import org.xml.sax.SAXException; -import sun.misc.BASE64Encoder; - -import javax.servlet.ServletOutputStream; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.bind.JAXBException; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.stream.XMLStreamException; -import javax.xml.transform.TransformerException; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -public class ExportController extends BaseMultiActionController { - private static final String IMG_EXPORT_FORMAT = "IMG_EXPORT_FORMAT"; - private static final String MAP_ID_PARAMETER = "mapId"; - private static final String MAP_SVG_PARAMETER = "mapSvg"; - private static final String EXPORT_FORMAT_PARAMETER = "exportFormat"; - private static final String IMG_SIZE_PARAMETER = "imgSize"; - private static final String MAP_XML_PARAM = "mapXml"; - - - public ModelAndView handleNoSuchRequestHandlingMethod(NoSuchRequestHandlingMethodException noSuchRequestHandlingMethodException, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception { - logger.info("Mindmap Controller: EXPORT action"); - final MindMap mindmap = getMindmapFromRequest(httpServletRequest); - return new ModelAndView("mindmapExport", "mindmap", new MindMapBean(mindmap)); - } - - public ModelAndView export(HttpServletRequest request, HttpServletResponse response) throws TranscoderException, IOException, JAXBException { - logger.info("Export Controller: exporting WiseMap action"); - - final String mapIdStr = request.getParameter(MAP_ID_PARAMETER); - if (mapIdStr != null) { - final String mapSvg = request.getParameter(MAP_SVG_PARAMETER); - try { - - int mindmapId = Integer.parseInt(mapIdStr); - - logger.debug("SVG Map to export:" + mapSvg); - if (mapSvg == null || mapSvg.isEmpty()) { - throw new IllegalArgumentException("SVG map could not be null"); - } - - String formatStr = request.getParameter(EXPORT_FORMAT_PARAMETER); - if (IMG_EXPORT_FORMAT.endsWith(formatStr)) { - formatStr = request.getParameter("imgFormat"); - } - - final MindmapService service = getMindmapService(); - final MindMap mindMap = service.getMindmapById(mindmapId); - - // Build format properties ... - final ExportFormat format = ExportFormat.valueOf(formatStr); - final ExportProperties properties = ExportProperties.create(format); - if (properties instanceof ExportProperties.ImageProperties) { - final String sizeStr = request.getParameter(IMG_SIZE_PARAMETER); - final ExportProperties.ImageProperties imageProperties = (ExportProperties.ImageProperties) properties; - if (sizeStr != null) { - final ExportProperties.ImageProperties.Size size = ExportProperties.ImageProperties.Size.valueOf(sizeStr); - imageProperties.setSize(size); - } else { - imageProperties.setSize(ExportProperties.ImageProperties.Size.LARGE); - } - } - - final ByteArrayOutputStream bos = new ByteArrayOutputStream(); - - // Change image link URL. - setBaseBaseImgUrl(format, properties); - ExporterFactory.export(properties, mindMap.getUnzippedXml(), bos, mapSvg); - - // If the export goes ok, write the map to the stream ... - - // Set format content type... - final String contentType = format.getContentType(); - response.setContentType(contentType); - - // Set file name... - final String fileName = mindMap.getTitle() + "." + format.getFileExtension(); - response.setHeader("Content-Disposition", "attachment;filename=" + fileName); - - // Write content ... - final ServletOutputStream outputStream = response.getOutputStream(); - outputStream.write(bos.toByteArray()); - - - } catch (Throwable e) { - logger.error("Unexpexted error during export process", e); - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - logger.error("map: " + mapSvg); - } - } else { - logger.warn("mapIdStr is null.Image could not be imported. UserAgent:" + request.getHeaders(UserAgent.USER_AGENT_HEADER)); - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - return null; - } - - private void setBaseBaseImgUrl(@NotNull ExportFormat format, @NotNull ExportProperties properties) { - - final String baseUrl; - if (format == ExportFormat.SVG) { - baseUrl = "http://www.wisemapping.com/images"; - } else { - final ServletContext servletContext = this.getServletContext(); - baseUrl = "file://" + servletContext.getRealPath("/icons/") + "/"; - } - properties.setBaseImagePath(baseUrl); - } - - public ModelAndView print(HttpServletRequest request, HttpServletResponse response) throws TranscoderException, IOException, JAXBException { - logger.info("Export Controller: printing WiseMap action"); - - final String mapIdStr = request.getParameter(MAP_ID_PARAMETER); - int mindmapId = Integer.parseInt(mapIdStr); - final MindmapService service = getMindmapService(); - final MindMap mindmap = service.getMindmapById(mindmapId); - final String mapSvg = request.getParameter(MAP_SVG_PARAMETER); - - final ByteArrayOutputStream bos = new ByteArrayOutputStream(); - try { - exportImage(response, mapSvg, bos, false); - } catch (Throwable e) { - logger.error("Unexpexted error generating the image", e); - logger.error("map: " + mapSvg); - } - - BASE64Encoder encoder = new BASE64Encoder(); - String content = encoder.encode(bos.toByteArray()); - final String exportContent = "data:image/png;base64," + content; - bos.close(); - - ModelAndView view = new ModelAndView("mindmapPrint", "mindmap", new MindMapBean(mindmap)); - final String xmlMap = mindmap.getNativeXmlAsJsLiteral(); - view.addObject(MAP_XML_PARAM, xmlMap); - view.addObject(MAP_SVG_PARAMETER, exportContent); - - return view; - - } - - public ModelAndView image(HttpServletRequest request, HttpServletResponse response) throws TranscoderException, IOException, JAXBException { - logger.info("Export Controller: generating image WiseMap action"); - - final String mapIdStr = request.getParameter(MAP_ID_PARAMETER); - final String mapSvg = request.getParameter(MAP_SVG_PARAMETER); - try { - final ServletOutputStream outputStream = response.getOutputStream(); - - exportImage(response, mapSvg, outputStream, true); - - - } catch (Throwable e) { - logger.error("Unexpexted error generating the image", e); - logger.error("map: " + mapSvg); - } - return null; - } - - private void exportImage(HttpServletResponse response, String mapSvg, OutputStream outputStream, boolean setOutput) throws TranscoderException, IOException, ParserConfigurationException, SAXException, XMLStreamException, TransformerException, JAXBException, ExportException { - - //Image Format - ExportFormat imageFormat = ExportFormat.PNG; - - // Build format properties ... - final ExportProperties.ImageProperties imageProperties = new ExportProperties.ImageProperties(imageFormat); - imageProperties.setSize(ExportProperties.ImageProperties.Size.XMEDIUM); - - // Change image link URL. - setBaseBaseImgUrl(imageFormat, imageProperties); - - // Set format content type... - if (setOutput) - response.setContentType(imageFormat.getContentType()); - - // Write content ... - ExporterFactory.export(imageProperties, null, outputStream, mapSvg); - } -} \ No newline at end of file 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 e3b0186a..ea78ae2a 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -4,9 +4,8 @@ package com.wisemapping.rest; import com.wisemapping.model.MindMap; import com.wisemapping.model.MindmapUser; import com.wisemapping.model.User; -import com.wisemapping.rest.model.RestMindMap; +import com.wisemapping.rest.model.RestMindmap; import com.wisemapping.service.MindmapService; -import com.wisemapping.validator.Utils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; @@ -16,21 +15,18 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import java.io.IOException; -import java.util.HashMap; import java.util.List; -import java.util.Map; @Controller public class MindmapController { @Autowired private MindmapService mindmapService; - - @RequestMapping(method = RequestMethod.GET, value = "/map/{id}") + @RequestMapping(method = RequestMethod.GET, value = "/map/{id}", produces = {"text/xml", "application/json", "text/html"}) @ResponseBody public ModelAndView getMindmap(@PathVariable int id) throws IOException { final MindMap mindMap = mindmapService.getMindmapById(id); - final RestMindMap map = new RestMindMap(mindMap); + final RestMindmap map = new RestMindmap(mindMap); return new ModelAndView("mapView", "map", map); } @@ -39,7 +35,7 @@ public class MindmapController { final User user = com.wisemapping.security.Utils.getUser(); final List list = mindmapService.getMindmapUserByUser(user); -// final RestMindMap map = new RestMindMap(mindMap); +// final RestMindMap map = new RestMindmap(mindMap); // return new ModelAndView("mapView", "map", map); return null; } diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java b/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java index 65238e89..445704d8 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java @@ -1,12 +1,16 @@ package com.wisemapping.rest; +import com.wisemapping.exporter.ExportFormat; import com.wisemapping.exporter.ExportProperties; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.HashMap; import java.util.Map; @@ -14,6 +18,10 @@ import java.util.Map; @Controller public class TransformerController { + private static final String PARAM_SVG_XML = "svgXml"; + private static final String PARAM_WISE_MAP_XML = "mapXml"; + private static final String PARAM_FILENAME = "filename"; + @RequestMapping(method = RequestMethod.POST, value = "/transform", produces = {"application/pdf"}, consumes = {"image/svg+xml"}) @ResponseBody public ModelAndView transformPdf(@RequestBody @Nullable final String content) throws IOException { @@ -26,6 +34,18 @@ public class TransformerController { return new ModelAndView("transformViewPdf", values); } + @RequestMapping(method = RequestMethod.POST, value = "/transform", produces = {"image/svg+xml"}, consumes = {"image/svg+xml"}) + @ResponseBody + public ModelAndView transformSvg(@RequestBody @Nullable final String content) throws IOException { + final Map values = new HashMap(); + if (content == null || content.length() == 0) { + throw new IllegalArgumentException("Body can not be null."); + } + + values.put("content", content); + return new ModelAndView("transformViewSvg", values); + } + @RequestMapping(method = RequestMethod.POST, value = "/transform", produces = {"image/png"}, consumes = {"image/svg+xml"}) @ResponseBody public ModelAndView transformPng(@RequestBody @Nullable final String content) throws IOException { @@ -47,7 +67,7 @@ public class TransformerController { } values.put("content", content); values.put("imageSize", ExportProperties.ImageProperties.Size.LARGE); - return new ModelAndView("transformViewJpg", values); + return new ModelAndView("transformViewJpeg", values); } @RequestMapping(method = RequestMethod.POST, value = "/transform", produces = {"application/freemind"}, consumes = {"text/xml"}) @@ -60,4 +80,42 @@ public class TransformerController { values.put("content", content); return new ModelAndView("transformViewFreemind", values); } + + @RequestMapping(method = RequestMethod.POST, value = "/transform", consumes = {"application/x-www-form-urlencoded"}) + public ModelAndView transform(@NotNull HttpServletRequest request, + @NotNull HttpServletResponse response) throws IOException { + final String svg = request.getParameter(PARAM_SVG_XML); + final String mapXml = request.getParameter(PARAM_WISE_MAP_XML); + final String filename = request.getParameter(PARAM_FILENAME); + + + // Obtains transformation type based on the last part of the URL ... + final String requestURI = request.getRequestURI(); + final String format = requestURI.substring(requestURI.lastIndexOf(".") + 1, requestURI.length()); + final ExportFormat exportFormat = ExportFormat.valueOf(format.toUpperCase()); + + ModelAndView result; + switch (exportFormat) { + case PNG: + result = this.transformPng(svg); + break; + case JPEG: + result = this.transformJpeg(svg); + break; + case PDF: + result = this.transformPdf(svg); + break; + case SVG: + result = this.transformSvg(svg); + break; + case FREEMIND: + result = this.transformFreemind(mapXml); + break; + default: + throw new IllegalArgumentException("Unsupported export format"); + + } + result.getModelMap().put("filename", filename); + return result; + } } diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java index 5291045c..8c4cf46e 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java @@ -17,17 +17,17 @@ import java.util.Date; @XmlRootElement(name = "map") @XmlAccessorType(XmlAccessType.PROPERTY) -public class RestMindMap { +public class RestMindmap { @JsonIgnore private MindMap mindmap; - public RestMindMap() { + public RestMindmap() { this(null); } - public RestMindMap(@NotNull MindMap mindmap) { + public RestMindmap(@NotNull MindMap mindmap) { this.mindmap = mindmap; } diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/view/TransformView.java b/wise-webapp/src/main/java/com/wisemapping/rest/view/TransformView.java index 6d31a78d..144db7e2 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/view/TransformView.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/view/TransformView.java @@ -28,6 +28,7 @@ public class TransformView extends AbstractView { protected void renderMergedOutputModel(@NotNull Map viewMap, @NotNull HttpServletRequest request, @NotNull final HttpServletResponse response) throws Exception { final String content = (String) viewMap.get("content"); + final String filename = (String) viewMap.get("filename"); // Build format properties ... final ExportProperties properties = ExportProperties.create(exportFormat); @@ -57,7 +58,7 @@ public class TransformView extends AbstractView { response.setContentType(contentType); // Set file name... - final String fileName = "map" + "." + exportFormat.getFileExtension(); + final String fileName = (filename != null ? filename : "map" + ".") + exportFormat.getFileExtension(); response.setHeader("Content-Disposition", "attachment;filename=" + fileName); // Write content ... diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-acegi-security.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-acegi-security.xml deleted file mode 100644 index 0359e3ea..00000000 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-acegi-security.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - - - - CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON - PATTERN_TYPE_APACHE_ANT - /**=httpSessionContextIntegrationFilter,logoutFilter,authenticationProcessingFilter,securityContextHolderAwareRequestFilter,rememberMeProcessingFilter,anonymousProcessingFilter,exceptionTranslationFilter,filterInvocationInterceptor - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /c/login.htm?login_error=2 - /c/login.htm?login_error=3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON - PATTERN_TYPE_APACHE_ANT - /index.jsp=IS_AUTHENTICATED_ANONYMOUSLY - /c/login*=IS_AUTHENTICATED_ANONYMOUSLY - /c/userregistration*=IS_AUTHENTICATED_ANONYMOUSLY - /c/activation.htm=IS_AUTHENTICATED_ANONYMOUSLY - /c/forgotpassword*=IS_AUTHENTICATED_ANONYMOUSLY - /c/captcha*=IS_AUTHENTICATED_ANONYMOUSLY - /c/home.htm=IS_AUTHENTICATED_ANONYMOUSLY - /c/try.htm=IS_AUTHENTICATED_ANONYMOUSLY - /c/search.htm=IS_AUTHENTICATED_ANONYMOUSLY - /c/keyboard.htm=IS_AUTHENTICATED_ANONYMOUSLY - /css/*=IS_AUTHENTICATED_ANONYMOUSLY - /js/**=IS_AUTHENTICATED_ANONYMOUSLY - /ws/**=IS_AUTHENTICATED_ANONYMOUSLY - /images/*=IS_AUTHENTICATED_ANONYMOUSLY - /c/embeddedview.htm=IS_AUTHENTICATED_ANONYMOUSLY - /c/export.htm=IS_AUTHENTICATED_ANONYMOUSLY - /c/publicview.htm=IS_AUTHENTICATED_ANONYMOUSLY - /dwr/engine.js=IS_AUTHENTICATED_ANONYMOUSLY - /dwr/interface/loggerservice.js=IS_AUTHENTICATED_ANONYMOUSLY - /dwr/call/plaincall/loggerservice.logerror.dwr=IS_AUTHENTICATED_ANONYMOUSLY - /**=IS_AUTHENTICATED_REMEMBERED - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml index 0c2baf05..1e0b28b4 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml @@ -15,15 +15,10 @@ - - - - - - com.wisemapping.rest.model.RestMindMap + com.wisemapping.rest.model.RestMindmap @@ -33,11 +28,14 @@ - + + - + + + @@ -76,5 +74,7 @@ - + + + \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml index 6ed011bf..0c3bde00 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml @@ -30,9 +30,11 @@ + + diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml index b19db494..8fd5e210 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml @@ -107,11 +107,7 @@ - - - - - + @@ -303,7 +299,6 @@ editorController cookerController settingsController - exportController publishController editProfileController tagsController diff --git a/wise-webapp/src/main/webapp/jsp/mindmapExport.jsp b/wise-webapp/src/main/webapp/jsp/mindmapExport.jsp index b5ab7be3..c580e92d 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapExport.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapExport.jsp @@ -1,13 +1,13 @@ <%@ include file="/jsp/init.jsp" %>

- - '${mindmap.title}'

+ '${mindmap.title}'
-
" style="height:100%;"> - - - + " + style="height:100%;" enctype="application/x-www-form-urlencoded"> + + + @@ -85,14 +85,36 @@ }); $('ok').addEvent('click', function(event) { - $('exportForm').submit(); + + var form = $('exportForm'); + + // Look for the selected format and append export suffix... + var value = $$('input[name=exportFormat]:checked')[0].get('value'); + var suffix; + if (value == 'IMG_EXPORT_FORMAT') { + var selected = $('imgFormat'); + suffix = selected.options[selected.selectedIndex].value; + } else { + suffix = value; + } + suffix = suffix.toLowerCase(); + form.action = form.action + "." + suffix; + + // Store SVG o native map... + if (suffix == "freemind") { + var mindmap = designer.getMindmap(); + var serializer = mindplot.XMLMindmapSerializerFactory.getSerializerFromMindmap(mindmap); + var domMap = serializer.toXML(mindmap); + form.mapXml.value = core.Utils.innerXML(domMap); + } else { + form.svgXml.value = $("workspaceContainer").innerHTML; + } + + // Finally, submit map ... + form.submit(); + + MooDialog.Request.active.close(); }); - $('cancel').addEvent('click', function(event) { - MooDialog.Request.active.close(); - }); - - document.exportForm.mapSvg.value = $("workspaceContainer").innerHTML; - \ No newline at end of file From 95aa9f18eb7358cd47bdbebf6376f77a130567b6 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 20 Feb 2012 10:01:53 -0300 Subject: [PATCH 06/45] Add missing images to wise-webapps. --- wise-editor/src/main/webapp/c/export.bin | Bin 658 -> 0 bytes wise-editor/src/main/webapp/c/export.htm | 75 +++++++++++------- wise-editor/src/main/webapp/html/editor.html | 3 + .../main/webapp/icons/legacy/printNews.png | Bin 6739 -> 0 bytes .../src/main/webapp/images/icon_list.png | Bin 0 -> 4556 bytes wise-webapp/src/main/webapp/images/key.png | Bin 0 -> 612 bytes 6 files changed, 49 insertions(+), 29 deletions(-) delete mode 100644 wise-editor/src/main/webapp/c/export.bin delete mode 100644 wise-editor/src/main/webapp/icons/legacy/printNews.png create mode 100644 wise-webapp/src/main/webapp/images/icon_list.png create mode 100644 wise-webapp/src/main/webapp/images/key.png diff --git a/wise-editor/src/main/webapp/c/export.bin b/wise-editor/src/main/webapp/c/export.bin deleted file mode 100644 index efa4f251a4939168342b9f844070b7ad90bad249..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 658 zcmZ?wbhEHbEMkyiIKsg2UqImhhY$ZRT=@Us!G8mT{|O2I6%_t2Snxj};QxdP|2J&- zUr_MBq2a%S!~X*Z{sYzj2NEOz#h)x-)jA*&WG4gbe+8Akl+1Ym7kTJ zZ^g|-nIw3SRCg&3x0_a2x(OCZSGfauB+)-DZx{~FZJKfA(eHywV+od|$!UF1cFWXiU4WOXyC`dbenc$K0oMi< zfhoORlO}v~cy~!ZNMmv2H`O->4rwGYSuB{wy2&fyoTpmht@j;HuV#GBy;2p(xU74H zqUjU~{qB`W?7p1;{N&l`++HjP2)iWi&(~kMh>+V5BQsS%w9Zb Q7I4#e*doFu!Ngz<0O^(iFaQ7m diff --git a/wise-editor/src/main/webapp/c/export.htm b/wise-editor/src/main/webapp/c/export.htm index 4e761788..c1f5f070 100644 --- a/wise-editor/src/main/webapp/c/export.htm +++ b/wise-editor/src/main/webapp/c/export.htm @@ -1,24 +1,18 @@
- - - -

- Export - 'sss'

+

Export

- - - - + + + +
@@ -92,9 +82,36 @@ }); $('ok').addEvent('click', function(event) { - $('exportForm').submit(); + + var form = $('exportForm'); + + // Look for the selected format and append export suffix... + var value = $$('input[name=exportFormat]:checked')[0].get('value'); + var suffix; + if (value == 'IMG_EXPORT_FORMAT') { + var selected = $('imgFormat'); + suffix = selected.options[selected.selectedIndex].value; + } else { + suffix = value; + } + suffix = suffix.toLowerCase(); + form.action = form.action + "." + suffix; + + // Store SVG o native map... + if (suffix == "freemind") { + var mindmap = designer.getMindmap(); + var serializer = mindplot.XMLMindmapSerializerFactory.getSerializerFromMindmap(mindmap); + var domMap = serializer.toXML(mindmap); + form.mapXml.value = core.Utils.innerXML(domMap); + } else { + form.svgXml.value = $("workspaceContainer").innerHTML; + } + + // Finally, submit map ... + form.submit(); + + MooDialog.Request.active.close(); }); - document.exportForm.mapSvg.value = $("workspaceContainer").innerHTML; \ No newline at end of file diff --git a/wise-editor/src/main/webapp/html/editor.html b/wise-editor/src/main/webapp/html/editor.html index 6e0d17a9..3c749a42 100644 --- a/wise-editor/src/main/webapp/html/editor.html +++ b/wise-editor/src/main/webapp/html/editor.html @@ -57,6 +57,9 @@
+
+ +
diff --git a/wise-editor/src/main/webapp/icons/legacy/printNews.png b/wise-editor/src/main/webapp/icons/legacy/printNews.png deleted file mode 100644 index 7dd56f786d6fb9b33e55a3caa67c9570ac79aeda..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6739 zcmZX31yoz#(r<7pQlvaPKSsyLEs3%q-p#Y$OA9RTp<004qQ0f5W< zM?u>Ffah}nV82UKKV(|w(iZ8&U01xeqV^h`w9)mYs1@{d*-?MpS zUVMZiMQAz4Yvo8jx=hgOvUGAE6-Po_EBPX2pqVwvGcA*x1|5l0bS6~%ERAukmDmd5 z$6>YWeWVCD?+f?EZ0q0puhhhA74^!RbeHgV64Q>R1P1-IoXw^SjW3!>8>F|#WAa0` z!j1dL7G6sBSY)VmxWAT<;bU^Gd#-+dFzxRDfmS*jp^HMEbjhOzgIUUcQrlQ|NWihl0RYc3(zwRM?-^9G+aB{5^0hR&8NVTLJ>v+*~MlcJNx+zXy0In0h3ztP8#QG&Z}XhrdS^ z)D9{4s}S(oJymN~VdIqW|29;(z5Wu!a?CsPM_*HCF$SLcD51zxk4=PjLDMmID6g%I zMu@GWL9V>g~0yi5>g} zu{5_YdSqhe#2xY#_=B-TCWj2&-p~m@XlbBN3?tHpL6Obv$= zk>)0^OkGbp!?oae0_7+_JN6nbDWs5)8+4pYTWY&mN= zGr>zS*0;X0Hp1haqdGTHG8EK(j#${Kgq(YNVsr$Q*^?>KVcTcP@33MJT??N%e-T27 zogF``fowD|4HV#__I^JzCCs%24oO{mG+7~@20z*G0)G%R>Ke~%YoFqKn+IPIlnr5z z6=?`qP1^2Ow!2YOSF^#&SRGO;q05$kLlqMrZe6uiE*k^xX4Q}3vbv-kw7+b>u*NlA z^Tk(wjK!qFHf$0|m);;>`Aj@^9b|m<6tSjnYCQV#cI^X{xQs(Fog`G7ks7H*0gfj6 zQX2e~5)9PZ`3!{uCt1vdC{-z~)0%G8Ho8M*uzUZoyUggSOSUT7vtm_A^2oiDkyA}r z6>+?w7gu2X(DP9!P0(#mkPN}MP0wkos37su4H#0dZOYzbNS$BWrc%&ey*fFcLI`_t zZ`lW_A|0~8ov$kC=7=jUnj)Ryk?X{_Pr>&DtXfi?rh*N&br_F9?DT}gb?!p}B8puMyM{|r+tzS}VVj)3Uuqz88zBC!Mq zsTC#rq{1b#Yh`mkI%)i6lIo7YmDqX*FJXPs!m#c?Nq8v!!ENk`tHFgoRJ!EAzfZ zL90RBJ2lBd1wXv-!j-_fauq&pp$gon1iX-GVBw!t>l`+aQF(@_=!{e8Nq8tbmI{=! z%piR%Io9!&>FBD9A{VWa+l1kb3$LST{?x1RE{BE$Tq4TxEci4x!6!fPQcoX6qL!g4 z6aM%8=^eKU1x}!M3fuadCpah6jf|@zxz8QF4W%eeyFFQB5Np2-*q{tTbTJ4ziHn<` z3mNkZCw8X_w$wKdG-;j|x)7c+F7G2fCfIwovi!UeaIv*1|jFb z-$G9JYhvuNTzDRpui4-bAA(;v zJMND-?_Wksq)^6(L8Byyw)Pjc%Gd?2 za>c&h-lfLKiKV5?0KN%V19xD4ImFf)$WJw5V5-L~^BbAH-Il#QSaHzbidtM0gXSWa zxmzsk-muPg%bpjP50@P9$Dh%Nv~T(&t20Z}_J7c1Ecy?iAR6$jgbLyfbYd?u`z#Hk zQV%ZWRjH~Nh%9dNr}`9C`Vm8vPTZLS*3UNuI+zX z+kc{y=%|%ANEC*03+s9j78|SX;`LnT-~S zT3~fk2F2yRjJJ@d>q`So(O+UT{_S4bQ5rN$^fVfDog`_#VJwAiE+4&L*-mZBAN3~B z^)`t{oiZpGnXE5{_iiP?SoP#m7Pv=P9qk)%SuaE`Bf`TaB_xm+q1~HxKTTcYkPA;T zrXHPuj5hM?K9ZD02pc&E&PmygAk@=ej!WTwqe+1YzAOZCGyx@>ZU~?5SsHoUVzQ6R z2u5q?n2S)vg~61e8zudGr-e7k651W9Nk(nLMIExo<*tg+=+tEOD$>WD#f~MafRX0T$>m*#7o#7ijk9S=p|elHHjeI0b{j5DAyzH#Jm| z{|Y}GT*>gc;+8*OFPCBMb3iolb?xa^1LKL*bb04eaVW|l-_M6g%+i_bqjx`sgP!Ap z8y@A@Fb3syYT;=m5$83v1y8!Ks2xv3`T44-gY1bAc@&4|tl@$XZWy9J8!|wS7<`R+H1m zJtH0&h<6BX_~B$i1mHq!1S!&ih<4OmODi7Kq!6Cc7wVuQGqA#x2^0Ldu6Y)E9}oq& z&kE}qq}{r*xxKqSc}#d1pf&cpAl3rTb@SB$-)HwT>qtb^5M%GrD_goE!JRP_pkMi2-Mxm1U0uZIhRGr;MF~~A6qmVSnW2ts#=v~ zp#VbEBo5Sg1 zcGlL1#kXZYA^5vd$ynx1r9N~A(y37zEZ6V95Ffc3m+uhSHIq6CrB+IW=0^>E`At%) zaZ|~%+SGW2p#|P5);T=P!liIm8pmHvQTz}L?L1BBx564+UNeIArEYzzDQHK85N7dHNj|UbsWH2)$Owe2pcCjNsiv-OpQH8L zYcP0ZXR5>pf>?F?f|YL3lw(8ZO4yc8S-=-ZNAi*EbvY+O%ra$KZxJ_s(z^4ihjXj< z3v(vZt-7}?@+fC}+^ zmaDMI1{&SvZ1nsjM`?6zx9wG@w<7lo*?^XvM58EJy#VxP^HltT z@?gOC0&19^l2Y$HUk54C4LdMv;*6|^CgNg4e9v&XM%)T^_9?4L8 zn;_l89DZ1I;V-4$_MYst`~=c;S(82gL)9th^xD~qLo)C7yek+!_v8fZIY~9r`E`>f zg>8qyC{<^g!{#=pTf%6xl%$Qu+HYa2B6FQnJU}iyk=3@857c^U{@Y(}HT73zCpz_&sYE#FZL}vLzi!Wvb$)G|d$Qlp?kR&b=sR}ejkldd z{QbSz5yJb%dvk=dbCqd{skM5plk)^A2OksfwlyIz^z0(bw&Oq&cR)aZ_3~J#_F_W% z^gGqu53tcpAW&XVf5}>io@Kzdqkntbz96=?R)Yb>HN}pf%?K>QqzG%EG`u)^r9VArI=dQwN{lYI_t~ChaBfru6zb^v zX4xOACHXNX&U?%HZBTmAum6mzC@Nz8UUU2rLDUxi^MgpAm4Bj+{(fXkC5d5kr`^{3 zLWk_a=D+b2=#7LI2W>)}EeRs)!#N>RwP`lFfo|?qLOf;?gV_OVy`_=U{kg4{g1jPw zvD2Tv;#;r3?KIF_tdy*=^?Tn{-M-`5x>;vxLjvSsqNF}vbfHa=X*yF8epuS45~Quo zK!cF-+WpSx+rd#-T)abx#$)c-if}mYp*1@+gch%VnT}Z8R4;aVL^i*z0bYC{QFpF9C1j7H*Du<|WZ?wG9GfTRaR zo45o7IHWLjA0;8@H~euBw}57gtL(QCZ!jpE*FD4Zt>~HSl`A{+Q=`z0L)DKk5AL~Z zAHB3Q^PXAG`whs<*^tc;+iE;ia2oJEUXweQFSWpk_1@YQEbFR^sEq10IcJRy z=sw*BlljpRrj?km?n_2A-V{vPKlSB7%h{6ywLqj;Ju(+_g<6DZz=u^Z)sb{0)|b}5 zkXf~!V6!U0Dc``k0i4-SBy6&QGpjVoxD4W}2}is41%9-9*EDruMCYT2WXd*Yb_ci6 zV}dA5wx`5W>L+2F`mAGDT_s~8u|)amW?MbP5|}#}zMFLEDx-777YD@hDJ2G-<+{&= z`lg7d!eX30m#my7)GudszRTLI`pFsxQ8C&$g}4`)xhn)|75yDB-cLs!9iQ9@;Br=k zCK=>r7WnYu*mBjklzY%m?f(g+MaQmvspPG(-cR1`2gz}cl80p-3_V~J8%(VH7T;pb zDNfX4A4XM|;xOxJWVr#tDIT>cIgilm*~3qX*P36E0=;*%)X?RjZiHxap$ye)i&jFN zt>?ygxwr`3$-SMITm5e?PvScQ&KBW`oEn)T4wTmeH9l8+^*(z-ZgzER0W+7o!F@b7 z-uXud76(sSwrJB2m^^!)O3w^S_^T_Q-qKW|6c5g=$`Jm6Srf?Y<+L@#^)^#VGrD6h zOReyC{J^cv`qjbgZBecCrHhTz$%TL9AZPrAwTd|UZ~ZYD%25D00a_u;QoK88y9?+H zCDJY&wWv#ZpiJ=`qTf4!u-uV3_das0XgR&TI-pwkbnLnh;rd%%RmchXu)lgK<-ML~*csB|Y7M?5FeR!#5b4{YVc&$S4(zv&&Pn>X zr6yl>g^tscf~DGy!dj<5*Y5&6Di)4mDiBY3m)98?sNqy8m*F|>7gl-~YfNGSoAEEH zOEsTczuSL~tcN0T3O~Sx(?tLL`2%=j?z8JX5oYFYpwwAK#r*ydON5YwB#zh-w~hrv~{qDCsE_?FeY#|^^BUdz?y znf1j`;^t*tlHxS_#+bsEsR2sa5-1PqVjpY2n6=Bw0Q!0D{vy}A)Z;%Z`>?mE73bb( zMT<-pgmPasfo4l8T8V!g9t{ejcwHasxA3f-61NrG$Us0XJf(|+v`s02jV?)cy;?Id z?5|QVNcN4seqL6G%L6I$d9Jh8@s_EbnKIoYh@jcmD-OMqR-a=o^2>*j6IzZN)cLes zVQ)K#jMV#_(8K9=Oi5=oCFrHD%+m-UT&gks0Ny_@i7{jb?(Nr-4f$cp>R0N%q^Ccw zFf?-=ZJZxxcMLQnP?|?c$tzv0n~KYvT%vn46WhqH4;@BP4n~4eB%I2;GLN%tS^>QcLuMEVi8*-WtDPN2d^m)_U_Eso{CWTIaxguUQan>&?$}f;yOyDZSXIqvy~! zjixS|&|-o%5w5_CV8=oE@HiXRndC6)b}Y^m{H;W1>SW{UU+nPa#U3}u5pw2|(ZJ@* zYo!w5TNqmQW_~2)4!(!P1E+LptGr7j1I* zP+7dzBCXW0Ua&YfSX+-=IIqPh=7#pMlKe{&+0~XOIRkMGrieS{_+itpR|KX)C-Dw7 zAU-N^Zfe}r=ShT-p48W-+s03NYkT*lGH2hv%5qwm06PoGDm9F9Xc2ke-+6)7!mg&c zXLtOUJ=na8yO-|;g=cG_;!ER@7+2Hj>Eg024|`{)V*DENY>;`2Jk1!kU@{)X2(4qQ zTaB$XRwyclg9PGVb>DVs)jy8S6@5ygpZe}c^i2-l7`8Queo+>GyVyVd=Dd3e)pwF_ z>1*1BNmvlur2q7&+KW#$&q6X=gF9X;cHF+U(Ysq||3*2Q%QVKUHW>D0S93HZ^LDz> z{|k9z)Pbyn_XJA#`LClq^8YIVIZj;q>3`FL6S8;{VseAC@_8s2Jx;bwUa;9&ysrsY z(pX+`b>M$i6F<`7>iuL7;J|;0^J7sslBtwI%8&Wvv;>C1%BN(*zwSP^C-|bBBl{eh z)=8!dya|!FCtIe#27ZO#tF_~j)`S%8n&TPNN;lM|ih(jI5v~ra{8ibB+}EQ)D=`S66Xmn#aQ|q<#+~^!YoZ@ ztUaZ*r^tu%&Hfj~FJ_$2xsWS#UtqAJs&*tg(q zn?AZ*lJnl$NaSer8tlh8qEcWKWR*dMLHxr(kJZgQ8||@ZJ8v$RkjaXu$_>gNZtq=A5RfDnH+SJk;@MqKJ3x81X+?T;q*wYB71Yvit$A z{~fn?8rQPl&jZaoFYfC9UvT}>PR>zxu#Y!ucV?nL@5G`P000vR1^@s6Wpbtk000gwX+uL$Nkc;* zP;zf(X>4Tx0C=30muWN=T>HlFGavJqF&xT}c^)#)88g;FnT|0W#~4D2kXe}tNfPxa z5eW z9{^De0F2)I+zbGW?)&@#02sqb-k|`9aR4kU*~6C%fcpl3)$;HRAptN-0)U4{2q^%7 zF$)090|Ej)02n6$K#W8Q4h3LB1Ar9K!I7|kWyco)3bg>Z%>Q`dB!I?b0Fj{oc*3;+ z918$9h5zHN+W-Op5FEoHUJCL60Dz#^1HepCsp}#DxGMm=*;MLI1(mvc0{}G%(C$wP z3l9JLzYvH)fd94LfAil$Apnp72q)w^Is&td^Tp57deY4>oMaqjwqfaGGh}b$ILg_` zEx}WMkee?{08fY!Ts}lP{943FwEhS|JY8Z_%2m2cR#GlQep%5{>9z_|)k*E1I$FbC zvr=nCM_o5wug8Gi(9$T~xZeb8s%sW$e$Qh5IJcF#b(Bqw?YKSqgzQNt;zftsjw4Q+ zr+J+?|?D zBa$2yaV{=8IVLkU=X_yY$%WF3~sCGqQQ^QRm~zCkanUExN4&t-Ea# z?GK-2Klke}>=fwy)ivB*)f4@~rdOo*ci&)t=>U09Ylwd6-Eh@N&`b4K=vRZIS6>s~ z@V)ssR`J$-Txk5$MCm)n_Z;s>CNF=`{jfb%H|_C}`{UrJxEcAGx!K$~!@14*o1g8z zpuap=a9?CuZ2wAGA}o!3yYOB9``nL$W%CupO4BNNO?2(kddW|R4bF|R&HP`ETYOtH z+tt4*JF0(>fBJXx_S~p4RO;XTcfyS0PT*hB9;0hzP-LuS7G%j|V`Wb`u)|5_n&YwK z?dChme}`~TFh%J1VK3nkQFXBjalAx;B8r@p7 z+7>z)x&!(&2Kt8QjP4oFn{b($m_?XZS&UllT8Ua)+eFx2vwLp;ap%Hg;p*(u}H z-P8Tf3$7S9L3ef12@kSol2@sBqffu@^qF;kTmUy&JW!ot8bl2C3JD24AC?lHbG9U+ zGO{-6{<)^;CoyfY&(1%O>$uQyu_OLjLffU5#79XD$#s`&Qf{V}rsbz+Wh7^w&kE1> zze2j|kYkyvpQoBHRUlNzQAAU;Tf9;-bM19$cUg0J&Gq7nv>VZt0XI)oncq^c7Qf9? zgRj}FoxAhuZrfjX>Wc0q-VdpFd0^I{(kS$h;o)}EZ1d2g=EoIJ(w>I3IJX+N$+UB} z?>+nce6Zs|XJJ=tH>t1(~$hVg-UfmdteNB8LJBAV(TXh4=x{A(lYaX+PhzT1f36yF^F6|}{=Rkv-rJ@-3mhk2*s zkK&(>UF+THy)%0o)F>(y0D(eEqO{TW7$0mbE)Rd3riFHlZixZO$j&6ntifW<>dqF% zo^+s)qn7hAS0DET&llcJJ|sV_00%)pP*_Ofkn~|$VL1^wQE4&pBO>B_5^R!q$=^~- z((h$@Wb5ThOtK}XIR=3m;*TiT}X*FwS>-g&G>G9~T>Gv5_ z7)BY{7>gf69(!kU-!#RHWUg+(Zt>l+`*^ukq_wS$lr7fwqunF>oD<}e$B072KMrG# z_ncBrd7jpE=5$_l>2tl|7VUn5B<+FonD%V)%JBB`(e!2aT{`pJufU%iU_j<3{|M}) z6a)nX>x8g}EQCG@OAmKFD<6T57>lfqiaci;%^UqK=4ovD`O|UIaeEhrFP6nq5_B)I zUYbp8NJ>g3UKYQ+oANTXGA$zAJVP*JGjkxTB0KVm)m5<^$eGBk&r8eqD$p%FSh!X6 zrucqI=Cy!Qvoi5=+VZd02P*E~$gB*$d7|p*ErDuG_0sLpnkTiDcQWoq{^eO`b5G~K zOufJZmIidgR^yL{^GzR`-#!|BJo04Z>8qBp*2%W{_SI+94(3kbF3oO-o`@GEy`6pQ z1HyyOLnXr>UrM}+8GZ9cb*y}xWg_)G!({%HazzZTE4?1uhTp$P%pb+Yy8>V0j!G@4QSRnimsfas>A;cPz6RC;x zK&BxdB0r+&QEDh3R6gnj>Ni>n?T#)$4`Xl`T}(8l8MBF1!iHg+u)lHIxJ$S}JO|zl ze;2<)V@gv@^Mh88wt#kp&V;U#9zpL)-_9V!kjU_j(U!4=NsK9%8Ox3M}m{&O&bXRoafR;caBe}qccDfx zN6D|!sq%q}_R1$!Ppi9XUf)@&!{3*BKx|BD>UfNLYSNn1KHs6ymEW_`M;v%MeCTD$ z=-Qa$c>DXq9}=fO&*;q+e_mbGU%K*rdgaI(<>$lA?QQLy_}wll_22zxgM%On3ZM&C z;07U(1SL=peJ~5V2yTQD!WI#NxQb{*j3fRag^(u5AY>7;6S;!oLz$t@p=wbd&@5;} z^f`1rdI=+pam8H2yvOojov_!ipKzi$GVUQB@aFhJ`~r;{O)AYtS|!?a+Anl^bY*mV z^e*(z7(^J-7&aJP82g#jm~J!kGH0@&S)y4sS%X-Aum!L!vj?+p9*E(3g;bF=S;jz?Pj*}Gt$dS0k>YtJZ)Iy0O;t%X{-dnwcn#3l(cISB(*CWp zr-#vJG~hNAF;X@@cI=c%uxX0fP4nj#pN^xfM6E4s!feaz2JClEN)cTh@*Iaw(VRAP zPH^dVqj5h@%J-P@lJ<`A89F26ch-NHEFPFhnGZG!sR?5ak2pIUX%*ETtq@avULdaU zB4>QwCGNzsWUw?>w9&Lb z=_qt7^da=y4DpQ2jMtfznTD8sS@0~itk$f**{ax29H2SS#u34($hpSVz#YM(&5P%K zeeecfD8I1)pTGuTMDUJK+M$5M*21bHf}-@I+hSjjOp3ph=#}h{YLjl0X_xJi8;~DU zm{D9+MyYVA%BqPsL>qO+R{0sYoiyh-(>K^=!mh`u_}|VX0ql{7Tw1WSb1Bw z*s|LN+7F(TB4#@LbUJma%URB)%#F!Cj`Y*h*K68`==;*o+`pG>9M~OX6xm_1r>CQ0z`z(nYrT@=G#_t;v>`r&1~D$c)@9vFxW;t#dx-ohx82tSZ(hd0FaR zwtM}`4bjS{RaUp=Zim<6?-c%Zq^|kCQT?liQ;l;?e$C5|gPyFmkXskpU7n407T2YoOA0+1jO{2>s6LI2-G*x%jHaR2~VW`GiB0DyLp^8Zsa)H5O!06;&G5*h64 z?GsASrBM7m3HpHnl(10GU`c`rnItVqke8KJ0s#0I4m%jL(icNY000A9Nkl?QgU{-tE?NnAnFj3B!hvBN@b2QJ|#F#Z3qT0kByC0 zRt537-B0Ni<6xb|+8Ju;fX~~8h6X1Hgj_Cz+4wcYVl$-cr5`!3ds|JbXYLE)mF2gH z*n8Wbd|v8(`ei)O;9R!gx8HB!^vDoK&m6BXM(-q2sY3who)DkM^CFoT+W*@7d~>8{ zCBtF*>Lfloa)2s^v3D*#H&`oI0N@V0<7D5CJ?ox`KD#0S0JvOkI2>!)&sV%OJ>tP&u#HT^AKkWdNzgP6d^`FDzWnMaZr{h*apq+!!Ep(t13mILs5TH)OghNflV_qD_2 za-&kw;rF$ny=@CNwm$-=vk95(O)$={sj7Oh3Q<(`vJm_z0B|nG)KqGS0YD%SaF_Ch z?*Yh>O^?Ct4&s*^Q)mfx;DzU21prK59Kq?4PqAfl6otFDF+MSje10J>*{s_WiNu9J zdk_wX8}Dcf)0TQ`Z#*8KUVJD1_5M)VEPh^Zvv2C@-hpjBeUR4&{$gMzJC7eOjbh^5 zH~95dGA#+dE0Ic#FK2cj5D3O%F$MVBi+{Me*`5X8Z;<(V<2sk8Gt!OSFTDZA7=}*` z;>y%{%q4GRbiF)iwbvg~6eUyZR#mm^$0y5jy#%StFv|yD+1KA?v)OU@NdHe>Am literal 0 HcmV?d00001 diff --git a/wise-webapp/src/main/webapp/images/key.png b/wise-webapp/src/main/webapp/images/key.png new file mode 100644 index 0000000000000000000000000000000000000000..4ec1a928140311ff30a0a9120e958096c77f446e GIT binary patch literal 612 zcmV-q0-ODbP)nmX^MrbE*gmZ6|p*GkKoxa?X?hD9M+@sRvFH{EqYA??u6x z2pu{uGnrwz*>rh zfvUA@7b#acN?M*mBG3rQV?e^+0R5m3YXWyRZL5Bt@3vAw{9JaEW$}=f4bXO52yBH{ z;G~ZN|GLn>k~{On3Swd-Sy(gFkOdyw-RP%&exwl01RJRp))TI*SsngruhZksQ*NT%!X?K0000 Date: Mon, 20 Feb 2012 11:32:37 -0300 Subject: [PATCH 07/45] All the resources of the editor asume that the resources css,js and images are relative to /. The base parameter could be used to change the default location. --- mindplot/src/main/javascript/ImageIcon.js | 2 +- mindplot/src/main/javascript/LinkIcon.js | 2 +- .../main/javascript/LocalStorageManager.js | 2 +- mindplot/src/main/javascript/NoteIcon.js | 2 +- .../javascript/widget/ColorPalettePanel.js | 2 +- mindplot/src/main/javascript/widget/Menu.js | 12 +-- .../main/javascript/widget/TopicShapePanel.js | 8 +- .../src/main/webapp/{html => c}/collab.html | 0 wise-editor/src/main/webapp/css/editor.less | 2 +- .../src/main/webapp/html/container.html | 4 +- wise-editor/src/main/webapp/html/editor.html | 60 +++++++------- .../src/main/webapp/html/embedded.html | 57 +++++++------- .../src/main/webapp/html/viewmode.html | 17 ++-- wise-editor/src/main/webapp/js/editor.js | 10 +-- .../webapp/WEB-INF/wisemapping-servlet.xml | 2 +- wise-webapp/src/main/webapp/js/help.js | 78 ------------------- .../src/main/webapp/jsp/mindmapEditor.jsp | 29 +++---- 17 files changed, 102 insertions(+), 187 deletions(-) rename wise-editor/src/main/webapp/{html => c}/collab.html (100%) delete mode 100644 wise-webapp/src/main/webapp/js/help.js diff --git a/mindplot/src/main/javascript/ImageIcon.js b/mindplot/src/main/javascript/ImageIcon.js index 61ab5d15..6f44ed4b 100644 --- a/mindplot/src/main/javascript/ImageIcon.js +++ b/mindplot/src/main/javascript/ImageIcon.js @@ -53,7 +53,7 @@ mindplot.ImageIcon = new Class({ }, _getImageUrl : function(iconId) { - return "../icons/" + iconId + ".png"; + return "icons/" + iconId + ".png"; }, getModel : function() { diff --git a/mindplot/src/main/javascript/LinkIcon.js b/mindplot/src/main/javascript/LinkIcon.js index 52b4c562..be4a176e 100644 --- a/mindplot/src/main/javascript/LinkIcon.js +++ b/mindplot/src/main/javascript/LinkIcon.js @@ -52,6 +52,6 @@ mindplot.LinkIcon = new Class({ actionDispatcher.removeLinkFromTopic(this._topic.getId()); } }); -mindplot.LinkIcon.IMAGE_URL = "../images/links.png"; +mindplot.LinkIcon.IMAGE_URL = "images/links.png"; \ No newline at end of file diff --git a/mindplot/src/main/javascript/LocalStorageManager.js b/mindplot/src/main/javascript/LocalStorageManager.js index d4306e2a..f6f77ceb 100644 --- a/mindplot/src/main/javascript/LocalStorageManager.js +++ b/mindplot/src/main/javascript/LocalStorageManager.js @@ -32,7 +32,7 @@ mindplot.LocalStorageManager = new Class({ if (xml == null) { // Let's try to open one from the local directory ... var xmlRequest = new Request({ - url: '../samples/' + mapId + '.xml', + url: 'samples/' + mapId + '.xml', method: 'get', async: false, onSuccess: function(responseText) { diff --git a/mindplot/src/main/javascript/NoteIcon.js b/mindplot/src/main/javascript/NoteIcon.js index 17f5e73b..261c4159 100644 --- a/mindplot/src/main/javascript/NoteIcon.js +++ b/mindplot/src/main/javascript/NoteIcon.js @@ -83,5 +83,5 @@ mindplot.NoteIcon = new Class({ } }); -mindplot.NoteIcon.IMAGE_URL = "../images/notes.png"; +mindplot.NoteIcon.IMAGE_URL = "images/notes.png"; diff --git a/mindplot/src/main/javascript/widget/ColorPalettePanel.js b/mindplot/src/main/javascript/widget/ColorPalettePanel.js index f68aa2d0..0765c688 100644 --- a/mindplot/src/main/javascript/widget/ColorPalettePanel.js +++ b/mindplot/src/main/javascript/widget/ColorPalettePanel.js @@ -22,7 +22,7 @@ mindplot.widget.ColorPalettePanel = new Class({ initialize : function(buttonId, model, baseUrl) { this._baseUrl = baseUrl; this.parent(buttonId, model); - $assert(baseUrl, "baseUrl can not be null"); + $assert($defined(baseUrl), "baseUrl can not be null"); }, _load : function() { diff --git a/mindplot/src/main/javascript/widget/Menu.js b/mindplot/src/main/javascript/widget/Menu.js index 74ba58de..8b9b527d 100644 --- a/mindplot/src/main/javascript/widget/Menu.js +++ b/mindplot/src/main/javascript/widget/Menu.js @@ -22,7 +22,7 @@ mindplot.widget.Menu = new Class({ initialize : function(designer, containerId, mapId, readOnly, baseUrl) { this.parent(designer, containerId, mapId); - baseUrl = !$defined(baseUrl) ? "../" : baseUrl; + baseUrl = !$defined(baseUrl) ? "" : baseUrl; var widgetsBaseUrl = baseUrl + "css/widget"; // Stop event propagation ... @@ -178,7 +178,7 @@ mindplot.widget.Menu = new Class({ this._toolbarElems.push(new mindplot.widget.ColorPalettePanel('fontColor', fontColorModel, baseUrl)); this._addButton('export', false, false, function() { - var reqDialog = new MooDialog.Request('../c/export.htm?mapId=' + mapId, null, + var reqDialog = new MooDialog.Request('c/export.htm?mapId=' + mapId, null, {'class': 'exportModalDialog', closeButton:true, destroyOnClose:true, @@ -280,7 +280,7 @@ mindplot.widget.Menu = new Class({ var tagElem = $('tagIt'); if (tagElem) { this._addButton('tagIt', false, false, function() { - var reqDialog = new MooDialog.Request('../c/tags.htm?mapId=' + mapId, null, + var reqDialog = new MooDialog.Request('c/tags.htm?mapId=' + mapId, null, {'class': 'tagItModalDialog', closeButton:true, destroyOnClose:true, @@ -297,7 +297,7 @@ mindplot.widget.Menu = new Class({ var shareElem = $('shareIt'); if (shareElem) { this._addButton('shareIt', false, false, function() { - var reqDialog = new MooDialog.Request('../c/mymaps.htm?action=collaborator&userEmail=paulo%40pveiga.com.ar&mapId=' + mapId, null, + var reqDialog = new MooDialog.Request('c/mymaps.htm?action=collaborator&mapId=' + mapId, null, {'class': 'shareItModalDialog', closeButton:true, destroyOnClose:true, @@ -315,7 +315,7 @@ mindplot.widget.Menu = new Class({ var publishElem = $('publishIt'); if (publishElem) { this._addButton('publishIt', false, false, function() { - var reqDialog = new MooDialog.Request('../c/publish.htm?mapId=' + mapId, null, + var reqDialog = new MooDialog.Request('c/publish.htm?mapId=' + mapId, null, {'class': 'publishModalDialog', closeButton:true, destroyOnClose:true, @@ -334,7 +334,7 @@ mindplot.widget.Menu = new Class({ if (historyElem) { this._addButton('history', false, false, function() { - var reqDialog = new MooDialog.Request('../c/history.htm?action=list&goToMindmapList&mapId=' + mapId, null, + var reqDialog = new MooDialog.Request('c/history.htm?action=list&goToMindmapList&mapId=' + mapId, null, {'class': 'historyModalDialog', closeButton:true, destroyOnClose:true, diff --git a/mindplot/src/main/javascript/widget/TopicShapePanel.js b/mindplot/src/main/javascript/widget/TopicShapePanel.js index 572163d3..70fa5394 100644 --- a/mindplot/src/main/javascript/widget/TopicShapePanel.js +++ b/mindplot/src/main/javascript/widget/TopicShapePanel.js @@ -26,10 +26,10 @@ mindplot.widget.TopicShapePanel = new Class({ var content = new Element("div", {'class':'toolbarPanel','id':'topicShapePanel'}); content.innerHTML = '' + - '
Rectangle
' + - '
Rounded Rectangle
' + - '
Line
' + - '
'; + '
Rectangle
' + + '
Rounded Rectangle
' + + '
Line
' + + '
'; return content; diff --git a/wise-editor/src/main/webapp/html/collab.html b/wise-editor/src/main/webapp/c/collab.html similarity index 100% rename from wise-editor/src/main/webapp/html/collab.html rename to wise-editor/src/main/webapp/c/collab.html diff --git a/wise-editor/src/main/webapp/css/editor.less b/wise-editor/src/main/webapp/css/editor.less index 5cff02f5..4abd09b9 100644 --- a/wise-editor/src/main/webapp/css/editor.less +++ b/wise-editor/src/main/webapp/css/editor.less @@ -1,5 +1,5 @@ @import "compatibility.less"; -@import "../css/libraries/moodialog/css/MooDialog.css"; +@import "css/libraries/moodialog/css/MooDialog.css"; /********************************************************************************/ /* Header & Toolbar Styles */ diff --git a/wise-editor/src/main/webapp/html/container.html b/wise-editor/src/main/webapp/html/container.html index b18f1fef..2e3e3e12 100644 --- a/wise-editor/src/main/webapp/html/container.html +++ b/wise-editor/src/main/webapp/html/container.html @@ -41,7 +41,7 @@ This is a simple example of how WiseMapping can be embedded in a page. Embedding WiseMapping editor is such simple as copying this line in your page:

-
<iframe src="embedded.html?confUrl=../html/container.json" width="800" height="600"></iframe>
+
<iframe src="embedded.html?confUrl=html/container.json" width="800" height="600"></iframe>

The container.json file contains a set of properties that must be configured. Properties:

@@ -61,7 +61,7 @@
- +
diff --git a/wise-editor/src/main/webapp/html/editor.html b/wise-editor/src/main/webapp/html/editor.html index 3c749a42..8982283a 100644 --- a/wise-editor/src/main/webapp/html/editor.html +++ b/wise-editor/src/main/webapp/html/editor.html @@ -2,20 +2,22 @@ + WiseMapping - Editor + - + - - - - + + + + - - + + + diff --git a/wise-editor/src/main/webapp/html/embedded.html b/wise-editor/src/main/webapp/html/embedded.html index 8143171c..b29e229e 100644 --- a/wise-editor/src/main/webapp/html/embedded.html +++ b/wise-editor/src/main/webapp/html/embedded.html @@ -2,20 +2,21 @@ + WiseMapping - Editor - + - - - - + + + + - - + + + diff --git a/wise-editor/src/main/webapp/html/viewmode.html b/wise-editor/src/main/webapp/html/viewmode.html index 744eb02b..f1bd225f 100644 --- a/wise-editor/src/main/webapp/html/viewmode.html +++ b/wise-editor/src/main/webapp/html/viewmode.html @@ -2,20 +2,21 @@ + WiseMapping - Editor - + - - - - + + + + - - + + + diff --git a/wise-editor/src/main/webapp/js/editor.js b/wise-editor/src/main/webapp/js/editor.js index 94f361f3..06e0e677 100644 --- a/wise-editor/src/main/webapp/js/editor.js +++ b/wise-editor/src/main/webapp/js/editor.js @@ -49,7 +49,7 @@ function buildDesigner(options) { // Register toolbar event ... if ($('toolbar')) { - var menu = new mindplot.widget.Menu(designer, 'toolbar'); + var menu = new mindplot.widget.Menu(designer, 'toolbar',""); // If a node has focus, focus can be move to another node using the keys. designer._cleanScreen = function() { @@ -150,7 +150,7 @@ editor.WaitDialog = new Class({ 'text-align':'center', width: '400px' }); - var img = new Element('img', {'src': '../images/ajax-loader.gif'}); + var img = new Element('img', {'src': 'images/ajax-loader.gif'}); img.inject(result); return result; }, @@ -165,11 +165,11 @@ editor.Help = { buildHelp:function(panel) { var container = new Element('div'); container.setStyles({width:'100%', textAlign:'center'}); - var content1 = Help.buildContentIcon('../images/black-keyboard.png', 'Keyboard Shortcuts', function() { + var content1 = Help.buildContentIcon('images/black-keyboard.png', 'Keyboard Shortcuts', function() { MOOdalBox.open('keyboard.htm', 'KeyBoard Shortcuts', '500px 400px', false); panel.hidePanel(); }); - var content2 = Help.buildContentIcon('../images/firstSteps.png', 'Editor First Steps', function() { + var content2 = Help.buildContentIcon('images/firstSteps.png', 'Editor First Steps', function() { var wOpen; var sOptions; @@ -233,4 +233,4 @@ waitDialog = new editor.WaitDialog(); waitDialog.show(); // Loading libraries ... -Asset.javascript("../js/mindplot-min.js"); +Asset.javascript("js/mindplot-min.js"); diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml index 8fd5e210..8b6b8860 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml @@ -16,7 +16,7 @@ /c/userRegistration.htm /c/captcha.htm /c/publicView.htm - /c/export.htm + /service/* /c/search.htm /c/keyboard.htm /c/renameMap.htm diff --git a/wise-webapp/src/main/webapp/js/help.js b/wise-webapp/src/main/webapp/js/help.js deleted file mode 100644 index e90225bc..00000000 --- a/wise-webapp/src/main/webapp/js/help.js +++ /dev/null @@ -1,78 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -var Help = { - buildHelp:function(panel){ - var container = new Element('div'); - container.setStyles({width:'100%', textAlign:'center'}); - var content1 = Help.buildContentIcon('../images/black-keyboard.png', 'Keyboard Shortcuts', function(){MOOdalBox.open('keyboard.htm','KeyBoard Shortcuts', '500px 400px', false);panel.hidePanel();}); - var content2 = Help.buildContentIcon('../images/firstSteps.png', 'Editor First Steps', function(){ - var wOpen; - var sOptions; - - sOptions = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes'; - sOptions = sOptions + ',width=' + (screen.availWidth - 10).toString(); - sOptions = sOptions + ',height=' + (screen.availHeight - 122).toString(); - sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0'; - - wOpen = window.open("firststeps.htm", "WiseMapping", "width=100px, height=100px"); - wOpen.focus(); - wOpen.moveTo( 0, 0 ); - wOpen.resizeTo( screen.availWidth, screen.availHeight ); - panel.hidePanel(); - }); - - container.addEvent('show', function(){ - content1.effect('opacity',{duration:800}).start(0,100); - var eff = function(){content2.effect('opacity',{duration:800}).start(0,100);}; - eff.delay(150); - }); - container.addEvent('hide', function(){ - content1.effect('opacity').set(0); - content2.effect('opacity').set(0) - }); - content1.inject(container); - content2.inject(container); - return container; - }, - buildContentIcon:function(image, text, onClickFn){ - var container = new Element('div').setStyles({margin:'15px 0px 0px 0px', opacity:0, padding:'5px 0px', border: '1px solid transparent', cursor:'pointer'}); - - var icon = new Element('div'); - icon.addEvent('click',onClickFn); - var img = new Element('img'); - img.setProperty('src',image); - img.inject(icon); - icon.inject(container); - - var textContainer = new Element('div').setStyles({width:'100%', color:'white'}); - textContainer.innerHTML=text; - textContainer.inject(container); - - container.addEvent('mouseover', function(event){ - $(this).setStyle('border-top', '1px solid #BBB4D6'); - $(this).setStyle('border-bottom', '1px solid #BBB4D6'); - }.bindWithEvent(container)); - container.addEvent('mouseout', function(event){ - $(this).setStyle('border-top', '1px solid transparent'); - $(this).setStyle('border-bottom', '1px solid transparent'); - - }.bindWithEvent(container)); - return container; - } -}; diff --git a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp index b2c05a6e..a7b4a5e1 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp @@ -10,19 +10,20 @@ + <spring:message code="SITE.TITLE"/> - ${mindmap.title} - - - - - + + + + + - - + + - - - - - -
@@ -91,6 +80,6 @@
- + From 89f7fd8d3c3df038a19c667ce3c894636f241a50 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 20 Feb 2012 14:42:07 -0300 Subject: [PATCH 08/45] Add REST service /service/maps. --- .../wisemapping/rest/MindmapController.java | 16 ++++-- .../wisemapping/rest/model/RestMindmap.java | 5 +- .../rest/model/RestMindmapList.java | 52 +++++++++++++++++ .../webapp/WEB-INF/classes/log4j.properties | 4 +- .../main/webapp/WEB-INF/jsp-rest/mapView.jsp | 56 +++++++++++++------ .../main/webapp/WEB-INF/jsp-rest/mapsView.jsp | 51 +++++++++++++++++ .../main/webapp/WEB-INF/wisemapping-rest.xml | 3 +- .../webapp/WEB-INF/wisemapping-security.xml | 20 +------ 8 files changed, 163 insertions(+), 44 deletions(-) create mode 100644 wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapList.java create mode 100644 wise-webapp/src/main/webapp/WEB-INF/jsp-rest/mapsView.jsp 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 ea78ae2a..3c92ac5b 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -5,6 +5,7 @@ import com.wisemapping.model.MindMap; import com.wisemapping.model.MindmapUser; import com.wisemapping.model.User; import com.wisemapping.rest.model.RestMindmap; +import com.wisemapping.rest.model.RestMindmapList; import com.wisemapping.service.MindmapService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import java.io.IOException; +import java.util.ArrayList; import java.util.List; @Controller @@ -30,13 +32,17 @@ public class MindmapController { return new ModelAndView("mapView", "map", map); } - @RequestMapping(method = RequestMethod.GET, value = "/maps") + @RequestMapping(method = RequestMethod.GET, value = "/maps", produces = {"text/xml", "application/json", "text/html"}) public ModelAndView getMindmaps() throws IOException { final User user = com.wisemapping.security.Utils.getUser(); - final List list = mindmapService.getMindmapUserByUser(user); -// final RestMindMap map = new RestMindmap(mindMap); -// return new ModelAndView("mapView", "map", map); - return null; + final List mapsByUser = mindmapService.getMindmapUserByUser(user); + final List mindmaps = new ArrayList(); + for (MindmapUser mindmapUser : mapsByUser) { + mindmaps.add(mindmapUser.getMindMap()); + } + + final RestMindmapList restMindmapList = new RestMindmapList(mindmaps); + return new ModelAndView("mapsView", "list", restMindmapList); } } diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java index 8c4cf46e..2680d089 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java @@ -3,6 +3,7 @@ package com.wisemapping.rest.model; import com.wisemapping.model.MindMap; import com.wisemapping.model.User; +import org.codehaus.jackson.annotate.JsonAutoDetect; import org.codehaus.jackson.annotate.JsonIgnore; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.jetbrains.annotations.NotNull; @@ -10,16 +11,16 @@ import org.jetbrains.annotations.NotNull; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; import java.io.IOException; import java.util.Calendar; import java.util.Date; @XmlRootElement(name = "map") @XmlAccessorType(XmlAccessType.PROPERTY) +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.NONE, + getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, isGetterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY) public class RestMindmap { - @JsonIgnore private MindMap mindmap; public RestMindmap() { diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapList.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapList.java new file mode 100644 index 00000000..96022155 --- /dev/null +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapList.java @@ -0,0 +1,52 @@ +package com.wisemapping.rest.model; + + +import com.wisemapping.model.MindMap; +import org.codehaus.jackson.annotate.JsonAutoDetect; +import org.codehaus.jackson.annotate.JsonIgnore; +import org.jetbrains.annotations.NotNull; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import java.util.ArrayList; + +import java.util.List; + +@XmlRootElement(name = "maps") +@XmlAccessorType(XmlAccessType.PROPERTY) +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.NONE, + getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, isGetterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY) +public class RestMindmapList { + + private List mindmaps; + + public RestMindmapList() { + this(null); + } + + public RestMindmapList(@NotNull List mindmaps) { + this.mindmaps = new ArrayList(); + for (MindMap mindMap : mindmaps) { + this.mindmaps.add(new RestMindmap(mindMap)); + } + } + + public int getCount() { + return this.mindmaps.size(); + } + + public void setCount(int count) { + + } + + @XmlElement(name = "map") + public List getMindmaps() { + return mindmaps; + } + + public void setMindmaps(List mindmaps) { + this.mindmaps = mindmaps; + } +} diff --git a/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties b/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties index 3bed50c9..70ee6799 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties +++ b/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties @@ -1,8 +1,8 @@ log4j.rootLogger=WARN, stdout, R log4j.logger.net.sf=FATAL,stdout, R log4j.logger.com.wisemapping=WARN,stdout,R -log4j.logger.org.wisemapping.ws= WARN,stdout, R -log4j.logger.org.acegisecurity.event.authentication= FATAL,stdout, R +log4j.logger.org.springframework=WARN,stdout,R + # Stdout logger � log4j.appender.stdout=org.apache.log4j.ConsoleAppender diff --git a/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/mapView.jsp b/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/mapView.jsp index 862b9a73..95e23838 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/mapView.jsp +++ b/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/mapView.jsp @@ -1,24 +1,48 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> - - Employees + + Mindmap Detail -
- - - Scalable Vector Graphics (SVG) - + + Scalable Vector Graphics (SVG)

Scalable Vector Graphics (SVG) is an XML markup language for describing two-dimensional @@ -30,9 +24,7 @@

- - Portable Document Format (PDF) - + Portable Document Format (PDF)

Get your map as Portable Document Format(PDF) to share use in your presentations. @@ -42,9 +34,7 @@

- - Freemind (version 0.9.0) - + Freemind (version 0.9.0)

FreeMind is a nice desktop mind mapping application that has the great benefit of being @@ -55,12 +45,11 @@

- - Image File - + Image File +

Get a graphic representation of your map including all colors and shapes to reuse in @@ -71,7 +60,8 @@

- +
- - - - - - <%----%> - <%----%> - <%----%> - <%----%> - <%----%> - <%----%> - <%----%> +

Details for map with id '${map.id}'

+
IDNameEmail
${employee.id}${employee.name}${employee.email}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Id:${map.id}
Title:${map.title}
Description:${map.description}
Owner:${map.owner}
Xml:
Last Modified:${map.lastModifierUser}
Creator:${map.creator}
Public:${map.public}
\ No newline at end of file diff --git a/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/mapsView.jsp b/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/mapsView.jsp new file mode 100644 index 00000000..2a40ceb2 --- /dev/null +++ b/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/mapsView.jsp @@ -0,0 +1,51 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + Mindmaps List + + +

Mindmaps List

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Id:${map.id}
Title:${map.title}
Description:${map.description}
Owner:${map.owner}
Xml:
Last Modified:${map.lastModifierUser}
Creator:${map.creator}
Public:${map.public}
+
+
+ + \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml index 1e0b28b4..8395ad92 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml @@ -19,6 +19,7 @@ com.wisemapping.rest.model.RestMindmap + com.wisemapping.rest.model.RestMindmapList @@ -29,7 +30,7 @@ - + diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml index 0c3bde00..ae03bcad 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml @@ -29,14 +29,11 @@ - - - + + - @@ -61,17 +58,4 @@ - - - - - - - - - - - - \ No newline at end of file From fb3f9946ae20d7374f01c4b68ba912691f384e0a Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 21 Feb 2012 14:22:43 -0300 Subject: [PATCH 09/45] Update to HSQLDB driver Remove DWR Remove native SVG tables Add new REST services for persistence. --- ...ceManager.js => RestPersistenceManager.js} | 0 wise-webapp/pom.xml | 18 ++-- .../controller/EmbeddedViewController.java | 2 +- .../wisemapping/controller/MindmapCooker.java | 4 +- .../controller/MindmapEditorController.java | 2 +- .../controller/NewMindmapController.java | 4 +- .../controller/PublicPagesController.java | 2 +- .../com/wisemapping/dao/MindmapManager.java | 10 +- .../wisemapping/dao/MindmapManagerImpl.java | 30 +++--- .../java/com/wisemapping/dao/UserManager.java | 6 +- .../com/wisemapping/dao/UserManagerImpl.java | 15 +-- .../com/wisemapping/dwr/BaseDwrService.java | 58 ---------- .../dwr/JavaScriptErrorLoggerService.java | 52 +++------ .../com/wisemapping/dwr/MapEditorService.java | 77 ------------- .../com/wisemapping/dwr/ResponseMessage.java | 66 ------------ .../wisemapping/exporter/ExporterFactory.java | 2 +- .../exporter/FreemindExporter.java | 7 +- .../importer/freemind/FreemindImporter.java | 2 +- .../{Colaborator.java => Collaborator.java} | 6 +- .../java/com/wisemapping/model/MindMap.java | 59 ++++------ .../com/wisemapping/model/MindMapHistory.java | 6 -- .../com/wisemapping/model/MindMapNative.java | 79 -------------- .../com/wisemapping/model/MindmapUser.java | 16 +-- .../main/java/com/wisemapping/model/User.java | 29 +++-- .../com/wisemapping/rest/AdminController.java | 49 +++++++++ .../wisemapping/rest/MindmapController.java | 39 +++++-- .../rest/TransformerController.java | 2 +- .../wisemapping/rest/model/RestMindmap.java | 26 +++-- .../com/wisemapping/rest/model/RestUser.java | 102 ++++++++++++++++++ .../com/wisemapping/security/UserDetails.java | 6 +- .../service/MindmapServiceImpl.java | 32 +++--- .../wisemapping/service/UserServiceImpl.java | 4 +- .../com/wisemapping/view/ColaboratorBean.java | 16 +-- .../com/wisemapping/view/MindMapBean.java | 2 +- ...laborator.hbm.xml => Collaborator.hbm.xml} | 2 +- .../com/wisemapping/model/MindMap.hbm.xml | 3 +- .../wisemapping/model/MindmapNative.hbm.xml | 21 ---- .../com/wisemapping/model/MindmapUser.hbm.xml | 20 ++-- .../src/main/webapp/WEB-INF/app.properties | 2 +- .../webapp/WEB-INF/classes/log4j.properties | 3 +- wise-webapp/src/main/webapp/WEB-INF/dwr.xml | 17 --- .../webapp/WEB-INF/jsp-rest/responseView.jsp | 11 ++ wise-webapp/src/main/webapp/WEB-INF/web.xml | 14 --- .../main/webapp/WEB-INF/wisemapping-dao.xml | 3 +- .../main/webapp/WEB-INF/wisemapping-rest.xml | 1 + .../webapp/WEB-INF/wisemapping-security.xml | 7 +- .../webapp/WEB-INF/wisemapping-service.xml | 18 ---- .../src/main/webapp/jsp/mindmapCooker.jsp | 2 +- .../src/main/webapp/jsp/mindmapEditor.jsp | 2 +- .../wisemapping/test/freemind/ExportTest.java | 1 - .../test/freemind/ImportExportTest.java | 4 +- .../com/wisemapping/test/model/JsonTest.java | 22 ++++ .../src/test/sql/hsql/create-schemas.sql | 46 +++----- .../src/test/sql/hsql/drop-schemas.sql | 1 - wise-webapp/src/test/sql/hsql/test-data.sql | 2 +- .../src/test/sql/mysql/create-schemas.sql | 8 -- .../src/test/sql/mysql/drop-schemas.sql | 1 - wise-webapp/src/test/sql/mysql/test-data.sql | 2 +- 58 files changed, 419 insertions(+), 624 deletions(-) rename mindplot/src/main/javascript/{DwrPersistenceManager.js => RestPersistenceManager.js} (100%) delete mode 100644 wise-webapp/src/main/java/com/wisemapping/dwr/BaseDwrService.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/dwr/MapEditorService.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/dwr/ResponseMessage.java rename wise-webapp/src/main/java/com/wisemapping/model/{Colaborator.java => Collaborator.java} (90%) delete mode 100755 wise-webapp/src/main/java/com/wisemapping/model/MindMapNative.java create mode 100644 wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java create mode 100644 wise-webapp/src/main/java/com/wisemapping/rest/model/RestUser.java rename wise-webapp/src/main/resources/com/wisemapping/model/{Colaborator.hbm.xml => Collaborator.hbm.xml} (90%) delete mode 100644 wise-webapp/src/main/resources/com/wisemapping/model/MindmapNative.hbm.xml delete mode 100644 wise-webapp/src/main/webapp/WEB-INF/dwr.xml create mode 100644 wise-webapp/src/main/webapp/WEB-INF/jsp-rest/responseView.jsp create mode 100644 wise-webapp/src/test/java/com/wisemapping/test/model/JsonTest.java diff --git a/mindplot/src/main/javascript/DwrPersistenceManager.js b/mindplot/src/main/javascript/RestPersistenceManager.js similarity index 100% rename from mindplot/src/main/javascript/DwrPersistenceManager.js rename to mindplot/src/main/javascript/RestPersistenceManager.js diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index 7f7f07d2..ce5cd55e 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -171,12 +171,6 @@ 1.7 runtime - - org.directwebremoting - dwr - 2.0.3 - compile - org.apache.xmlgraphics batik-svg-dom @@ -245,9 +239,9 @@ - hsqldb + org.hsqldb hsqldb - 1.8.0.10 + 2.2.8 runtime @@ -274,10 +268,10 @@ org.codehaus.mojo sql-maven-plugin - 1.2 + 1.5 - org.hsqldb.jdbcDriver + org.hsqldb.jdbc.JDBCDriver jdbc:hsqldb:file:${basedir}/target/db/wisemapping sa + + - + \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/WEB-INF/app.properties b/wise-webapp/src/main/webapp/WEB-INF/app.properties index f6030826..30659d8f 100755 --- a/wise-webapp/src/main/webapp/WEB-INF/app.properties +++ b/wise-webapp/src/main/webapp/WEB-INF/app.properties @@ -11,7 +11,7 @@ # HSQL Configuration properties database.url=jdbc:hsqldb:file:target/db/wisemapping -database.driver=org.hsqldb.jdbcDriver +database.driver=org.hsqldb.jdbc.JDBCDriver database.hibernate.dialect=org.hibernate.dialect.HSQLDialect database.username=sa database.password= diff --git a/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties b/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties index 70ee6799..8abef6ba 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties +++ b/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties @@ -1,8 +1,7 @@ log4j.rootLogger=WARN, stdout, R -log4j.logger.net.sf=FATAL,stdout, R log4j.logger.com.wisemapping=WARN,stdout,R log4j.logger.org.springframework=WARN,stdout,R - +log4j.logger.org.codehaus.jackson=WARN,stdout,R # Stdout logger � log4j.appender.stdout=org.apache.log4j.ConsoleAppender diff --git a/wise-webapp/src/main/webapp/WEB-INF/dwr.xml b/wise-webapp/src/main/webapp/WEB-INF/dwr.xml deleted file mode 100644 index 11470e35..00000000 --- a/wise-webapp/src/main/webapp/WEB-INF/dwr.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/responseView.jsp b/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/responseView.jsp new file mode 100644 index 00000000..46c69913 --- /dev/null +++ b/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/responseView.jsp @@ -0,0 +1,11 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + + +

Message: ${message}

+
+ + \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/WEB-INF/web.xml b/wise-webapp/src/main/webapp/WEB-INF/web.xml index 608b0682..d62b5db1 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/web.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/web.xml @@ -110,15 +110,6 @@ - - dwr-invoker - org.directwebremoting.servlet.DwrServlet - - debug - true - - - mvc-servlet *.htm @@ -129,11 +120,6 @@ /service/* - - dwr-invoker - /dwr/* - - index.jsp diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-dao.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-dao.xml index c84a871b..4dd54afb 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-dao.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-dao.xml @@ -24,11 +24,10 @@ - com/wisemapping/model/Colaborator.hbm.xml + com/wisemapping/model/Collaborator.hbm.xml com/wisemapping/model/MindMap.hbm.xml com/wisemapping/model/MindmapUser.hbm.xml com/wisemapping/model/UserLogin.hbm.xml - com/wisemapping/model/MindmapNative.hbm.xml com/wisemapping/model/MindMapHistory.hbm.xml diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml index 8395ad92..31b0d02f 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml @@ -20,6 +20,7 @@ com.wisemapping.rest.model.RestMindmap com.wisemapping.rest.model.RestMindmapList + com.wisemapping.rest.model.RestUser diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml index ae03bcad..88d0108d 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml @@ -14,6 +14,7 @@ + @@ -26,12 +27,10 @@ - - - - + + diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-service.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-service.xml index 9706803c..a93e24e2 100755 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-service.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-service.xml @@ -40,24 +40,6 @@ - - - - - - - - - - - - - - - - - - diff --git a/wise-webapp/src/main/webapp/jsp/mindmapCooker.jsp b/wise-webapp/src/main/webapp/jsp/mindmapCooker.jsp index 41ae0742..a9d7031e 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapCooker.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapCooker.jsp @@ -13,7 +13,7 @@ Native XML: - + diff --git a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp index a7b4a5e1..f86e2ca3 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp @@ -33,7 +33,7 @@ // Configure designer options ... var options = loadDesignerOptions(); - options.persistenceManager = "mindplot.DwrPersitenceManager"; + options.persistenceManager = new mindplot.RESTPersistenceManager("service/maps/"); var userOptions = ${mindmap.properties}; options.zoom = userOptions.zoom; diff --git a/wise-webapp/src/test/java/com/wisemapping/test/freemind/ExportTest.java b/wise-webapp/src/test/java/com/wisemapping/test/freemind/ExportTest.java index e97a009e..fece1544 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/freemind/ExportTest.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/freemind/ExportTest.java @@ -73,7 +73,6 @@ public class ExportTest { final MindMap result = new MindMap(); result.setXml(content.toString().getBytes("UTF-8")); - result.setNativeXml(content.toString()); return result; } diff --git a/wise-webapp/src/test/java/com/wisemapping/test/freemind/ImportExportTest.java b/wise-webapp/src/test/java/com/wisemapping/test/freemind/ImportExportTest.java index d7b2634e..cb10b30a 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/freemind/ImportExportTest.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/freemind/ImportExportTest.java @@ -42,11 +42,11 @@ public class ImportExportTest { final String recContent = readFile(wiseFile); // Export mile content ... - Assert.assertEquals(mindMap.getUnzippedXml(), recContent); + Assert.assertEquals(mindMap.getXmlStr(), recContent); } else { final FileOutputStream fos = new FileOutputStream(wiseFile); - fos.write(mindMap.getUnzippedXml().getBytes("UTF-8")); + fos.write(mindMap.getXmlStr().getBytes("UTF-8")); fos.close(); } diff --git a/wise-webapp/src/test/java/com/wisemapping/test/model/JsonTest.java b/wise-webapp/src/test/java/com/wisemapping/test/model/JsonTest.java new file mode 100644 index 00000000..8e9535f7 --- /dev/null +++ b/wise-webapp/src/test/java/com/wisemapping/test/model/JsonTest.java @@ -0,0 +1,22 @@ +package com.wisemapping.test.model; + + +import com.wisemapping.rest.model.RestMindmap; +import org.codehaus.jackson.map.DeserializationConfig; +import org.codehaus.jackson.map.ObjectMapper; +import org.testng.annotations.Test; + +import java.io.IOException; + +@Test +public class JsonTest { + + @Test + void deserialize() throws IOException { + String json = "{\"id\":\"1\",\"xml\":\"\",\"properties\":\"{\\\"zoom\\\":0.85}\"}"; + ObjectMapper mapper = new ObjectMapper(); + final RestMindmap restMindmap = mapper.readValue(json, RestMindmap.class); + + } + +} diff --git a/wise-webapp/src/test/sql/hsql/create-schemas.sql b/wise-webapp/src/test/sql/hsql/create-schemas.sql index a53615bc..993ebfad 100644 --- a/wise-webapp/src/test/sql/hsql/create-schemas.sql +++ b/wise-webapp/src/test/sql/hsql/create-schemas.sql @@ -1,11 +1,10 @@ CREATE TABLE COLABORATOR ( -id INTEGER NOT NULL IDENTITY PRIMARY KEY, +id INTEGER NOT NULL IDENTITY, email varchar(255) NOT NULL, -creation_date date -); +creation_date date); CREATE TABLE USER ( -id INTEGER NOT NULL IDENTITY PRIMARY KEY, +id INTEGER NOT NULL IDENTITY, colaborator_id INTEGER NOT NULL, username varchar(255) NOT NULL, firstname varchar(255) NOT NULL, @@ -18,12 +17,11 @@ FOREIGN KEY(colaborator_id) REFERENCES colaborator(id) ) ; CREATE TABLE MINDMAP ( -id INTEGER NOT NULL IDENTITY PRIMARY KEY, +id INTEGER NOT NULL IDENTITY, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, xml LONGVARBINARY NOT NULL, public BOOLEAN not null, -mindMapNative_id INTEGER NOT NULL, creation_date date, edition_date date, owner_id INTEGER not null, @@ -32,44 +30,34 @@ last_editor varchar(255) , creator_user varchar(255) , editor_properties varchar(512) --FOREIGN KEY(owner_id) REFERENCES USER(colaborator_id) -) ; - -CREATE TABLE MINDMAP_NATIVE -( -id INTEGER NOT NULL IDENTITY PRIMARY KEY, -svg_xml LONGVARBINARY, -vml_xml LONGVARBINARY -) ; +); CREATE TABLE MINDMAP_HISTORY -( -id INTEGER NOT NULL IDENTITY PRIMARY KEY, +(id INTEGER NOT NULL IDENTITY, xml LONGVARBINARY NOT NULL, mindmap_id INTEGER NOT NULL, creation_date datetime, -creator_user varchar(255) -) ; +creator_user varchar(255)); -CREATE TABLE MINDMAP_COLABORATOR ( -id INTEGER NOT NULL IDENTITY PRIMARY KEY, +CREATE TABLE MINDMAP_COLABORATOR +(id INTEGER NOT NULL IDENTITY, colaborator_id INTEGER NOT NULL, mindmap_id INTEGER NOT NULL, role_id INTEGER NOT NULL, FOREIGN KEY(colaborator_id) REFERENCES colaborator(id), FOREIGN KEY(mindmap_id) REFERENCES mindmap(id) -) ; +); -CREATE TABLE TAG( -id INTEGER NOT NULL IDENTITY PRIMARY KEY, +CREATE TABLE TAG +(id INTEGER NOT NULL IDENTITY, name varchar(255) NOT NULL, -user_id INTEGER NOT NULL +user_id INTEGER NOT NULL, --FOREIGN KEY(user_id) REFERENCES user(colaborator_id) ); -CREATE TABLE USER_LOGIN ( -id INTEGER NOT NULL IDENTITY PRIMARY KEY, -email varchar(255) , -login_date date -) ; +CREATE TABLE USER_LOGIN +(id INTEGER NOT NULL IDENTITY, +email varchar(255), +login_date date); COMMIT; SHUTDOWN; \ No newline at end of file diff --git a/wise-webapp/src/test/sql/hsql/drop-schemas.sql b/wise-webapp/src/test/sql/hsql/drop-schemas.sql index 7485defb..a47b3b2b 100644 --- a/wise-webapp/src/test/sql/hsql/drop-schemas.sql +++ b/wise-webapp/src/test/sql/hsql/drop-schemas.sql @@ -1,5 +1,4 @@ DROP TABLE TAG; -DROP TABLE MINDMAP_NATIVE; DROP TABLE MINDMAP_COLABORATOR; DROP TABLE MINDMAP_HISTORY; DROP TABLE MINDMAP; diff --git a/wise-webapp/src/test/sql/hsql/test-data.sql b/wise-webapp/src/test/sql/hsql/test-data.sql index f1236e59..45519d51 100644 --- a/wise-webapp/src/test/sql/hsql/test-data.sql +++ b/wise-webapp/src/test/sql/hsql/test-data.sql @@ -1,5 +1,5 @@ INSERT INTO COLABORATOR(id,email,creation_date) values (1,'test@wisemapping.org',CURDATE()); INSERT INTO USER (colaborator_id,username,firstname, lastname, password, activationCode,activation_date,allowSendEmail) -values(1,'Wise Mapping Test User','Wise','test', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3',1237,CURDATE(),1); +values(1,'WiseMapping Test User','Wise','test', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3',1237,CURDATE(),1); COMMIT; SHUTDOWN; \ No newline at end of file diff --git a/wise-webapp/src/test/sql/mysql/create-schemas.sql b/wise-webapp/src/test/sql/mysql/create-schemas.sql index 5ff9de9f..c386744e 100644 --- a/wise-webapp/src/test/sql/mysql/create-schemas.sql +++ b/wise-webapp/src/test/sql/mysql/create-schemas.sql @@ -23,7 +23,6 @@ title varchar(255) CHARACTER SET utf8 NOT NULL, description varchar(255) CHARACTER SET utf8 NOT NULL, xml blob NOT NULL, public BOOL not null default 0, -mindMapNative_id INTEGER NOT NULL default 0, creation_date date, edition_date date, owner_id INTEGER not null, @@ -34,13 +33,6 @@ editor_properties varchar(512) CHARACTER SET utf8 , FOREIGN KEY(owner_id) REFERENCES USER(colaborator_id) ) CHARACTER SET utf8 ; -CREATE TABLE MINDMAP_NATIVE -( -id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, -svg_xml blob, -vml_xml blob -) CHARACTER SET utf8 ; - CREATE TABLE MINDMAP_HISTORY ( id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, diff --git a/wise-webapp/src/test/sql/mysql/drop-schemas.sql b/wise-webapp/src/test/sql/mysql/drop-schemas.sql index de87f4ca..0cb786d5 100644 --- a/wise-webapp/src/test/sql/mysql/drop-schemas.sql +++ b/wise-webapp/src/test/sql/mysql/drop-schemas.sql @@ -1,5 +1,4 @@ DROP TABLE TAG; -DROP TABLE MINDMAP_NATIVE; DROP TABLE MINDMAP_COLABORATOR; DROP TABLE MINDMAP_HISTORY; DROP TABLE MINDMAP; diff --git a/wise-webapp/src/test/sql/mysql/test-data.sql b/wise-webapp/src/test/sql/mysql/test-data.sql index 5121071c..82db4a9a 100644 --- a/wise-webapp/src/test/sql/mysql/test-data.sql +++ b/wise-webapp/src/test/sql/mysql/test-data.sql @@ -1,4 +1,4 @@ INSERT INTO COLABORATOR(id,email,creation_date) values (1,'test@wisemapping.org',CURRENT_DATE()); INSERT INTO USER (colaborator_id,username,firstname, lastname, password, activationCode,activation_date,allowSendEmail) -values(1,'Wise Mapping Test User','Wise','Test', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3',1237,CURRENT_DATE(),1); +values(1,'WiseMapping Test User','Wise','Test', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3',1237,CURRENT_DATE(),1); COMMIT; From 7b6cae0fd29ba049b8fbbaffc4bb9fa7745b27ce Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 21 Feb 2012 15:37:15 -0300 Subject: [PATCH 10/45] - Add missing changes. --- mindplot/pom.xml | 2 +- .../main/javascript/RestPersistenceManager.js | 140 +++-- mindplot/src/main/javascript/widget/IMenu.js | 2 +- wise-editor/src/main/webapp/js/editor.js | 477 +++++++++--------- .../main/java/com/wisemapping/model/User.java | 2 - .../security/AuthenticationProvider.java | 4 +- .../com/wisemapping/test/model/JsonTest.java | 9 +- .../src/test/sql/hsql/create-schemas.sql | 2 +- 8 files changed, 310 insertions(+), 328 deletions(-) diff --git a/mindplot/pom.xml b/mindplot/pom.xml index 92ee3278..f04c21fb 100644 --- a/mindplot/pom.xml +++ b/mindplot/pom.xml @@ -94,7 +94,7 @@ - + diff --git a/mindplot/src/main/javascript/RestPersistenceManager.js b/mindplot/src/main/javascript/RestPersistenceManager.js index 739901f1..7569c1eb 100644 --- a/mindplot/src/main/javascript/RestPersistenceManager.js +++ b/mindplot/src/main/javascript/RestPersistenceManager.js @@ -1,83 +1,57 @@ -/* - * Copyright [2011] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -mindplot.DwrPersitenceManager = new Class({ - Extends:mindplot.PersistenceManager, - initialize: function() { - this.parent(); - }, - - saveMapXml : function(mapId, mapXml, pref, saveHistory, events) { - window.MapEditorService.saveMap(mapId, mapXml, pref, saveHistory, { - callback:function(response) { - if (response.msgCode != "OK") { - events.onError(response); - } else { - events.onSuccess(response); - } - }, - - errorHandler:function(message) { - events.onError(message); - }, - verb:"POST", - async: true - } - ) - }, - - loadMapDom : function(mapId) { - $assert(mapId, "mapId can not be null"); - throw "This must be implemented"; - -// var result = {r:null}; -// window.MapEditorService.loadMap(mapId, { -// callback:function(response) { -// -// if (response.msgCode == "OK") { -// // Explorer Hack with local files ... -// var xmlContent = response.content; -// var domDocument = core.Utils.createDocumentFromText(xmlContent); -// var serializer = mindplot.XMLMindmapSerializerFactory.getSerializerFromDocument(domDocument); -// var mindmap = serializer.loadFromDom(domDocument); -// mindmap.setId(mapId); -// -// result.r = mindmap; -// } else { -// // Handle error message ... -// var msg = response.msgDetails; -// var monitor = core.ToolbarNotifier.getInstance(); -// monitor.logFatal("We're sorry, an error has occurred and we can't load your map. Please try again in a few minutes."); -//// wLogger.error(msg); -// } -// }, -// verb:"GET", -// async: false, -// errorHandler:function(msg) { -// var monitor = core.ToolbarNotifier.getInstance(); -// monitor.logFatal("We're sorry, an error has occurred and we can't load your map. Please try again in a few minutes."); -//// wLogger.error(msg); -// } -// }); -// -// return result.r; - } - } -); - - +/* + * Copyright [2011] [wisemapping] + * + * Licensed under WiseMapping Public License, Version 1.0 (the "License"). + * It is basically the Apache License, Version 2.0 (the "License") plus the + * "powered by wisemapping" text requirement on every single page; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the license at + * + * http://www.wisemapping.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +mindplot.RESTPersistenceManager = new Class({ + Extends:mindplot.PersistenceManager, + initialize: function(saveUrl) { + this.parent(); + $assert(saveUrl, "saveUrl can not be null"); + this.saveUrl = saveUrl; + }, + + saveMapXml : function(mapId, mapXml, pref, saveHistory, events) { + + var data = { + id:mapId, + xml: mapXml, + properties: pref + }; + + var request = new Request({ + url:this.saveUrl + mapId, + method: 'put', + onSuccess:function(responseText, responseXML) { + events.onSuccess(); + + }, + onException:function(headerName, value) { + events.onError(); + }, + onFailure:function(xhr) { + events.onError(); + }, + headers: {"Content-Type":"application/json","Accept":"application/json"}, + emulation:false, + urlEncoded:false + }); + request.put(JSON.encode(data)); + } + } +); + + diff --git a/mindplot/src/main/javascript/widget/IMenu.js b/mindplot/src/main/javascript/widget/IMenu.js index aaec386b..3a480550 100644 --- a/mindplot/src/main/javascript/widget/IMenu.js +++ b/mindplot/src/main/javascript/widget/IMenu.js @@ -59,7 +59,7 @@ mindplot.widget.IMenu = new Class({ onError: function() { if (saveHistory) { saveElem.setStyle('cursor', 'pointer'); - $notify("Save could not be completed. Try latter"); + $notify("Save could not be completed. Try latter."); } } }); diff --git a/wise-editor/src/main/webapp/js/editor.js b/wise-editor/src/main/webapp/js/editor.js index 06e0e677..2f6e8ccb 100644 --- a/wise-editor/src/main/webapp/js/editor.js +++ b/wise-editor/src/main/webapp/js/editor.js @@ -1,236 +1,241 @@ -/* - * Copyright [2011] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var designer = null; - -function buildDesigner(options) { - - var container = $(options.container); - $assert(container, 'container could not be null'); - - // Register load events ... - designer = new mindplot.Designer(options, container); - designer.addEvent('loadSuccess', function() { - window.waitDialog.close(); - window.waitDialog.destroy(); - }); - - designer.addEvent('loadError', function(e) { - window.waitDialog.close(); - window.waitDialog.destroy(); - console.log(e); - }); - - - // Configure default persistence manager ... - var persistence; - if (options.persistenceManager) { - persistence = eval("new " + options.persistenceManager + "()"); - - } else { - persistence = new mindplot.LocalStorageManager(); - } - mindplot.PersistenceManager.init(persistence); - - // Register toolbar event ... - if ($('toolbar')) { - var menu = new mindplot.widget.Menu(designer, 'toolbar',""); - - // If a node has focus, focus can be move to another node using the keys. - designer._cleanScreen = function() { - menu.clear() - }; - } - - return designer; -} - - -function loadDesignerOptions(jsonConf) { - // Load map options ... - if (jsonConf) { - var request = new Request.JSON({ - url: jsonConf, - async:false, - onSuccess: - function(options) { - this.options = options; - - }.bind(this) - } - ); - request.get(); - result = this.options; - } - else { - // Set workspace screen size as default. In this way, resize issues are solved. - var containerSize = { - height: parseInt(screen.height), - width: parseInt(screen.width) - }; - - var viewPort = { - height: parseInt(window.innerHeight - 70), // Footer and Header - width: parseInt(window.innerWidth) - }; - result = {readOnly:false,zoom:0.85,saveOnLoad:true,size:containerSize,viewPort:viewPort,container:'mindplot'}; - } - console.log("result:" + JSON.encode(result)); - return result; -} - -editor = {}; -editor.WaitDialog = new Class({ - Extends:MooDialog, - initialize : function() { - var panel = this._buildPanel(); - this.parent({ - closeButton:false, - destroyOnClose:true, - autoOpen:true, - useEscKey:false, - title:'Loading ...', - onInitialize: function(wrapper) { - wrapper.setStyle('opacity', 0); - this.fx = new Fx.Morph(wrapper, { - duration: 100, - transition: Fx.Transitions.Bounce.easeOut - }); - this.overlay = new Overlay(this.options.inject, { - duration: this.options.duration - }); - if (this.options.closeOnOverlayClick) this.overlay.addEvent('click', this.close.bind(this)); - } - , - - onBeforeOpen: function() { - this.overlay.open(); - this.fx.start({ - 'margin-top': [-200, -100], - opacity: [0, 1] - }).chain(function() { - this.fireEvent('show'); - }.bind(this)); - } - , - - onBeforeClose: function() { - this.fx.start({ - 'margin-top': [-100, 0], - opacity: 0, - duration: 200 - }).chain(function() { - this.fireEvent('hide'); - }.bind(this)); - this.overlay.close(); - }} - ) - ; - this.setContent(panel); - }, - - _buildPanel : function () { - var result = new Element('div'); - result.setStyles({ - 'text-align':'center', - width: '400px' - }); - var img = new Element('img', {'src': 'images/ajax-loader.gif'}); - img.inject(result); - return result; - }, - - show : function() { - this.open(); - } - -}); - -editor.Help = { - buildHelp:function(panel) { - var container = new Element('div'); - container.setStyles({width:'100%', textAlign:'center'}); - var content1 = Help.buildContentIcon('images/black-keyboard.png', 'Keyboard Shortcuts', function() { - MOOdalBox.open('keyboard.htm', 'KeyBoard Shortcuts', '500px 400px', false); - panel.hidePanel(); - }); - var content2 = Help.buildContentIcon('images/firstSteps.png', 'Editor First Steps', function() { - var wOpen; - var sOptions; - - sOptions = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes'; - sOptions = sOptions + ',width=' + (screen.availWidth - 10).toString(); - sOptions = sOptions + ',height=' + (screen.availHeight - 122).toString(); - sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0'; - - wOpen = window.open("firststeps.htm", "WiseMapping", "width=100px, height=100px"); - wOpen.focus(); - wOpen.moveTo(0, 0); - wOpen.resizeTo(screen.availWidth, screen.availHeight); - panel.hidePanel(); - }); - - container.addEvent('show', function() { - content1.effect('opacity', {duration:800}).start(0, 100); - var eff = function() { - content2.effect('opacity', {duration:800}).start(0, 100); - }; - eff.delay(150); - }); - container.addEvent('hide', function() { - content1.effect('opacity').set(0); - content2.effect('opacity').set(0) - }); - content1.inject(container); - content2.inject(container); - return container; - }, - buildContentIcon:function(image, text, onClickFn) { - var container = new Element('div').setStyles({margin:'15px 0px 0px 0px', opacity:0, padding:'5px 0px', border: '1px solid transparent', cursor:'pointer'}); - - var icon = new Element('div'); - icon.addEvent('click', onClickFn); - var img = new Element('img'); - img.setProperty('src', image); - img.inject(icon); - icon.inject(container); - - var textContainer = new Element('div').setStyles({width:'100%', color:'white'}); - textContainer.innerHTML = text; - textContainer.inject(container); - - container.addEvent('mouseover', function() { - $(this).setStyle('border-top', '1px solid #BBB4D6'); - $(this).setStyle('border-bottom', '1px solid #BBB4D6'); - }.bindWithEvent(container)); - container.addEvent('mouseout', function() { - $(this).setStyle('border-top', '1px solid transparent'); - $(this).setStyle('border-bottom', '1px solid transparent'); - - }.bindWithEvent(container)); - return container; - } -}; - - -// Show loading dialog ... -waitDialog = new editor.WaitDialog(); -waitDialog.show(); - -// Loading libraries ... -Asset.javascript("js/mindplot-min.js"); +/* + * Copyright [2011] [wisemapping] + * + * Licensed under WiseMapping Public License, Version 1.0 (the "License"). + * It is basically the Apache License, Version 2.0 (the "License") plus the + * "powered by wisemapping" text requirement on every single page; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the license at + * + * http://www.wisemapping.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +var designer = null; + +function buildDesigner(options) { + + var container = $(options.container); + $assert(container, 'container could not be null'); + + // Register load events ... + designer = new mindplot.Designer(options, container); + designer.addEvent('loadSuccess', function() { + window.waitDialog.close(); + window.waitDialog.destroy(); + }); + + designer.addEvent('loadError', function(e) { + window.waitDialog.close(); + window.waitDialog.destroy(); + console.log(e); + }); + + + // Configure default persistence manager ... + var persistence; + if (options.persistenceManager) { + if(options.persistenceManager instanceof String) { + persistence = eval("new " + options.persistenceManager + "()"); + } + else { + persistence = options.persistenceManager; + } + + } else { + persistence = new mindplot.LocalStorageManager(); + } + mindplot.PersistenceManager.init(persistence); + + // Register toolbar event ... + if ($('toolbar')) { + var menu = new mindplot.widget.Menu(designer, 'toolbar',""); + + // If a node has focus, focus can be move to another node using the keys. + designer._cleanScreen = function() { + menu.clear() + }; + } + + return designer; +} + + +function loadDesignerOptions(jsonConf) { + // Load map options ... + if (jsonConf) { + var request = new Request.JSON({ + url: jsonConf, + async:false, + onSuccess: + function(options) { + this.options = options; + + }.bind(this) + } + ); + request.get(); + result = this.options; + } + else { + // Set workspace screen size as default. In this way, resize issues are solved. + var containerSize = { + height: parseInt(screen.height), + width: parseInt(screen.width) + }; + + var viewPort = { + height: parseInt(window.innerHeight - 70), // Footer and Header + width: parseInt(window.innerWidth) + }; + result = {readOnly:false,zoom:0.85,saveOnLoad:true,size:containerSize,viewPort:viewPort,container:'mindplot'}; + } + console.log("result:" + JSON.encode(result)); + return result; +} + +editor = {}; +editor.WaitDialog = new Class({ + Extends:MooDialog, + initialize : function() { + var panel = this._buildPanel(); + this.parent({ + closeButton:false, + destroyOnClose:true, + autoOpen:true, + useEscKey:false, + title:'Loading ...', + onInitialize: function(wrapper) { + wrapper.setStyle('opacity', 0); + this.fx = new Fx.Morph(wrapper, { + duration: 100, + transition: Fx.Transitions.Bounce.easeOut + }); + this.overlay = new Overlay(this.options.inject, { + duration: this.options.duration + }); + if (this.options.closeOnOverlayClick) this.overlay.addEvent('click', this.close.bind(this)); + } + , + + onBeforeOpen: function() { + this.overlay.open(); + this.fx.start({ + 'margin-top': [-200, -100], + opacity: [0, 1] + }).chain(function() { + this.fireEvent('show'); + }.bind(this)); + } + , + + onBeforeClose: function() { + this.fx.start({ + 'margin-top': [-100, 0], + opacity: 0, + duration: 200 + }).chain(function() { + this.fireEvent('hide'); + }.bind(this)); + this.overlay.close(); + }} + ) + ; + this.setContent(panel); + }, + + _buildPanel : function () { + var result = new Element('div'); + result.setStyles({ + 'text-align':'center', + width: '400px' + }); + var img = new Element('img', {'src': 'images/ajax-loader.gif'}); + img.inject(result); + return result; + }, + + show : function() { + this.open(); + } + +}); + +editor.Help = { + buildHelp:function(panel) { + var container = new Element('div'); + container.setStyles({width:'100%', textAlign:'center'}); + var content1 = Help.buildContentIcon('images/black-keyboard.png', 'Keyboard Shortcuts', function() { + MOOdalBox.open('keyboard.htm', 'KeyBoard Shortcuts', '500px 400px', false); + panel.hidePanel(); + }); + var content2 = Help.buildContentIcon('images/firstSteps.png', 'Editor First Steps', function() { + var wOpen; + var sOptions; + + sOptions = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes'; + sOptions = sOptions + ',width=' + (screen.availWidth - 10).toString(); + sOptions = sOptions + ',height=' + (screen.availHeight - 122).toString(); + sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0'; + + wOpen = window.open("firststeps.htm", "WiseMapping", "width=100px, height=100px"); + wOpen.focus(); + wOpen.moveTo(0, 0); + wOpen.resizeTo(screen.availWidth, screen.availHeight); + panel.hidePanel(); + }); + + container.addEvent('show', function() { + content1.effect('opacity', {duration:800}).start(0, 100); + var eff = function() { + content2.effect('opacity', {duration:800}).start(0, 100); + }; + eff.delay(150); + }); + container.addEvent('hide', function() { + content1.effect('opacity').set(0); + content2.effect('opacity').set(0) + }); + content1.inject(container); + content2.inject(container); + return container; + }, + buildContentIcon:function(image, text, onClickFn) { + var container = new Element('div').setStyles({margin:'15px 0px 0px 0px', opacity:0, padding:'5px 0px', border: '1px solid transparent', cursor:'pointer'}); + + var icon = new Element('div'); + icon.addEvent('click', onClickFn); + var img = new Element('img'); + img.setProperty('src', image); + img.inject(icon); + icon.inject(container); + + var textContainer = new Element('div').setStyles({width:'100%', color:'white'}); + textContainer.innerHTML = text; + textContainer.inject(container); + + container.addEvent('mouseover', function() { + $(this).setStyle('border-top', '1px solid #BBB4D6'); + $(this).setStyle('border-bottom', '1px solid #BBB4D6'); + }.bindWithEvent(container)); + container.addEvent('mouseout', function() { + $(this).setStyle('border-top', '1px solid transparent'); + $(this).setStyle('border-bottom', '1px solid transparent'); + + }.bindWithEvent(container)); + return container; + } +}; + + +// Show loading dialog ... +waitDialog = new editor.WaitDialog(); +waitDialog.show(); + +// Loading libraries ... +Asset.javascript("js/mindplot-min.js"); diff --git a/wise-webapp/src/main/java/com/wisemapping/model/User.java b/wise-webapp/src/main/java/com/wisemapping/model/User.java index 7c7a9165..4e5ba43d 100644 --- a/wise-webapp/src/main/java/com/wisemapping/model/User.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/User.java @@ -18,11 +18,9 @@ package com.wisemapping.model; -import javax.xml.bind.annotation.XmlRootElement; import java.io.Serializable; import java.util.*; -@XmlRootElement(name = "user") public class User extends Collaborator implements Serializable { diff --git a/wise-webapp/src/main/java/com/wisemapping/security/AuthenticationProvider.java b/wise-webapp/src/main/java/com/wisemapping/security/AuthenticationProvider.java index db861554..0f1a3030 100644 --- a/wise-webapp/src/main/java/com/wisemapping/security/AuthenticationProvider.java +++ b/wise-webapp/src/main/java/com/wisemapping/security/AuthenticationProvider.java @@ -17,12 +17,12 @@ public class AuthenticationProvider implements org.springframework.security.auth private PasswordEncoder encoder; - @Override + @Override() public Authentication authenticate(@NotNull final Authentication auth) throws AuthenticationException { // All your user authentication needs - final String email = auth.getName(); + final User user = userManager.getUserBy(email); final String credentials = (String) auth.getCredentials(); if (user == null || credentials == null || !encoder.isPasswordValid(user.getPassword(), credentials, null)) { diff --git a/wise-webapp/src/test/java/com/wisemapping/test/model/JsonTest.java b/wise-webapp/src/test/java/com/wisemapping/test/model/JsonTest.java index 8e9535f7..a70755f5 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/model/JsonTest.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/model/JsonTest.java @@ -2,6 +2,7 @@ package com.wisemapping.test.model; import com.wisemapping.rest.model.RestMindmap; +import com.wisemapping.rest.model.RestUser; import org.codehaus.jackson.map.DeserializationConfig; import org.codehaus.jackson.map.ObjectMapper; import org.testng.annotations.Test; @@ -13,10 +14,14 @@ public class JsonTest { @Test void deserialize() throws IOException { - String json = "{\"id\":\"1\",\"xml\":\"\",\"properties\":\"{\\\"zoom\\\":0.85}\"}"; + String mapJson = "{\"id\":\"1\",\"xml\":\"\",\"properties\":\"{\\\"zoom\\\":0.85}\"}"; ObjectMapper mapper = new ObjectMapper(); - final RestMindmap restMindmap = mapper.readValue(json, RestMindmap.class); + final RestMindmap restMindmap = mapper.readValue(mapJson, RestMindmap.class); + + String userJson = "{\"username\":\"admin\",\"email\":\"admin@wisemapping.org\",\"tags\":[],\"creationDate\":1329706800000,\"firstname\":\"Wise\",\"lastname\":\"test\",\"password\":\"test\"}"; + final RestUser restUser = mapper.readValue(userJson, RestUser.class); } + } diff --git a/wise-webapp/src/test/sql/hsql/create-schemas.sql b/wise-webapp/src/test/sql/hsql/create-schemas.sql index 993ebfad..f589b5ba 100644 --- a/wise-webapp/src/test/sql/hsql/create-schemas.sql +++ b/wise-webapp/src/test/sql/hsql/create-schemas.sql @@ -14,7 +14,7 @@ activationCode BIGINT NOT NULL, activation_date DATE, allowSendEmail CHAR(1) NOT NULL, FOREIGN KEY(colaborator_id) REFERENCES colaborator(id) -) ; +); CREATE TABLE MINDMAP ( id INTEGER NOT NULL IDENTITY, From 6ff556b317ff5edb29f542f0cfd230611d38fe80 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 21 Feb 2012 16:36:19 -0300 Subject: [PATCH 11/45] Add configurable support for admin profile. --- .../main/java/com/wisemapping/model/User.java | 5 --- .../com/wisemapping/rest/AdminController.java | 10 +++--- .../security/AuthenticationProvider.java | 17 +++++---- .../com/wisemapping/security/UserDetails.java | 6 ++-- ...ilService.java => UserDetailsService.java} | 17 +++++++-- .../src/main/webapp/WEB-INF/app.properties | 15 ++++++-- .../main/webapp/WEB-INF/jsp-rest/userView.jsp | 35 +++++++++++++++++++ .../webapp/WEB-INF/wisemapping-security.xml | 11 ++++-- wise-webapp/src/test/sql/hsql/test-data.sql | 6 ++++ wise-webapp/src/test/sql/mysql/test-data.sql | 6 ++++ 10 files changed, 102 insertions(+), 26 deletions(-) rename wise-webapp/src/main/java/com/wisemapping/security/{UserDetailService.java => UserDetailsService.java} (77%) create mode 100644 wise-webapp/src/main/webapp/WEB-INF/jsp-rest/userView.jsp diff --git a/wise-webapp/src/main/java/com/wisemapping/model/User.java b/wise-webapp/src/main/java/com/wisemapping/model/User.java index 4e5ba43d..900b4ae9 100644 --- a/wise-webapp/src/main/java/com/wisemapping/model/User.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/User.java @@ -25,7 +25,6 @@ public class User extends Collaborator implements Serializable { - private static final String ADMIN_EMAIL = "test@wisemapping.org"; private String firstname; private String lastname; private String password; @@ -132,8 +131,4 @@ public class User public void setUsername(String username) { this.username = username; } - - public boolean isAdmin() { - return ADMIN_EMAIL.equals(this.getEmail()); - } } diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java index dfbdfaf8..69a13f4b 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java @@ -18,7 +18,7 @@ public class AdminController { @Autowired private UserService userService; - @RequestMapping(method = RequestMethod.GET, value = "admin/users/{id}", produces = {"application/xml", "application/json"}) + @RequestMapping(method = RequestMethod.GET, value = "admin/users/{id}", produces = {"application/xml", "application/json","text/html"}) @ResponseBody public ModelAndView getUserById(@PathVariable int id) throws IOException { final User userBy = userService.getUserBy(id); @@ -28,22 +28,24 @@ public class AdminController { return new ModelAndView("userView", "user", new RestUser(userBy)); } - @RequestMapping(method = RequestMethod.GET, value = "admin/users/email/{email}", produces = {"application/xml", "application/json"}) + @RequestMapping(method = RequestMethod.GET, value = "admin/users/email/{email}", produces = {"application/xml", "application/json","text/html"}) @ResponseBody public ModelAndView getUserByEmail(@PathVariable String email) throws IOException { final User userBy = userService.getUserBy(email); if (userBy == null) { - throw new IllegalArgumentException("User could not be found"); + throw new IllegalArgumentException("User '" + email + "' could not be found" ); } return new ModelAndView("userView", "user", new RestUser(userBy)); } @RequestMapping(method = RequestMethod.POST, value = "admin/users", consumes = {"application/xml", "application/json"}) - public void getUserByEmail(@RequestBody RestUser user) throws IOException, WiseMappingException { + public ModelAndView getUserByEmail(@RequestBody RestUser user) throws IOException, WiseMappingException { if (user == null) { throw new IllegalArgumentException("User could not be found"); } userService.createUser(user.getDelegated(), false); + return new ModelAndView("responseView", "message", "User created successfully"); + } } diff --git a/wise-webapp/src/main/java/com/wisemapping/security/AuthenticationProvider.java b/wise-webapp/src/main/java/com/wisemapping/security/AuthenticationProvider.java index 0f1a3030..48454c66 100644 --- a/wise-webapp/src/main/java/com/wisemapping/security/AuthenticationProvider.java +++ b/wise-webapp/src/main/java/com/wisemapping/security/AuthenticationProvider.java @@ -1,10 +1,8 @@ package com.wisemapping.security; -import com.wisemapping.dao.UserManager; import com.wisemapping.model.User; import org.jetbrains.annotations.NotNull; -import org.springframework.security.authentication.AbstractAuthenticationToken; import org.springframework.security.authentication.BadCredentialsException; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.authentication.encoding.PasswordEncoder; @@ -13,8 +11,7 @@ import org.springframework.security.core.AuthenticationException; public class AuthenticationProvider implements org.springframework.security.authentication.AuthenticationProvider { - private UserManager userManager; - + private UserDetailsService userDetailsService; private PasswordEncoder encoder; @Override() @@ -23,13 +20,12 @@ public class AuthenticationProvider implements org.springframework.security.auth // All your user authentication needs final String email = auth.getName(); - final User user = userManager.getUserBy(email); + final UserDetails userDetails = getUserDetailsService().loadUserByUsername(email); + final User user = userDetails.getUser(); final String credentials = (String) auth.getCredentials(); if (user == null || credentials == null || !encoder.isPasswordValid(user.getPassword(), credentials, null)) { throw new BadCredentialsException("Username/Password does not match for " + auth.getPrincipal()); } - - final UserDetails userDetails = new UserDetails(user); return new UsernamePasswordAuthenticationToken(userDetails, credentials, userDetails.getAuthorities()); } @@ -42,8 +38,11 @@ public class AuthenticationProvider implements org.springframework.security.auth this.encoder = encoder; } - public void setUserManager(UserManager userManager) { - this.userManager = userManager; + public UserDetailsService getUserDetailsService() { + return userDetailsService; } + public void setUserDetailsService(UserDetailsService userDetailsService) { + this.userDetailsService = userDetailsService; + } } diff --git a/wise-webapp/src/main/java/com/wisemapping/security/UserDetails.java b/wise-webapp/src/main/java/com/wisemapping/security/UserDetails.java index e9da42d9..cb09c68e 100644 --- a/wise-webapp/src/main/java/com/wisemapping/security/UserDetails.java +++ b/wise-webapp/src/main/java/com/wisemapping/security/UserDetails.java @@ -28,14 +28,16 @@ import java.util.Collection; public class UserDetails implements org.springframework.security.core.userdetails.UserDetails { private com.wisemapping.model.User user; + private boolean isAdmin; - public UserDetails(@NotNull final com.wisemapping.model.User user) { + public UserDetails(@NotNull final com.wisemapping.model.User user, boolean isAdmin) { this.user = user; + this.isAdmin = isAdmin; } public Collection getAuthorities() { final Collection result = new ArrayList(); - if(this.getUser().isAdmin()) { + if (this.isAdmin) { final SimpleGrantedAuthority role_admin = new SimpleGrantedAuthority("ROLE_ADMIN"); result.add(role_admin); } diff --git a/wise-webapp/src/main/java/com/wisemapping/security/UserDetailService.java b/wise-webapp/src/main/java/com/wisemapping/security/UserDetailsService.java similarity index 77% rename from wise-webapp/src/main/java/com/wisemapping/security/UserDetailService.java rename to wise-webapp/src/main/java/com/wisemapping/security/UserDetailsService.java index 4a83a481..d5285236 100644 --- a/wise-webapp/src/main/java/com/wisemapping/security/UserDetailService.java +++ b/wise-webapp/src/main/java/com/wisemapping/security/UserDetailsService.java @@ -20,25 +20,31 @@ package com.wisemapping.security; import com.wisemapping.dao.UserManager; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.springframework.dao.DataAccessException; import org.springframework.security.core.userdetails.UsernameNotFoundException; -public class UserDetailService +public class UserDetailsService implements org.springframework.security.core.userdetails.UserDetailsService { private UserManager userManager; + private String adminUser; @Override public UserDetails loadUserByUsername(@NotNull String email) throws UsernameNotFoundException, DataAccessException { final com.wisemapping.model.User model = userManager.getUserBy(email); if (model != null) { - return new UserDetails(model); + return new UserDetails(model, isAdmin(email)); } else { throw new UsernameNotFoundException(email); } } + private boolean isAdmin(@Nullable String email) { + return email != null && adminUser != null && email.trim().endsWith(adminUser); + } + public UserManager getUserManager() { return userManager; } @@ -47,4 +53,11 @@ public class UserDetailService this.userManager = userManager; } + public String getAdminUser() { + return adminUser; + } + + public void setAdminUser(String adminUser) { + this.adminUser = adminUser; + } } diff --git a/wise-webapp/src/main/webapp/WEB-INF/app.properties b/wise-webapp/src/main/webapp/WEB-INF/app.properties index 30659d8f..d7c00098 100755 --- a/wise-webapp/src/main/webapp/WEB-INF/app.properties +++ b/wise-webapp/src/main/webapp/WEB-INF/app.properties @@ -16,8 +16,6 @@ database.hibernate.dialect=org.hibernate.dialect.HSQLDialect database.username=sa database.password= -# Enable/Disable user confirmation by e-mail. If it's enabled, mail must be configured. -user.confirm.registration=false ################################################################################## # Mail configuration. Must be configured to enable user registration confirmation. @@ -34,3 +32,16 @@ mail.user= mail.password= mail.registrationEmail=root@localhost mail.siteEmail=root@localhost + + +################################################################################## +# Site configuration +################################################################################## + +# Enable/Disable user registration confirmation by e-mail. If it's enabled, mail must be configured. +user.confirm.registration=false + +# Site administration user. This user will have special permissions for operations such as removing users, set password +# etc. +admin.user = admin@wisemapping.org + diff --git a/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/userView.jsp b/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/userView.jsp new file mode 100644 index 00000000..7c568172 --- /dev/null +++ b/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/userView.jsp @@ -0,0 +1,35 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + Mindmap Detail + + +

Details for User with id '${user.id}'

+ + + + + + + + + + + + + + + + + + + + + + + +
Email:${user.email}
Fist Name:${user.firstname}
Last Name:${user.lastname}
Username:${user.username}
Active:${user.active}
+ + \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml index 88d0108d..256c2640 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml @@ -8,6 +8,11 @@ http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"> + + + + + @@ -50,11 +55,13 @@ - + - + + + \ No newline at end of file diff --git a/wise-webapp/src/test/sql/hsql/test-data.sql b/wise-webapp/src/test/sql/hsql/test-data.sql index 45519d51..54318c6d 100644 --- a/wise-webapp/src/test/sql/hsql/test-data.sql +++ b/wise-webapp/src/test/sql/hsql/test-data.sql @@ -1,5 +1,11 @@ INSERT INTO COLABORATOR(id,email,creation_date) values (1,'test@wisemapping.org',CURDATE()); INSERT INTO USER (colaborator_id,username,firstname, lastname, password, activationCode,activation_date,allowSendEmail) values(1,'WiseMapping Test User','Wise','test', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3',1237,CURDATE(),1); + +INSERT INTO COLABORATOR(id,email,creation_date) values (2,'admin@wisemapping.org',CURDATE()); +INSERT INTO USER (colaborator_id,username,firstname, lastname, password, activationCode,activation_date,allowSendEmail) +values(2,'WiseMapping Admin User','Wise','test', 'admin',1237,CURDATE(),1); + + COMMIT; SHUTDOWN; \ No newline at end of file diff --git a/wise-webapp/src/test/sql/mysql/test-data.sql b/wise-webapp/src/test/sql/mysql/test-data.sql index 82db4a9a..fc794d3d 100644 --- a/wise-webapp/src/test/sql/mysql/test-data.sql +++ b/wise-webapp/src/test/sql/mysql/test-data.sql @@ -1,4 +1,10 @@ INSERT INTO COLABORATOR(id,email,creation_date) values (1,'test@wisemapping.org',CURRENT_DATE()); INSERT INTO USER (colaborator_id,username,firstname, lastname, password, activationCode,activation_date,allowSendEmail) values(1,'WiseMapping Test User','Wise','Test', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3',1237,CURRENT_DATE(),1); + +INSERT INTO COLABORATOR(id,email,creation_date) values (2,'admin@wisemapping.org',CURRENT_DATE()); +INSERT INTO USER (colaborator_id,username,firstname, lastname, password, activationCode,activation_date,allowSendEmail) +values(2,'WiseMapping Admin User','Wise','Test', 'admin',1237,CURRENT_DATE(),1); + + COMMIT; From a4e097ad15164d82908ca3110321f0cf6b62fd2e Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 21 Feb 2012 17:41:51 -0300 Subject: [PATCH 12/45] Add REST service for reseting user password. --- wise-webapp/pom.xml | 6 +-- .../controller/ActivationController.java | 2 +- .../java/com/wisemapping/dao/UserManager.java | 3 ++ .../com/wisemapping/dao/UserManagerImpl.java | 25 ++++++--- .../com/wisemapping/rest/AdminController.java | 51 +++++++++++++++---- .../wisemapping/rest/MindmapController.java | 7 ++- .../com/wisemapping/service/UserService.java | 7 ++- .../wisemapping/service/UserServiceImpl.java | 10 +++- .../webapp/WEB-INF/classes/log4j.properties | 2 +- 9 files changed, 83 insertions(+), 30 deletions(-) diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index ce5cd55e..48d2e549 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -256,9 +256,9 @@ 1.9.4
- com.thoughtworks.xstream - xstream - 1.3.1 + org.slf4j + slf4j-api + 1.6.4 diff --git a/wise-webapp/src/main/java/com/wisemapping/controller/ActivationController.java b/wise-webapp/src/main/java/com/wisemapping/controller/ActivationController.java index 3a663c5e..50f9e866 100755 --- a/wise-webapp/src/main/java/com/wisemapping/controller/ActivationController.java +++ b/wise-webapp/src/main/java/com/wisemapping/controller/ActivationController.java @@ -43,7 +43,7 @@ public class ActivationController try { final String code = request.getParameter("code"); - userService.activateAcount(Long.parseLong(code)); + userService.activateAccount(Long.parseLong(code)); modelAndView = new ModelAndView("activationAccountConfirmation"); } catch (Throwable exc) diff --git a/wise-webapp/src/main/java/com/wisemapping/dao/UserManager.java b/wise-webapp/src/main/java/com/wisemapping/dao/UserManager.java index d06581e5..7439e3e9 100644 --- a/wise-webapp/src/main/java/com/wisemapping/dao/UserManager.java +++ b/wise-webapp/src/main/java/com/wisemapping/dao/UserManager.java @@ -47,4 +47,7 @@ public interface UserManager { public Collaborator getCollaboratorBy(String email); public User createUser(User user, Collaborator col); + + public void deleteUser(User user); + } diff --git a/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java b/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java index d30b04b1..5f4df024 100644 --- a/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java @@ -44,6 +44,8 @@ public class UserManagerImpl return getHibernateTemplate().find("from com.wisemapping.model.User user"); } + + @Override public User getUserBy(final String email) { final User user; final List users = getHibernateTemplate().find("from com.wisemapping.model.User colaborator where email=?", email); @@ -56,6 +58,7 @@ public class UserManagerImpl return user; } + @Override public Collaborator getCollaboratorBy(final String email) { final Collaborator cola; final List cols = getHibernateTemplate().find("from com.wisemapping.model.Collaborator colaborator where email=?", email); @@ -68,11 +71,11 @@ public class UserManagerImpl return cola; } - public User getUserBy(long id) - { - return (User)getHibernateTemplate().get(User.class,id); + public User getUserBy(long id) { + return getHibernateTemplate().get(User.class, id); } + @Override public User getUserByUsername(String username) { final User user; final List users = getHibernateTemplate().find("from com.wisemapping.model.User colaborator where username=?", username); @@ -85,6 +88,7 @@ public class UserManagerImpl return user; } + @Override public boolean authenticate(final String email, final String password) { final boolean result; final User user = getUserBy(email); @@ -92,20 +96,21 @@ public class UserManagerImpl return result; } + @Override public void createUser(User user) { assert user != null : "Trying to store a null user"; // user.setPassword(passwordEncoder.encodePassword(user.getPassword(),null)); getHibernateTemplate().saveOrUpdate(user); } - public User createUser(@NotNull User user, @NotNull Collaborator col) - { + @Override + public User createUser(@NotNull User user, @NotNull Collaborator col) { // user.setPassword(passwordEncoder.encodePassword(user.getPassword(),null)); assert user != null : "Trying to store a null user"; final Set set = col.getMindmapUsers(); for (MindmapUser mindmapUser : set) { - MindmapUser newMapUser = new MindmapUser(); + MindmapUser newMapUser = new MindmapUser(); newMapUser.setRoleId(mindmapUser.getRole().ordinal()); newMapUser.setMindMap(mindmapUser.getMindMap()); newMapUser.setCollaborator(user); @@ -118,6 +123,14 @@ public class UserManagerImpl return user; } + @Override + public void deleteUser(@NotNull User user) { + final Collaborator collaborator = this.getCollaboratorBy(user.getEmail()); + getHibernateTemplate().delete(collaborator); + getHibernateTemplate().delete(user); + getHibernateTemplate().flush(); + } + public void auditLogin(UserLogin userLogin) { assert userLogin != null : "userLogin is null"; getHibernateTemplate().save(userLogin); diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java index 69a13f4b..b306515a 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java @@ -5,7 +5,6 @@ import com.wisemapping.exceptions.WiseMappingException; import com.wisemapping.model.User; import com.wisemapping.rest.model.RestUser; import com.wisemapping.service.UserService; -import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; @@ -15,12 +14,13 @@ import java.io.IOException; @Controller public class AdminController { + private static final String RESPONSE_VIEW = "responseView"; @Autowired private UserService userService; - @RequestMapping(method = RequestMethod.GET, value = "admin/users/{id}", produces = {"application/xml", "application/json","text/html"}) + @RequestMapping(method = RequestMethod.GET, value = "admin/users/{id}", produces = {"application/json", "text/html", "application/xml"}) @ResponseBody - public ModelAndView getUserById(@PathVariable int id) throws IOException { + public ModelAndView getUserById(@PathVariable long id) throws IOException { final User userBy = userService.getUserBy(id); if (userBy == null) { throw new IllegalArgumentException("User could not be found"); @@ -28,24 +28,53 @@ public class AdminController { return new ModelAndView("userView", "user", new RestUser(userBy)); } - @RequestMapping(method = RequestMethod.GET, value = "admin/users/email/{email}", produces = {"application/xml", "application/json","text/html"}) + @RequestMapping(method = RequestMethod.GET, value = "admin/users/email/{email}", produces = {"application/json", "text/html", "application/xml"}) @ResponseBody public ModelAndView getUserByEmail(@PathVariable String email) throws IOException { - final User userBy = userService.getUserBy(email); - if (userBy == null) { - throw new IllegalArgumentException("User '" + email + "' could not be found" ); + final User user = userService.getUserBy(email); + if (user == null) { + throw new IllegalArgumentException("User '" + email + "' could not be found"); } - return new ModelAndView("userView", "user", new RestUser(userBy)); + return new ModelAndView("userView", "user", new RestUser(user)); } - @RequestMapping(method = RequestMethod.POST, value = "admin/users", consumes = {"application/xml", "application/json"}) + @RequestMapping(method = RequestMethod.POST, value = "admin/users", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"}) public ModelAndView getUserByEmail(@RequestBody RestUser user) throws IOException, WiseMappingException { if (user == null) { throw new IllegalArgumentException("User could not be found"); } - userService.createUser(user.getDelegated(), false); - return new ModelAndView("responseView", "message", "User created successfully"); + // User already exists ? + final String email = user.getEmail(); + if(userService.getUserBy(email)!=null){ + throw new IllegalArgumentException("User already exists with this email."); + } + + userService.createUser(user.getDelegated(), false); + return new ModelAndView(RESPONSE_VIEW, "message", "User '" + user.getId() + "' created successfully"); + } + + @RequestMapping(method = RequestMethod.PUT, value = "admin/users/{id}/password", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"}) + public ModelAndView changePassword(@RequestBody String password, @PathVariable long id) throws IOException, WiseMappingException { + if (password == null) { + throw new IllegalArgumentException("Password can not be null"); + } + + final User user = userService.getUserBy(id); + user.setPassword(password); + + userService.changePassword(user); + return new ModelAndView(RESPONSE_VIEW, "message", "User '" + user.getId() + "' password has been updated."); + } + + @RequestMapping(method = RequestMethod.DELETE, value = "admin/users/{id}", produces = {"application/json", "text/html", "application/xml"}) + public ModelAndView getUserByEmail(@PathVariable long id) throws IOException, WiseMappingException { + final User user = userService.getUserBy(id); + if (user == null) { + throw new IllegalArgumentException("User '" + id + "' could not be found"); + } + userService.deleteUser(user); + return new ModelAndView(RESPONSE_VIEW, "message", "User deleted successfully"); } } 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 fdc16102..9b57cd1b 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -26,7 +26,7 @@ public class MindmapController { @Autowired private MindmapService mindmapService; - @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/xml", "application/json", "text/html"}) + @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/json", "text/html", "application/xml"}) @ResponseBody public ModelAndView getMindmap(@PathVariable int id) throws IOException { final MindMap mindMap = mindmapService.getMindmapById(id); @@ -34,7 +34,7 @@ public class MindmapController { return new ModelAndView("mapView", "map", map); } - @RequestMapping(method = RequestMethod.GET, value = "/maps", produces = {"application/xml", "application/json", "text/html"}) + @RequestMapping(method = RequestMethod.GET, value = "/maps", produces = {"application/json", "text/html", "application/xml"}) public ModelAndView getMindmaps() throws IOException { final User user = com.wisemapping.security.Utils.getUser(); @@ -48,7 +48,7 @@ public class MindmapController { return new ModelAndView("mapsView", "list", restMindmapList); } - @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}", consumes = {"application/xml", "application/json"}) + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}", consumes = {"application/xml", "application/json"},produces = {"application/json", "text/html", "application/xml"}) public ModelAndView updateMap(@RequestBody RestMindmap restMindmap, @PathVariable int id) throws IOException, WiseMappingException { final MindMap mindMap = mindmapService.getMindmapById(id); @@ -70,6 +70,5 @@ public class MindmapController { mindmapService.updateMindmap(mindMap, true); return new ModelAndView("responseView", "message", "Map has been updated successfully"); - } } diff --git a/wise-webapp/src/main/java/com/wisemapping/service/UserService.java b/wise-webapp/src/main/java/com/wisemapping/service/UserService.java index 40887ce4..ff06cd5d 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/UserService.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/UserService.java @@ -20,12 +20,13 @@ package com.wisemapping.service; import com.wisemapping.model.User; import com.wisemapping.exceptions.WiseMappingException; +import org.jetbrains.annotations.NotNull; public interface UserService { - public void activateAcount(long code) throws InvalidActivationCodeException; + public void activateAccount(long code) throws InvalidActivationCodeException; - public void createUser(User user, boolean emailConfirmEnabled) throws WiseMappingException; + public User createUser(@NotNull User user, boolean emailConfirmEnabled) throws WiseMappingException; public void changePassword(User user); @@ -40,4 +41,6 @@ public interface UserService { public void sendEmailPassword(String email) throws InvalidUserEmailException; public User reloadUser(final User user); + + public void deleteUser(@NotNull User user); } diff --git a/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java b/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java index c158b318..75158993 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java @@ -24,6 +24,7 @@ import com.wisemapping.mail.Mailer; import com.wisemapping.model.Collaborator; import com.wisemapping.model.User; import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; import java.util.Calendar; import java.util.HashMap; @@ -37,7 +38,7 @@ public class UserServiceImpl private Mailer mailer; final static Logger logger = Logger.getLogger("org.wisemapping.service"); - public void activateAcount(long code) + public void activateAccount(long code) throws InvalidActivationCodeException { final User user = userManager.getUserByActivationCode(code); if (user == null || user.isActive()) { @@ -90,7 +91,11 @@ public class UserServiceImpl return lo + i; } - public void createUser(User user, boolean emailConfirmEnabled) throws WiseMappingException { + public void deleteUser(@NotNull User user){ + userManager.deleteUser(user); + } + + public User createUser(@NotNull User user, boolean emailConfirmEnabled) throws WiseMappingException { final UUID uuid = UUID.randomUUID(); user.setCreationDate(Calendar.getInstance()); user.setActivationCode(uuid.getLeastSignificantBits()); @@ -116,6 +121,7 @@ public class UserServiceImpl if (emailConfirmEnabled) { sendRegistrationEmail(user); } + return user; } private void sendRegistrationEmail(User user) { diff --git a/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties b/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties index 8abef6ba..69310dd9 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties +++ b/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties @@ -1,6 +1,6 @@ log4j.rootLogger=WARN, stdout, R log4j.logger.com.wisemapping=WARN,stdout,R -log4j.logger.org.springframework=WARN,stdout,R +log4j.logger.org.springframework=DEBUG,stdout,R log4j.logger.org.codehaus.jackson=WARN,stdout,R # Stdout logger � From 0bd71c12f97f45df8d58f9936090f024910cdc29 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 21 Feb 2012 18:14:28 -0300 Subject: [PATCH 13/45] - Fix crlt for edition. - Support minor changes --- .../java/com/wisemapping/rest/MindmapController.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 9b57cd1b..5b1219ca 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -9,7 +9,6 @@ import com.wisemapping.rest.model.RestMindmap; import com.wisemapping.rest.model.RestMindmapList; import com.wisemapping.security.Utils; import com.wisemapping.service.MindmapService; -import org.codehaus.jackson.map.ObjectMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; @@ -48,8 +47,8 @@ public class MindmapController { return new ModelAndView("mapsView", "list", restMindmapList); } - @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}", consumes = {"application/xml", "application/json"},produces = {"application/json", "text/html", "application/xml"}) - public ModelAndView updateMap(@RequestBody RestMindmap restMindmap, @PathVariable int id) throws IOException, WiseMappingException { + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"}) + public ModelAndView updateMap(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor) throws IOException, WiseMappingException { final MindMap mindMap = mindmapService.getMindmapById(id); final User user = Utils.getUser(); @@ -67,8 +66,8 @@ public class MindmapController { final String xml = restMindmap.getXml(); mindMap.setXmlStr(xml); - mindmapService.updateMindmap(mindMap, true); + mindmapService.updateMindmap(mindMap, minor); - return new ModelAndView("responseView", "message", "Map has been updated successfully"); + return new ModelAndView("responseView", "message", "Map has been updated successfully"); } } From 1256d0e21823b31fa2fe5706d2d6eaee5e5e311e Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 21 Feb 2012 18:26:00 -0300 Subject: [PATCH 14/45] Fix ctrl issue during node edition. --- mindplot/src/main/javascript/DesignerKeyboard.js | 2 +- mindplot/src/main/javascript/RestPersistenceManager.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mindplot/src/main/javascript/DesignerKeyboard.js b/mindplot/src/main/javascript/DesignerKeyboard.js index 075073dc..074dc18a 100644 --- a/mindplot/src/main/javascript/DesignerKeyboard.js +++ b/mindplot/src/main/javascript/DesignerKeyboard.js @@ -201,7 +201,7 @@ mindplot.DesignerKeyboard = new Class({ var regex = /^(?:shift|control|ctrl|alt|meta)$/; var modifiers = ['shift', 'control', 'alt', 'meta']; - var excludes = ['esc','capslock','tab','f1','f3','f4','f5','f6','f7','f8','f9','f10','f11','f12','backspace','down','up','left','right']; + var excludes = ['esc','capslock','tab','f1','f3','f4','f5','f6','f7','f8','f9','f10','f11','f12','backspace','down','up','left','right','control']; $(document).addEvent('keydown', function(event) { diff --git a/mindplot/src/main/javascript/RestPersistenceManager.js b/mindplot/src/main/javascript/RestPersistenceManager.js index 7569c1eb..a270cb05 100644 --- a/mindplot/src/main/javascript/RestPersistenceManager.js +++ b/mindplot/src/main/javascript/RestPersistenceManager.js @@ -33,7 +33,7 @@ mindplot.RESTPersistenceManager = new Class({ }; var request = new Request({ - url:this.saveUrl + mapId, + url:this.saveUrl + mapId + "?minor=" + !saveHistory, method: 'put', onSuccess:function(responseText, responseXML) { events.onSuccess(); From 7e59b19fc0b6171d2cd958df048aaed3590fb542 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 21 Feb 2012 18:47:43 -0300 Subject: [PATCH 15/45] Fix PNG exporter. --- .../java/com/wisemapping/exporter/ExporterFactory.java | 8 ++------ .../java/com/wisemapping/rest/view/TransformView.java | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/exporter/ExporterFactory.java b/wise-webapp/src/main/java/com/wisemapping/exporter/ExporterFactory.java index 21073695..9313c633 100644 --- a/wise-webapp/src/main/java/com/wisemapping/exporter/ExporterFactory.java +++ b/wise-webapp/src/main/java/com/wisemapping/exporter/ExporterFactory.java @@ -213,14 +213,10 @@ public class ExporterFactory { int index = imgUrl.lastIndexOf("/"); elem.removeAttribute("href"); if (index != -1) { - final String iconName = imgUrl.substring(index+1); + final String iconName = imgUrl.substring(index + 1); // Hack for backward compatibility . This can be removed in 2012. :) String imgPath; - if (imgUrl.contains("images")) { - imgPath = imgBaseUrl + "/../icons/legacy/" + iconName; - } else { - imgPath = imgBaseUrl + "/" + imgUrl; - } + imgPath = imgBaseUrl + "/" + imgUrl; elem.setAttribute("xlink:href", imgPath); elem.appendChild(document.createTextNode(" ")); } diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/view/TransformView.java b/wise-webapp/src/main/java/com/wisemapping/rest/view/TransformView.java index 144db7e2..6b75a502 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/view/TransformView.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/view/TransformView.java @@ -58,7 +58,7 @@ public class TransformView extends AbstractView { response.setContentType(contentType); // Set file name... - final String fileName = (filename != null ? filename : "map" + ".") + exportFormat.getFileExtension(); + final String fileName = (filename != null ? filename : "map") + "." + exportFormat.getFileExtension(); response.setHeader("Content-Disposition", "attachment;filename=" + fileName); // Write content ... @@ -79,7 +79,7 @@ public class TransformView extends AbstractView { baseUrl = "http://www.wisemapping.com/images"; } else { final ServletContext servletContext = this.getServletContext(); - baseUrl = "file://" + servletContext.getRealPath("/icons/") + "/"; + baseUrl = "file://" + servletContext.getRealPath("/"); } properties.setBaseImagePath(baseUrl); } From f96b0d49c241b712feb74e34c97f95a5163ca989 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 21 Feb 2012 20:04:17 -0300 Subject: [PATCH 16/45] Configure default exception handlers for REST services. --- .../com/wisemapping/rest/AdminController.java | 17 +++++++----- .../com/wisemapping/rest/BaseController.java | 27 +++++++++++++++++++ .../wisemapping/rest/MindmapController.java | 9 ++++--- .../rest/TransformerController.java | 2 +- 4 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java index b306515a..8231c3cd 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java @@ -6,6 +6,7 @@ import com.wisemapping.model.User; import com.wisemapping.rest.model.RestUser; import com.wisemapping.service.UserService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; @@ -13,7 +14,7 @@ import org.springframework.web.servlet.ModelAndView; import java.io.IOException; @Controller -public class AdminController { +public class AdminController extends BaseController { private static final String RESPONSE_VIEW = "responseView"; @Autowired private UserService userService; @@ -46,7 +47,7 @@ public class AdminController { // User already exists ? final String email = user.getEmail(); - if(userService.getUserBy(email)!=null){ + if (userService.getUserBy(email) != null) { throw new IllegalArgumentException("User already exists with this email."); } @@ -55,26 +56,28 @@ public class AdminController { } @RequestMapping(method = RequestMethod.PUT, value = "admin/users/{id}/password", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"}) - public ModelAndView changePassword(@RequestBody String password, @PathVariable long id) throws IOException, WiseMappingException { + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void changePassword(@RequestBody String password, @PathVariable long id) throws IOException, WiseMappingException { if (password == null) { throw new IllegalArgumentException("Password can not be null"); } final User user = userService.getUserBy(id); + if (user == null) { + throw new IllegalArgumentException("User '" + id + "' could not be found"); + } user.setPassword(password); - userService.changePassword(user); - return new ModelAndView(RESPONSE_VIEW, "message", "User '" + user.getId() + "' password has been updated."); } @RequestMapping(method = RequestMethod.DELETE, value = "admin/users/{id}", produces = {"application/json", "text/html", "application/xml"}) - public ModelAndView getUserByEmail(@PathVariable long id) throws IOException, WiseMappingException { + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void getUserByEmail(@PathVariable long id) throws IOException, WiseMappingException { final User user = userService.getUserBy(id); if (user == null) { throw new IllegalArgumentException("User '" + id + "' could not be found"); } userService.deleteUser(user); - return new ModelAndView(RESPONSE_VIEW, "message", "User deleted successfully"); } } diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java b/wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java new file mode 100644 index 00000000..201c4eb3 --- /dev/null +++ b/wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java @@ -0,0 +1,27 @@ +package com.wisemapping.rest; + + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; + +public class BaseController { + + @ExceptionHandler(IllegalArgumentException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + @ResponseBody + public String handleClientErrors(Exception ex) { + ex.printStackTrace(); + return ex.getMessage(); + } + + @ExceptionHandler(Exception.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ResponseBody + public String handleServerErrors(Exception ex) { + ex.printStackTrace(); +// LOGGER.error(ex.getMessage(), ex); + return ex.getMessage(); + } +} 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 5b1219ca..d68556ef 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -10,6 +10,7 @@ import com.wisemapping.rest.model.RestMindmapList; import com.wisemapping.security.Utils; import com.wisemapping.service.MindmapService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; @@ -21,7 +22,7 @@ import java.util.Date; import java.util.List; @Controller -public class MindmapController { +public class MindmapController extends BaseController{ @Autowired private MindmapService mindmapService; @@ -48,7 +49,8 @@ public class MindmapController { } @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"}) - public ModelAndView updateMap(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor) throws IOException, WiseMappingException { + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void updateMap(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor) throws IOException, WiseMappingException { final MindMap mindMap = mindmapService.getMindmapById(id); final User user = Utils.getUser(); @@ -67,7 +69,6 @@ public class MindmapController { final String xml = restMindmap.getXml(); mindMap.setXmlStr(xml); mindmapService.updateMindmap(mindMap, minor); - - return new ModelAndView("responseView", "message", "Map has been updated successfully"); } + } diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java b/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java index cbbea9bf..2c4a1819 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java @@ -16,7 +16,7 @@ import java.util.HashMap; import java.util.Map; @Controller -public class TransformerController { +public class TransformerController extends BaseController { private static final String PARAM_SVG_XML = "svgXml"; private static final String PARAM_WISE_MAP_XML = "mapXml"; From e401d73cb67adc05f6a793d5a1a09358735ae8ee Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 25 Feb 2012 11:56:20 -0300 Subject: [PATCH 17/45] Fix freemind import bug with relationships. --- wise-webapp/pom.xml | 2 +- .../exporter/FreemindExporter.java | 6 +- .../importer/freemind/FreemindImporter.java | 74 +++++++---- .../com/wisemapping/rest/BaseController.java | 5 +- wise-webapp/src/test/data/freemind/process.mm | 125 ++++++++++++++++++ .../src/test/data/freemind/process.mmr | 1 + .../src/test/data/freemind/process.wxml | 1 + wise-webapp/src/test/data/svg/map1.svg | 8 +- wise-webapp/src/test/data/svg/map3.svg | 14 +- wise-webapp/src/test/data/svg/map4.svg | 14 +- 10 files changed, 201 insertions(+), 49 deletions(-) create mode 100644 wise-webapp/src/test/data/freemind/process.mm create mode 100644 wise-webapp/src/test/data/freemind/process.mmr create mode 100644 wise-webapp/src/test/data/freemind/process.wxml diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index 48d2e549..f9083b49 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -413,7 +413,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.7.2 + 2.12 true diff --git a/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java b/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java index 6e2c39fe..09d63ad0 100755 --- a/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java +++ b/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java @@ -94,10 +94,12 @@ public class FreemindExporter Arrowlink arrowlink = objectFactory.createArrowlink(); Node dstNode = nodesMap.get(relationship.getDestTopicId()); arrowlink.setDESTINATION(dstNode.getID()); - if (relationship.isEndArrow()) + if (relationship.isEndArrow()!=null && relationship.isEndArrow()) arrowlink.setENDARROW("Default"); - if (relationship.isStartArrow()) + + if (relationship.isStartArrow()!=null && relationship.isStartArrow()) arrowlink.setSTARTARROW("Default"); + List cloudOrEdge = srcNode.getArrowlinkOrCloudOrEdge(); cloudOrEdge.add(arrowlink); } 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 abfd2900..224ae963 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 @@ -94,7 +94,7 @@ public class FreemindImporter } - public MindMap importMap(@NotNull String mapName, @NotNull String description, @NotNull InputStream input) throws ImporterException { + public MindMap importMap(@NotNull String mapName, @NotNull String description, @NotNull InputStream input) throws ImporterException { final MindMap result = new MindMap(); nodesMap = new HashMap(); @@ -181,28 +181,37 @@ public class FreemindImporter TopicType destTopicType = nodesMap.get(rel.getDestTopicId()); //Fix x coord - final Coord srcCtrlCoord = Coord.parse(rel.getSrcCtrlPoint()); - final Coord destCtrlCoord = Coord.parse(rel.getDestCtrlPoint()); + final String srcCtrlPoint = rel.getSrcCtrlPoint(); + if (srcCtrlPoint != null) { + final Coord srcCtrlCoord = Coord.parse(srcCtrlPoint); - if (Coord.parse(srcTopic.getPosition()).isOnLeftSide()) { - int x = srcCtrlCoord.x * -1; - rel.setSrcCtrlPoint(x + "," + srcCtrlCoord.y); - } - if (Coord.parse(destTopicType.getPosition()).isOnLeftSide()) { - int x = destCtrlCoord.x * -1; - rel.setDestCtrlPoint(x + "," + destCtrlCoord.y); - } + if (Coord.parse(srcTopic.getPosition()).isOnLeftSide()) { + int x = srcCtrlCoord.x * -1; + rel.setSrcCtrlPoint(x + "," + srcCtrlCoord.y); - //Fix coord - if (srcTopic.getOrder() != null && srcTopic.getOrder() % 2 != 0) { //Odd order. - int y = srcCtrlCoord.y * -1; - rel.setSrcCtrlPoint(srcCtrlCoord.x + "," + y); - } - if (destTopicType.getOrder() != null && destTopicType.getOrder() % 2 != 0) { //Odd order. - int y = destCtrlCoord.y * -1; - rel.setDestCtrlPoint(destCtrlCoord.x + "," + y); + //Fix coord + if (srcTopic.getOrder() != null && srcTopic.getOrder() % 2 != 0) { //Odd order. + int y = srcCtrlCoord.y * -1; + rel.setSrcCtrlPoint(srcCtrlCoord.x + "," + y); + } + } } + final String destCtrlPoint = rel.getDestCtrlPoint(); + if (destCtrlPoint != null) { + final Coord destCtrlCoord = Coord.parse(destCtrlPoint); + + if (Coord.parse(destTopicType.getPosition()).isOnLeftSide()) { + int x = destCtrlCoord.x * -1; + rel.setDestCtrlPoint(x + "," + destCtrlCoord.y); + } + + + if (destTopicType.getOrder() != null && destTopicType.getOrder() % 2 != 0) { //Odd order. + int y = destCtrlCoord.y * -1; + rel.setDestCtrlPoint(destCtrlCoord.x + "," + y); + } + } } private void convertChildNodes(@NotNull Node freeParent, @NotNull TopicType wiseParent, final int depth) { @@ -299,13 +308,26 @@ public class FreemindImporter String destId = arrow.getDESTINATION(); relt.setSrcTopicId(freeParent.getID()); relt.setDestTopicId(destId); - String[] inclination = arrow.getENDINCLINATION().split(";"); - relt.setDestCtrlPoint(inclination[0] + "," + inclination[1]); - inclination = arrow.getSTARTINCLINATION().split(";"); - relt.setSrcCtrlPoint(inclination[0] + "," + inclination[1]); - //relationship.setCtrlPointRelative(true); - relt.setEndArrow(!arrow.getENDARROW().toLowerCase().equals("none")); - relt.setStartArrow(!arrow.getSTARTARROW().toLowerCase().equals("none")); + final String endinclination = arrow.getENDINCLINATION(); + if (endinclination != null) { + String[] inclination = endinclination.split(";"); + relt.setDestCtrlPoint(inclination[0] + "," + inclination[1]); + } + final String startinclination = arrow.getSTARTINCLINATION(); + if (startinclination != null) { + String[] inclination = startinclination.split(";"); + relt.setSrcCtrlPoint(inclination[0] + "," + inclination[1]); + } + + final String endarrow = arrow.getENDARROW(); + if (endarrow != null) { + relt.setEndArrow(!endarrow.toLowerCase().equals("none")); + } + + final String startarrow = arrow.getSTARTARROW(); + if (startarrow != null) { + relt.setStartArrow(!startarrow.toLowerCase().equals("none")); + } relt.setLineType("3"); relationships.add(relt); } diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java b/wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java index 201c4eb3..ecdfa21d 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java @@ -1,6 +1,7 @@ package com.wisemapping.rest; +import org.jetbrains.annotations.NotNull; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseBody; @@ -11,7 +12,7 @@ public class BaseController { @ExceptionHandler(IllegalArgumentException.class) @ResponseStatus(HttpStatus.BAD_REQUEST) @ResponseBody - public String handleClientErrors(Exception ex) { + public String handleClientErrors(@NotNull Exception ex) { ex.printStackTrace(); return ex.getMessage(); } @@ -19,7 +20,7 @@ public class BaseController { @ExceptionHandler(Exception.class) @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) @ResponseBody - public String handleServerErrors(Exception ex) { + public String handleServerErrors(@NotNull Exception ex) { ex.printStackTrace(); // LOGGER.error(ex.getMessage(), ex); return ex.getMessage(); diff --git a/wise-webapp/src/test/data/freemind/process.mm b/wise-webapp/src/test/data/freemind/process.mm new file mode 100644 index 00000000..a1863efd --- /dev/null +++ b/wise-webapp/src/test/data/freemind/process.mm @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Part%20of%20Tissue%20Banks%20International + + + + + + + + EIN%20953138799 + + + + + + + + + + + + + + + EIN%20581990866 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wise-webapp/src/test/data/freemind/process.mmr b/wise-webapp/src/test/data/freemind/process.mmr new file mode 100644 index 00000000..fff79e47 --- /dev/null +++ b/wise-webapp/src/test/data/freemind/process.mmr @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wise-webapp/src/test/data/freemind/process.wxml b/wise-webapp/src/test/data/freemind/process.wxml new file mode 100644 index 00000000..60a65b85 --- /dev/null +++ b/wise-webapp/src/test/data/freemind/process.wxml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wise-webapp/src/test/data/svg/map1.svg b/wise-webapp/src/test/data/svg/map1.svg index b9c723fd..daa5d473 100644 --- a/wise-webapp/src/test/data/svg/map1.svg +++ b/wise-webapp/src/test/data/svg/map1.svg @@ -72,7 +72,7 @@ fill="#525c61" style="cursor: move;" y="9" x="20" visibility="visible">Aval de la Municipalidad - + Es tan fuerte ? - + Web Lista (Gratuita) - - + + web - + @@ -223,7 +223,7 @@ fill="#ffffff" style="cursor: move;" y="12" x="22" visibility="visible">Plan de Negocio - + @@ -240,8 +240,8 @@ fill="#525c61" style="cursor: move;" y="9" x="32" visibility="visible">ascTimeTable - - + + lantiv - + Competencia - + @@ -452,7 +452,7 @@ fill="#525c61" style="cursor: move;" y="12" x="22" visibility="visible">Features - + diff --git a/wise-webapp/src/test/data/svg/map4.svg b/wise-webapp/src/test/data/svg/map4.svg index 231534c5..4e68c232 100644 --- a/wise-webapp/src/test/data/svg/map4.svg +++ b/wise-webapp/src/test/data/svg/map4.svg @@ -148,7 +148,7 @@ fill="#525c61" style="cursor: move;" y="12" x="22" visibility="visible">web - + @@ -223,7 +223,7 @@ fill="#ffffff" style="cursor: move;" y="12" x="22" visibility="visible">Plan de Negocio - + @@ -240,8 +240,8 @@ fill="#525c61" style="cursor: move;" y="9" x="32" visibility="visible">ascTimeTable - - + + lantiv - + Competencia - + @@ -452,7 +452,7 @@ fill="#525c61" style="cursor: move;" y="12" x="22" visibility="visible">Features - + From 9e4480431434a4db5a395e04c5b73d7e7b0c86c4 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 25 Feb 2012 23:32:15 -0300 Subject: [PATCH 18/45] Move persistence clases to persistence package. --- mindplot/pom.xml | 33 +- ...ispatcher.js => CollabActionDispatcher.js} | 2 +- mindplot/src/main/javascript/Designer.js | 8 +- mindplot/src/main/javascript/MediaTopic.js | 136 ++++ .../src/main/javascript/PersistenceManager.js | 4 +- .../src/main/javascript/RichTextEditor.js | 158 ----- .../src/main/javascript/ShrinkConnector.js | 2 +- mindplot/src/main/javascript/TextTopic.js | 590 ++++++++++++++++++ .../BrixCollaborativeModelFactory.js | 0 .../{brix => collab}/BrixFramework.js | 0 .../{brix => collab}/model/Mindmap.js | 0 .../{brix => collab}/model/NodeModel.js | 0 mindplot/src/main/javascript/header.js | 3 +- .../src/main/javascript/model/INodeModel.js | 9 + mindplot/src/main/javascript/model/Mindmap.js | 2 +- .../{ => persistence}/Beta2PelaMigrator.js | 6 +- .../{ => persistence}/ModelCodeName.js | 2 +- .../{ => persistence}/Pela2TangoMigrator.js | 6 +- .../XMLSerializerFactory.js} | 34 +- .../XMLSerializer_Beta.js} | 8 +- .../XMLSerializer_Pela.js} | 39 +- .../XMLSerializer_Tango.js} | 4 +- .../src/test/javascript/ModelMigrationTest.js | 6 +- wise-editor/src/main/webapp/c/export.htm | 2 +- wise-editor/src/main/webapp/html/editor.html | 8 +- .../src/main/webapp/samples/welcome.xml | 1 + .../src/main/webapp/jsp/embeddedView.jsp | 2 +- .../src/main/webapp/jsp/mindmapExport.jsp | 2 +- .../src/main/webapp/jsp/mindmapPrint.jsp | 2 +- 29 files changed, 820 insertions(+), 249 deletions(-) rename mindplot/src/main/javascript/{BrixActionDispatcher.js => CollabActionDispatcher.js} (98%) create mode 100644 mindplot/src/main/javascript/MediaTopic.js delete mode 100644 mindplot/src/main/javascript/RichTextEditor.js create mode 100644 mindplot/src/main/javascript/TextTopic.js rename mindplot/src/main/javascript/collaboration/framework/{brix => collab}/BrixCollaborativeModelFactory.js (100%) rename mindplot/src/main/javascript/collaboration/framework/{brix => collab}/BrixFramework.js (100%) rename mindplot/src/main/javascript/collaboration/framework/{brix => collab}/model/Mindmap.js (100%) rename mindplot/src/main/javascript/collaboration/framework/{brix => collab}/model/NodeModel.js (100%) rename mindplot/src/main/javascript/{ => persistence}/Beta2PelaMigrator.js (85%) rename mindplot/src/main/javascript/{ => persistence}/ModelCodeName.js (95%) rename mindplot/src/main/javascript/{ => persistence}/Pela2TangoMigrator.js (91%) rename mindplot/src/main/javascript/{XMLMindmapSerializerFactory.js => persistence/XMLSerializerFactory.js} (53%) rename mindplot/src/main/javascript/{XMLMindmapSerializer_Beta.js => persistence/XMLSerializer_Beta.js} (96%) rename mindplot/src/main/javascript/{XMLMindmapSerializer_Pela.js => persistence/XMLSerializer_Pela.js} (95%) rename mindplot/src/main/javascript/{XMLMindmapSerializer_Tango.js => persistence/XMLSerializer_Tango.js} (87%) diff --git a/mindplot/pom.xml b/mindplot/pom.xml index f04c21fb..1098a977 100644 --- a/mindplot/pom.xml +++ b/mindplot/pom.xml @@ -68,6 +68,7 @@ + @@ -81,18 +82,18 @@ - + + files="persistence/XMLSerializer_Pela.js"/> + files="persistence/XMLSerializer_Tango.js"/> + files="persistence/Pela2TangoMigrator.js"/> - + files="persistence/XMLSerializer_Beta.js"/> + + files="persistence/XMLSerializerFactory.js"/> @@ -245,23 +246,7 @@ - + diff --git a/mindplot/src/main/javascript/BrixActionDispatcher.js b/mindplot/src/main/javascript/CollabActionDispatcher.js similarity index 98% rename from mindplot/src/main/javascript/BrixActionDispatcher.js rename to mindplot/src/main/javascript/CollabActionDispatcher.js index b6ea01a4..0aeef814 100644 --- a/mindplot/src/main/javascript/BrixActionDispatcher.js +++ b/mindplot/src/main/javascript/CollabActionDispatcher.js @@ -34,7 +34,7 @@ mindplot.BrixActionDispatcher = new Class({ // Set position ... node.setPosition(position); } else { - $assert("Illegal commnad state exception."); + $assert("Illegal commnand state exception."); } // Finally, connect node ... if ($defined(this._parentId)) { diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index f528d2fe..5215018a 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -422,7 +422,7 @@ mindplot.Designer = new Class({ $assert(mindmapModel, "mindmapModel can not be null"); this._mindmap = mindmapModel; - try { +// try { // Init layout manager ... var size = {width:25,height:25}; var layoutManager = new mindplot.layout.LayoutManager(mindmapModel.getCentralTopic().getId(), size); @@ -460,9 +460,9 @@ mindplot.Designer = new Class({ mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout); this.fireEvent('loadSuccess'); - } catch(e) { - this.fireEvent('loadError',e); - } +// } catch(e) { +// this.fireEvent('loadError',e); +// } }, getMindmap : function() { diff --git a/mindplot/src/main/javascript/MediaTopic.js b/mindplot/src/main/javascript/MediaTopic.js new file mode 100644 index 00000000..aaad649a --- /dev/null +++ b/mindplot/src/main/javascript/MediaTopic.js @@ -0,0 +1,136 @@ +/* + * Copyright [2011] [wisemapping] + * + * Licensed under WiseMapping Public License, Version 1.0 (the "License"). + * It is basically the Apache License, Version 2.0 (the "License") plus the + * "powered by wisemapping" text requirement on every single page; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the license at + * + * http://www.wisemapping.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +mindplot.MediaTopic = new Class({ + Extends:mindplot.Topic, + initialize : function(model, options) { + this.parent(model, options); + }, + + getInnerShape : function() { + if (!$defined(this._innerShape)) { + // Create inner box. + var model = this.getModel(); + + this._innerShape = new web2d.Image(); + this._innerShape.setHref(model.getImageUrl()); + this._innerShape.setPosition(0, 0); + } + return this._innerShape; + }, + + getOuterShape : function() { + if (!$defined(this._outerShape)) { + var rect = new web2d.Rect(0, mindplot.Topic.OUTER_SHAPE_ATTRIBUTES); + rect.setPosition(-2, -3); + rect.setOpacity(0); + this._outerShape = rect; + } + + return this._outerShape; + }, + + + _buildShape : function() { + var groupAttributes = {width: 100, height:100,coordSizeWidth:100,coordSizeHeight:100}; + var group = new web2d.Group(groupAttributes); + this._set2DElement(group); + + // Shape must be build based on the model width ... + var outerShape = this.getOuterShape(); + var innerShape = this.getInnerShape(); + var shrinkConnector = this.getShrinkConnector(); + + // Add to the group ... + group.appendChild(outerShape); + group.appendChild(innerShape); + + // Update figure size ... +// var model = this.getModel(); +// if (model.getLinks().length != 0 || model.getNotes().length != 0 || model.getIcons().length != 0) { +// this.getOrBuildIconGroup(); +// } + + if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { + shrinkConnector.addToWorkspace(group); + } + + // Register listeners ... + this._registerDefaultListenersToElement(group, this); + + + }, + + workoutOutgoingConnectionPoint : function(targetPosition) { + $assert(targetPosition, 'targetPoint can not be null'); + var pos = this.getPosition(); + + var result; + result = new core.Point(); + var groupPosition = this._elem2d.getPosition(); + var innerShareSize = this.getInnerShape().getSize(); + var isAtRight = mindplot.util.Shape.isAtRight(targetPosition, pos); + + result = mindplot.util.Shape.calculateRectConnectionPoint(pos, this.getSize(), isAtRight, true); + return result; + }, + + createDragNode : function(layoutManager) { + var result = this.parent(layoutManager); + + // Is the node already connected ? + var targetTopic = this.getOutgoingConnectedTopic(); + if ($defined(targetTopic)) { + result.connectTo(targetTopic); + result.setVisibility(false); + } + return result; + }, + + _adjustShapes : function() { + if (this._isInWorkspace) { + + var size = this.getModel().getSize(); + this.setSize(size, true); + + } + }, + + _updatePositionOnChangeSize : function(oldSize, newSize) { + + var xOffset = Math.round((newSize.width - oldSize.width) / 2); + var pos = this.getPosition(); + if ($defined(pos)) { + if (pos.x > 0) { + pos.x = pos.x + xOffset; + } else { + pos.x = pos.x - xOffset; + } + this.setPosition(pos); + } + }, + + updateTopicShape : function() { + // Todo: verify ... + }, + + closeEditors : function() { + //@Todo: + } +}); diff --git a/mindplot/src/main/javascript/PersistenceManager.js b/mindplot/src/main/javascript/PersistenceManager.js index 12d941f4..56c596cc 100644 --- a/mindplot/src/main/javascript/PersistenceManager.js +++ b/mindplot/src/main/javascript/PersistenceManager.js @@ -28,7 +28,7 @@ mindplot.PersistenceManager = new Class({ var mapId = mindmap.getId(); $assert(mapId, "mapId can not be null"); - var serializer = mindplot.XMLMindmapSerializerFactory.getSerializerFromMindmap(mindmap); + var serializer = mindplot.persistence.XMLSerializerFactory.getSerializerFromMindmap(mindmap); var domMap = serializer.toXML(mindmap); var mapXml = core.Utils.innerXML(domMap); @@ -59,7 +59,7 @@ mindplot.PersistenceManager = new Class({ $assert(mapId, "mapId can not be null"); $assert(mapDom, "mapDom can not be null"); - var serializer = mindplot.XMLMindmapSerializerFactory.getSerializerFromDocument(mapDom); + var serializer = mindplot.persistence.XMLSerializerFactory.getSerializerFromDocument(mapDom); return serializer.loadFromDom(mapDom, mapId); }, diff --git a/mindplot/src/main/javascript/RichTextEditor.js b/mindplot/src/main/javascript/RichTextEditor.js deleted file mode 100644 index 9b177dda..00000000 --- a/mindplot/src/main/javascript/RichTextEditor.js +++ /dev/null @@ -1,158 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -mindplot.RichTextEditor = mindplot.TextEditor.extend({ - initialize:function(screenManager,actionRunner){ - this.parent(screenManager, actionRunner); - }, - _buildEditor:function(){ - //Create editor ui - this._size = {width:440, height:200}; - this._myOverlay = new Element('div').setStyles({position:"absolute", display: "none", zIndex: "8", top: "50%", left:"50%", marginLeft:"-200px", marginTop:"-90px", width:"400px", height:"180px"}); - var inputContainer = new Element('div').setStyles({border:"none", overflow:"auto"}).inject(this._myOverlay); - this.inputText = new Element('textarea').setProperties({tabindex:'-1', id:"inputText2", value:""}).setStyles({width:"398px", height:"175px", border:"none", background:"transparent"}).inject(inputContainer); - this._myOverlay.inject(this._screenManager.getContainer()); - this._editorNode = new web2d.Rect(0.3,mindplot.Topic.OUTER_SHAPE_ATTRIBUTES); - this._editorNode.setSize(50,20); - this._editorNode.setVisibility(false); - this._designer.getWorkSpace().appendChild(this._editorNode); - this._addListeners(); - }, - _registerListeners:function(){ - - $(this._myOverlay).addEvent('click', function(event){ - event.preventDefault(); - event.stop(); - }.bindWithEvent(this)); - $(this._myOverlay).addEvent('dblclick', function(event){ - event.preventDefault(); - event.stop(); - }.bindWithEvent(this)); - }, - getFocusEvent:function(node){ - var screenSize = this._designer.getWorkSpace().getSize(); - var coordOrigin = this._designer.getWorkSpace()._workspace.getCoordOrigin(); - var middlePosition = {x:parseInt(screenSize.width)/2 + parseInt(coordOrigin.x), y:parseInt(screenSize.height)/2 + parseInt(coordOrigin.y)}; - - this._designer.getWorkSpace().enableWorkspaceEvents(false); - var position = node.getPosition().clone(); - var size = node.getSize(); - this._editorNode.setPosition(position.x-(size.width/2), position.y-(size.height/2)); - position = this._editorNode.getPosition(); - this._editorNode.setSize(size.width, size.height); - this._editorNode.moveToFront(); - this._editorNode.setVisibility(true); - var scale = web2d.peer.utils.TransformUtil.workoutScale(node.getOuterShape()); -// scale.width=1; -// scale.height = 1; - var steps = 10; - this._delta = {width:((this._size.width/scale.width)-size.width)/steps, height:((this._size.height/scale.height)-size.height)/steps}; - var finx = (middlePosition.x-(((this._size.width)/2)/scale.width)); - var finy = (middlePosition.y-((this._size.height/2)/scale.height)); - var step = 10; - var d = {x:(position.x - finx)/step, y:(position.y - finy)/step}; - var _animEffect = null; - var effect = function(){ - if(step>=0){ - var xStep= (position.x -finx)/step; - var yStep= (position.y -finy)/step; - var pos = {x:position.x - d.x*(10-step), y: position.y -d.y *(10-step)}; - - var size = this._editorNode.getSize(); - this._editorNode.setSize(size.width + this._delta.width, size.height + this._delta.height); - this._editorNode.setPosition(pos.x, pos.y); - if(step>0) - this._editorNode.setOpacity(1-step/10); - step--; - }else{ - $clear(_animEffect); - this._editorNode.setSize((this._size.width/scale.width), (this._size.height/scale.height)); - this.init(node); - } - }.bind(this); - _animEffect = effect.periodical(10); - $(this.inputText).value = $defined(this.initialText)&& this.initialText!=""? this.initialText: node.getText(); - this._editor = new nicEditor({iconsPath: '../images/nicEditorIcons.gif', buttonList : ['bold','italic','underline','removeformat','forecolor', 'fontSize', 'fontFamily', 'xhtml']}).panelInstance("inputText2"); - }, - init:function(node){ - this._currentNode = node; - this._applyChanges = false; - $(this._myOverlay.setStyle('display','block')); - inst = this._editor.instanceById("inputText2"); - inst.elm.focus(); - - - - //becarefull this._editor is not mootools!! - this._editor.addEvent('blur',function(event){ - this._myOverlay.setStyle('display','none'); - var text = this._text; - this._text = this._editor.instanceById("inputText2").getContent(); - if(text!=this._text){ - this._applyChanges = true; - } - console.log('bye'); - this.lostFocusListener(); - this._editor.removeInstance("inputText2"); - this._editor.destruct(); - this._editor = null; - - }.bind(this)); - - this._editor.fireEvent(); - $(this.inputText).focus(); - }, - getText:function(){ - return this._text; - }, - lostFocusListener:function(){ - this._hideNode(); - if (this._currentNode != null) - { - if(this._applyChanges) - { - this._updateModel(); - } - this._applyChanges=true; - this._currentNode = null; - } - }, - _hideNode:function(){ - var _animEffect = null; - var step = 10; - var position = this._editorNode.getPosition(); - var finx = this._currentNode.getPosition().x - this._currentNode.getSize().width/2; - var finy = this._currentNode.getPosition().y - this._currentNode.getSize().height/2; - var d = {x:(position.x - finx)/step, y:(position.y - finy)/step}; - var effect = function(){ - if(step>=0){ - var pos = {x:position.x - d.x*(10-step), y: position.y - d.y*(10-step)}; - - var size = this._editorNode.getSize(); - this._editorNode.setSize(size.width - this._delta.width, size.height - this._delta.height); - this._editorNode.setPosition(pos.x, pos.y); - this._editorNode.setOpacity(step/10); - step--; - }else{ - $clear(_animEffect); - this._designer.getWorkSpace().enableWorkspaceEvents(true); - this._editorNode.setVisibility(false); } - }.bind(this); - _animEffect = effect.periodical(10); - } -}); diff --git a/mindplot/src/main/javascript/ShrinkConnector.js b/mindplot/src/main/javascript/ShrinkConnector.js index 1f177314..d6f200fb 100644 --- a/mindplot/src/main/javascript/ShrinkConnector.js +++ b/mindplot/src/main/javascript/ShrinkConnector.js @@ -19,7 +19,7 @@ mindplot.ShirinkConnector = new Class({ initialize: function(topic) { - var ellipse = new web2d.Elipse(mindplot.Topic.prototype.INNER_RECT_ATTRIBUTES); + var ellipse = new web2d.Elipse(mindplot.TextTopic.prototype.INNER_RECT_ATTRIBUTES); this._ellipse = ellipse; ellipse.setFill('rgb(62,118,179)'); diff --git a/mindplot/src/main/javascript/TextTopic.js b/mindplot/src/main/javascript/TextTopic.js new file mode 100644 index 00000000..b3c825a2 --- /dev/null +++ b/mindplot/src/main/javascript/TextTopic.js @@ -0,0 +1,590 @@ +/* + * Copyright [2011] [wisemapping] + * + * Licensed under WiseMapping Public License, Version 1.0 (the "License"). + * It is basically the Apache License, Version 2.0 (the "License") plus the + * "powered by wisemapping" text requirement on every single page; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the license at + * + * http://www.wisemapping.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +mindplot.TextTopic = new Class({ + Extends:mindplot.Topic, + initialize : function(model, options) { + this._textEditor = new mindplot.MultilineTextEditor(this); + this.parent(model, options); + }, + + _registerEvents : function() { + + this.parent(); + this.addEvent('dblclick', function (event) { + this._textEditor.show(); + event.stopPropagation(true); + }.bind(this)); + + this._textEditor.addEvent('input', function(event, text) { + var textShape = this.getTextShape(); +// var oldText = textShape.getText(); + +// this._setText(text, false); + // @Todo: I must resize, no change the position ... +// textShape.setText(oldText); + }.bind(this)); + + }, + + setShapeType : function(type) { + this._setShapeType(type, true); + + }, + + _setShapeType : function(type, updateModel) { + // Remove inner shape figure ... + var model = this.getModel(); + if ($defined(updateModel) && updateModel) { + model.setShapeType(type); + } + + var oldInnerShape = this.getInnerShape(); + if (oldInnerShape != null) { + + this._removeInnerShape(); + + // Create a new one ... + var innerShape = this.getInnerShape(); + + // Update figure size ... + var size = model.getSize(); + this.setSize(size, true); + + var group = this.get2DElement(); + group.appendChild(innerShape); + + // Move text to the front ... + var text = this.getTextShape(); + text.moveToFront(); + + //Move iconGroup to front ... + var iconGroup = this.getIconGroup(); + if ($defined(iconGroup)) { + iconGroup.moveToFront(); + } + //Move connector to front + var connector = this.getShrinkConnector(); + if ($defined(connector)) { + connector.moveToFront(); + } + } + + }, + + getShapeType : function() { + var model = this.getModel(); + var result = model.getShapeType(); + if (!$defined(result)) { + result = this._defaultShapeType(); + } + return result; + }, + + getInnerShape : function() { + if (!$defined(this._innerShape)) { + // Create inner box. + this._innerShape = this.buildShape(mindplot.TextTopic.INNER_RECT_ATTRIBUTES); + + // Update bgcolor ... + var bgColor = this.getBackgroundColor(); + this._setBackgroundColor(bgColor, false); + + // Update border color ... + var brColor = this.getBorderColor(); + this._setBorderColor(brColor, false); + + // Define the pointer ... + if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { + this._innerShape.setCursor('move'); + } else { + this._innerShape.setCursor('default'); + } + + } + return this._innerShape; + }, + + buildShape : function(attributes, type) { + var result; + if (!$defined(type)) { + type = this.getShapeType(); + } + + if (type == mindplot.model.INodeModel.SHAPE_TYPE_RECT) { + result = new web2d.Rect(0, attributes); + } + else if (type == mindplot.model.INodeModel.SHAPE_TYPE_ELIPSE) { + result = new web2d.Rect(0.9, attributes); + } + else if (type == mindplot.model.INodeModel.SHAPE_TYPE_ROUNDED_RECT) { + result = new web2d.Rect(0.3, attributes); + } + else if (type == mindplot.model.INodeModel.SHAPE_TYPE_LINE) { + result = new web2d.Line({strokeColor:"#495879",strokeWidth:1}); + result.setSize = function(width, height) { + this.size = {width:width, height:height}; + result.setFrom(0, height); + result.setTo(width, height); + + // Lines will have the same color of the default connection lines... + var stokeColor = mindplot.ConnectionLine.getStrokeColor(); + result.setStroke(1, 'solid', stokeColor); + }; + + result.getSize = function() { + return this.size; + }; + + result.setPosition = function() { + }; + + var setStrokeFunction = result.setStroke; + result.setFill = function() { + + }; + + result.setStroke = function() { + + }; + } + else { + $assert(false, "Unsupported figure type:" + type); + } + result.setPosition(0, 0); + return result; + }, + + + getOuterShape : function() { + if (!$defined(this._outerShape)) { + var rect = this.buildShape(mindplot.Topic.OUTER_SHAPE_ATTRIBUTES, mindplot.model.INodeModel.SHAPE_TYPE_ROUNDED_RECT); + rect.setPosition(-2, -3); + rect.setOpacity(0); + this._outerShape = rect; + } + + return this._outerShape; + }, + + getTextShape : function() { + if (!$defined(this._text)) { + this._text = this._buildTextShape(false); + + // Set Text ... + var text = this.getText(); + this._setText(text, false); + } + return this._text; + }, + + + _buildTextShape : function(readOnly) { + var result = new web2d.Text(); + var family = this.getFontFamily(); + var size = this.getFontSize(); + var weight = this.getFontWeight(); + var style = this.getFontStyle(); + result.setFont(family, size, style, weight); + + var color = this.getFontColor(); + result.setColor(color); + + if (!readOnly) { + // Propagate mouse events ... + if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { + result.setCursor('move'); + } else { + result.setCursor('default'); + } + } + + return result; + }, + + _getInnerPadding : function() { + throw "this must be implemented"; + }, + + setFontFamily : function(value, updateModel) { + var textShape = this.getTextShape(); + textShape.setFontFamily(value); + if ($defined(updateModel) && updateModel) { + var model = this.getModel(); + model.setFontFamily(value); + } + this._adjustShapes(updateModel); + }, + + setFontSize : function(value, updateModel) { + + var textShape = this.getTextShape(); + textShape.setSize(value); + + if ($defined(updateModel) && updateModel) { + var model = this.getModel(); + model.setFontSize(value); + } + this._adjustShapes(updateModel); + + }, + + setFontStyle : function(value, updateModel) { + var textShape = this.getTextShape(); + textShape.setStyle(value); + if ($defined(updateModel) && updateModel) { + var model = this.getModel(); + model.setFontStyle(value); + } + this._adjustShapes(updateModel); + }, + + setFontWeight : function(value, updateModel) { + var textShape = this.getTextShape(); + textShape.setWeight(value); + if ($defined(updateModel) && updateModel) { + var model = this.getModel(); + model.setFontWeight(value); + } + this._adjustShapes(); + }, + + getFontWeight : function() { + var model = this.getModel(); + var result = model.getFontWeight(); + if (!$defined(result)) { + var font = this._defaultFontStyle(); + result = font.weight; + } + return result; + }, + + getFontFamily : function() { + var model = this.getModel(); + var result = model.getFontFamily(); + if (!$defined(result)) { + var font = this._defaultFontStyle(); + result = font.font; + } + return result; + }, + + getFontColor : function() { + var model = this.getModel(); + var result = model.getFontColor(); + if (!$defined(result)) { + var font = this._defaultFontStyle(); + result = font.color; + } + return result; + }, + + getFontStyle : function() { + var model = this.getModel(); + var result = model.getFontStyle(); + if (!$defined(result)) { + var font = this._defaultFontStyle(); + result = font.style; + } + return result; + }, + + getFontSize : function() { + var model = this.getModel(); + var result = model.getFontSize(); + if (!$defined(result)) { + var font = this._defaultFontStyle(); + result = font.size; + } + return result; + }, + + setFontColor : function(value, updateModel) { + var textShape = this.getTextShape(); + textShape.setColor(value); + if ($defined(updateModel) && updateModel) { + var model = this.getModel(); + model.setFontColor(value); + } + }, + + _setText : function(text, updateModel) { + var textShape = this.getTextShape(); + textShape.setText(text == null ? this._defaultText() : text); + + if ($defined(updateModel) && updateModel) { + var model = this.getModel(); + model.setText(text); + } + }, + + setText : function(text) { + // Avoid empty nodes ... + if (text.trim().length == 0) { + text = null; + } + + this._setText(text, true); + this._adjustShapes(); + }, + + getText : function() { + var model = this.getModel(); + var result = model.getText(); + if (!$defined(result)) { + result = this._defaultText(); + } + return result; + }, + + setBackgroundColor : function(color) { + this._setBackgroundColor(color, true); + }, + + _setBackgroundColor : function(color, updateModel) { + var innerShape = this.getInnerShape(); + innerShape.setFill(color); + + var connector = this.getShrinkConnector(); + connector.setFill(color); + + if ($defined(updateModel) && updateModel) { + var model = this.getModel(); + model.setBackgroundColor(color); + } + }, + + getBackgroundColor : function() { + var model = this.getModel(); + var result = model.getBackgroundColor(); + if (!$defined(result)) { + result = this._defaultBackgroundColor(); + } + return result; + }, + + setBorderColor : function(color) { + this._setBorderColor(color, true); + }, + + _setBorderColor : function(color, updateModel) { + var innerShape = this.getInnerShape(); + innerShape.setAttribute('strokeColor', color); + + var connector = this.getShrinkConnector(); + connector.setAttribute('strokeColor', color); + + + if ($defined(updateModel) && updateModel) { + var model = this.getModel(); + model.setBorderColor(color); + } + }, + + getBorderColor : function() { + var model = this.getModel(); + var result = model.getBorderColor(); + if (!$defined(result)) { + result = this._defaultBorderColor(); + } + return result; + }, + + _buildShape : function() { + var groupAttributes = {width: 100, height:100,coordSizeWidth:100,coordSizeHeight:100}; + var group = new web2d.Group(groupAttributes); + this._set2DElement(group); + + // Shape must be build based on the model width ... + var outerShape = this.getOuterShape(); + var innerShape = this.getInnerShape(); + var textShape = this.getTextShape(); + var shrinkConnector = this.getShrinkConnector(); + + // Add to the group ... + group.appendChild(outerShape); + group.appendChild(innerShape); + group.appendChild(textShape); + + // Update figure size ... + var model = this.getModel(); + if (model.getLinks().length != 0 || model.getNotes().length != 0 || model.getIcons().length != 0) { + this.getOrBuildIconGroup(); + } + + if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { + shrinkConnector.addToWorkspace(group); + } + + // Register listeners ... + this._registerDefaultListenersToElement(group, this); + }, + + + showTextEditor : function(text) { + this._textEditor.show(text); + }, + + showLinkEditor : function() { + + var topicId = this.getId(); + var model = this.getModel(); + var editorModel = { + getValue : function() { + var links = model.getLinks(); + var result; + if (links.length > 0) + result = links[0].getUrl(); + + return result; + }, + + setValue : function(value) { + var dispatcher = mindplot.ActionDispatcher.getInstance(); + if (!$defined(value)) { + dispatcher.removeLinkFromTopic(topicId); + } + else { + dispatcher.changeLinkToTopic(topicId, value); + } + } + }; + + this.closeEditors(); + var editor = new mindplot.widget.LinkEditor(editorModel); + editor.show(); + }, + + + closeEditors : function() { + this._textEditor.close(true); + }, + + /** + * Point: references the center of the rect shape.!!! + */ + setPosition : function(point) { + $assert(point, "position can not be null"); + point.x = Math.ceil(point.x); + point.y = Math.ceil(point.y); + + // Update model's position ... + var model = this.getModel(); + model.setPosition(point.x, point.y); + + // Elements are positioned in the center. + // All topic element must be positioned based on the innerShape. + var size = this.getSize(); + + var cx = point.x - (size.width / 2); + var cy = point.y - (size.height / 2); + + // Update visual position. + this._elem2d.setPosition(cx, cy); + + // Update connection lines ... + this._updateConnectionLines(); + + // Check object state. + this.invariant(); + }, + + getOutgoingConnectedTopic : function() { + var result = null; + var line = this.getOutgoingLine(); + if ($defined(line)) { + result = line.getTargetTopic(); + } + return result; + }, + + _setTopicVisibility : function(value) { + this.parent(value); + + var textShape = this.getTextShape(); + textShape.setVisibility(value); + + }, + + setOpacity : function(opacity) { + this.parent(); + + var textShape = this.getTextShape(); + textShape.setOpacity(opacity); + }, + + _updatePositionOnChangeSize : function(oldSize, newSize) { + $assert(false, "this method must be overwrited."); + }, + + createDragNode : function(layoutManager) { + var result = this.parent(layoutManager); + + // Is the node already connected ? + var targetTopic = this.getOutgoingConnectedTopic(); + if ($defined(targetTopic)) { + result.connectTo(targetTopic); + result.setVisibility(false); + } + + // If a drag node is create for it, let's hide the editor. + this._textEditor.close(); + + return result; + }, + + _adjustShapes : function() { + if (this._isInWorkspace) { + var textShape = this.getTextShape(); + var textWidth = textShape.getWidth(); + + var textHeight = textShape.getHeight(); + textHeight = textHeight != 0 ? textHeight : 20; + + var topicPadding = this._getInnerPadding(); + + // Adjust the icon size to the size of the text ... + var iconGroup = this.getOrBuildIconGroup(); + var fontHeight = this.getTextShape().getFontHeight(); + iconGroup.setPosition(topicPadding, topicPadding); + iconGroup.seIconSize(fontHeight, fontHeight); + + // Add a extra padding between the text and the icons + var iconsWidth = iconGroup.getSize().width; + if (iconsWidth != 0) { + + iconsWidth = iconsWidth + (textHeight / 4); + } + + var height = textHeight + (topicPadding * 2); + var width = textWidth + iconsWidth + (topicPadding * 2); + + this.setSize({width:width,height:height}); + + // Position node ... + textShape.setPosition(topicPadding + iconsWidth, topicPadding); + } + } + +}); + +mindplot.TextTopic.INNER_RECT_ATTRIBUTES = {stroke:'2 solid'}; + + + diff --git a/mindplot/src/main/javascript/collaboration/framework/brix/BrixCollaborativeModelFactory.js b/mindplot/src/main/javascript/collaboration/framework/collab/BrixCollaborativeModelFactory.js similarity index 100% rename from mindplot/src/main/javascript/collaboration/framework/brix/BrixCollaborativeModelFactory.js rename to mindplot/src/main/javascript/collaboration/framework/collab/BrixCollaborativeModelFactory.js diff --git a/mindplot/src/main/javascript/collaboration/framework/brix/BrixFramework.js b/mindplot/src/main/javascript/collaboration/framework/collab/BrixFramework.js similarity index 100% rename from mindplot/src/main/javascript/collaboration/framework/brix/BrixFramework.js rename to mindplot/src/main/javascript/collaboration/framework/collab/BrixFramework.js diff --git a/mindplot/src/main/javascript/collaboration/framework/brix/model/Mindmap.js b/mindplot/src/main/javascript/collaboration/framework/collab/model/Mindmap.js similarity index 100% rename from mindplot/src/main/javascript/collaboration/framework/brix/model/Mindmap.js rename to mindplot/src/main/javascript/collaboration/framework/collab/model/Mindmap.js diff --git a/mindplot/src/main/javascript/collaboration/framework/brix/model/NodeModel.js b/mindplot/src/main/javascript/collaboration/framework/collab/model/NodeModel.js similarity index 100% rename from mindplot/src/main/javascript/collaboration/framework/brix/model/NodeModel.js rename to mindplot/src/main/javascript/collaboration/framework/collab/model/NodeModel.js diff --git a/mindplot/src/main/javascript/header.js b/mindplot/src/main/javascript/header.js index 3c5c2f6b..e3018861 100644 --- a/mindplot/src/main/javascript/header.js +++ b/mindplot/src/main/javascript/header.js @@ -26,7 +26,6 @@ mindplot.widget = {}; mindplot.model = {}; mindplot.collaboration = {}; mindplot.collaboration.framework = {}; -mindplot.collaboration.framework.brix = {}; -mindplot.collaboration.framework.brix.model = {}; +mindplot.persistence = {}; mindplot.layout = {}; diff --git a/mindplot/src/main/javascript/model/INodeModel.js b/mindplot/src/main/javascript/model/INodeModel.js index d7bd055d..604d9f18 100644 --- a/mindplot/src/main/javascript/model/INodeModel.js +++ b/mindplot/src/main/javascript/model/INodeModel.js @@ -82,6 +82,15 @@ mindplot.model.INodeModel = new Class({ return result; }, + setImageUrl:function(url) { + this.putProperty('imageUrl', url); + + }, + + getImageUrl:function() { + return this.getProperty('imageUrl'); + }, + getMindmap : function() { return this._mindmap; }, diff --git a/mindplot/src/main/javascript/model/Mindmap.js b/mindplot/src/main/javascript/model/Mindmap.js index 02c6ca86..7767a62a 100644 --- a/mindplot/src/main/javascript/model/Mindmap.js +++ b/mindplot/src/main/javascript/model/Mindmap.js @@ -22,7 +22,7 @@ mindplot.model.Mindmap = new Class({ this._branches = []; this._description = null; this._relationships = []; - this._version = $defined(version) ? version : mindplot.ModelCodeName.TANGO; + this._version = $defined(version) ? version : mindplot.persistence.ModelCodeName.TANGO; this._id = id; }, diff --git a/mindplot/src/main/javascript/Beta2PelaMigrator.js b/mindplot/src/main/javascript/persistence/Beta2PelaMigrator.js similarity index 85% rename from mindplot/src/main/javascript/Beta2PelaMigrator.js rename to mindplot/src/main/javascript/persistence/Beta2PelaMigrator.js index b4e6abcf..5f30e6b8 100644 --- a/mindplot/src/main/javascript/Beta2PelaMigrator.js +++ b/mindplot/src/main/javascript/persistence/Beta2PelaMigrator.js @@ -15,10 +15,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -mindplot.Beta2PelaMigrator = new Class({ +mindplot.persistence.Beta2PelaMigrator = new Class({ initialize : function(betaSerializer) { this._betaSerializer = betaSerializer; - this._pelaSerializer = new mindplot.XMLMindmapSerializer_Pela(); + this._pelaSerializer = new mindplot.persistence.XMLSerializer_Pela(); }, toXML : function(mindmap) { @@ -28,7 +28,7 @@ mindplot.Beta2PelaMigrator = new Class({ loadFromDom : function(dom, mapId) { $assert($defined(mapId), "mapId can not be null"); var mindmap = this._betaSerializer.loadFromDom(dom, mapId); - mindmap.setVersion(mindplot.ModelCodeName.PELA); + mindmap.setVersion(mindplot.persistence.ModelCodeName.PELA); return mindmap; } }); diff --git a/mindplot/src/main/javascript/ModelCodeName.js b/mindplot/src/main/javascript/persistence/ModelCodeName.js similarity index 95% rename from mindplot/src/main/javascript/ModelCodeName.js rename to mindplot/src/main/javascript/persistence/ModelCodeName.js index 4b201a75..28028a32 100644 --- a/mindplot/src/main/javascript/ModelCodeName.js +++ b/mindplot/src/main/javascript/persistence/ModelCodeName.js @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -mindplot.ModelCodeName = { +mindplot.persistence.ModelCodeName = { BETA : "beta", PELA : "pela", TANGO : "tango" diff --git a/mindplot/src/main/javascript/Pela2TangoMigrator.js b/mindplot/src/main/javascript/persistence/Pela2TangoMigrator.js similarity index 91% rename from mindplot/src/main/javascript/Pela2TangoMigrator.js rename to mindplot/src/main/javascript/persistence/Pela2TangoMigrator.js index f97f9c66..3de67874 100644 --- a/mindplot/src/main/javascript/Pela2TangoMigrator.js +++ b/mindplot/src/main/javascript/persistence/Pela2TangoMigrator.js @@ -15,10 +15,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -mindplot.Pela2TangoMigrator = new Class({ +mindplot.persistence.Pela2TangoMigrator = new Class({ initialize : function(pelaSerializer) { this._pelaSerializer = pelaSerializer; - this._tangoSerializer = new mindplot.XMLMindmapSerializer_Tango(); + this._tangoSerializer = new mindplot.persistence.XMLSerializer_Tango(); }, toXML : function(mindmap) { @@ -28,7 +28,7 @@ mindplot.Pela2TangoMigrator = new Class({ loadFromDom : function(dom, mapId) { $assert($defined(mapId), "mapId can not be null"); var mindmap = this._pelaSerializer.loadFromDom(dom, mapId); - mindmap.setVersion(mindplot.ModelCodeName.TANGO); + mindmap.setVersion(mindplot.persistence.ModelCodeName.TANGO); this._fixOrder(mindmap); return mindmap; }, diff --git a/mindplot/src/main/javascript/XMLMindmapSerializerFactory.js b/mindplot/src/main/javascript/persistence/XMLSerializerFactory.js similarity index 53% rename from mindplot/src/main/javascript/XMLMindmapSerializerFactory.js rename to mindplot/src/main/javascript/persistence/XMLSerializerFactory.js index 7fa666f5..dba43285 100644 --- a/mindplot/src/main/javascript/XMLMindmapSerializerFactory.js +++ b/mindplot/src/main/javascript/persistence/XMLSerializerFactory.js @@ -15,23 +15,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -mindplot.XMLMindmapSerializerFactory = {}; +mindplot.persistence.XMLSerializerFactory = {}; -mindplot.XMLMindmapSerializerFactory.getSerializerFromMindmap = function(mindmap) { - return mindplot.XMLMindmapSerializerFactory.getSerializer(mindmap.getVersion()); +mindplot.persistence.XMLSerializerFactory.getSerializerFromMindmap = function(mindmap) { + return mindplot.persistence.XMLSerializerFactory.getSerializer(mindmap.getVersion()); }; -mindplot.XMLMindmapSerializerFactory.getSerializerFromDocument = function(domDocument) { +mindplot.persistence.XMLSerializerFactory.getSerializerFromDocument = function(domDocument) { var rootElem = domDocument.documentElement; - return mindplot.XMLMindmapSerializerFactory.getSerializer(rootElem.getAttribute("version")) + return mindplot.persistence.XMLSerializerFactory.getSerializer(rootElem.getAttribute("version")) }; -mindplot.XMLMindmapSerializerFactory.getSerializer = function(version) { +mindplot.persistence.XMLSerializerFactory.getSerializer = function(version) { if (!$defined(version)) { - version = mindplot.ModelCodeName.BETA; + version = mindplot.persistence.ModelCodeName.BETA; } - var codeNames = mindplot.XMLMindmapSerializerFactory._codeNames; + var codeNames = mindplot.persistence.XMLSerializerFactory._codeNames; var found = false; var serializer = null; for (var i = 0; i < codeNames.length; i++) { @@ -48,22 +48,22 @@ mindplot.XMLMindmapSerializerFactory.getSerializer = function(version) { return serializer; }; -mindplot.XMLMindmapSerializerFactory._codeNames = +mindplot.persistence.XMLSerializerFactory._codeNames = [ { - codeName:mindplot.ModelCodeName.BETA, - serializer: mindplot.XMLMindmapSerializer_Beta, + codeName:mindplot.persistence.ModelCodeName.BETA, + serializer: mindplot.persistence.XMLSerializer_Beta, migrator:function() { } }, { - codeName:mindplot.ModelCodeName.PELA, - serializer:mindplot.XMLMindmapSerializer_Pela, - migrator:mindplot.Beta2PelaMigrator + codeName:mindplot.persistence.ModelCodeName.PELA, + serializer:mindplot.persistence.XMLSerializer_Pela, + migrator:mindplot.persistence.Beta2PelaMigrator }, { - codeName:mindplot.ModelCodeName.TANGO, - serializer:mindplot.XMLMindmapSerializer_Tango, - migrator:mindplot.Pela2TangoMigrator + codeName:mindplot.persistence.ModelCodeName.TANGO, + serializer:mindplot.persistence.XMLSerializer_Tango, + migrator:mindplot.persistence.Pela2TangoMigrator } ]; \ No newline at end of file diff --git a/mindplot/src/main/javascript/XMLMindmapSerializer_Beta.js b/mindplot/src/main/javascript/persistence/XMLSerializer_Beta.js similarity index 96% rename from mindplot/src/main/javascript/XMLMindmapSerializer_Beta.js rename to mindplot/src/main/javascript/persistence/XMLSerializer_Beta.js index c0e27aca..bf680c63 100644 --- a/mindplot/src/main/javascript/XMLMindmapSerializer_Beta.js +++ b/mindplot/src/main/javascript/persistence/XMLSerializer_Beta.js @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -mindplot.XMLMindmapSerializer_Beta = new Class({ +mindplot.persistence.XMLSerializer_Beta = new Class({ toXML : function(mindmap) { $assert(mindmap, "Can not save a null mindmap"); @@ -164,11 +164,11 @@ mindplot.XMLMindmapSerializer_Beta = new Class({ var rootElem = dom.documentElement; // Is a wisemap?. - $assert(rootElem.tagName == mindplot.XMLMindmapSerializer_Beta.MAP_ROOT_NODE, "This seem not to be a map document."); + $assert(rootElem.tagName == mindplot.persistence.XMLSerializer_Beta.MAP_ROOT_NODE, "This seem not to be a map document."); // Start the loading process ... var version = rootElem.getAttribute("version"); - version = !$defined(version) ? mindplot.ModelCodeName.BETA : version; + version = !$defined(version) ? mindplot.persistence.ModelCodeName.BETA : version; var mindmap = new mindplot.model.Mindmap(mapId, version); var children = rootElem.childNodes; @@ -288,4 +288,4 @@ mindplot.XMLMindmapSerializer_Beta = new Class({ return topic.createNote(domElem.getAttribute("text")); }}); -mindplot.XMLMindmapSerializer_Beta.MAP_ROOT_NODE = 'map'; \ No newline at end of file +mindplot.persistence.XMLSerializer_Beta.MAP_ROOT_NODE = 'map'; \ No newline at end of file diff --git a/mindplot/src/main/javascript/XMLMindmapSerializer_Pela.js b/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js similarity index 95% rename from mindplot/src/main/javascript/XMLMindmapSerializer_Pela.js rename to mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js index b4a4508a..4bf42f23 100644 --- a/mindplot/src/main/javascript/XMLMindmapSerializer_Pela.js +++ b/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js @@ -16,7 +16,7 @@ * limitations under the License. */ -mindplot.XMLMindmapSerializer_Pela = new Class({ +mindplot.persistence.XMLSerializer_Pela = new Class({ toXML : function(mindmap) { $assert(mindmap, "Can not save a null mindmap"); @@ -217,7 +217,7 @@ mindplot.XMLMindmapSerializer_Pela = new Class({ var rootElem = dom.documentElement; // Is a wisemap?. - $assert(rootElem.tagName == mindplot.XMLMindmapSerializer_Pela.MAP_ROOT_NODE, "This seem not to be a map document."); + $assert(rootElem.tagName == mindplot.persistence.XMLSerializer_Pela.MAP_ROOT_NODE, "This seem not to be a map document."); this._idsMap = new Hash(); // Start the loading process ... @@ -262,27 +262,15 @@ mindplot.XMLMindmapSerializer_Pela = new Class({ } var topic = mindmap.createNode(type, id); - var text = domElem.getAttribute('text'); if ($defined(text)) { topic.setText(text); } - - var order = domElem.getAttribute('order'); - if ($defined(order)) { - topic.setOrder(parseInt(order)); - } - var shape = domElem.getAttribute('shape'); if ($defined(shape)) { topic.setShapeType(shape); } - var isShrink = domElem.getAttribute('shrink'); - if ($defined(isShrink)) { - topic.setChildrenShrunken(isShrink); - } - var fontStyle = domElem.getAttribute('fontStyle'); if ($defined(fontStyle)) { var font = fontStyle.split(';'); @@ -317,6 +305,27 @@ mindplot.XMLMindmapSerializer_Pela = new Class({ if ($defined(borderColor)) { topic.setBorderColor(borderColor); } +// +// } else { +// var sizeStr = domElem.getAttribute('size'); +// $assert(sizeStr, "size can not be null"); +// var size = sizeStr.split(','); +// topic.setSize(size[0], size[1]); +// +// var url = domElem.getAttribute('image'); +// $assert(url, "url can not be null"); +// topic.setImageUrl(url); +// } + + var order = domElem.getAttribute('order'); + if ($defined(order)) { + topic.setOrder(parseInt(order)); + } + + var isShrink = domElem.getAttribute('shrink'); + if ($defined(isShrink)) { + topic.setChildrenShrunken(isShrink); + } var position = domElem.getAttribute('position'); if ($defined(position)) { @@ -415,4 +424,4 @@ mindplot.XMLMindmapSerializer_Pela = new Class({ } }); -mindplot.XMLMindmapSerializer_Pela.MAP_ROOT_NODE = 'map'; \ No newline at end of file +mindplot.persistence.XMLSerializer_Pela.MAP_ROOT_NODE = 'map'; \ No newline at end of file diff --git a/mindplot/src/main/javascript/XMLMindmapSerializer_Tango.js b/mindplot/src/main/javascript/persistence/XMLSerializer_Tango.js similarity index 87% rename from mindplot/src/main/javascript/XMLMindmapSerializer_Tango.js rename to mindplot/src/main/javascript/persistence/XMLSerializer_Tango.js index a3f4a959..8db3adff 100644 --- a/mindplot/src/main/javascript/XMLMindmapSerializer_Tango.js +++ b/mindplot/src/main/javascript/persistence/XMLSerializer_Tango.js @@ -16,6 +16,6 @@ * limitations under the License. */ -mindplot.XMLMindmapSerializer_Tango = new Class({ - Extends: mindplot.XMLMindmapSerializer_Pela +mindplot.persistence.XMLSerializer_Tango = new Class({ + Extends: mindplot.persistence.XMLSerializer_Pela }); \ No newline at end of file diff --git a/mindplot/src/test/javascript/ModelMigrationTest.js b/mindplot/src/test/javascript/ModelMigrationTest.js index cbb58402..bb17a6d0 100644 --- a/mindplot/src/test/javascript/ModelMigrationTest.js +++ b/mindplot/src/test/javascript/ModelMigrationTest.js @@ -6,14 +6,14 @@ TestCase("Model Migration Tests",{ ids=[]; var domDocument = core.Utils.createDocumentFromText(mapXml); - var betaSerializer = new mindplot.XMLMindmapSerializer_Beta(); + var betaSerializer = new mindplot.persistence.XMLSerializer_Beta(); var betaMap = betaSerializer.loadFromDom(domDocument); - var serializer = mindplot.XMLMindmapSerializerFactory.getSerializerFromDocument(domDocument); + var serializer = mindplot.persistence.XMLSerializerFactory.getSerializerFromDocument(domDocument); var mindmap = serializer.loadFromDom(domDocument); //Assert that the new model is Pela - assertEquals(mindplot.ModelCodeName.PELA, mindmap.getVersion()); + assertEquals(mindplot.persistence.ModelCodeName.PELA, mindmap.getVersion()); //Assert same number of branches var betaBranches = betaMap.getBranches(); diff --git a/wise-editor/src/main/webapp/c/export.htm b/wise-editor/src/main/webapp/c/export.htm index c1f5f070..c0017ee0 100644 --- a/wise-editor/src/main/webapp/c/export.htm +++ b/wise-editor/src/main/webapp/c/export.htm @@ -100,7 +100,7 @@ // Store SVG o native map... if (suffix == "freemind") { var mindmap = designer.getMindmap(); - var serializer = mindplot.XMLMindmapSerializerFactory.getSerializerFromMindmap(mindmap); + var serializer = mindplot.persistence.XMLSerializerFactory.getSerializerFromMindmap(mindmap); var domMap = serializer.toXML(mindmap); form.mapXml.value = core.Utils.innerXML(domMap); } else { diff --git a/wise-editor/src/main/webapp/html/editor.html b/wise-editor/src/main/webapp/html/editor.html index 8982283a..f3361e8d 100644 --- a/wise-editor/src/main/webapp/html/editor.html +++ b/wise-editor/src/main/webapp/html/editor.html @@ -29,12 +29,12 @@ // Load map from XML file persisted on disk... var persistence = mindplot.PersistenceManager.getInstance(); var mindmap; - try { +// try { mindmap = persistence.load(mapId); - } catch(e) { +// } catch(e) { // If the map could not be loaded, create a new empty map... - mindmap = mindplot.model.Mindmap.buildEmpty(mapId); - } +// mindmap = mindplot.model.Mindmap.buildEmpty(mapId); +// } designer.loadMap(mindmap); }); diff --git a/wise-editor/src/main/webapp/samples/welcome.xml b/wise-editor/src/main/webapp/samples/welcome.xml index c26ee3fb..2a762e44 100644 --- a/wise-editor/src/main/webapp/samples/welcome.xml +++ b/wise-editor/src/main/webapp/samples/welcome.xml @@ -42,5 +42,6 @@ + \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/jsp/embeddedView.jsp b/wise-webapp/src/main/webapp/jsp/embeddedView.jsp index 741da0df..1ca9f426 100644 --- a/wise-webapp/src/main/webapp/jsp/embeddedView.jsp +++ b/wise-webapp/src/main/webapp/jsp/embeddedView.jsp @@ -29,7 +29,7 @@ designer = buildDesigner(editorProperties); var domDocument = core.Utils.createDocumentFromText(mapXml); - var serializer = mindplot.XMLMindmapSerializerFactory.getSerializerFromDocument(domDocument); + var serializer = mindplot.persistence.XMLSerializerFactory.getSerializerFromDocument(domDocument); var mindmap = serializer.loadFromDom(domDocument, mapId); // Now, load the map ... diff --git a/wise-webapp/src/main/webapp/jsp/mindmapExport.jsp b/wise-webapp/src/main/webapp/jsp/mindmapExport.jsp index c580e92d..77d71cba 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapExport.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapExport.jsp @@ -103,7 +103,7 @@ // Store SVG o native map... if (suffix == "freemind") { var mindmap = designer.getMindmap(); - var serializer = mindplot.XMLMindmapSerializerFactory.getSerializerFromMindmap(mindmap); + var serializer = mindplot.persistence.XMLSerializerFactory.getSerializerFromMindmap(mindmap); var domMap = serializer.toXML(mindmap); form.mapXml.value = core.Utils.innerXML(domMap); } else { diff --git a/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp b/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp index 7bdf5e20..c6800919 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp @@ -42,7 +42,7 @@ designer = buildDesigner(editorProperties); var domDocument = core.Utils.createDocumentFromText(mapXml); - var serializer = mindplot.XMLMindmapSerializerFactory.getSerializerFromDocument(domDocument); + var serializer = mindplot.persistence.MLSerializerFactory.getSerializerFromDocument(domDocument); var mindmap = serializer.loadFromDom(domDocument, mapId); // Now, load the map ... From 7ba0e36cb9901548c0244a35fb0c7787adbb8760 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 27 Feb 2012 18:17:15 -0300 Subject: [PATCH 19/45] Introduce the convept of Feature to a topic. --- mindplot/pom.xml | 23 +- .../src/main/javascript/ActionDispatcher.js | 38 +- mindplot/src/main/javascript/Command.js | 3 + mindplot/src/main/javascript/Designer.js | 11 +- mindplot/src/main/javascript/IconGroup.js | 15 +- mindplot/src/main/javascript/ImageIcon.js | 42 +- .../src/main/javascript/ShrinkConnector.js | 2 +- .../javascript/StandaloneActionDispatcher.js | 43 +- mindplot/src/main/javascript/TextTopic.js | 590 ------------------ mindplot/src/main/javascript/Topic.js | 147 ++--- mindplot/src/main/javascript/TopicFeature.js | 68 ++ ...Command.js => AddFeatureToTopicCommand.js} | 24 +- ...mand.js => ChangeFeatureToTopicCommand.js} | 25 +- .../commands/ChangeLinkToTopicCommand.js | 48 -- .../commands/ChangeNoteToTopicCommand.js | 49 -- ...nd.js => RemoveFeatureFromTopicCommand.js} | 29 +- .../commands/RemoveIconFromTopicCommand.js | 39 -- .../src/main/javascript/model/FeatureModel.js | 76 +++ .../src/main/javascript/model/INodeModel.js | 48 -- .../src/main/javascript/model/IconModel.js | 45 +- .../src/main/javascript/model/LinkModel.js | 32 +- .../src/main/javascript/model/NodeModel.js | 107 +--- .../src/main/javascript/model/NoteModel.js | 26 +- .../persistence/XMLSerializer_Beta.js | 12 +- .../persistence/XMLSerializer_Pela.js | 120 ++-- .../com/wisemapping/test/freemind/pepe.xml | 61 +- 26 files changed, 483 insertions(+), 1240 deletions(-) delete mode 100644 mindplot/src/main/javascript/TextTopic.js create mode 100644 mindplot/src/main/javascript/TopicFeature.js rename mindplot/src/main/javascript/commands/{AddIconToTopicCommand.js => AddFeatureToTopicCommand.js} (59%) rename mindplot/src/main/javascript/commands/{RemoveLinkFromTopicCommand.js => ChangeFeatureToTopicCommand.js} (58%) delete mode 100644 mindplot/src/main/javascript/commands/ChangeLinkToTopicCommand.js delete mode 100644 mindplot/src/main/javascript/commands/ChangeNoteToTopicCommand.js rename mindplot/src/main/javascript/commands/{RemoveNoteFromTopicCommand.js => RemoveFeatureFromTopicCommand.js} (58%) delete mode 100644 mindplot/src/main/javascript/commands/RemoveIconFromTopicCommand.js create mode 100644 mindplot/src/main/javascript/model/FeatureModel.js diff --git a/mindplot/pom.xml b/mindplot/pom.xml index 1098a977..2c29a931 100644 --- a/mindplot/pom.xml +++ b/mindplot/pom.xml @@ -68,7 +68,6 @@ - @@ -82,7 +81,8 @@ - + - + @@ -105,6 +106,7 @@ + @@ -114,7 +116,7 @@ - + @@ -123,17 +125,11 @@ + files="commands/ChangeFeatureToTopicCommand.js"/> + files="commands/RemoveFeatureFromTopicCommand.js"/> - - - + files="commands/AddFeatureToTopicCommand.js"/> + diff --git a/mindplot/src/main/javascript/ActionDispatcher.js b/mindplot/src/main/javascript/ActionDispatcher.js index fd23aa00..6d8dfb36 100644 --- a/mindplot/src/main/javascript/ActionDispatcher.js +++ b/mindplot/src/main/javascript/ActionDispatcher.js @@ -23,18 +23,6 @@ mindplot.ActionDispatcher = new Class({ $assert(commandContext, "commandContext can not be null"); }, - addIconToTopic: function(topicId, iconType) { - throw "method must be implemented."; - }, - - changeLinkToTopic: function(topicId, url) { - throw "method must be implemented."; - }, - - changeNoteToTopic: function(topicId, text) { - throw "method must be implemented."; - }, - connectByRelation: function(model, mindmap) { throw "method must be implemented."; }, @@ -59,18 +47,6 @@ mindplot.ActionDispatcher = new Class({ throw "method must be implemented."; }, - removeIconFromTopic: function(topicId, iconModel) { - throw "method must be implemented."; - }, - - removeLinkFromTopic: function(topicId) { - throw "method must be implemented."; - }, - - removeNoteFromTopic: function(topicId) { - throw "method must be implemented."; - }, - changeFontFamilyToTopic: function(topicIds, fontFamily) { throw "method must be implemented."; }, @@ -109,9 +85,19 @@ mindplot.ActionDispatcher = new Class({ shrinkBranch : function(topicsIds, collapse) { throw "method must be implemented."; + }, + + addFeatureToTopic : function(topicId, type, attributes) { + throw "method must be implemented."; + }, + + changeFeatureToTopic : function(topicId, featureId, attributes) { + throw "method must be implemented."; + }, + + removeFeatureFromTopic : function(topicId, featureId) { + throw "method must be implemented."; } - - }); mindplot.ActionDispatcher.setInstance = function(dispatcher) { diff --git a/mindplot/src/main/javascript/Command.js b/mindplot/src/main/javascript/Command.js index 5235deb7..21bcc4ae 100644 --- a/mindplot/src/main/javascript/Command.js +++ b/mindplot/src/main/javascript/Command.js @@ -22,14 +22,17 @@ mindplot.Command = new Class( { this._id = mindplot.Command._nextUUID(); }, + execute: function(commandContext) { throw "execute must be implemented."; }, + undoExecute: function(commandContext) { throw "undo must be implemented."; }, + getId:function() { return this._id; diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index 5215018a..84b3ed40 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -422,7 +422,7 @@ mindplot.Designer = new Class({ $assert(mindmapModel, "mindmapModel can not be null"); this._mindmap = mindmapModel; -// try { + try { // Init layout manager ... var size = {width:25,height:25}; var layoutManager = new mindplot.layout.LayoutManager(mindmapModel.getCentralTopic().getId(), size); @@ -446,7 +446,6 @@ mindplot.Designer = new Class({ nodeGraph.setBranchVisibility(true); } - var relationships = mindmapModel.getRelationships(); for (var j = 0; j < relationships.length; j++) { this._relationshipModelToRelationship(relationships[j]); @@ -460,9 +459,9 @@ mindplot.Designer = new Class({ mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout); this.fireEvent('loadSuccess'); -// } catch(e) { -// this.fireEvent('loadError',e); -// } + } catch(e) { + this.fireEvent('loadError', e); + } }, getMindmap : function() { @@ -707,7 +706,7 @@ mindplot.Designer = new Class({ addIconType : function(iconType) { var topicsIds = this.getModel().filterTopicsIds(); if (topicsIds.length > 0) { - this._actionDispatcher.addIconToTopic(topicsIds[0], iconType); + this._actionDispatcher.addFeatureToTopic(topicsIds[0], mindplot.TopicFeature.Icon.id, {id:iconType}); } }, diff --git a/mindplot/src/main/javascript/IconGroup.js b/mindplot/src/main/javascript/IconGroup.js index ce2faf29..82879c22 100644 --- a/mindplot/src/main/javascript/IconGroup.js +++ b/mindplot/src/main/javascript/IconGroup.js @@ -83,10 +83,10 @@ mindplot.IconGroup = new Class({ _findIconFromModel : function(iconModel) { var result = null; - this._icons.each(function(el) { - var elModel = el.getModel(); - if (result == null && $defined(elModel.isIconModel) && elModel.getId() == iconModel.getId()) { - result = el; + this._icons.each(function(icon) { + var elModel = icon.getModel(); + if (elModel.getId() == iconModel.getId()) { + result = icon; } }, this); @@ -110,6 +110,13 @@ mindplot.IconGroup = new Class({ this._removeIcon(icon); }, + removeIconByModel : function(featureModel) { + $assert(featureModel, "featureModel can not be null"); + + var icon = this._findIconFromModel(featureModel); + this._removeIcon(icon); + }, + _removeIcon : function(icon) { $assert(icon, "icon can not be null"); diff --git a/mindplot/src/main/javascript/ImageIcon.js b/mindplot/src/main/javascript/ImageIcon.js index 6f44ed4b..0f21d438 100644 --- a/mindplot/src/main/javascript/ImageIcon.js +++ b/mindplot/src/main/javascript/ImageIcon.js @@ -23,7 +23,7 @@ mindplot.ImageIcon = new Class({ $assert(topic, 'topic can not be null'); this._topicId = topic.getId(); - this._iconModel = iconModel; + this._featureModel = iconModel; // @Todo: Read only must be a property ... this._readOnly = designer._readOnly; @@ -57,7 +57,7 @@ mindplot.ImageIcon = new Class({ }, getModel : function() { - return this._iconModel; + return this._featureModel; }, _getNextFamilyIconId : function(iconId) { @@ -98,21 +98,39 @@ mindplot.ImageIcon = new Class({ return result; }, - getId : function() { - return this._iconType; - }, - - getUiId : function() { - return this._uiId; - }, - remove : function() { var actionDispatcher = mindplot.ActionDispatcher.getInstance(); - actionDispatcher.removeIconFromTopic(this._topicId, this._iconModel); + var featureId = this._featureModel.getId(); + var topicId = this._topicId; + actionDispatcher.removeFeatureFromTopic(topicId, featureId); } }); -mindplot.ImageIcon.prototype.ICON_FAMILIES = [{"id": "face", "icons" : ["face_plain","face_sad","face_crying","face_smile","face_surprise","face_wink"]},{"id": "funy", "icons" : ["funy_angel","funy_devilish","funy_glasses","funy_grin","funy_kiss","funy_monkey"]},{"id": "conn", "icons" : ["conn_connect","conn_disconnect"]},{"id": "sport", "icons" : ["sport_basketball","sport_football","sport_golf","sport_raquet","sport_shuttlecock","sport_soccer","sport_tennis"]},{"id": "bulb", "icons" : ["bulb_light_on","bulb_light_off"]},{"id": "thumb", "icons" : ["thumb_thumb_up","thumb_thumb_down"]},{"id": "tick", "icons" : ["tick_tick","tick_cross"]},{"id": "onoff", "icons" : ["onoff_clock","onoff_clock_red","onoff_add","onoff_delete","onoff_status_offline","onoff_status_online"]},{"id": "money", "icons" : ["money_money","money_dollar","money_euro","money_pound","money_yen","money_coins","money_ruby"]},{"id": "time", "icons" : ["time_calendar","time_clock","time_hourglass"]},{"id": "chart", "icons" : ["chart_bar","chart_line","chart_curve","chart_pie","chart_organisation"]},{"id": "sign", "icons" : ["sign_warning","sign_info","sign_stop","sign_help","sign_cancel"]},{"id": "hard", "icons" : ["hard_cd","hard_computer","hard_controller","hard_driver_disk","hard_ipod","hard_keyboard","hard_mouse","hard_printer"]},{"id": "soft", "icons" : ["soft_bug","soft_cursor","soft_database_table","soft_database","soft_feed","soft_folder_explore","soft_rss","soft_penguin"]},{"id": "arrow", "icons" : ["arrow_up","arrow_down","arrow_left","arrow_right"]},{"id": "arrowc", "icons" : ["arrowc_rotate_anticlockwise","arrowc_rotate_clockwise","arrowc_turn_left","arrowc_turn_right"]},{"id": "people", "icons" : ["people_group","people_male1","people_male2","people_female1","people_female2"]},{"id": "mail", "icons" : ["mail_envelop","mail_mailbox","mail_edit","mail_list"]},{"id": "flag", "icons" : ["flag_blue","flag_green","flag_orange","flag_pink","flag_purple","flag_yellow"]},{"id": "bullet", "icons" : ["bullet_black","bullet_blue","bullet_green","bullet_orange","bullet_red","bullet_pink","bullet_purple"]},{"id": "tag", "icons" : ["tag_blue","tag_green","tag_orange","tag_red","tag_pink","tag_yellow"]},{"id": "object", "icons" : ["object_bell","object_clanbomber","object_key","object_pencil","object_phone","object_magnifier","object_clip","object_music","object_star","object_wizard","object_house","object_cake","object_camera","object_palette","object_rainbow"]},{"id": "weather", "icons" : ["weather_clear-night","weather_clear","weather_few-clouds-night","weather_few-clouds","weather_overcast","weather_severe-alert","weather_showers-scattered","weather_showers","weather_snow","weather_storm"]}]; +mindplot.ImageIcon.prototype.ICON_FAMILIES = [ + {"id": "face", "icons" : ["face_plain","face_sad","face_crying","face_smile","face_surprise","face_wink"]}, + {"id": "funy", "icons" : ["funy_angel","funy_devilish","funy_glasses","funy_grin","funy_kiss","funy_monkey"]}, + {"id": "conn", "icons" : ["conn_connect","conn_disconnect"]}, + {"id": "sport", "icons" : ["sport_basketball","sport_football","sport_golf","sport_raquet","sport_shuttlecock","sport_soccer","sport_tennis"]}, + {"id": "bulb", "icons" : ["bulb_light_on","bulb_light_off"]}, + {"id": "thumb", "icons" : ["thumb_thumb_up","thumb_thumb_down"]}, + {"id": "tick", "icons" : ["tick_tick","tick_cross"]}, + {"id": "onoff", "icons" : ["onoff_clock","onoff_clock_red","onoff_add","onoff_delete","onoff_status_offline","onoff_status_online"]}, + {"id": "money", "icons" : ["money_money","money_dollar","money_euro","money_pound","money_yen","money_coins","money_ruby"]}, + {"id": "time", "icons" : ["time_calendar","time_clock","time_hourglass"]}, + {"id": "chart", "icons" : ["chart_bar","chart_line","chart_curve","chart_pie","chart_organisation"]}, + {"id": "sign", "icons" : ["sign_warning","sign_info","sign_stop","sign_help","sign_cancel"]}, + {"id": "hard", "icons" : ["hard_cd","hard_computer","hard_controller","hard_driver_disk","hard_ipod","hard_keyboard","hard_mouse","hard_printer"]}, + {"id": "soft", "icons" : ["soft_bug","soft_cursor","soft_database_table","soft_database","soft_feed","soft_folder_explore","soft_rss","soft_penguin"]}, + {"id": "arrow", "icons" : ["arrow_up","arrow_down","arrow_left","arrow_right"]}, + {"id": "arrowc", "icons" : ["arrowc_rotate_anticlockwise","arrowc_rotate_clockwise","arrowc_turn_left","arrowc_turn_right"]}, + {"id": "people", "icons" : ["people_group","people_male1","people_male2","people_female1","people_female2"]}, + {"id": "mail", "icons" : ["mail_envelop","mail_mailbox","mail_edit","mail_list"]}, + {"id": "flag", "icons" : ["flag_blue","flag_green","flag_orange","flag_pink","flag_purple","flag_yellow"]}, + {"id": "bullet", "icons" : ["bullet_black","bullet_blue","bullet_green","bullet_orange","bullet_red","bullet_pink","bullet_purple"]}, + {"id": "tag", "icons" : ["tag_blue","tag_green","tag_orange","tag_red","tag_pink","tag_yellow"]}, + {"id": "object", "icons" : ["object_bell","object_clanbomber","object_key","object_pencil","object_phone","object_magnifier","object_clip","object_music","object_star","object_wizard","object_house","object_cake","object_camera","object_palette","object_rainbow"]}, + {"id": "weather", "icons" : ["weather_clear-night","weather_clear","weather_few-clouds-night","weather_few-clouds","weather_overcast","weather_severe-alert","weather_showers-scattered","weather_showers","weather_snow","weather_storm"]} +]; diff --git a/mindplot/src/main/javascript/ShrinkConnector.js b/mindplot/src/main/javascript/ShrinkConnector.js index d6f200fb..1f177314 100644 --- a/mindplot/src/main/javascript/ShrinkConnector.js +++ b/mindplot/src/main/javascript/ShrinkConnector.js @@ -19,7 +19,7 @@ mindplot.ShirinkConnector = new Class({ initialize: function(topic) { - var ellipse = new web2d.Elipse(mindplot.TextTopic.prototype.INNER_RECT_ATTRIBUTES); + var ellipse = new web2d.Elipse(mindplot.Topic.prototype.INNER_RECT_ATTRIBUTES); this._ellipse = ellipse; ellipse.setFill('rgb(62,118,179)'); diff --git a/mindplot/src/main/javascript/StandaloneActionDispatcher.js b/mindplot/src/main/javascript/StandaloneActionDispatcher.js index f2520a2e..0c6aea88 100644 --- a/mindplot/src/main/javascript/StandaloneActionDispatcher.js +++ b/mindplot/src/main/javascript/StandaloneActionDispatcher.js @@ -28,26 +28,12 @@ mindplot.StandaloneActionDispatcher = new Class({ this._actionRunner.hasBeenChanged(); }, - addIconToTopic: function(topicId, iconType) { - var command = new mindplot.commands.AddIconToTopicCommand(topicId, iconType); - this.execute(command); - }, - - changeLinkToTopic: function(topicId, url) { - var command = new mindplot.commands.ChangeLinkToTopicCommand(topicId, url); - this.execute(command); - }, addTopic:function(nodeModel, parentTopicId, animated) { var command = new mindplot.commands.AddTopicCommand(nodeModel, parentTopicId, animated); this.execute(command); }, - changeNoteToTopic: function(topicId, text) { - var command = new mindplot.commands.ChangeNoteToTopicCommand(topicId, text); - this.execute(command); - }, - connectByRelation: function(model) { var command = new mindplot.commands.AddRelationshipCommand(model); this.execute(command); @@ -82,20 +68,6 @@ mindplot.StandaloneActionDispatcher = new Class({ this.execute(command); }, - removeIconFromTopic: function(topicId, iconModel) { - var command = new mindplot.commands.RemoveIconFromTopicCommand(topicId, iconModel); - this.execute(command); - }, - removeLinkFromTopic: function(topicId) { - var command = new mindplot.commands.RemoveLinkFromTopicCommand(topicId); - this.execute(command); - }, - - removeNoteFromTopic: function(topicId) { - var command = new mindplot.commands.RemoveNoteFromTopicCommand(topicId); - this.execute(command); - }, - changeFontStyleToTopic: function(topicsIds) { var commandFunc = function(topic) { @@ -242,6 +214,21 @@ mindplot.StandaloneActionDispatcher = new Class({ this.execute(command, false); }, + addFeatureToTopic : function(topicId, featureType, attributes) { + var command = new mindplot.commands.AddFeatureToTopicCommand(topicId, featureType, attributes); + this.execute(command); + }, + + changeFeatureToTopic : function(topicId, featureId, attributes) { + var command = new mindplot.commands.ChangeFeatureToTopicCommand(topicId, featureId, attributes); + this.execute(command); + }, + + removeFeatureFromTopic : function(topicId, featureId) { + var command = new mindplot.commands.RemoveFeatureFromTopicCommand(topicId, featureId); + this.execute(command); + }, + execute:function(command) { this._actionRunner.execute(command); mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout); diff --git a/mindplot/src/main/javascript/TextTopic.js b/mindplot/src/main/javascript/TextTopic.js deleted file mode 100644 index b3c825a2..00000000 --- a/mindplot/src/main/javascript/TextTopic.js +++ /dev/null @@ -1,590 +0,0 @@ -/* - * Copyright [2011] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -mindplot.TextTopic = new Class({ - Extends:mindplot.Topic, - initialize : function(model, options) { - this._textEditor = new mindplot.MultilineTextEditor(this); - this.parent(model, options); - }, - - _registerEvents : function() { - - this.parent(); - this.addEvent('dblclick', function (event) { - this._textEditor.show(); - event.stopPropagation(true); - }.bind(this)); - - this._textEditor.addEvent('input', function(event, text) { - var textShape = this.getTextShape(); -// var oldText = textShape.getText(); - -// this._setText(text, false); - // @Todo: I must resize, no change the position ... -// textShape.setText(oldText); - }.bind(this)); - - }, - - setShapeType : function(type) { - this._setShapeType(type, true); - - }, - - _setShapeType : function(type, updateModel) { - // Remove inner shape figure ... - var model = this.getModel(); - if ($defined(updateModel) && updateModel) { - model.setShapeType(type); - } - - var oldInnerShape = this.getInnerShape(); - if (oldInnerShape != null) { - - this._removeInnerShape(); - - // Create a new one ... - var innerShape = this.getInnerShape(); - - // Update figure size ... - var size = model.getSize(); - this.setSize(size, true); - - var group = this.get2DElement(); - group.appendChild(innerShape); - - // Move text to the front ... - var text = this.getTextShape(); - text.moveToFront(); - - //Move iconGroup to front ... - var iconGroup = this.getIconGroup(); - if ($defined(iconGroup)) { - iconGroup.moveToFront(); - } - //Move connector to front - var connector = this.getShrinkConnector(); - if ($defined(connector)) { - connector.moveToFront(); - } - } - - }, - - getShapeType : function() { - var model = this.getModel(); - var result = model.getShapeType(); - if (!$defined(result)) { - result = this._defaultShapeType(); - } - return result; - }, - - getInnerShape : function() { - if (!$defined(this._innerShape)) { - // Create inner box. - this._innerShape = this.buildShape(mindplot.TextTopic.INNER_RECT_ATTRIBUTES); - - // Update bgcolor ... - var bgColor = this.getBackgroundColor(); - this._setBackgroundColor(bgColor, false); - - // Update border color ... - var brColor = this.getBorderColor(); - this._setBorderColor(brColor, false); - - // Define the pointer ... - if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { - this._innerShape.setCursor('move'); - } else { - this._innerShape.setCursor('default'); - } - - } - return this._innerShape; - }, - - buildShape : function(attributes, type) { - var result; - if (!$defined(type)) { - type = this.getShapeType(); - } - - if (type == mindplot.model.INodeModel.SHAPE_TYPE_RECT) { - result = new web2d.Rect(0, attributes); - } - else if (type == mindplot.model.INodeModel.SHAPE_TYPE_ELIPSE) { - result = new web2d.Rect(0.9, attributes); - } - else if (type == mindplot.model.INodeModel.SHAPE_TYPE_ROUNDED_RECT) { - result = new web2d.Rect(0.3, attributes); - } - else if (type == mindplot.model.INodeModel.SHAPE_TYPE_LINE) { - result = new web2d.Line({strokeColor:"#495879",strokeWidth:1}); - result.setSize = function(width, height) { - this.size = {width:width, height:height}; - result.setFrom(0, height); - result.setTo(width, height); - - // Lines will have the same color of the default connection lines... - var stokeColor = mindplot.ConnectionLine.getStrokeColor(); - result.setStroke(1, 'solid', stokeColor); - }; - - result.getSize = function() { - return this.size; - }; - - result.setPosition = function() { - }; - - var setStrokeFunction = result.setStroke; - result.setFill = function() { - - }; - - result.setStroke = function() { - - }; - } - else { - $assert(false, "Unsupported figure type:" + type); - } - result.setPosition(0, 0); - return result; - }, - - - getOuterShape : function() { - if (!$defined(this._outerShape)) { - var rect = this.buildShape(mindplot.Topic.OUTER_SHAPE_ATTRIBUTES, mindplot.model.INodeModel.SHAPE_TYPE_ROUNDED_RECT); - rect.setPosition(-2, -3); - rect.setOpacity(0); - this._outerShape = rect; - } - - return this._outerShape; - }, - - getTextShape : function() { - if (!$defined(this._text)) { - this._text = this._buildTextShape(false); - - // Set Text ... - var text = this.getText(); - this._setText(text, false); - } - return this._text; - }, - - - _buildTextShape : function(readOnly) { - var result = new web2d.Text(); - var family = this.getFontFamily(); - var size = this.getFontSize(); - var weight = this.getFontWeight(); - var style = this.getFontStyle(); - result.setFont(family, size, style, weight); - - var color = this.getFontColor(); - result.setColor(color); - - if (!readOnly) { - // Propagate mouse events ... - if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { - result.setCursor('move'); - } else { - result.setCursor('default'); - } - } - - return result; - }, - - _getInnerPadding : function() { - throw "this must be implemented"; - }, - - setFontFamily : function(value, updateModel) { - var textShape = this.getTextShape(); - textShape.setFontFamily(value); - if ($defined(updateModel) && updateModel) { - var model = this.getModel(); - model.setFontFamily(value); - } - this._adjustShapes(updateModel); - }, - - setFontSize : function(value, updateModel) { - - var textShape = this.getTextShape(); - textShape.setSize(value); - - if ($defined(updateModel) && updateModel) { - var model = this.getModel(); - model.setFontSize(value); - } - this._adjustShapes(updateModel); - - }, - - setFontStyle : function(value, updateModel) { - var textShape = this.getTextShape(); - textShape.setStyle(value); - if ($defined(updateModel) && updateModel) { - var model = this.getModel(); - model.setFontStyle(value); - } - this._adjustShapes(updateModel); - }, - - setFontWeight : function(value, updateModel) { - var textShape = this.getTextShape(); - textShape.setWeight(value); - if ($defined(updateModel) && updateModel) { - var model = this.getModel(); - model.setFontWeight(value); - } - this._adjustShapes(); - }, - - getFontWeight : function() { - var model = this.getModel(); - var result = model.getFontWeight(); - if (!$defined(result)) { - var font = this._defaultFontStyle(); - result = font.weight; - } - return result; - }, - - getFontFamily : function() { - var model = this.getModel(); - var result = model.getFontFamily(); - if (!$defined(result)) { - var font = this._defaultFontStyle(); - result = font.font; - } - return result; - }, - - getFontColor : function() { - var model = this.getModel(); - var result = model.getFontColor(); - if (!$defined(result)) { - var font = this._defaultFontStyle(); - result = font.color; - } - return result; - }, - - getFontStyle : function() { - var model = this.getModel(); - var result = model.getFontStyle(); - if (!$defined(result)) { - var font = this._defaultFontStyle(); - result = font.style; - } - return result; - }, - - getFontSize : function() { - var model = this.getModel(); - var result = model.getFontSize(); - if (!$defined(result)) { - var font = this._defaultFontStyle(); - result = font.size; - } - return result; - }, - - setFontColor : function(value, updateModel) { - var textShape = this.getTextShape(); - textShape.setColor(value); - if ($defined(updateModel) && updateModel) { - var model = this.getModel(); - model.setFontColor(value); - } - }, - - _setText : function(text, updateModel) { - var textShape = this.getTextShape(); - textShape.setText(text == null ? this._defaultText() : text); - - if ($defined(updateModel) && updateModel) { - var model = this.getModel(); - model.setText(text); - } - }, - - setText : function(text) { - // Avoid empty nodes ... - if (text.trim().length == 0) { - text = null; - } - - this._setText(text, true); - this._adjustShapes(); - }, - - getText : function() { - var model = this.getModel(); - var result = model.getText(); - if (!$defined(result)) { - result = this._defaultText(); - } - return result; - }, - - setBackgroundColor : function(color) { - this._setBackgroundColor(color, true); - }, - - _setBackgroundColor : function(color, updateModel) { - var innerShape = this.getInnerShape(); - innerShape.setFill(color); - - var connector = this.getShrinkConnector(); - connector.setFill(color); - - if ($defined(updateModel) && updateModel) { - var model = this.getModel(); - model.setBackgroundColor(color); - } - }, - - getBackgroundColor : function() { - var model = this.getModel(); - var result = model.getBackgroundColor(); - if (!$defined(result)) { - result = this._defaultBackgroundColor(); - } - return result; - }, - - setBorderColor : function(color) { - this._setBorderColor(color, true); - }, - - _setBorderColor : function(color, updateModel) { - var innerShape = this.getInnerShape(); - innerShape.setAttribute('strokeColor', color); - - var connector = this.getShrinkConnector(); - connector.setAttribute('strokeColor', color); - - - if ($defined(updateModel) && updateModel) { - var model = this.getModel(); - model.setBorderColor(color); - } - }, - - getBorderColor : function() { - var model = this.getModel(); - var result = model.getBorderColor(); - if (!$defined(result)) { - result = this._defaultBorderColor(); - } - return result; - }, - - _buildShape : function() { - var groupAttributes = {width: 100, height:100,coordSizeWidth:100,coordSizeHeight:100}; - var group = new web2d.Group(groupAttributes); - this._set2DElement(group); - - // Shape must be build based on the model width ... - var outerShape = this.getOuterShape(); - var innerShape = this.getInnerShape(); - var textShape = this.getTextShape(); - var shrinkConnector = this.getShrinkConnector(); - - // Add to the group ... - group.appendChild(outerShape); - group.appendChild(innerShape); - group.appendChild(textShape); - - // Update figure size ... - var model = this.getModel(); - if (model.getLinks().length != 0 || model.getNotes().length != 0 || model.getIcons().length != 0) { - this.getOrBuildIconGroup(); - } - - if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { - shrinkConnector.addToWorkspace(group); - } - - // Register listeners ... - this._registerDefaultListenersToElement(group, this); - }, - - - showTextEditor : function(text) { - this._textEditor.show(text); - }, - - showLinkEditor : function() { - - var topicId = this.getId(); - var model = this.getModel(); - var editorModel = { - getValue : function() { - var links = model.getLinks(); - var result; - if (links.length > 0) - result = links[0].getUrl(); - - return result; - }, - - setValue : function(value) { - var dispatcher = mindplot.ActionDispatcher.getInstance(); - if (!$defined(value)) { - dispatcher.removeLinkFromTopic(topicId); - } - else { - dispatcher.changeLinkToTopic(topicId, value); - } - } - }; - - this.closeEditors(); - var editor = new mindplot.widget.LinkEditor(editorModel); - editor.show(); - }, - - - closeEditors : function() { - this._textEditor.close(true); - }, - - /** - * Point: references the center of the rect shape.!!! - */ - setPosition : function(point) { - $assert(point, "position can not be null"); - point.x = Math.ceil(point.x); - point.y = Math.ceil(point.y); - - // Update model's position ... - var model = this.getModel(); - model.setPosition(point.x, point.y); - - // Elements are positioned in the center. - // All topic element must be positioned based on the innerShape. - var size = this.getSize(); - - var cx = point.x - (size.width / 2); - var cy = point.y - (size.height / 2); - - // Update visual position. - this._elem2d.setPosition(cx, cy); - - // Update connection lines ... - this._updateConnectionLines(); - - // Check object state. - this.invariant(); - }, - - getOutgoingConnectedTopic : function() { - var result = null; - var line = this.getOutgoingLine(); - if ($defined(line)) { - result = line.getTargetTopic(); - } - return result; - }, - - _setTopicVisibility : function(value) { - this.parent(value); - - var textShape = this.getTextShape(); - textShape.setVisibility(value); - - }, - - setOpacity : function(opacity) { - this.parent(); - - var textShape = this.getTextShape(); - textShape.setOpacity(opacity); - }, - - _updatePositionOnChangeSize : function(oldSize, newSize) { - $assert(false, "this method must be overwrited."); - }, - - createDragNode : function(layoutManager) { - var result = this.parent(layoutManager); - - // Is the node already connected ? - var targetTopic = this.getOutgoingConnectedTopic(); - if ($defined(targetTopic)) { - result.connectTo(targetTopic); - result.setVisibility(false); - } - - // If a drag node is create for it, let's hide the editor. - this._textEditor.close(); - - return result; - }, - - _adjustShapes : function() { - if (this._isInWorkspace) { - var textShape = this.getTextShape(); - var textWidth = textShape.getWidth(); - - var textHeight = textShape.getHeight(); - textHeight = textHeight != 0 ? textHeight : 20; - - var topicPadding = this._getInnerPadding(); - - // Adjust the icon size to the size of the text ... - var iconGroup = this.getOrBuildIconGroup(); - var fontHeight = this.getTextShape().getFontHeight(); - iconGroup.setPosition(topicPadding, topicPadding); - iconGroup.seIconSize(fontHeight, fontHeight); - - // Add a extra padding between the text and the icons - var iconsWidth = iconGroup.getSize().width; - if (iconsWidth != 0) { - - iconsWidth = iconsWidth + (textHeight / 4); - } - - var height = textHeight + (topicPadding * 2); - var width = textWidth + iconsWidth + (topicPadding * 2); - - this.setSize({width:width,height:height}); - - // Position node ... - textShape.setPosition(topicPadding + iconsWidth, topicPadding); - } - } - -}); - -mindplot.TextTopic.INNER_RECT_ATTRIBUTES = {stroke:'2 solid'}; - - - diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js index 93e103d9..cc9c2a41 100644 --- a/mindplot/src/main/javascript/Topic.js +++ b/mindplot/src/main/javascript/Topic.js @@ -260,129 +260,55 @@ mindplot.Topic = new Class({ var padding = this._getInnerPadding(); result.setPosition(padding, padding); + // Load topic features ... var model = this.getModel(); - - //Icons - var icons = model.getIcons(); - for (var i = 0; i < icons.length; i++) { - // Update model identifier ... - var iconModel = icons[i]; - var icon = new mindplot.ImageIcon(this, iconModel); - result.addIcon(icon, true); - } - - //Links - var links = model.getLinks(); - for (var i = 0; i < links.length; i++) { - this._link = new mindplot.LinkIcon(this, links[i]); - result.addIcon(this._link); - } - - //Notes - var notes = model.getNotes(); - for (var j = 0; j < notes.length; j++) { - this._note = new mindplot.NoteIcon(this, notes[j]); - result.addIcon(this._note); + var featuresModel = model.getFeatures(); + for (var i = 0; i < featuresModel.length; i++) { + var featureModel = featuresModel[i]; + var icon = mindplot.TopicFeature.createIcon(this, featureModel); + result.addIcon(icon, featureModel.getType() == "icon"); // @Todo: Remove hack ... } return result; }, - addLink : function(url) { - var iconGroup = this.getOrBuildIconGroup(); - var model = this.getModel(); - var linkModel = model.createLink(url); - model.addLink(linkModel); - - this._link = new mindplot.LinkIcon(this, linkModel); - iconGroup.addIcon(this._link); - - this._adjustShapes(); - }, - - addNote : function(text) { - var iconGroup = this.getOrBuildIconGroup(); - var model = this.getModel(); - - var noteModel = model.createNote(text); - model.addNote(noteModel); - - this._note = new mindplot.NoteIcon(this, noteModel); - iconGroup.addIcon(this._note); - - this._adjustShapes(); - }, - - addIcon : function(iconType) { + addFeature : function(type, attributes) { var iconGroup = this.getOrBuildIconGroup(); this.closeEditors(); var model = this.getModel(); // Update model ... - var iconModel = model.createIcon(iconType); - model.addIcon(iconModel); + var feature = model.createFeature(type, attributes); + model.addFeature(feature); + + var result = mindplot.TopicFeature.createIcon(this, feature); + iconGroup.addIcon(result, type == "icon"); // @Todo: Remove hack ... - var imageIcon = new mindplot.ImageIcon(this, iconModel); - iconGroup.addIcon(imageIcon, true); this._adjustShapes(); - return imageIcon; + return result; }, - removeIcon : function(iconModel) { + findFeatureById : function(id) { + var model = this.getModel(); + return model.findFeatureById(id); + }, + + removeFeature : function(featureModel) { + $assert(featureModel, "featureModel could not be null"); //Removing the icon from MODEL var model = this.getModel(); - model.removeIcon(iconModel); + model.removeFeature(featureModel); //Removing the icon from UI var iconGroup = this.getIconGroup(); if ($defined(iconGroup)) { - iconGroup.removeIcon(iconModel); + iconGroup.removeIconByModel(featureModel); } this._adjustShapes(); }, - removeLink : function() { - // Update model ... - var model = this.getModel(); - var links = model.getLinks(); - model._removeLink(links[0]); - - // Remove UI ... - var iconGroup = this.getIconGroup(); - if ($defined(iconGroup)) { - iconGroup.removeIconByUrl(mindplot.LinkIcon.IMAGE_URL); - } - - this._link = null; - this._adjustShapes(); - }, - - removeNote : function() { - // Update model ... - var model = this.getModel(); - var notes = model.getNotes(); - model.removeNote(notes[0]); - - // Remove UI ... - var iconGroup = this.getIconGroup(); - if ($defined(iconGroup)) { - iconGroup.removeIconByUrl(mindplot.NoteIcon.IMAGE_URL); - } - - this._note = null; - this._adjustShapes(); - }, - - hasNote : function() { - return this.getModel().getNotes().length != 0; - }, - - hasLink : function() { - return this.getModel().getLinks().length != 0; - }, - connectByRelation : function(relationship) { this._relationships.push(relationship); }, @@ -624,7 +550,7 @@ mindplot.Topic = new Class({ // Update figure size ... var model = this.getModel(); - if (model.getLinks().length != 0 || model.getNotes().length != 0 || model.getIcons().length != 0) { + if (model.getFeatures().length != 0) { this.getOrBuildIconGroup(); } @@ -728,7 +654,7 @@ mindplot.Topic = new Class({ var model = this.getModel(); var editorModel = { getValue : function() { - var notes = model.getNotes(); + var notes = model.findFeatureByType(mindplot.TopicFeature.Note.id); var result; if (notes.length > 0) result = notes[0].getText(); @@ -738,11 +664,18 @@ mindplot.Topic = new Class({ setValue : function(value) { var dispatcher = mindplot.ActionDispatcher.getInstance(); + var notes = model.findFeatureByType(mindplot.TopicFeature.Note.id); if (!$defined(value)) { - dispatcher.removeNoteFromTopic(topicId); + var featureId = notes[0].getId(); + dispatcher.removeFeatureFromTopic(topicId, featureId); } else { - dispatcher.changeNoteToTopic(topicId, value); + if (notes.length > 0) { + dispatcher.changeFeatureToTopic(topicId, notes[0].getId(), {text:value}); + } + else { + dispatcher.addFeatureToTopic(topicId, mindplot.TopicFeature.Note.id, {text:value}); + } } } }; @@ -757,7 +690,7 @@ mindplot.Topic = new Class({ var model = this.getModel(); var editorModel = { getValue : function() { - var links = model.getLinks(); + var links = model.findFeatureByType(mindplot.TopicFeature.Link.id); var result; if (links.length > 0) result = links[0].getUrl(); @@ -767,11 +700,18 @@ mindplot.Topic = new Class({ setValue : function(value) { var dispatcher = mindplot.ActionDispatcher.getInstance(); + var links = model.findFeatureByType(mindplot.TopicFeature.Link.id); if (!$defined(value)) { - dispatcher.removeLinkFromTopic(topicId); + var featureId = links[0].getId(); + dispatcher.removeFeatureFromTopic(topicId, featureId); } else { - dispatcher.changeLinkToTopic(topicId, value); + if (links.length > 0) { + dispatcher.changeFeatureToTopic(topicId, links[0].getId(), {url:value}); + } + else { + dispatcher.addFeatureToTopic(topicId, mindplot.TopicFeature.Link.id, {url:value}); + } } } }; @@ -841,7 +781,6 @@ mindplot.Topic = new Class({ return result; }, - _updateConnectionLines : function() { // Update this to parent line ... var outgoingLine = this.getOutgoingLine(); diff --git a/mindplot/src/main/javascript/TopicFeature.js b/mindplot/src/main/javascript/TopicFeature.js new file mode 100644 index 00000000..8cba25f3 --- /dev/null +++ b/mindplot/src/main/javascript/TopicFeature.js @@ -0,0 +1,68 @@ +/* + * Copyright [2011] [wisemapping] + * + * Licensed under WiseMapping Public License, Version 1.0 (the "License"). + * It is basically the Apache License, Version 2.0 (the "License") plus the + * "powered by wisemapping" text requirement on every single page; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the license at + * + * http://www.wisemapping.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +mindplot.TopicFeature = { + Icon: { + id:mindplot.model.IconModel.FEATURE_TYPE, + model: mindplot.model.IconModel, + icon : mindplot.ImageIcon + }, + + Link: { + id: mindplot.model.LinkModel.FEATURE_TYPE, + model: mindplot.model.LinkModel, + icon : mindplot.LinkIcon + }, + + Note: { + id: mindplot.model.NoteModel.FEATURE_TYPE, + model: mindplot.model.NoteModel, + icon : mindplot.NoteIcon + }, + + isSupported : function(id) { + return mindplot.TopicFeature._featuresMetadataById.some(function(elem) { + return elem.id == id; + }); + }, + + createModel : function(id, topic, attributes) { + $assert(id, 'type can not be null'); + $assert(topic, 'topic can not be null'); + $assert(attributes, 'attributes can not be null'); + + var model = mindplot.TopicFeature._featuresMetadataById.filter(function(elem) { + return elem.id == id; + })[0].model; + return new model(topic, attributes); + }, + + createIcon : function(topic, model) { + $assert(topic, 'topic can not be null'); + $assert(model, 'model can not be null'); + + var icon = mindplot.TopicFeature._featuresMetadataById.filter(function(elem) { + return elem.id == model.getType(); + })[0].icon; + return new icon(topic, model); + } +}; + +mindplot.TopicFeature._featuresMetadataById = [mindplot.TopicFeature.Icon,mindplot.TopicFeature.Link,mindplot.TopicFeature.Note] + + diff --git a/mindplot/src/main/javascript/commands/AddIconToTopicCommand.js b/mindplot/src/main/javascript/commands/AddFeatureToTopicCommand.js similarity index 59% rename from mindplot/src/main/javascript/commands/AddIconToTopicCommand.js rename to mindplot/src/main/javascript/commands/AddFeatureToTopicCommand.js index e764cee4..ee649d7d 100644 --- a/mindplot/src/main/javascript/commands/AddIconToTopicCommand.js +++ b/mindplot/src/main/javascript/commands/AddFeatureToTopicCommand.js @@ -16,23 +16,27 @@ * limitations under the License. */ -mindplot.commands.AddIconToTopicCommand = new Class({ +mindplot.commands.AddFeatureToTopicCommand = new Class({ Extends:mindplot.Command, - initialize: function(topicId, iconType) { + initialize: function(topicId, featureType, attributes) { + $assert($defined(topicId), 'topicId can not be null'); - $assert(iconType, 'iconType can not be null'); - this._topicsIds = topicId; - this._iconType = iconType; + $assert(featureType, 'featureType can not be null'); + $assert(attributes, 'attributes can not be null'); + + this._topicId = topicId; + this._featureType = featureType; + this._attributes = attributes; }, execute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; - var iconImg = topic.addIcon(this._iconType, commandContext._designer); - this._iconModel = iconImg.getModel(); + var topic = commandContext.findTopics(this._topicId)[0]; + var icon = topic.addFeature(this._featureType, this._attributes); + this._featureModel = icon.getModel(); }, undoExecute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; - topic.removeIcon(this._iconModel); + var topic = commandContext.findTopics(this._topicId)[0]; + topic.removeFeature(this._featureModel); } }); \ No newline at end of file diff --git a/mindplot/src/main/javascript/commands/RemoveLinkFromTopicCommand.js b/mindplot/src/main/javascript/commands/ChangeFeatureToTopicCommand.js similarity index 58% rename from mindplot/src/main/javascript/commands/RemoveLinkFromTopicCommand.js rename to mindplot/src/main/javascript/commands/ChangeFeatureToTopicCommand.js index 3800c91b..0923b3ed 100644 --- a/mindplot/src/main/javascript/commands/RemoveLinkFromTopicCommand.js +++ b/mindplot/src/main/javascript/commands/ChangeFeatureToTopicCommand.js @@ -16,23 +16,28 @@ * limitations under the License. */ -mindplot.commands.RemoveLinkFromTopicCommand = new Class({ +mindplot.commands.ChangeFeatureToTopicCommand = new Class({ Extends:mindplot.Command, - initialize: function(topicId) { + initialize: function(topicId, featureId, attributes) { $assert($defined(topicId), 'topicId can not be null'); - this._topicsIds = topicId; + $assert($defined(featureId), 'featureId can not be null'); + $assert($defined(attributes), 'attributes can not be null'); + + this._topicId = topicId; + this._featureId = featureId; + this._attributes = attributes; }, execute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; - var model = topic.getModel(); - var links = model.getLinks()[0]; - this._text = links.getUrl(); - topic.removeLink(); + var topic = commandContext.findTopics(this._topicId)[0]; + var feature = topic.findFeatureById(this._featureId); + + var oldAttributes = feature.getAttributes(); + feature.setAttributes(this._attributes); + this._attributes = oldAttributes; }, undoExecute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; - topic.addLink(this._url, commandContext._designer); + this.execute(commandContext); } }); \ No newline at end of file diff --git a/mindplot/src/main/javascript/commands/ChangeLinkToTopicCommand.js b/mindplot/src/main/javascript/commands/ChangeLinkToTopicCommand.js deleted file mode 100644 index 3578b12d..00000000 --- a/mindplot/src/main/javascript/commands/ChangeLinkToTopicCommand.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright [2011] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -mindplot.commands.ChangeLinkToTopicCommand = new Class({ - Extends:mindplot.Command, - initialize: function(topicId, url) { - $assert($defined(topicId), 'topicId can not be null'); - this._topicsIds = topicId; - this._url = url; - this._id = mindplot.Command._nextUUID(); - }, - - execute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; - if (topic.hasLink()) { - var model = topic.getModel(); - var link = model.getLinks()[0]; - this._oldUrl = link.getUrl(); - topic.removeLink(); - } - topic.addLink(this._url); - }, - - undoExecute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; - if (this._oldtext) { - topic.removeLink(); - topic.addLink(this._oldUrl); - } else { - topic.removeLink(); - } - } -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/commands/ChangeNoteToTopicCommand.js b/mindplot/src/main/javascript/commands/ChangeNoteToTopicCommand.js deleted file mode 100644 index 117d97c7..00000000 --- a/mindplot/src/main/javascript/commands/ChangeNoteToTopicCommand.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright [2011] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -mindplot.commands.ChangeNoteToTopicCommand = new Class({ - Extends:mindplot.Command, - initialize: function(topicId, text) { - $assert($defined(topicId), 'topicId can not be null'); - this._topicsIds = topicId; - this._text = text; - this._oldtext = null; - this._id = mindplot.Command._nextUUID(); - }, - - execute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; - if (topic.hasNote()) { - var model = topic.getModel(); - var notes = model.getNotes()[0]; - this._oldtext = notes.getText(); - topic.removeNote(); - } - topic.addNote(this._text); - }, - - undoExecute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; - if (this._oldtext) { - topic.removeNote(); - topic.addNote(this._oldtext); - } else { - topic.removeNote(); - } - } -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/commands/RemoveNoteFromTopicCommand.js b/mindplot/src/main/javascript/commands/RemoveFeatureFromTopicCommand.js similarity index 58% rename from mindplot/src/main/javascript/commands/RemoveNoteFromTopicCommand.js rename to mindplot/src/main/javascript/commands/RemoveFeatureFromTopicCommand.js index 230e191d..0f0a52f5 100644 --- a/mindplot/src/main/javascript/commands/RemoveNoteFromTopicCommand.js +++ b/mindplot/src/main/javascript/commands/RemoveFeatureFromTopicCommand.js @@ -16,21 +16,30 @@ * limitations under the License. */ -mindplot.commands.RemoveNoteFromTopicCommand = new Class({ +mindplot.commands.RemoveFeatureFromTopicCommand = new Class({ Extends:mindplot.Command, - initialize: function(topicId) { + initialize: function(topicId, featureId) { $assert($defined(topicId), 'topicId can not be null'); - this._topicsIds = topicId; + $assert(featureId, 'iconModel can not be null'); + + this._topicId = topicId; + this._featureId = featureId; + this._oldFeature = null; }, + execute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; - var model = topic.getModel(); - var notes = model.getNotes()[0]; - this._text = notes.getText(); - topic.removeNote(); + var topic = commandContext.findTopics(this._topicId)[0]; + + var feature = topic.findFeatureById(this._featureId); + topic.removeFeature(feature); + this._oldFeature = feature; }, + undoExecute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; - topic.addNote(this._text, commandContext._designer); + var topic = commandContext.findTopics(this._topicId)[0]; + + var feature = this._oldFeature; + topic.addFeature(feature.getType(), feature.getAttributes()); + this._oldFeature = null; } }); \ No newline at end of file diff --git a/mindplot/src/main/javascript/commands/RemoveIconFromTopicCommand.js b/mindplot/src/main/javascript/commands/RemoveIconFromTopicCommand.js deleted file mode 100644 index 32717760..00000000 --- a/mindplot/src/main/javascript/commands/RemoveIconFromTopicCommand.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright [2011] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -mindplot.commands.RemoveIconFromTopicCommand = new Class({ - Extends:mindplot.Command, - initialize: function(topicIds, iconModel) { - $assert($defined(topicIds), 'topicIds can not be null'); - $assert(iconModel, 'iconModel can not be null'); - this._topicsIds = topicIds; - this._iconModel = iconModel; - }, - - execute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; - topic.removeIcon(this._iconModel); - }, - - undoExecute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; - var iconType = this._iconModel.getIconType(); - var iconImg = topic.addIcon(iconType, commandContext._designer); - this._iconModel = iconImg.getModel(); - } -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/model/FeatureModel.js b/mindplot/src/main/javascript/model/FeatureModel.js new file mode 100644 index 00000000..03d58e95 --- /dev/null +++ b/mindplot/src/main/javascript/model/FeatureModel.js @@ -0,0 +1,76 @@ +/* + * Copyright [2011] [wisemapping] + * + * Licensed under WiseMapping Public License, Version 1.0 (the "License"). + * It is basically the Apache License, Version 2.0 (the "License") plus the + * "powered by wisemapping" text requirement on every single page; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the license at + * + * http://www.wisemapping.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +mindplot.model.FeatureModel = new Class({ + initialize:function(type, topic) { + $assert(type, 'type can not be null'); + $assert(topic, 'topic can not be null'); + + this._id = mindplot.model.FeatureModel._nextUUID(); + this._type = type; + this._topic = topic; + this._attributes = {}; + + // Create type method ... + this['is' + type.camelCase() + 'Model'] = function() { + return true; + }; + }, + + getAttributes : function() { + return Object.clone(this._attributes); + }, + + setAttributes : function(attributes) { + for (key in attributes) { + this["set" + key.capitalize()](attributes[key]); + } + }, + + setAttribute : function(key, value) { + $assert(key, 'key id can not be null'); + this._attributes[key] = value; + }, + + getAttribute : function(key) { + $assert(key, 'key id can not be null'); + + return this._attributes[key]; + }, + + getTopic : function() { + return this._topic; + }, + + getId : function() { + return this._id; + }, + + getType:function() { + return this._type; + } +}); + +mindplot.model.FeatureModel._nextUUID = function() { + if (!$defined(this._uuid)) { + this._uuid = 0; + } + + this._uuid = this._uuid + 1; + return this._uuid; +}; diff --git a/mindplot/src/main/javascript/model/INodeModel.js b/mindplot/src/main/javascript/model/INodeModel.js index 604d9f18..85a30414 100644 --- a/mindplot/src/main/javascript/model/INodeModel.js +++ b/mindplot/src/main/javascript/model/INodeModel.js @@ -248,58 +248,10 @@ mindplot.model.INodeModel = new Class({ throw "Unsupported operation"; }, - createLink : function(url) { - throw "Unsupported operation"; - }, - - addLink : function(link) { - throw "Unsupported operation"; - }, - - createNote : function(text) { - throw "Unsupported operation"; - }, - - addNote : function(note) { - throw "Unsupported operation"; - }, - - removeNote : function(note) { - throw "Unsupported operation"; - }, - - createIcon : function(iconType) { - throw "Unsupported operation"; - }, - - addIcon : function(icon) { - throw "Unsupported operation"; - }, - - removeIcon : function(icon) { - throw "Unsupported operation"; - }, - - removeLastIcon : function() { - throw "Unsupported operation"; - }, - getChildren : function() { throw "Unsupported operation"; }, - getIcons : function() { - throw "Unsupported operation"; - }, - - getLinks : function() { - throw "Unsupported operation"; - }, - - getNotes : function() { - throw "Unsupported operation"; - }, - getParent : function() { throw "Unsupported operation"; }, diff --git a/mindplot/src/main/javascript/model/IconModel.js b/mindplot/src/main/javascript/model/IconModel.js index 95533a4d..55f238d5 100644 --- a/mindplot/src/main/javascript/model/IconModel.js +++ b/mindplot/src/main/javascript/model/IconModel.js @@ -17,46 +17,19 @@ */ mindplot.model.IconModel = new Class({ - initialize:function(iconType, topic) { - $assert(iconType, 'Icon id can not be null'); - $assert(topic, 'topic can not be null'); - - this._iconType = iconType; - this._id = mindplot.model.IconModel._nextUUID(); - this._topic = topic; - }, - - getId : function() { - return this._id; + Extends: mindplot.model.FeatureModel, + initialize:function(topic, attributes) { + this.parent(mindplot.model.IconModel.FEATURE_TYPE, topic); + this.setIconType(attributes.id); }, getIconType : function() { - return this._iconType; + return this.getAttribute('id'); }, - setIconType : function(iconType) { - this._iconType = iconType; - }, - - getTopic : function() { - return this._topic; - }, - - isIconModel : function() { - return true; - }}); - - -/** - * @todo: This method must be implemented. - */ -mindplot.model.IconModel._nextUUID = function() { - if (!$defined(this._uuid)) { - this._uuid = 0; + $assert(iconType, 'iconType id can not be null'); + this.setAttribute('id', iconType); } - - this._uuid = this._uuid + 1; - return this._uuid; -}; - +}); +mindplot.model.IconModel.FEATURE_TYPE = "icon"; diff --git a/mindplot/src/main/javascript/model/LinkModel.js b/mindplot/src/main/javascript/model/LinkModel.js index dabc18d7..b218804a 100644 --- a/mindplot/src/main/javascript/model/LinkModel.js +++ b/mindplot/src/main/javascript/model/LinkModel.js @@ -17,31 +17,27 @@ */ mindplot.model.LinkModel = new Class({ - initialize : function(url, topic) { - $assert(url, 'url can not be null'); - $assert(topic, 'mindmap can not be null'); - this._topic = topic; - this.setUrl(url); + Extends: mindplot.model.FeatureModel, + initialize : function(topic, attributes) { + this.parent(mindplot.model.LinkModel.FEATURE_TYPE, topic); + this.setUrl(attributes.url); }, getUrl : function() { - return this._url; + return this.getAttribute('url'); }, setUrl : function(url) { $assert(url, 'url can not be null'); - this._url = this._fixUrl(url); - this._type = this._url.contains('mailto:') ? 'mail' : 'url'; + + var fixedUrl = this._fixUrl(url); + this.setAttribute('url', fixedUrl); + + var type = fixedUrl.contains('mailto:') ? 'mail' : 'url'; + this.setAttribute('type', type); + }, - getTopic : function() { - return this._topic; - }, - - isLinkModel : function() { - return true; - } - , _fixUrl : function(url) { var result = url; if (!result.contains('http://') && !result.contains('https://') && !result.contains('mailto://')) { @@ -49,4 +45,6 @@ mindplot.model.LinkModel = new Class({ } return result; } -}); \ No newline at end of file +}); + +mindplot.model.LinkModel.FEATURE_TYPE = 'link'; \ No newline at end of file diff --git a/mindplot/src/main/javascript/model/NodeModel.js b/mindplot/src/main/javascript/model/NodeModel.js index 971fea66..3cdefc32 100644 --- a/mindplot/src/main/javascript/model/NodeModel.js +++ b/mindplot/src/main/javascript/model/NodeModel.js @@ -30,9 +30,39 @@ mindplot.model.NodeModel = new Class({ this.setSize(50, 20); this._children = []; - this._icons = []; - this._links = []; - this._notes = []; + this._feature = []; + }, + + createFeature: function(type, attributes) { + return mindplot.TopicFeature.createModel(type, this, attributes); + }, + + addFeature: function(feature) { + $assert(feature, 'feature can not be null'); + this._feature.push(feature); + }, + + getFeatures: function() { + return this._feature; + }, + + removeFeature: function(feature) { + $assert(feature, 'feature can not be null'); + this._feature.erase(feature); + }, + + findFeatureByType : function(type) { + $assert(type, 'type can not be null'); + return this._feature.filter(function(feature) { + return feature.getType() == type; + }); + }, + + findFeatureById : function(id) { + $assert($defined(id), 'id can not be null'); + return this._feature.filter(function(feature) { + return feature.getId() == id; + })[0]; }, getPropertiesKeys : function() { @@ -64,67 +94,10 @@ mindplot.model.NodeModel = new Class({ }); result._properties = Object.clone(this._properties); - result._icons = this._icons.clone(); - result._links = this._links.clone(); - result._notes = this._notes.clone(); + result._feature = this._feature.clone(); return result; }, - addChildren : function() { - $assert(child && child.isNodeModel(), 'Only NodeModel can be appended to Mindmap object'); - this._children.push(child); - child._parent = this; - }, - - createLink : function(url) { - $assert(url, 'Link URL must be specified.'); - return new mindplot.model.LinkModel(url, this); - }, - - addLink : function(link) { - $assert(link && link.isLinkModel(), 'Only LinkModel can be appended to Mindmap object as links'); - this._links.push(link); - }, - - _removeLink : function(link) { - $assert(link && link.isLinkModel(), 'Only LinkModel can be appended to Mindmap object as links'); - this._links.erase(link); - }, - - createNote : function(text) { - $assert(text != null, 'note text must be specified.'); - return new mindplot.model.NoteModel(text, this); - }, - - addNote : function(note) { - $assert(note && note.isNoteModel(), 'Only NoteModel can be appended to Mindmap object as links'); - this._notes.push(note); - }, - - removeNote : function(note) { - $assert(note && note.isNoteModel(), 'Only NoteModel can be appended to Mindmap object as links'); - this._notes.erase(note); - }, - - createIcon : function(iconType) { - $assert(iconType, 'IconType must be specified.'); - return new mindplot.model.IconModel(iconType, this); - }, - - addIcon : function(icon) { - $assert(icon && icon.isIconModel(), 'Only IconModel can be appended to Mindmap object as icons'); - this._icons.push(icon); - }, - - removeIcon : function(icon) { - $assert(icon && icon.isIconModel(), 'Only IconModel can be appended to Mindmap object as icons'); - this._icons.erase(icon); - }, - - removeLastIcon : function() { - this._icons.pop(); - }, - appendChild : function(child) { $assert(child && child.isNodeModel(), 'Only NodeModel can be appended to Mindmap object'); this._children.push(child); @@ -141,18 +114,6 @@ mindplot.model.NodeModel = new Class({ return this._children; }, - getIcons : function() { - return this._icons; - }, - - getLinks : function() { - return this._links; - }, - - getNotes : function() { - return this._notes; - }, - getParent : function() { return this._parent; }, diff --git a/mindplot/src/main/javascript/model/NoteModel.js b/mindplot/src/main/javascript/model/NoteModel.js index b41e43ea..2cd6f62f 100644 --- a/mindplot/src/main/javascript/model/NoteModel.js +++ b/mindplot/src/main/javascript/model/NoteModel.js @@ -17,26 +17,20 @@ */ mindplot.model.NoteModel = new Class({ - initialize : function(text, topic) { - $assert(text, 'text text can not be null'); - $assert(topic, 'topic can not be null'); - this._text = text; - this._topic = topic; + Extends: mindplot.model.FeatureModel, + initialize : function(topic, attributes) { + this.parent(mindplot.model.NoteModel.FEATURE_TYPE, topic); + this.setText(attributes.text); }, getText:function() { - return this._text; + return this.getAttribute('text'); }, setText : function(text) { - this._text = text; - }, - - getTopic : function() { - return this._topic; - }, - - isNoteModel : function() { - return true; + $assert(text, 'text can not be null'); + this.setAttribute('text', text); } -}); \ No newline at end of file +}); + +mindplot.model.NoteModel.FEATURE_TYPE = "note"; diff --git a/mindplot/src/main/javascript/persistence/XMLSerializer_Beta.js b/mindplot/src/main/javascript/persistence/XMLSerializer_Beta.js index bf680c63..6d40edd6 100644 --- a/mindplot/src/main/javascript/persistence/XMLSerializer_Beta.js +++ b/mindplot/src/main/javascript/persistence/XMLSerializer_Beta.js @@ -260,13 +260,13 @@ mindplot.persistence.XMLSerializer_Beta = new Class({ childTopic.connectTo(topic); } else if (child.tagName == "icon") { var icon = this._deserializeIcon(child, topic); - topic.addIcon(icon); + topic.addFeature(icon); } else if (child.tagName == "link") { var link = this._deserializeLink(child, topic); - topic.addLink(link); + topic.addFeature(link); } else if (child.tagName == "note") { var note = this._deserializeNote(child, topic); - topic.addNote(note); + topic.addFeature(note); } } } @@ -277,15 +277,15 @@ mindplot.persistence.XMLSerializer_Beta = new Class({ _deserializeIcon : function(domElem, topic) { var icon = domElem.getAttribute("id"); icon = icon.replace("images/", "icons/legacy/"); - return topic.createIcon(icon); + return mindplot.TopicFeature.createModel(mindplot.TopicFeature.Icon.id, topic, {id:icon}); }, _deserializeLink : function(domElem, topic) { - return topic.createLink(domElem.getAttribute("url")); + return mindplot.TopicFeature.createModel(mindplot.TopicFeature.Link.id, topic, {url:domElem.getAttribute("url")}); }, _deserializeNote : function(domElem, topic) { - return topic.createNote(domElem.getAttribute("text")); + return mindplot.TopicFeature.createModel(mindplot.TopicFeature.Note.id, topic, {text:domElem.getAttribute("url")}); }}); mindplot.persistence.XMLSerializer_Beta.MAP_ROOT_NODE = 'map'; \ No newline at end of file diff --git a/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js b/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js index 4bf42f23..d094ecbb 100644 --- a/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js +++ b/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js @@ -47,8 +47,6 @@ mindplot.persistence.XMLSerializer_Pela = new Class({ // Create Relationships var relationships = mindmap.getRelationships(); if (relationships.length > 0) { -// var relationshipDom=document.createElement("relationships"); -// mapElem.appendChild(relationshipDom); for (var j = 0; j < relationships.length; j++) { var relationDom = this._relationshipToXML(document, relationships[j]); mapElem.appendChild(relationDom); @@ -124,60 +122,38 @@ mindplot.persistence.XMLSerializer_Pela = new Class({ parentTopic.setAttribute('brColor', brColor); } - //ICONS - var icons = topic.getIcons(); - for (var i = 0; i < icons.length; i++) { - var icon = icons[i]; - var iconDom = this._iconToXML(document, icon); - parentTopic.appendChild(iconDom); - } + // Serialize features ... + var features = topic.getFeatures(); + for (var i = 0; i < features.length; i++) { + var feature = features[i]; - //LINKS - var links = topic.getLinks(); - for (var i = 0; i < links.length; i++) { - var link = links[i]; - var linkDom = this._linkToXML(document, link); - parentTopic.appendChild(linkDom); - } + var featureType = feature.getType(); + var featureDom = document.createElement(featureType); + var attributes = feature.getAttributes(); - var notes = topic.getNotes(); - for (var i = 0; i < notes.length; i++) { - var note = notes[i]; - var noteDom = this._noteToXML(document, note); - parentTopic.appendChild(noteDom); + for (var key in attributes) { + var value = attributes[key]; + if (key == 'text') { + var cdata = document.createCDATASection(value); + featureDom.appendChild(cdata); + } else { + featureDom.setAttribute(key, value); + } + } + parentTopic.appendChild(featureDom); } //CHILDREN TOPICS var childTopics = topic.getChildren(); - for (var i = 0; i < childTopics.length; i++) { - var childTopic = childTopics[i]; + for (var j = 0; j < childTopics.length; j++) { + var childTopic = childTopics[j]; var childDom = this._topicToXML(document, childTopic); parentTopic.appendChild(childDom); } - return parentTopic; }, - _iconToXML : function(document, icon) { - var iconDom = document.createElement("icon"); - iconDom.setAttribute('id', icon.getIconType()); - return iconDom; - }, - - _linkToXML : function(document, link) { - var linkDom = document.createElement("link"); - linkDom.setAttribute('url', link.getUrl()); - return linkDom; - }, - - _noteToXML : function(document, note) { - var noteDom = document.createElement("note"); - var cdata = document.createCDATASection(note.getText()); - noteDom.appendChild(cdata); - return noteDom; - }, - _noteTextToXML : function(document, elem, text) { if (text.indexOf('\n') == -1) { elem.setAttribute('text', text); @@ -305,17 +281,6 @@ mindplot.persistence.XMLSerializer_Pela = new Class({ if ($defined(borderColor)) { topic.setBorderColor(borderColor); } -// -// } else { -// var sizeStr = domElem.getAttribute('size'); -// $assert(sizeStr, "size can not be null"); -// var size = sizeStr.split(','); -// topic.setSize(size[0], size[1]); -// -// var url = domElem.getAttribute('image'); -// $assert(url, "url can not be null"); -// topic.setImageUrl(url); -// } var order = domElem.getAttribute('order'); if ($defined(order)) { @@ -338,40 +303,40 @@ mindplot.persistence.XMLSerializer_Pela = new Class({ for (var i = 0; i < children.length; i++) { var child = children[i]; if (child.nodeType == Node.ELEMENT_NODE) { - $assert(child.tagName == "topic" || child.tagName == "icon" || child.tagName == "link" || child.tagName == "note" || child.tagName == "text", 'Illegal node type:' + child.tagName); if (child.tagName == "topic") { var childTopic = this._deserializeNode(child, mindmap); childTopic.connectTo(topic); - } else if (child.tagName == "icon") { - var icon = this._deserializeIcon(child, topic); - topic.addIcon(icon); - } else if (child.tagName == "link") { - var link = this._deserializeLink(child, topic); - topic.addLink(link); - } else if (child.tagName == "note") { - var note = this._deserializeNote(child, topic); - topic.addNote(note); + } else if (mindplot.TopicFeature.isSupported(child.tagName)) { + + // Load attributes ... + var namedNodeMap = child.attributes; + var attributes = {}; + for (var j = 0; j < namedNodeMap.length; j++) { + var attribute = namedNodeMap.item(j); + attributes[attribute.name] = attribute.value; + } + + // Has text node ?. + var textAttr = this._deserializeTextAttr(child); + if (textAttr) { + attributes['text'] = textAttr; + } + + // Create a new element .... + var featureType = child.tagName; + var feature = mindplot.TopicFeature.createModel(featureType, topic, attributes); + topic.addFeature(feature); + } else if (child.tagName == "text") { var nodeText = this._deserializeNodeText(child); topic.setText(nodeText); } - } } return topic; }, - _deserializeIcon : function(domElem, topic) { - var icon = domElem.getAttribute("id"); - icon = icon.replace("images/", "icons/legacy/"); - return topic.createIcon(icon); - }, - - _deserializeLink : function(domElem, topic) { - return topic.createLink(domElem.getAttribute("url")); - }, - - _deserializeNote : function(domElem, topic) { + _deserializeTextAttr : function(domElem) { var value = domElem.getAttribute("text"); if (!$defined(value)) { var children = domElem.childNodes; @@ -382,11 +347,10 @@ mindplot.persistence.XMLSerializer_Pela = new Class({ } } } - return topic.createNote(value); + return value; }, _deserializeNodeText: function(domElem) { - var children = domElem.childNodes; var value = null; for (var i = 0; i < children.length; i++) { diff --git a/wise-webapp/src/test/java/com/wisemapping/test/freemind/pepe.xml b/wise-webapp/src/test/java/com/wisemapping/test/freemind/pepe.xml index 02985956..4d83d907 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/freemind/pepe.xml +++ b/wise-webapp/src/test/java/com/wisemapping/test/freemind/pepe.xml @@ -1,20 +1,49 @@ -Actual : - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 368f39261ae9af261ef2c6503ba05f3ed265ac28 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 27 Feb 2012 18:52:41 -0300 Subject: [PATCH 20/45] Fix missing dialog image ... --- .../src/main/webapp/css/libraries/moodialog/css/dialog-close.png | 1 + 1 file changed, 1 insertion(+) create mode 120000 wise-editor/src/main/webapp/css/libraries/moodialog/css/dialog-close.png diff --git a/wise-editor/src/main/webapp/css/libraries/moodialog/css/dialog-close.png b/wise-editor/src/main/webapp/css/libraries/moodialog/css/dialog-close.png new file mode 120000 index 00000000..2b7bcf87 --- /dev/null +++ b/wise-editor/src/main/webapp/css/libraries/moodialog/css/dialog-close.png @@ -0,0 +1 @@ +../../../../../../../../mindplot/src/main/javascript/libraries/moodialog/css/dialog-close.png \ No newline at end of file From 58f1f741b06a227ea6b24beefec752cbb0cb5d5d Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 27 Feb 2012 19:06:00 -0300 Subject: [PATCH 21/45] Remove unused methods. --- mindplot/src/main/javascript/IconGroup.js | 25 ----------------------- 1 file changed, 25 deletions(-) diff --git a/mindplot/src/main/javascript/IconGroup.js b/mindplot/src/main/javascript/IconGroup.js index 82879c22..8931a34d 100644 --- a/mindplot/src/main/javascript/IconGroup.js +++ b/mindplot/src/main/javascript/IconGroup.js @@ -70,17 +70,6 @@ mindplot.IconGroup = new Class({ } }, - _findIconFromUrl : function(url) { - var result = null; - this._icons.each(function(el) { - var nativeImage = el.getImage(); - if (nativeImage.getHref() == url) { - result = el; - } - }, this); - return result; - }, - _findIconFromModel : function(iconModel) { var result = null; this._icons.each(function(icon) { @@ -97,19 +86,6 @@ mindplot.IconGroup = new Class({ return result; }, - removeIconByUrl : function(url) { - var icon = this._findIconFromUrl(url); - $assert(icon, 'icon could not be found'); - this._removeIcon(icon); - }, - - removeIcon : function(iconModel) { - $assert(iconModel, "iconModel can not be null"); - - var icon = this._findIconFromModel(iconModel); - this._removeIcon(icon); - }, - removeIconByModel : function(featureModel) { $assert(featureModel, "featureModel can not be null"); @@ -222,7 +198,6 @@ mindplot.IconGroup.RemoveTip = new Class({ } if (this._activeIcon) { - var icon = this._activeIcon; var widget = this._widget; var close = function() { From e67b2ba50b59e5385ca39cc0bfd528b9ef097949 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 27 Feb 2012 19:25:14 -0300 Subject: [PATCH 22/45] Fix commands calling super class constructor. --- .../commands/AddFeatureToTopicCommand.js | 1 + .../commands/AddRelationshipCommand.js | 3 +- .../javascript/commands/AddTopicCommand.js | 2 + .../commands/ChangeFeatureToTopicCommand.js | 1 + .../main/javascript/commands/DeleteCommand.js | 1 + .../javascript/commands/DragTopicCommand.js | 3 +- .../commands/GenericFunctionCommand.js | 2 +- .../commands/MoveControlPointCommand.js | 2 +- .../commands/RemoveFeatureFromTopicCommand.js | 1 + .../com/wisemapping/test/freemind/pepe.xml | 49 ------------------- 10 files changed, 12 insertions(+), 53 deletions(-) delete mode 100644 wise-webapp/src/test/java/com/wisemapping/test/freemind/pepe.xml diff --git a/mindplot/src/main/javascript/commands/AddFeatureToTopicCommand.js b/mindplot/src/main/javascript/commands/AddFeatureToTopicCommand.js index ee649d7d..b23d8490 100644 --- a/mindplot/src/main/javascript/commands/AddFeatureToTopicCommand.js +++ b/mindplot/src/main/javascript/commands/AddFeatureToTopicCommand.js @@ -24,6 +24,7 @@ mindplot.commands.AddFeatureToTopicCommand = new Class({ $assert(featureType, 'featureType can not be null'); $assert(attributes, 'attributes can not be null'); + this.parent(); this._topicId = topicId; this._featureType = featureType; this._attributes = attributes; diff --git a/mindplot/src/main/javascript/commands/AddRelationshipCommand.js b/mindplot/src/main/javascript/commands/AddRelationshipCommand.js index 6a61212a..72825571 100644 --- a/mindplot/src/main/javascript/commands/AddRelationshipCommand.js +++ b/mindplot/src/main/javascript/commands/AddRelationshipCommand.js @@ -19,8 +19,9 @@ mindplot.commands.AddRelationshipCommand = new Class({ Extends:mindplot.Command, initialize: function(model) { $assert(model, 'Relationship model can not be null'); + + this.parent(); this._model = model; - this._id = mindplot.Command._nextUUID(); }, execute: function(commandContext) { var relationship = commandContext.createRelationship(this._model); diff --git a/mindplot/src/main/javascript/commands/AddTopicCommand.js b/mindplot/src/main/javascript/commands/AddTopicCommand.js index 3f916f02..2923c30c 100644 --- a/mindplot/src/main/javascript/commands/AddTopicCommand.js +++ b/mindplot/src/main/javascript/commands/AddTopicCommand.js @@ -21,6 +21,8 @@ mindplot.commands.AddTopicCommand = new Class( Extends:mindplot.Command, initialize: function(model, parentTopicId, animated) { $assert(model, 'Model can not be null'); + + this.parent(); this._model = model; this._parentId = parentTopicId; this._id = mindplot.Command._nextUUID(); diff --git a/mindplot/src/main/javascript/commands/ChangeFeatureToTopicCommand.js b/mindplot/src/main/javascript/commands/ChangeFeatureToTopicCommand.js index 0923b3ed..694a616d 100644 --- a/mindplot/src/main/javascript/commands/ChangeFeatureToTopicCommand.js +++ b/mindplot/src/main/javascript/commands/ChangeFeatureToTopicCommand.js @@ -23,6 +23,7 @@ mindplot.commands.ChangeFeatureToTopicCommand = new Class({ $assert($defined(featureId), 'featureId can not be null'); $assert($defined(attributes), 'attributes can not be null'); + this.parent(); this._topicId = topicId; this._featureId = featureId; this._attributes = attributes; diff --git a/mindplot/src/main/javascript/commands/DeleteCommand.js b/mindplot/src/main/javascript/commands/DeleteCommand.js index 650168f6..7e0c4a6f 100644 --- a/mindplot/src/main/javascript/commands/DeleteCommand.js +++ b/mindplot/src/main/javascript/commands/DeleteCommand.js @@ -21,6 +21,7 @@ mindplot.commands.DeleteCommand = new Class({ initialize: function(topicIds, relIds) { $assert($defined(topicIds), 'topicIds can not be null'); + this.parent(); this._relIds = relIds; this._topicIds = topicIds; this._deletedTopicModels = []; diff --git a/mindplot/src/main/javascript/commands/DragTopicCommand.js b/mindplot/src/main/javascript/commands/DragTopicCommand.js index e6d73c7c..1ff47023 100644 --- a/mindplot/src/main/javascript/commands/DragTopicCommand.js +++ b/mindplot/src/main/javascript/commands/DragTopicCommand.js @@ -25,6 +25,7 @@ mindplot.commands.DragTopicCommand = new Class({ if ($defined(parentTopic)) this._parentId = parentTopic.getId(); + this.parent(); this._position = position; this._order = order; this._id = mindplot.Command._nextUUID(); @@ -58,7 +59,7 @@ mindplot.commands.DragTopicCommand = new Class({ // Set position ... topic.setPosition(this._position); } else { - $assert("Illegal commnad state exception."); + $assert("Illegal command state exception."); } // Finally, connect topic ... diff --git a/mindplot/src/main/javascript/commands/GenericFunctionCommand.js b/mindplot/src/main/javascript/commands/GenericFunctionCommand.js index 41e9ea4c..f8dd4eb2 100644 --- a/mindplot/src/main/javascript/commands/GenericFunctionCommand.js +++ b/mindplot/src/main/javascript/commands/GenericFunctionCommand.js @@ -22,11 +22,11 @@ mindplot.commands.GenericFunctionCommand = new Class({ $assert(commandFunc, "commandFunc must be defined"); $assert($defined(topicsIds), "topicsIds must be defined"); + this.parent(); this._value = value; this._topicsIds = topicsIds; this._commandFunc = commandFunc; this._oldValues = []; - this._id = mindplot.Command._nextUUID(); }, execute: function(commandContext) { diff --git a/mindplot/src/main/javascript/commands/MoveControlPointCommand.js b/mindplot/src/main/javascript/commands/MoveControlPointCommand.js index d640dfd4..c8e799c8 100644 --- a/mindplot/src/main/javascript/commands/MoveControlPointCommand.js +++ b/mindplot/src/main/javascript/commands/MoveControlPointCommand.js @@ -21,6 +21,7 @@ mindplot.commands.MoveControlPointCommand = new Class({ $assert(ctrlPointController, 'line can not be null'); $assert($defined(point), 'point can not be null'); + this.parent(); this._ctrlPointControler = ctrlPointController; this._line = ctrlPointController._line; this._controlPoint = this._ctrlPointControler.getControlPoint(point).clone(); @@ -36,7 +37,6 @@ mindplot.commands.MoveControlPointCommand = new Class({ this._endPoint = this._line.getLine().getTo().clone(); break; } - this._id = mindplot.Command._nextUUID(); this._point = point; }, diff --git a/mindplot/src/main/javascript/commands/RemoveFeatureFromTopicCommand.js b/mindplot/src/main/javascript/commands/RemoveFeatureFromTopicCommand.js index 0f0a52f5..3ebfe9d5 100644 --- a/mindplot/src/main/javascript/commands/RemoveFeatureFromTopicCommand.js +++ b/mindplot/src/main/javascript/commands/RemoveFeatureFromTopicCommand.js @@ -22,6 +22,7 @@ mindplot.commands.RemoveFeatureFromTopicCommand = new Class({ $assert($defined(topicId), 'topicId can not be null'); $assert(featureId, 'iconModel can not be null'); + this.parent(); this._topicId = topicId; this._featureId = featureId; this._oldFeature = null; diff --git a/wise-webapp/src/test/java/com/wisemapping/test/freemind/pepe.xml b/wise-webapp/src/test/java/com/wisemapping/test/freemind/pepe.xml deleted file mode 100644 index 4d83d907..00000000 --- a/wise-webapp/src/test/java/com/wisemapping/test/freemind/pepe.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 1fefb929dafe9de46e68b56d014b8c8195cd6f50 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 27 Feb 2012 22:47:10 -0300 Subject: [PATCH 23/45] Fix change shape bug. --- mindplot/src/main/javascript/CentralTopic.js | 2 +- .../src/main/javascript/ConnectionLine.js | 2 +- mindplot/src/main/javascript/Designer.js | 6 ++--- mindplot/src/main/javascript/MainTopic.js | 12 ++++----- mindplot/src/main/javascript/Topic.js | 17 ++++++------- mindplot/src/main/javascript/TopicEditor.js | 25 +++++++++++++++++++ .../src/main/javascript/model/INodeModel.js | 14 ++++++++--- 7 files changed, 54 insertions(+), 24 deletions(-) create mode 100644 mindplot/src/main/javascript/TopicEditor.js diff --git a/mindplot/src/main/javascript/CentralTopic.js b/mindplot/src/main/javascript/CentralTopic.js index ed793c4e..3bd61009 100644 --- a/mindplot/src/main/javascript/CentralTopic.js +++ b/mindplot/src/main/javascript/CentralTopic.js @@ -55,7 +55,7 @@ mindplot.CentralTopic = new Class({ _defaultShapeType : function() { - return mindplot.model.INodeModel.SHAPE_TYPE_ROUNDED_RECT; + return mindplot.model.TopicShape.ROUNDED_RECT; }, diff --git a/mindplot/src/main/javascript/ConnectionLine.js b/mindplot/src/main/javascript/ConnectionLine.js index b4f2f3a4..e5ab6570 100644 --- a/mindplot/src/main/javascript/ConnectionLine.js +++ b/mindplot/src/main/javascript/ConnectionLine.js @@ -123,7 +123,7 @@ mindplot.ConnectionLine = new Class({ var offset = mindplot.Topic.CONNECTOR_WIDTH / 2; var targetTopicSize = targetTopic.getSize(); var y; - if (targetTopic.getShapeType() == mindplot.model.INodeModel.SHAPE_TYPE_LINE) { + if (targetTopic.getShapeType() == mindplot.model.TopicShape.LINE) { y = targetTopicSize.height; } else { y = targetTopicSize.height / 2; diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index 84b3ed40..76217500 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -656,7 +656,7 @@ mindplot.Designer = new Class({ changeBackgroundColor : function(color) { var validateFunc = function(topic) { - return topic.getShapeType() != mindplot.model.INodeModel.SHAPE_TYPE_LINE + return topic.getShapeType() != mindplot.model.TopicShape.LINE; }; var validateError = 'Color can not be set to line topics.'; @@ -668,7 +668,7 @@ mindplot.Designer = new Class({ changeBorderColor : function(color) { var validateFunc = function(topic) { - return topic.getShapeType() != mindplot.model.INodeModel.SHAPE_TYPE_LINE + return topic.getShapeType() != mindplot.model.TopicShape.LINE ; }; var validateError = 'Color can not be set to line topics.'; var topicsIds = this.getModel().filterTopicsIds(validateFunc, validateError); @@ -686,7 +686,7 @@ mindplot.Designer = new Class({ changeTopicShape : function(shape) { var validateFunc = function(topic) { - return !(topic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE && shape == mindplot.model.INodeModel.SHAPE_TYPE_LINE) + return !(topic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE && shape == mindplot.model.TopicShape.LINE) }; var validateError = 'Central Topic shape can not be changed to line figure.'; diff --git a/mindplot/src/main/javascript/MainTopic.js b/mindplot/src/main/javascript/MainTopic.js index ca2aaeb0..57e6e9af 100644 --- a/mindplot/src/main/javascript/MainTopic.js +++ b/mindplot/src/main/javascript/MainTopic.js @@ -56,7 +56,7 @@ mindplot.MainTopic = new Class({ _defaultShapeType : function() { - return mindplot.model.INodeModel.SHAPE_TYPE_LINE; + return mindplot.model.TopicShape.LINE; }, updateTopicShape : function(targetTopic, workspace) { @@ -81,7 +81,7 @@ mindplot.MainTopic = new Class({ if (!$defined(shapeType)) { // Change figure ... shapeType = this.getShapeType(); - this._setShapeType(mindplot.model.INodeModel.SHAPE_TYPE_ROUNDED_RECT, false); + this._setShapeType(mindplot.model.TopicShape.ROUNDED_RECT, false); } var innerShape = this.getInnerShape(); innerShape.setVisibility(true); @@ -112,7 +112,7 @@ mindplot.MainTopic = new Class({ var isAtRight = mindplot.util.Shape.isAtRight(sourcePosition, pos); var result = mindplot.util.Shape.calculateRectConnectionPoint(pos, size, isAtRight); - if (this.getShapeType() == mindplot.model.INodeModel.SHAPE_TYPE_LINE) { + if (this.getShapeType() == mindplot.model.TopicShape.LINE) { result.y = result.y + (this.getSize().height / 2); } @@ -133,14 +133,15 @@ mindplot.MainTopic = new Class({ workoutOutgoingConnectionPoint : function(targetPosition) { $assert(targetPosition, 'targetPoint can not be null'); var pos = this.getPosition(); + var isAtRight = mindplot.util.Shape.isAtRight(targetPosition, pos); + var size = this.getSize(); var result; - if (this.getShapeType() == mindplot.model.INodeModel.SHAPE_TYPE_LINE) { + if (this.getShapeType() == mindplot.model.TopicShape.LINE) { result = new core.Point(); var groupPosition = this._elem2d.getPosition(); var innerShareSize = this.getInnerShape().getSize(); - var isAtRight = mindplot.util.Shape.isAtRight(targetPosition, pos); if (innerShareSize) { var magicCorrectionNumber = 0.3; @@ -153,7 +154,6 @@ mindplot.MainTopic = new Class({ } else { // Hack: When the size has not being defined. This is because the node has not being added. // Try to do our best ... - var size = this.getSize(); if (!isAtRight) { result.x = pos.x + (size.width / 2); } else { diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js index cc9c2a41..9e62422d 100644 --- a/mindplot/src/main/javascript/Topic.js +++ b/mindplot/src/main/javascript/Topic.js @@ -55,7 +55,7 @@ mindplot.Topic = new Class({ event.stopPropagation(true); }.bind(this)); - this._textEditor.addEvent('input', function(event, text) { + this._textEditor.addEvent('input', function() { var textShape = this.getTextShape(); // var oldText = textShape.getText(); @@ -162,16 +162,16 @@ mindplot.Topic = new Class({ type = this.getShapeType(); } - if (type == mindplot.model.INodeModel.SHAPE_TYPE_RECT) { + if (type == mindplot.model.TopicShape.RECTANGLE) { result = new web2d.Rect(0, attributes); } - else if (type == mindplot.model.INodeModel.SHAPE_TYPE_ELIPSE) { + else if (type == mindplot.model.TopicShape.ELIPSE) { result = new web2d.Rect(0.9, attributes); } - else if (type == mindplot.model.INodeModel.SHAPE_TYPE_ROUNDED_RECT) { + else if (type == mindplot.model.TopicShape.ROUNDED_RECT) { result = new web2d.Rect(0.3, attributes); } - else if (type == mindplot.model.INodeModel.SHAPE_TYPE_LINE) { + else if (type == mindplot.model.TopicShape.LINE) { result = new web2d.Line({strokeColor:"#495879",strokeWidth:1}); result.setSize = function(width, height) { this.size = {width:width, height:height}; @@ -220,7 +220,7 @@ mindplot.Topic = new Class({ getOuterShape : function() { if (!$defined(this._outerShape)) { - var rect = this.buildShape(mindplot.Topic.OUTER_SHAPE_ATTRIBUTES, mindplot.model.INodeModel.SHAPE_TYPE_ROUNDED_RECT); + var rect = this.buildShape(mindplot.Topic.OUTER_SHAPE_ATTRIBUTES, mindplot.model.TopicShape.ROUNDED_RECT); rect.setPosition(-2, -3); rect.setOpacity(0); this._outerShape = rect; @@ -596,7 +596,6 @@ mindplot.Topic = new Class({ }, isCollapsed : function() { - var model = this.getModel(); var result = false; var current = this.getParent(); @@ -637,7 +636,7 @@ mindplot.Topic = new Class({ outerShape.setOpacity(1); }, - handleMouseOut : function(event) { + handleMouseOut : function() { var outerShape = this.getOuterShape(); if (!this.isOnFocus()) { outerShape.setOpacity(0); @@ -936,7 +935,7 @@ mindplot.Topic = new Class({ } }, - _updatePositionOnChangeSize : function(oldSize, newSize) { + _updatePositionOnChangeSize : function() { $assert(false, "this method must be overwrited."); }, diff --git a/mindplot/src/main/javascript/TopicEditor.js b/mindplot/src/main/javascript/TopicEditor.js new file mode 100644 index 00000000..18181919 --- /dev/null +++ b/mindplot/src/main/javascript/TopicEditor.js @@ -0,0 +1,25 @@ +/* + * Copyright [2011] [wisemapping] + * + * Licensed under WiseMapping Public License, Version 1.0 (the "License"). + * It is basically the Apache License, Version 2.0 (the "License") plus the + * "powered by wisemapping" text requirement on every single page; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the license at + * + * http://www.wisemapping.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +mindplot.TopicEditor = new Class({ + Extends: Events, + initialize:function(topic) { + this._topic = topic; + } +}); + diff --git a/mindplot/src/main/javascript/model/INodeModel.js b/mindplot/src/main/javascript/model/INodeModel.js index 85a30414..78883e86 100644 --- a/mindplot/src/main/javascript/model/INodeModel.js +++ b/mindplot/src/main/javascript/model/INodeModel.js @@ -289,13 +289,19 @@ mindplot.model.INodeModel = new Class({ } }); +mindplot.model.TopicShape = +{ + RECTANGLE : 'rectagle', + ROUNDED_RECT : 'rounded rectagle', + ELIPSE : 'elipse', + LINE : 'line', + IMAGE : 'image' +}; + + mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE = 'CentralTopic'; mindplot.model.INodeModel.MAIN_TOPIC_TYPE = 'MainTopic'; -mindplot.model.INodeModel.SHAPE_TYPE_RECT = 'rectagle'; -mindplot.model.INodeModel.SHAPE_TYPE_ROUNDED_RECT = 'rounded rectagle'; -mindplot.model.INodeModel.SHAPE_TYPE_ELIPSE = 'elipse'; -mindplot.model.INodeModel.SHAPE_TYPE_LINE = 'line'; mindplot.model.INodeModel.MAIN_TOPIC_TO_MAIN_TOPIC_DISTANCE = 220; From f704e730c977e3366accad79ee8bc2055e8c3a68 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 29 Feb 2012 18:52:07 -0300 Subject: [PATCH 24/45] Minor bug fixing. --- mindplot/src/main/javascript/MediaTopic.js | 136 ------------------ mindplot/src/main/javascript/Topic.js | 5 +- .../src/main/javascript/model/INodeModel.js | 2 +- .../src/main/webapp/jsp/mindmapPrint.jsp | 2 +- 4 files changed, 5 insertions(+), 140 deletions(-) delete mode 100644 mindplot/src/main/javascript/MediaTopic.js diff --git a/mindplot/src/main/javascript/MediaTopic.js b/mindplot/src/main/javascript/MediaTopic.js deleted file mode 100644 index aaad649a..00000000 --- a/mindplot/src/main/javascript/MediaTopic.js +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright [2011] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -mindplot.MediaTopic = new Class({ - Extends:mindplot.Topic, - initialize : function(model, options) { - this.parent(model, options); - }, - - getInnerShape : function() { - if (!$defined(this._innerShape)) { - // Create inner box. - var model = this.getModel(); - - this._innerShape = new web2d.Image(); - this._innerShape.setHref(model.getImageUrl()); - this._innerShape.setPosition(0, 0); - } - return this._innerShape; - }, - - getOuterShape : function() { - if (!$defined(this._outerShape)) { - var rect = new web2d.Rect(0, mindplot.Topic.OUTER_SHAPE_ATTRIBUTES); - rect.setPosition(-2, -3); - rect.setOpacity(0); - this._outerShape = rect; - } - - return this._outerShape; - }, - - - _buildShape : function() { - var groupAttributes = {width: 100, height:100,coordSizeWidth:100,coordSizeHeight:100}; - var group = new web2d.Group(groupAttributes); - this._set2DElement(group); - - // Shape must be build based on the model width ... - var outerShape = this.getOuterShape(); - var innerShape = this.getInnerShape(); - var shrinkConnector = this.getShrinkConnector(); - - // Add to the group ... - group.appendChild(outerShape); - group.appendChild(innerShape); - - // Update figure size ... -// var model = this.getModel(); -// if (model.getLinks().length != 0 || model.getNotes().length != 0 || model.getIcons().length != 0) { -// this.getOrBuildIconGroup(); -// } - - if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { - shrinkConnector.addToWorkspace(group); - } - - // Register listeners ... - this._registerDefaultListenersToElement(group, this); - - - }, - - workoutOutgoingConnectionPoint : function(targetPosition) { - $assert(targetPosition, 'targetPoint can not be null'); - var pos = this.getPosition(); - - var result; - result = new core.Point(); - var groupPosition = this._elem2d.getPosition(); - var innerShareSize = this.getInnerShape().getSize(); - var isAtRight = mindplot.util.Shape.isAtRight(targetPosition, pos); - - result = mindplot.util.Shape.calculateRectConnectionPoint(pos, this.getSize(), isAtRight, true); - return result; - }, - - createDragNode : function(layoutManager) { - var result = this.parent(layoutManager); - - // Is the node already connected ? - var targetTopic = this.getOutgoingConnectedTopic(); - if ($defined(targetTopic)) { - result.connectTo(targetTopic); - result.setVisibility(false); - } - return result; - }, - - _adjustShapes : function() { - if (this._isInWorkspace) { - - var size = this.getModel().getSize(); - this.setSize(size, true); - - } - }, - - _updatePositionOnChangeSize : function(oldSize, newSize) { - - var xOffset = Math.round((newSize.width - oldSize.width) / 2); - var pos = this.getPosition(); - if ($defined(pos)) { - if (pos.x > 0) { - pos.x = pos.x + xOffset; - } else { - pos.x = pos.x - xOffset; - } - this.setPosition(pos); - } - }, - - updateTopicShape : function() { - // Todo: verify ... - }, - - closeEditors : function() { - //@Todo: - } -}); diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js index 9e62422d..15ec72d8 100644 --- a/mindplot/src/main/javascript/Topic.js +++ b/mindplot/src/main/javascript/Topic.js @@ -68,7 +68,6 @@ mindplot.Topic = new Class({ setShapeType : function(type) { this._setShapeType(type, true); - }, getParent : function() { @@ -164,8 +163,10 @@ mindplot.Topic = new Class({ if (type == mindplot.model.TopicShape.RECTANGLE) { result = new web2d.Rect(0, attributes); + }else if(type == mindplot.model.TopicShape.IMAGE){ + throw "Must be implemented ..."; } - else if (type == mindplot.model.TopicShape.ELIPSE) { + else if (type == mindplot.model.TopicShape.ELLIPSE) { result = new web2d.Rect(0.9, attributes); } else if (type == mindplot.model.TopicShape.ROUNDED_RECT) { diff --git a/mindplot/src/main/javascript/model/INodeModel.js b/mindplot/src/main/javascript/model/INodeModel.js index 78883e86..e0e98570 100644 --- a/mindplot/src/main/javascript/model/INodeModel.js +++ b/mindplot/src/main/javascript/model/INodeModel.js @@ -293,7 +293,7 @@ mindplot.model.TopicShape = { RECTANGLE : 'rectagle', ROUNDED_RECT : 'rounded rectagle', - ELIPSE : 'elipse', + ELLIPSE : 'elipse', LINE : 'line', IMAGE : 'image' }; diff --git a/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp b/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp index c6800919..8a4db9e9 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp @@ -42,7 +42,7 @@ designer = buildDesigner(editorProperties); var domDocument = core.Utils.createDocumentFromText(mapXml); - var serializer = mindplot.persistence.MLSerializerFactory.getSerializerFromDocument(domDocument); + var serializer = mindplot.persistence.XMLSerializerFactory.getSerializerFromDocument(domDocument); var mindmap = serializer.loadFromDom(domDocument, mapId); // Now, load the map ... From 9f4c928d13b3a8de5177bce5bc8273dd68fd0e1e Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 29 Feb 2012 20:22:27 -0300 Subject: [PATCH 25/45] Add support for Freemind to Wise transformation: curl http://localhost:8080/service/transform.wise --data @fonts.mm -H "Content-Type:application/freemind" --post301 --- .../com/wisemapping/importer/Importer.java | 6 +-- .../rest/TransformerController.java | 12 +++++ .../rest/view/ImportTransformationView.java | 52 +++++++++++++++++++ .../wisemapping/rest/view/TransformView.java | 22 ++++---- .../main/webapp/WEB-INF/wisemapping-rest.xml | 6 +++ .../webapp/WEB-INF/wisemapping-security.xml | 2 +- 6 files changed, 83 insertions(+), 17 deletions(-) create mode 100644 wise-webapp/src/main/java/com/wisemapping/rest/view/ImportTransformationView.java diff --git a/wise-webapp/src/main/java/com/wisemapping/importer/Importer.java b/wise-webapp/src/main/java/com/wisemapping/importer/Importer.java index 61f064ad..f54ecaff 100755 --- a/wise-webapp/src/main/java/com/wisemapping/importer/Importer.java +++ b/wise-webapp/src/main/java/com/wisemapping/importer/Importer.java @@ -19,11 +19,11 @@ package com.wisemapping.importer; import com.wisemapping.model.MindMap; +import org.jetbrains.annotations.NotNull; import java.io.IOException; import java.io.InputStream; -public interface Importer -{ - public MindMap importMap(String mapName,String description,InputStream input) throws ImporterException; +public interface Importer { + public MindMap importMap(@NotNull String mapName, @NotNull String description, @NotNull InputStream input) throws ImporterException; } diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java b/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java index 2c4a1819..8221ab5e 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java @@ -81,6 +81,18 @@ public class TransformerController extends BaseController { return new ModelAndView("transformViewFreemind", values); } + + @RequestMapping(method = RequestMethod.POST, value = "/transform", produces = {"application/wisemapping+xml"}, consumes = {"application/freemind"}) + @ResponseBody + public ModelAndView transformWisemapping(@RequestBody @Nullable final String content) throws IOException { + final Map values = new HashMap(); + if (content == null || content.length() == 0) { + throw new IllegalArgumentException("Body can not be null."); + } + values.put("content", content); + return new ModelAndView("transformViewWise", values); + } + @RequestMapping(method = RequestMethod.POST, value = "/transform", consumes = {"application/x-www-form-urlencoded"}) public ModelAndView transform(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response) throws IOException { diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/view/ImportTransformationView.java b/wise-webapp/src/main/java/com/wisemapping/rest/view/ImportTransformationView.java new file mode 100644 index 00000000..31e290c4 --- /dev/null +++ b/wise-webapp/src/main/java/com/wisemapping/rest/view/ImportTransformationView.java @@ -0,0 +1,52 @@ +package com.wisemapping.rest.view; + + +import com.wisemapping.importer.ImportFormat; +import com.wisemapping.importer.Importer; +import com.wisemapping.importer.ImporterException; +import com.wisemapping.importer.ImporterFactory; +import com.wisemapping.model.MindMap; +import org.jetbrains.annotations.NotNull; +import org.springframework.web.servlet.view.AbstractView; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.util.Map; + +public class ImportTransformationView extends AbstractView { + + private String contentType; + private Importer importer; + + public ImportTransformationView(@NotNull final String contentType) throws ImporterException { + ImporterFactory exporterFactory = ImporterFactory.getInstance(); + importer = exporterFactory.getImporter(ImportFormat.FREEMIND); + this.contentType = contentType; + } + + @Override + protected void renderMergedOutputModel(@NotNull Map viewMap, @NotNull HttpServletRequest request, @NotNull final HttpServletResponse response) throws Exception { + final String content = (String) viewMap.get("content"); + final String filename = (String) viewMap.get("filename"); + + // Convert to map ... + final InputStream is = new ByteArrayInputStream(content.getBytes("UTF-8")); + final MindMap mindMap = importer.importMap("filename", "filename", is); + + // Set file name... + final String fileName = (filename != null ? filename : "map") + "." + "xwise"; + response.setHeader("Content-Disposition", "attachment;filename=" + fileName); + + // Write the conversion content ... + final ServletOutputStream outputStream = response.getOutputStream(); + outputStream.print(mindMap.getXmlStr()); + } + + @Override + public String getContentType() { + return contentType; + } +} diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/view/TransformView.java b/wise-webapp/src/main/java/com/wisemapping/rest/view/TransformView.java index 6b75a502..2ec1c1b1 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/view/TransformView.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/view/TransformView.java @@ -43,16 +43,6 @@ public class TransformView extends AbstractView { } } - final ByteArrayOutputStream bos = new ByteArrayOutputStream(); - - // Change image link URL. - setBaseBaseImgUrl(exportFormat, properties); - if (exportFormat == ExportFormat.FREEMIND) { - ExporterFactory.export(properties, content, bos, null); - } else { - ExporterFactory.export(properties, null, bos, content); - } - // Set format content type... final String contentType = exportFormat.getContentType(); response.setContentType(contentType); @@ -61,9 +51,16 @@ public class TransformView extends AbstractView { final String fileName = (filename != null ? filename : "map") + "." + exportFormat.getFileExtension(); response.setHeader("Content-Disposition", "attachment;filename=" + fileName); - // Write content ... + // Change image link URL. + setBaseBaseImgUrl(exportFormat, properties); + + // Write the conversion content ... final ServletOutputStream outputStream = response.getOutputStream(); - outputStream.write(bos.toByteArray()); + if (exportFormat == ExportFormat.FREEMIND) { + ExporterFactory.export(properties, content, outputStream, null); + } else { + ExporterFactory.export(properties, null, outputStream, content); + } } @Override @@ -71,7 +68,6 @@ public class TransformView extends AbstractView { return contentType; } - private void setBaseBaseImgUrl(@NotNull ExportFormat format, @NotNull ExportProperties properties) { final String baseUrl; diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml index 31b0d02f..ed8f588e 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml @@ -38,6 +38,8 @@ + + @@ -79,4 +81,8 @@ + + + + \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml index 256c2640..0092731a 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml @@ -32,7 +32,7 @@ - + From dc4f47ab7addbfb138452ce67554d1b666a1ae5e Mon Sep 17 00:00:00 2001 From: Gonzalo Bellver Date: Tue, 6 Mar 2012 15:53:22 -0300 Subject: [PATCH 26/45] Solved issue when overlapping a free node to another branch --- .../javascript/layout/AbstractBasicSorter.js | 1 + .../src/test/javascript/static/layout.html | 4 ++ .../javascript/static/test/FreeTestSuite.js | 39 +++++++++++++++++++ 3 files changed, 44 insertions(+) diff --git a/mindplot/src/main/javascript/layout/AbstractBasicSorter.js b/mindplot/src/main/javascript/layout/AbstractBasicSorter.js index e78d6af7..b8c71926 100644 --- a/mindplot/src/main/javascript/layout/AbstractBasicSorter.js +++ b/mindplot/src/main/javascript/layout/AbstractBasicSorter.js @@ -31,6 +31,7 @@ mindplot.layout.AbstractBasicSorter = new Class({ _computeChildrenHeight : function(treeSet, node, heightCache) { var height = node.getSize().height + (this._getVerticalPadding() * 2); // 2* Top and down padding; + height += Math.abs(node.getFreeDisplacement().y); var result; var children = treeSet.getChildren(node); diff --git a/mindplot/src/test/javascript/static/layout.html b/mindplot/src/test/javascript/static/layout.html index f71c5484..68288fd0 100644 --- a/mindplot/src/test/javascript/static/layout.html +++ b/mindplot/src/test/javascript/static/layout.html @@ -178,6 +178,10 @@

testBalancedFreePredict:

+ +

testFreeReorder:

+
+
diff --git a/mindplot/src/test/javascript/static/test/FreeTestSuite.js b/mindplot/src/test/javascript/static/test/FreeTestSuite.js index b4952f29..e43b9c72 100644 --- a/mindplot/src/test/javascript/static/test/FreeTestSuite.js +++ b/mindplot/src/test/javascript/static/test/FreeTestSuite.js @@ -27,6 +27,7 @@ mindplot.layout.FreeTestSuite = new Class({ this.testSiblingOverlapping(); this.testRootNodeChildrenPositioning(); this.testBalancedFreePredict(); + this.testFreeReorder(); }, testFreePosition: function() { @@ -362,6 +363,44 @@ mindplot.layout.FreeTestSuite = new Class({ console.log("OK!\n\n"); }, + testFreeReorder: function() { + console.log("testFreeReorder:"); + var position = {x:0,y:0}; + var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + + // Prepare a sample graph ... + manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,1,0); + manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,4,0); + manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,5,1); + manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,6,2); + + manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,2,2); + manager.addNode(7, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2,7,0); + manager.addNode(8, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2,8,1); + manager.addNode(9, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2,9,2); + manager.addNode(10, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2,10,3); + + manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,3,4); + manager.addNode(11, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,11,0); + manager.addNode(12, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,12,1); + manager.addNode(13, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,13,2); + manager.addNode(14, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,14,3); + manager.addNode(15, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,15,4); + manager.addNode(16, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,16,5); + + manager.layout(); +// var graph1 = manager.plot("testFreeReorder1", {width:800, height:800}); + + manager.moveNode(14, {x:270, y:-160}); + manager.layout(); + var graph1 = manager.plot("testFreeReorder2", {width:800, height:1200}); + + $assert(manager.find(14).getPosition().y > manager.find(10).getPosition().y, "Node 14 should be below branch 2"); + + + console.log("OK!\n\n"); + }, + _assertFreePosition: function(manager, id, position) { if (id != null && position.x != null && position.y != null) { var node = manager.find(id); From 6506b60977359367729dae0c50bdb04ee106aa3e Mon Sep 17 00:00:00 2001 From: Gonzalo Bellver Date: Tue, 6 Mar 2012 18:01:56 -0300 Subject: [PATCH 27/45] Fixed branch overlapping bug --- .../main/javascript/layout/OriginalLayout.js | 14 +++---- .../main/javascript/layout/SymmetricSorter.js | 4 ++ .../src/test/javascript/static/layout.html | 5 ++- .../javascript/static/test/FreeTestSuite.js | 41 +++++++++++++++++-- 4 files changed, 50 insertions(+), 14 deletions(-) diff --git a/mindplot/src/main/javascript/layout/OriginalLayout.js b/mindplot/src/main/javascript/layout/OriginalLayout.js index b8b4064f..6c39ca74 100644 --- a/mindplot/src/main/javascript/layout/OriginalLayout.js +++ b/mindplot/src/main/javascript/layout/OriginalLayout.js @@ -157,7 +157,8 @@ mindplot.layout.OriginalLayout = new Class({ }, this); if (!sibling.isFree() || overlappingOccurs) { - this._treeSet.shiftBranchPosition(sibling, 0, node.getFreeDisplacement().y); + var sAmount = node.getFreeDisplacement().y; + this._treeSet.shiftBranchPosition(sibling, 0, sAmount); shiftedBranches.push(sibling); } }, this); @@ -167,14 +168,9 @@ mindplot.layout.OriginalLayout = new Class({ }); branchesToShift.forEach(function(branch) { - var overlappingOccurs = shiftedBranches.some(function(shiftedBranch) { - return this._branchesOverlap(shiftedBranch, branch, heightById); - }, this); - - if (overlappingOccurs) { - this._treeSet.shiftBranchPosition(branch, 0, node.getFreeDisplacement().y); - shiftedBranches.push(branch); - } + var bAmount = node.getFreeDisplacement().y; + this._treeSet.shiftBranchPosition(branch, 0, bAmount); + shiftedBranches.push(branch); last = branch; },this); }, diff --git a/mindplot/src/main/javascript/layout/SymmetricSorter.js b/mindplot/src/main/javascript/layout/SymmetricSorter.js index 56ae4cc3..b611b79f 100644 --- a/mindplot/src/main/javascript/layout/SymmetricSorter.js +++ b/mindplot/src/main/javascript/layout/SymmetricSorter.js @@ -176,6 +176,10 @@ mindplot.layout.SymmetricSorter = new Class({ toString:function() { return "Symmetric Sorter"; + }, + + _getVerticalPadding: function() { + return mindplot.layout.SymmetricSorter.INTERNODE_VERTICAL_PADDING; } }); diff --git a/mindplot/src/test/javascript/static/layout.html b/mindplot/src/test/javascript/static/layout.html index 68288fd0..49c8d415 100644 --- a/mindplot/src/test/javascript/static/layout.html +++ b/mindplot/src/test/javascript/static/layout.html @@ -181,7 +181,10 @@

testFreeReorder:

-
+ +

testFreeOverlap:

+
+
diff --git a/mindplot/src/test/javascript/static/test/FreeTestSuite.js b/mindplot/src/test/javascript/static/test/FreeTestSuite.js index e43b9c72..bdb0d2c8 100644 --- a/mindplot/src/test/javascript/static/test/FreeTestSuite.js +++ b/mindplot/src/test/javascript/static/test/FreeTestSuite.js @@ -28,6 +28,7 @@ mindplot.layout.FreeTestSuite = new Class({ this.testRootNodeChildrenPositioning(); this.testBalancedFreePredict(); this.testFreeReorder(); + this.testFreeOverlap(); }, testFreePosition: function() { @@ -389,14 +390,46 @@ mindplot.layout.FreeTestSuite = new Class({ manager.addNode(16, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,16,5); manager.layout(); -// var graph1 = manager.plot("testFreeReorder1", {width:800, height:800}); - manager.moveNode(14, {x:270, y:-160}); manager.layout(); - var graph1 = manager.plot("testFreeReorder2", {width:800, height:1200}); - + manager.plot("testFreeReorder1", {width:800, height:1200}); $assert(manager.find(14).getPosition().y > manager.find(10).getPosition().y, "Node 14 should be below branch 2"); + console.log("OK!\n\n"); + }, + + testFreeOverlap: function() { + console.log("testFreeOverlap:"); + var position = {x:0,y:0}; + var manager = new mindplot.layout.LayoutManager(0, mindplot.layout.TestSuite.ROOT_NODE_SIZE); + + // Prepare a sample graph ... + manager.addNode(1, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,1,0); + manager.addNode(4, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,4,0); + manager.addNode(5, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,5,1); + manager.addNode(6, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(1,6,2); + + manager.addNode(2, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,2,2); + manager.addNode(7, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2,7,0); + manager.addNode(8, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2,8,1); + manager.addNode(9, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2,9,2); + manager.addNode(10, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(2,10,3); + + manager.addNode(3, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(0,3,4); + manager.addNode(11, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,11,0); + manager.addNode(12, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,12,1); + manager.addNode(13, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,13,2); + manager.addNode(14, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,14,3); + manager.addNode(15, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,15,4); + manager.addNode(16, mindplot.layout.TestSuite.NODE_SIZE, position).connectNode(3,16,5); + + manager.layout(); + manager.plot("testFreeOverlap1", {width:800, height:1200}); + + manager.moveNode(14, {x:270, y:7}); + manager.layout(); + manager.plot("testFreeOverlap2", {width:800, height:1200}); + $assert(manager.find(2).getPosition().y > manager.find(1).getPosition().y, "Branches 1 and 2 are overlapping"); console.log("OK!\n\n"); }, From 25f1e2f549e8fe0177bae6cb81a18116bc3a5392 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 6 Mar 2012 23:26:11 -0300 Subject: [PATCH 28/45] - Remove commited JAXB stubs - Export support multiline notes. --- pom.xml | 15 +- wise-webapp/pom.xml | 48 + .../exporter/FreemindExporter.java | 62 +- .../wisemapping/importer/ImporterFactory.java | 109 +- .../importer/JaxbCDATAMarshaller.java | 36 + .../importer/freemind/FreemindImporter.java | 174 ++- .../com/wisemapping/schemas/SVGWiseMap.xsd | 147 -- .../com/wisemapping/schemas/VMLWiseMap.xsd | 171 --- .../com/wisemapping/schemas/sampleSVG.xml | 228 ---- .../com/wisemapping/schemas/sampleVML.html | 577 -------- .../com/wisemapping/schemas/sampleVML.xml | 612 --------- .../java/com/wisemapping/util/JAXBUtils.java | 139 +- .../main/java/com/wisemapping/xml/Style.java | 161 --- .../wisemapping/xml/SvgToVMLConverter.java | 442 ------ .../wisemapping/xml/VmlToSvgConverter.java | 450 ------ .../wisemapping/xml/freemind/Arrowlink.java | 229 ---- .../com/wisemapping/xml/freemind/Cloud.java | 67 - .../com/wisemapping/xml/freemind/Edge.java | 121 -- .../com/wisemapping/xml/freemind/Font.java | 162 --- .../com/wisemapping/xml/freemind/Hook.java | 126 -- .../com/wisemapping/xml/freemind/Html.java | 79 -- .../com/wisemapping/xml/freemind/Icon.java | 67 - .../com/wisemapping/xml/freemind/Map.java | 99 -- .../com/wisemapping/xml/freemind/Node.java | 466 ------- .../xml/freemind/ObjectFactory.java | 140 -- .../wisemapping/xml/freemind/Parameters.java | 68 - .../wisemapping/xml/freemind/Richcontent.java | 106 -- .../main/java/com/wisemapping/xml/mindmap.xsd | 65 - .../com/wisemapping/xml/mindmap/Icon.java | 92 -- .../com/wisemapping/xml/mindmap/Link.java | 92 -- .../java/com/wisemapping/xml/mindmap/Map.java | 165 --- .../com/wisemapping/xml/mindmap/Note.java | 65 - .../xml/mindmap/ObjectFactory.java | 110 -- .../xml/mindmap/RelationshipType.java | 254 ---- .../wisemapping/xml/mindmap/TopicType.java | 431 ------ .../com/wisemapping/xml/svgmap/Ellipse.java | 269 ---- .../java/com/wisemapping/xml/svgmap/G.java | 288 ---- .../java/com/wisemapping/xml/svgmap/Line.java | 278 ---- .../wisemapping/xml/svgmap/ObjectFactory.java | 104 -- .../com/wisemapping/xml/svgmap/Polyline.java | 239 ---- .../java/com/wisemapping/xml/svgmap/Rect.java | 341 ----- .../java/com/wisemapping/xml/svgmap/Svg.java | 331 ----- .../java/com/wisemapping/xml/svgmap/Text.java | 298 ---- .../wisemapping/xml/svgmap/package-info.java | 26 - .../com/wisemapping/xml/vmlmap/Element.java | 169 --- .../java/com/wisemapping/xml/vmlmap/Fill.java | 79 -- .../com/wisemapping/xml/vmlmap/Group.java | 318 ----- .../java/com/wisemapping/xml/vmlmap/Line.java | 184 --- .../wisemapping/xml/vmlmap/ObjectFactory.java | 139 -- .../java/com/wisemapping/xml/vmlmap/Oval.java | 166 --- .../com/wisemapping/xml/vmlmap/Polyline.java | 184 --- .../java/com/wisemapping/xml/vmlmap/Rect.java | 158 --- .../com/wisemapping/xml/vmlmap/Roundrect.java | 166 --- .../com/wisemapping/xml/vmlmap/Shape.java | 112 -- .../com/wisemapping/xml/vmlmap/Stroke.java | 88 -- .../com/wisemapping/xml/vmlmap/Textbox.java | 211 --- .../wisemapping/xml/vmlmap/package-info.java | 26 - .../freemind_0.9.0.xsd} | 316 ++--- wise-webapp/src/main/resources/mindmap.xjb | 14 + wise-webapp/src/main/resources/mindmap.xsd | 131 +- .../src/main/resources/wiseservices.wsdl | 106 -- wise-webapp/src/test/data/freemind/basic.mmr | 16 +- wise-webapp/src/test/data/freemind/basic.wxml | 31 +- wise-webapp/src/test/data/freemind/fonts.mmr | 41 +- wise-webapp/src/test/data/freemind/fonts.wxml | 56 +- wise-webapp/src/test/data/freemind/i18n.mmr | 9 +- wise-webapp/src/test/data/freemind/i18n.wxml | 16 +- wise-webapp/src/test/data/freemind/icons.mmr | 199 ++- wise-webapp/src/test/data/freemind/icons.wxml | 296 +++- wise-webapp/src/test/data/freemind/links.mmr | 15 +- wise-webapp/src/test/data/freemind/links.wxml | 19 +- .../src/test/data/freemind/longnodes.mmr | 7 +- .../src/test/data/freemind/longnodes.wxml | 10 +- .../src/test/data/freemind/node-styles.mmr | 51 +- .../src/test/data/freemind/node-styles.wxml | 64 +- .../src/test/data/freemind/process.mmr | 122 +- .../src/test/data/freemind/process.wxml | 228 +++- wise-webapp/src/test/data/wisemaps/bigmap.mmr | 277 +++- .../src/test/data/wisemaps/simple-maps.mmr | 1214 +++++++++++++++++ .../src/test/data/wisemaps/welcome.mmr | 37 + .../src/test/data/wisemaps/welcome.wxml | 53 + .../wisemapping/test/freemind/ExportTest.java | 8 +- .../test/freemind/ImportExportTest.java | 13 +- wise-webapp/testng.xml | 2 +- 84 files changed, 3322 insertions(+), 10578 deletions(-) create mode 100644 wise-webapp/src/main/java/com/wisemapping/importer/JaxbCDATAMarshaller.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/schemas/SVGWiseMap.xsd delete mode 100644 wise-webapp/src/main/java/com/wisemapping/schemas/VMLWiseMap.xsd delete mode 100644 wise-webapp/src/main/java/com/wisemapping/schemas/sampleSVG.xml delete mode 100644 wise-webapp/src/main/java/com/wisemapping/schemas/sampleVML.html delete mode 100644 wise-webapp/src/main/java/com/wisemapping/schemas/sampleVML.xml delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/Style.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/SvgToVMLConverter.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/VmlToSvgConverter.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/freemind/Arrowlink.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/freemind/Cloud.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/freemind/Edge.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/freemind/Font.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/freemind/Hook.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/freemind/Html.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/freemind/Icon.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/freemind/Map.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/freemind/Node.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/freemind/ObjectFactory.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/freemind/Parameters.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/freemind/Richcontent.java delete mode 100755 wise-webapp/src/main/java/com/wisemapping/xml/mindmap.xsd delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Icon.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Link.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Map.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Note.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/mindmap/ObjectFactory.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/mindmap/RelationshipType.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/mindmap/TopicType.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Ellipse.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/svgmap/G.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Line.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/svgmap/ObjectFactory.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Polyline.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Rect.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Svg.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Text.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/svgmap/package-info.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Element.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Fill.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Group.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Line.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/ObjectFactory.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Oval.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Polyline.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Rect.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Roundrect.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Shape.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Stroke.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Textbox.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/package-info.java rename wise-webapp/src/main/{java/com/wisemapping/xml/freemind_0_9_0.xsd => resources/freemind_0.9.0.xsd} (97%) create mode 100644 wise-webapp/src/main/resources/mindmap.xjb mode change 100755 => 100644 wise-webapp/src/main/resources/mindmap.xsd delete mode 100644 wise-webapp/src/main/resources/wiseservices.wsdl create mode 100644 wise-webapp/src/test/data/wisemaps/welcome.mmr create mode 100644 wise-webapp/src/test/data/wisemaps/welcome.wxml diff --git a/pom.xml b/pom.xml index 04509022..1d518924 100644 --- a/pom.xml +++ b/pom.xml @@ -33,14 +33,13 @@ WiseMapping - http://www.wisemapping.com + http://www.wisemapping.org/ org.apache.maven.plugins - true maven-resources-plugin 2.5 @@ -53,20 +52,10 @@ maven-compiler-plugin 2.3.2 - 1.5 + 1.6 1.6 - - org.apache.maven.plugins - true - maven-checkstyle-plugin - 2.8 - - config/maven_checks.xml - - - org.apache.maven.plugins maven-assembly-plugin diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index f9083b49..34ff62b2 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -260,6 +260,11 @@ slf4j-api 1.6.4 + + xerces + xercesImpl + 2.10.0 + @@ -433,6 +438,49 @@ 10 + + + org.jvnet.jaxb2.maven2 + maven-jaxb2-plugin + + + mindmap-generate + + generate + + + src/main/resources/ + + mindmap.xsd + + src/main/resources/ + + mindmap.xjb + + com.wisemapping.jaxb.mindmap + ${project.build.directory}/generated-sources/xjc1 + + + + freemind-generate + + generate + + + src/main/resources/ + + freemind_0.9.0.xsd + + src/main/resources/ + + freemind_0.9.0.xjb + + com.wisemapping.jaxb.freemind + ${project.build.directory}/generated-sources/xjc2 + + + + diff --git a/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java b/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java index 09d63ad0..1a303bd5 100755 --- a/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java +++ b/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java @@ -23,10 +23,10 @@ import com.wisemapping.importer.freemind.FreemindIconConverter; import com.wisemapping.model.MindMap; import com.wisemapping.model.ShapeStyle; import com.wisemapping.util.JAXBUtils; -import com.wisemapping.xml.freemind.*; -import com.wisemapping.xml.mindmap.RelationshipType; -import com.wisemapping.xml.mindmap.TopicType; -import com.wisemapping.xml.mindmap.Icon; +import com.wisemapping.jaxb.freemind.*; +import com.wisemapping.jaxb.mindmap.RelationshipType; +import com.wisemapping.jaxb.mindmap.TopicType; +import com.wisemapping.jaxb.mindmap.Icon; import org.jetbrains.annotations.NotNull; import javax.xml.bind.JAXBException; @@ -43,7 +43,7 @@ public class FreemindExporter private static final String FREE_MIND_VERSION = "0.9.0"; private static final String POSITION_LEFT = "left"; private static final String POSITION_RIGHT = "right"; - private com.wisemapping.xml.freemind.ObjectFactory objectFactory; + private com.wisemapping.jaxb.freemind.ObjectFactory objectFactory; private static final String EMPTY_FONT_STYLE = ";;;;;"; private Map nodesMap = null; @@ -54,15 +54,15 @@ public class FreemindExporter public void export(byte[] xml, OutputStream outputStream) throws ExportException { - objectFactory = new com.wisemapping.xml.freemind.ObjectFactory(); + objectFactory = new com.wisemapping.jaxb.freemind.ObjectFactory(); nodesMap = new HashMap(); - final com.wisemapping.xml.mindmap.Map mindmapMap; + final com.wisemapping.jaxb.mindmap.Map mindmapMap; try { final ByteArrayInputStream stream = new ByteArrayInputStream(xml); - mindmapMap = (com.wisemapping.xml.mindmap.Map) JAXBUtils.getMapObject(stream, "com.wisemapping.xml.mindmap"); + mindmapMap = (com.wisemapping.jaxb.mindmap.Map) JAXBUtils.getMapObject(stream, "com.wisemapping.jaxb.mindmap"); - final com.wisemapping.xml.freemind.Map freemindMap = objectFactory.createMap(); + final com.wisemapping.jaxb.freemind.Map freemindMap = objectFactory.createMap(); freemindMap.setVersion(FREE_MIND_VERSION); @@ -94,17 +94,17 @@ public class FreemindExporter Arrowlink arrowlink = objectFactory.createArrowlink(); Node dstNode = nodesMap.get(relationship.getDestTopicId()); arrowlink.setDESTINATION(dstNode.getID()); - if (relationship.isEndArrow()!=null && relationship.isEndArrow()) + if (relationship.isEndArrow() != null && relationship.isEndArrow()) arrowlink.setENDARROW("Default"); - if (relationship.isStartArrow()!=null && relationship.isStartArrow()) + if (relationship.isStartArrow() != null && relationship.isStartArrow()) arrowlink.setSTARTARROW("Default"); List cloudOrEdge = srcNode.getArrowlinkOrCloudOrEdge(); cloudOrEdge.add(arrowlink); } - JAXBUtils.saveMap(freemindMap, outputStream, "com.wisemapping.xml.freemind"); + JAXBUtils.saveMap(freemindMap, outputStream, "com.wisemapping.jaxb.freemind"); } catch (JAXBException e) { throw new ExportException(e); } @@ -128,9 +128,14 @@ public class FreemindExporter } } - private void setTopicPropertiesToNode(@NotNull com.wisemapping.xml.freemind.Node freemindNode, @NotNull com.wisemapping.xml.mindmap.TopicType mindmapTopic, boolean isRoot) { + private void setTopicPropertiesToNode(@NotNull com.wisemapping.jaxb.freemind.Node freemindNode, @NotNull com.wisemapping.jaxb.mindmap.TopicType mindmapTopic, boolean isRoot) { freemindNode.setID("ID_" + mindmapTopic.getId()); - freemindNode.setTEXT(mindmapTopic.getText()); + + String text = mindmapTopic.getTextAttr(); + if (text == null || text.isEmpty()) { + text = mindmapTopic.getText(); + } + freemindNode.setTEXT(text); freemindNode.setBACKGROUNDCOLOR(mindmapTopic.getBgColor()); final String shape = mindmapTopic.getShape(); @@ -144,33 +149,24 @@ public class FreemindExporter freemindNode.setSTYLE(style); } addIconNode(freemindNode, mindmapTopic); - addLinkNode(freemindNode, mindmapTopic); - addFontNode(freemindNode, mindmapTopic); addEdgeNode(freemindNode, mindmapTopic); addNote(freemindNode, mindmapTopic); - final String position = mindmapTopic.getPosition(); - if (position != null && !position.isEmpty()) { - freemindNode.setWcoords(position); - } - - final Integer order = mindmapTopic.getOrder(); - if (order != null) { - freemindNode.setWorder(BigInteger.valueOf(order)); - } - Boolean shrink = mindmapTopic.isShrink(); if (shrink != null && shrink) freemindNode.setFOLDED(String.valueOf(shrink)); } } - private void addNote(com.wisemapping.xml.freemind.Node freemindNode, com.wisemapping.xml.mindmap.TopicType mindmapTopic) { + private void addNote(com.wisemapping.jaxb.freemind.Node freemindNode, com.wisemapping.jaxb.mindmap.TopicType mindmapTopic) { if (mindmapTopic.getNote() != null) { final Hook note = new Hook(); - String textNote = mindmapTopic.getNote().getText(); + String textNote = mindmapTopic.getNote().getTextAttr(); + if (textNote == null || textNote.isEmpty()) { + textNote = mindmapTopic.getNote().getText(); + } textNote = textNote.replaceAll("%0A", "\n"); note.setNAME("accessories/plugins/NodeNote.properties"); note.setText(textNote); @@ -178,14 +174,14 @@ public class FreemindExporter } } - private void addLinkNode(com.wisemapping.xml.freemind.Node freemindNode, com.wisemapping.xml.mindmap.TopicType mindmapTopic) { + private void addLinkNode(com.wisemapping.jaxb.freemind.Node freemindNode, com.wisemapping.jaxb.mindmap.TopicType mindmapTopic) { if (mindmapTopic.getLink() != null) { final String url = mindmapTopic.getLink().getUrl(); freemindNode.setLINK(url); } } - private void addIconNode(com.wisemapping.xml.freemind.Node freemindNode, com.wisemapping.xml.mindmap.TopicType mindmapTopic) { + private void addIconNode(com.wisemapping.jaxb.freemind.Node freemindNode, com.wisemapping.jaxb.mindmap.TopicType mindmapTopic) { if (mindmapTopic.getIcon() != null) { final List iconsList = mindmapTopic.getIcon(); for (Icon icon : iconsList) { @@ -193,7 +189,7 @@ public class FreemindExporter final String freemindIconId = FreemindIconConverter.toFreemindId(id); if (freemindIconId != null) { - com.wisemapping.xml.freemind.Icon freemindIcon = new com.wisemapping.xml.freemind.Icon(); + com.wisemapping.jaxb.freemind.Icon freemindIcon = new com.wisemapping.jaxb.freemind.Icon(); freemindIcon.setBUILTIN(freemindIconId); freemindNode.getArrowlinkOrCloudOrEdge().add(freemindIcon); } @@ -201,7 +197,7 @@ public class FreemindExporter } } - private void addEdgeNode(com.wisemapping.xml.freemind.Node freemindNode, com.wisemapping.xml.mindmap.TopicType mindmapTopic) { + private void addEdgeNode(com.wisemapping.jaxb.freemind.Node freemindNode, com.wisemapping.jaxb.mindmap.TopicType mindmapTopic) { if (mindmapTopic.getBrColor() != null) { final Edge edgeNode = objectFactory.createEdge(); edgeNode.setCOLOR(mindmapTopic.getBrColor()); @@ -214,7 +210,7 @@ public class FreemindExporter * eg: Verdana;10;#ffffff;bold;italic; * */ - private void addFontNode(@NotNull com.wisemapping.xml.freemind.Node freemindNode, com.wisemapping.xml.mindmap.TopicType mindmapTopic) { + private void addFontNode(@NotNull com.wisemapping.jaxb.freemind.Node freemindNode, com.wisemapping.jaxb.mindmap.TopicType mindmapTopic) { final String fontStyle = mindmapTopic.getFontStyle(); if (fontStyle != null && fontStyle.length() != 0) { final Font font = objectFactory.createFont(); diff --git a/wise-webapp/src/main/java/com/wisemapping/importer/ImporterFactory.java b/wise-webapp/src/main/java/com/wisemapping/importer/ImporterFactory.java index 718289ca..c4f1a349 100755 --- a/wise-webapp/src/main/java/com/wisemapping/importer/ImporterFactory.java +++ b/wise-webapp/src/main/java/com/wisemapping/importer/ImporterFactory.java @@ -1,54 +1,55 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -package com.wisemapping.importer; - -import com.wisemapping.importer.freemind.FreemindImporter; - -public class ImporterFactory -{ - - private static ImporterFactory instance = null; - - private ImporterFactory() {} - - public static ImporterFactory getInstance() - { - if (instance == null) - { - instance = new ImporterFactory(); - } - return instance; - } - - public Importer getImporter(ImportFormat format) - throws ImporterException - { - Importer importer; - switch (format) - { - case FREEMIND: - importer = new FreemindImporter(); - break; - default: - throw new ImporterException("Invalid format type:" + format); - } - - return importer; - } -} +/* +* Copyright [2011] [wisemapping] +* +* Licensed under WiseMapping Public License, Version 1.0 (the "License"). +* It is basically the Apache License, Version 2.0 (the "License") plus the +* "powered by wisemapping" text requirement on every single page; +* you may not use this file except in compliance with the License. +* You may obtain a copy of the license at +* +* http://www.wisemapping.org/license +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package com.wisemapping.importer; + +import com.wisemapping.importer.freemind.FreemindImporter; +import org.jetbrains.annotations.NotNull; + +public class ImporterFactory +{ + + private static ImporterFactory instance = null; + + private ImporterFactory() {} + + public static ImporterFactory getInstance() + { + if (instance == null) + { + instance = new ImporterFactory(); + } + return instance; + } + + public Importer getImporter(@NotNull ImportFormat format) + throws ImporterException + { + Importer importer; + switch (format) + { + case FREEMIND: + importer = new FreemindImporter(); + break; + default: + throw new ImporterException("Invalid format type:" + format); + } + + return importer; + } +} diff --git a/wise-webapp/src/main/java/com/wisemapping/importer/JaxbCDATAMarshaller.java b/wise-webapp/src/main/java/com/wisemapping/importer/JaxbCDATAMarshaller.java new file mode 100644 index 00000000..122041ba --- /dev/null +++ b/wise-webapp/src/main/java/com/wisemapping/importer/JaxbCDATAMarshaller.java @@ -0,0 +1,36 @@ +package com.wisemapping.importer; + +import java.io.OutputStream; + +import org.apache.xml.serialize.OutputFormat; +import org.apache.xml.serialize.XMLSerializer; +import org.jetbrains.annotations.NotNull; +import org.w3c.dom.Document; + +@SuppressWarnings("deprecation") +public class JaxbCDATAMarshaller { + + public static XMLSerializer createMindmapXMLSerializer(@NotNull OutputStream out) { + // configure an OutputFormat to handle CDATA + OutputFormat of = new OutputFormat(); + + // specify which of your elements you want to be handled as CDATA. + // The use of the '^' between the namespaceURI and the localname + // seems to be an implementation detail of the xerces code. + // When processing xml that doesn't use namespaces, simply omit the + // namespace prefix as shown in the third CDataElement below. + of.setCDataElements( + new String[]{"^text"}); // + + // set any other options you'd like +// of.setPreserveSpace(true); + of.setIndenting(true); + + // create the serializer + XMLSerializer result = new XMLSerializer(of); + result.setOutputByteStream(out); + + return result; + } + +} \ No newline at end of file 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 224ae963..f256497f 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 @@ -25,12 +25,12 @@ import com.wisemapping.importer.VersionNumber; import com.wisemapping.model.MindMap; import com.wisemapping.model.ShapeStyle; import com.wisemapping.util.JAXBUtils; -import com.wisemapping.xml.freemind.*; -import com.wisemapping.xml.freemind.Map; -import com.wisemapping.xml.freemind.Node; -import com.wisemapping.xml.mindmap.RelationshipType; -import com.wisemapping.xml.mindmap.TopicType; -import com.wisemapping.xml.mindmap.Link; +import com.wisemapping.jaxb.freemind.*; +import com.wisemapping.jaxb.freemind.Map; +import com.wisemapping.jaxb.freemind.Node; +import com.wisemapping.jaxb.mindmap.RelationshipType; +import com.wisemapping.jaxb.mindmap.TopicType; +import com.wisemapping.jaxb.mindmap.Link; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.w3c.dom.*; @@ -46,12 +46,12 @@ import java.math.BigInteger; public class FreemindImporter implements Importer { - public static final String CODE_VERSION = "pela"; + public static final String CODE_VERSION = "tango"; public static final int SECOND_LEVEL_TOPIC_HEIGHT = 25; public static final int ROOT_LEVEL_TOPIC_HEIGHT = SECOND_LEVEL_TOPIC_HEIGHT; public static final int CENTRAL_TO_TOPIC_DISTANCE = 200; public static final int TOPIC_TO_TOPIC_DISTANCE = 90; - private com.wisemapping.xml.mindmap.ObjectFactory mindmapObjectFactory; + private com.wisemapping.jaxb.mindmap.ObjectFactory mindmapObjectFactory; private static final String POSITION_LEFT = "left"; private static final String BOLD = "bold"; private static final String ITALIC = "italic"; @@ -99,11 +99,11 @@ public class FreemindImporter final MindMap result = new MindMap(); nodesMap = new HashMap(); relationships = new ArrayList(); - mindmapObjectFactory = new com.wisemapping.xml.mindmap.ObjectFactory(); + mindmapObjectFactory = new com.wisemapping.jaxb.mindmap.ObjectFactory(); try { String wiseXml; - final Map freemindMap = (Map) JAXBUtils.getMapObject(input, "com.wisemapping.xml.freemind"); + final Map freemindMap = (Map) JAXBUtils.getMapObject(input, "com.wisemapping.jaxb.freemind"); final String version = freemindMap.getVersion(); if (version != null) { @@ -116,7 +116,7 @@ public class FreemindImporter final ByteArrayOutputStream baos = new ByteArrayOutputStream(); - final com.wisemapping.xml.mindmap.Map mindmapMap = mindmapObjectFactory.createMap(); + final com.wisemapping.jaxb.mindmap.Map mindmapMap = mindmapObjectFactory.createMap(); mindmapMap.setVersion(CODE_VERSION); currentId = 0; @@ -137,7 +137,7 @@ public class FreemindImporter convertChildNodes(freeNode, wiseTopic, 1); addRelationships(mindmapMap); - JAXBUtils.saveMap(mindmapMap, baos, "com.wisemapping.xml.mindmap"); + JAXBUtils.saveMap(mindmapMap, baos, "com.wisemapping.jaxb.mindmap"); wiseXml = new String(baos.toByteArray(), UTF_8_CHARSET); @@ -155,7 +155,7 @@ public class FreemindImporter return result; } - private void addRelationships(@NotNull com.wisemapping.xml.mindmap.Map mindmapMap) { + private void addRelationships(@NotNull com.wisemapping.jaxb.mindmap.Map mindmapMap) { List mapRelationships = mindmapMap.getRelationship(); for (RelationshipType relationship : relationships) { relationship.setId(String.valueOf(currentId++)); @@ -270,14 +270,14 @@ public class FreemindImporter String iconId = freemindIcon.getBUILTIN(); final String wiseIconId = FreemindIconConverter.toWiseId(iconId); if (wiseIconId != null) { - final com.wisemapping.xml.mindmap.Icon mindmapIcon = new com.wisemapping.xml.mindmap.Icon(); + final com.wisemapping.jaxb.mindmap.Icon mindmapIcon = new com.wisemapping.jaxb.mindmap.Icon(); mindmapIcon.setId(wiseIconId); currentWiseTopic.getIcon().add(mindmapIcon); } } else if (element instanceof Hook) { final Hook hook = (Hook) element; - final com.wisemapping.xml.mindmap.Note mindmapNote = new com.wisemapping.xml.mindmap.Note(); + final com.wisemapping.jaxb.mindmap.Note mindmapNote = new com.wisemapping.jaxb.mindmap.Note(); String textNote = hook.getText(); if (textNote == null) // It is not a note is a BlinkingNodeHook or AutomaticLayout Hook { @@ -291,13 +291,11 @@ public class FreemindImporter if (type.equals("NODE")) { String text = getText(content); - text = text.replaceAll("\n", ""); - text = text.trim(); currentWiseTopic.setText(text); } else { String text = getRichContent(content); - final com.wisemapping.xml.mindmap.Note mindmapNote = new com.wisemapping.xml.mindmap.Note(); - text = text != null ? text.replaceAll("\n", "%0A") : EMPTY_NOTE; + final com.wisemapping.jaxb.mindmap.Note mindmapNote = new com.wisemapping.jaxb.mindmap.Note(); + text = text != null ? text : EMPTY_NOTE; mindmapNote.setText(text); currentWiseTopic.setNote(mindmapNote); @@ -347,41 +345,36 @@ public class FreemindImporter final List nodes = new ArrayList(); int result; - if (freeChild.getWorder() != null) { - result = freeChild.getWorder().intValue(); + // Collect all the nodes of the same side ... + for (Object child : freeChilden) { + if (child instanceof Node) { + Node node = (Node) child; + + final String side = node.getPOSITION(); + if (freeChild.getPOSITION().equals(side)) { + nodes.add(node); + } + } + } + + // What is the index of the current node ? + int nodeIndex = 0; + for (Node node : nodes) { + if (node == freeChild) { + break; + } + nodeIndex++; + } + + int size = nodes.size(); + int center = (size - 1) / 2; + result = nodeIndex - center; + + if (result < 0) { + result = (result * ORDER_SEPARATION_FACTOR * -2) - 1; + } else { - // Collect all the nodes of the same side ... - for (Object child : freeChilden) { - if (child instanceof Node) { - Node node = (Node) child; - - final String side = node.getPOSITION(); - if (freeChild.getPOSITION().equals(side)) { - nodes.add(node); - } - } - } - - // What is the index of the current node ? - int nodeIndex = 0; - for (Node node : nodes) { - if (node == freeChild) { - break; - } - nodeIndex++; - } - - int size = nodes.size(); - int center = (size - 1) / 2; - result = nodeIndex - center; - - if (result < 0) { - result = (result * ORDER_SEPARATION_FACTOR * -2) - 1; - - } else { - result = result * ORDER_SEPARATION_FACTOR * 2; - } - + result = result * ORDER_SEPARATION_FACTOR * 2; } return result; } @@ -396,53 +389,50 @@ public class FreemindImporter String convertPosition(@NotNull TopicType wiseParent, @NotNull Node freeChild, final int depth, int order, int childrenCount) { // Which side must be the node be positioned ? - String result = freeChild.getWcoords(); - if (result == null) { - // Calculate X ... + // Calculate X ... - // Problem on setting X position: - // Text Size is not taken into account ... - int x = CENTRAL_TO_TOPIC_DISTANCE + ((depth - 1) * TOPIC_TO_TOPIC_DISTANCE); - if (depth == 1) { + // Problem on setting X position: + // Text Size is not taken into account ... + int x = CENTRAL_TO_TOPIC_DISTANCE + ((depth - 1) * TOPIC_TO_TOPIC_DISTANCE); + if (depth == 1) { - final String side = freeChild.getPOSITION(); - assert side != null : "This should not happen"; - x = x * (POSITION_LEFT.equals(side) ? -1 : 1); + final String side = freeChild.getPOSITION(); + assert side != null : "This should not happen"; + x = x * (POSITION_LEFT.equals(side) ? -1 : 1); + } else { + final Coord coord = Coord.parse(wiseParent.getPosition()); + x = x * (coord.isOnLeftSide() ? -1 : 1); + } + + + // Calculate y ... + int y; + if (depth == 1) { + + // Follow the following algorithm ... + // Order: 3 = -100 1 + // Order: 1 = -50 2 + // Order: 0 = 0 3 + // Order: 2 = 50 4 + // Order: 4 = 100 5 + if (order % 2 == 0) { + y = ROOT_LEVEL_TOPIC_HEIGHT * order; } else { - final Coord coord = Coord.parse(wiseParent.getPosition()); - x = x * (coord.isOnLeftSide() ? -1 : 1); + y = -ROOT_LEVEL_TOPIC_HEIGHT * (order + 1); } + } else { + // Problem: What happen if the node is more tall than what is defined here. + Coord coord = Coord.parse(wiseParent.getPosition()); + int parentY = coord.y; + y = parentY - ((childrenCount / 2) * SECOND_LEVEL_TOPIC_HEIGHT - (order * SECOND_LEVEL_TOPIC_HEIGHT)); - // Calculate y ... - int y; - if (depth == 1) { - - // Follow the following algorithm ... - // Order: 3 = -100 1 - // Order: 1 = -50 2 - // Order: 0 = 0 3 - // Order: 2 = 50 4 - // Order: 4 = 100 5 - if (order % 2 == 0) { - y = ROOT_LEVEL_TOPIC_HEIGHT * order; - } else { - y = -ROOT_LEVEL_TOPIC_HEIGHT * (order + 1); - } - } else { - - // Problem: What happen if the node is more tall than what is defined here. - Coord coord = Coord.parse(wiseParent.getPosition()); - int parentY = coord.y; - y = parentY - ((childrenCount / 2) * SECOND_LEVEL_TOPIC_HEIGHT - (order * SECOND_LEVEL_TOPIC_HEIGHT)); - - - } - result = x + "," + y; } - return result; + return x + "," + y; + + } /** @@ -546,7 +536,7 @@ public class FreemindImporter return text.toString(); } - private void convertNodeProperties(@NotNull com.wisemapping.xml.freemind.Node freeNode, @NotNull com.wisemapping.xml.mindmap.TopicType wiseTopic) { + private void convertNodeProperties(@NotNull com.wisemapping.jaxb.freemind.Node freeNode, @NotNull com.wisemapping.jaxb.mindmap.TopicType wiseTopic) { final String text = freeNode.getTEXT(); wiseTopic.setText(text); diff --git a/wise-webapp/src/main/java/com/wisemapping/schemas/SVGWiseMap.xsd b/wise-webapp/src/main/java/com/wisemapping/schemas/SVGWiseMap.xsd deleted file mode 100644 index 21f14e08..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/schemas/SVGWiseMap.xsd +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/wise-webapp/src/main/java/com/wisemapping/schemas/VMLWiseMap.xsd b/wise-webapp/src/main/java/com/wisemapping/schemas/VMLWiseMap.xsd deleted file mode 100644 index 94dd6a0b..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/schemas/VMLWiseMap.xsd +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/wise-webapp/src/main/java/com/wisemapping/schemas/sampleSVG.xml b/wise-webapp/src/main/java/com/wisemapping/schemas/sampleSVG.xml deleted file mode 100644 index aa0e5292..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/schemas/sampleSVG.xml +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - Node 0 - - - - - - - Node 1 - - - - - - - Node 2 - - - - - - - Node 3 - - - - - - Main Topic - - - - - - - - Sub Topic - - - - - - - Sub Topic - - - - - - - Sub Topic - - - - - - - Sub Topic - - - - - - Main Topic - - - - - - - Main Topic - - - - - - - Central Topic - - - - - - - Sub Topic - - - - - - - Sub Topic - - - - - - - Sub Topic - - - - - - - Sub Topic - - - - - - Isolated Topic - - - - \ No newline at end of file diff --git a/wise-webapp/src/main/java/com/wisemapping/schemas/sampleVML.html b/wise-webapp/src/main/java/com/wisemapping/schemas/sampleVML.html deleted file mode 100644 index 5b2dc44f..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/schemas/sampleVML.html +++ /dev/null @@ -1,577 +0,0 @@ - - - - VML Sample - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Node 0 - - - - - - - - - - - - - - - - Node 1 - - - - - - - - - - - - - - - - Node 2 - - - - - - - - - - - - - - - - Node 3 - - - - - - - - - - - - - Main Topic - - - - - - - - - - - - - - - - - - - - - Sub Topic - - - - - - - - - - - - - - - - - Sub Topic - - - - - - - - - - - - - - - - - Sub Topic - - - - - - - - - - - - - - - - - Sub Topic - - - - - - - - - - - - - - Main Topic - - - - - - - - - - - - - - - - - - Main Topic - - - - - - - - - - - - - - - - - - Central Topic - - - - - - - - - - - - - - - - - Sub Topic - - - - - - - - - - - - - - - - - Sub Topic - - - - - - - - - - - - - - - - - Sub Topic - - - - - - - - - - - - - - - - - Sub Topic - - - - - - - - - - - - - - Isolated Topic - - - - - - - - -
- - - \ No newline at end of file diff --git a/wise-webapp/src/main/java/com/wisemapping/schemas/sampleVML.xml b/wise-webapp/src/main/java/com/wisemapping/schemas/sampleVML.xml deleted file mode 100644 index f6a0fcac..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/schemas/sampleVML.xml +++ /dev/null @@ -1,612 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Node 0 - - - - - - - - - - - - - - - - - - - - Node 1 - - - - - - - - - - - - - - - - - - - - Node 2 - - - - - - - - - - - - - - - - - - - - Node 3 - - - - - - - - - - - - - - - - - Main Topic - - - - - - - - - - - - - - - - - - - - - - - - Sub Topic - - - - - - - - - - - - - - - - - - - - Sub Topic - - - - - - - - - - - - - - - - - - - - Sub Topic - - - - - - - - - - - - - - - - - - - - Sub Topic - - - - - - - - - - - - - - - - - Main Topic - - - - - - - - - - - - - - - - - - - - - Main Topic - - - - - - - - - - - - - - - - - - - - - Central Topic - - - - - - - - - - - - - - - - - - - - Sub Topic - - - - - - - - - - - - - - - - - - - - Sub Topic - - - - - - - - - - - - - - - - - - - - Sub Topic - - - - - - - - - - - - - - - - - - - - Sub Topic - - - - - - - - - - - - - - - - - Isolated Topic - - - - - - - - - - - - - - - - - Main Topic - - - - - - - - - - - \ No newline at end of file diff --git a/wise-webapp/src/main/java/com/wisemapping/util/JAXBUtils.java b/wise-webapp/src/main/java/com/wisemapping/util/JAXBUtils.java index d982da5e..175cea7f 100755 --- a/wise-webapp/src/main/java/com/wisemapping/util/JAXBUtils.java +++ b/wise-webapp/src/main/java/com/wisemapping/util/JAXBUtils.java @@ -1,64 +1,75 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -package com.wisemapping.util; - -import org.jetbrains.annotations.NotNull; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; -import javax.xml.bind.Unmarshaller; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.HashMap; -import java.util.Map; - -public class JAXBUtils { - - private final static Map context = new HashMap(); - - public static Object getMapObject(@NotNull InputStream stream, @NotNull final String pakage) throws JAXBException { - - final JAXBContext context = getInstance(pakage); - final Unmarshaller unmarshaller = context.createUnmarshaller(); - - return unmarshaller.unmarshal(stream); - } - - private static JAXBContext getInstance(@NotNull String pakage) throws JAXBException { - - JAXBContext result = context.get(pakage); - if (result == null) { - synchronized (context) { - result = JAXBContext.newInstance(pakage); - context.put(pakage, result); - } - } - return result; - - } - - public static void saveMap(@NotNull Object obj, @NotNull OutputStream out, String packag) throws JAXBException { - - final JAXBContext context = getInstance(packag); - final Marshaller marshaller = context.createMarshaller(); - - marshaller.marshal(obj, out); - } -} +/* +* Copyright [2011] [wisemapping] +* +* Licensed under WiseMapping Public License, Version 1.0 (the "License"). +* It is basically the Apache License, Version 2.0 (the "License") plus the +* "powered by wisemapping" text requirement on every single page; +* you may not use this file except in compliance with the License. +* You may obtain a copy of the license at +* +* http://www.wisemapping.org/license +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package com.wisemapping.util; + +import com.wisemapping.importer.JaxbCDATAMarshaller; +import org.apache.xml.serialize.XMLSerializer; +import org.jetbrains.annotations.NotNull; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.bind.Unmarshaller; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.HashMap; +import java.util.Map; + +public class JAXBUtils { + + private final static Map context = new HashMap(); + + public static Object getMapObject(@NotNull InputStream stream, @NotNull final String pakage) throws JAXBException { + + final JAXBContext context = getInstance(pakage); + final Unmarshaller unmarshaller = context.createUnmarshaller(); + + return unmarshaller.unmarshal(stream); + } + + private static JAXBContext getInstance(@NotNull String pakage) throws JAXBException { + + JAXBContext result = context.get(pakage); + if (result == null) { + synchronized (context) { + result = JAXBContext.newInstance(pakage); + context.put(pakage, result); + } + } + return result; + + } + + public static void saveMap(@NotNull Object obj, @NotNull OutputStream out, String packag) throws JAXBException { + + final JAXBContext context = getInstance(packag); + final Marshaller marshaller = context.createMarshaller(); + + // get an Apache XMLSerializer configured to generate CDATA + XMLSerializer serializer = JaxbCDATAMarshaller.createMindmapXMLSerializer(out); + + try { + // marshal using the Apache XMLSerializer + marshaller.marshal(obj, serializer.asContentHandler()); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } +} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/Style.java b/wise-webapp/src/main/java/com/wisemapping/xml/Style.java deleted file mode 100644 index 9185c57d..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/Style.java +++ /dev/null @@ -1,161 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -package com.wisemapping.xml; - -public class Style { - - private float width; - private float height; - private String left; - private String top; - private float fontSize; - private String fontFamily; - private String color; - private String fontWidth; - private boolean isVisible = true; - - public boolean isVisible() { - return isVisible; - } - - public void setVisible(boolean visible) { - isVisible = visible; - } - - public static Style parse(final String styleValue) { - Style result = new Style(); - String[] strings = styleValue.split(";"); - - for (String style : strings) { - final String key = style.substring(0, style.indexOf(":")); - String value = style.substring(style.indexOf(":") + 1, style.length()); - value = value.trim(); - - if (key.trim().equals("WIDTH")) { - result.setWidth(parseFloat(value)); - } else if (key.trim().equals("HEIGHT")) { - result.setHeight(parseFloat(value)); - } - if (key.trim().equals("TOP")) { - result.setTop(removeUnit(value)); - } else if (key.trim().equals("LEFT")) { - result.setLeft(removeUnit(value)); - } else if (key.trim().equals("FONT")) { - final String[] fontValues = value.split(" "); - if (fontValues.length == 3) { - result.setFontWidth(fontValues[0]); - result.setFontSize(parseFloat(fontValues[1])); - result.setFontFamily(fontValues[2]); - } else if (fontValues.length == 2) { - result.setFontSize(parseFloat(fontValues[0])); - result.setFontFamily(fontValues[1]); - } - } else if (key.trim().equals("COLOR")) { - result.setColor(value); - } else if (key.trim().equals("VISIBILITY")) { - result.setVisible(!"hidden".equals(value)); - } - - } - return result; - } - - private void setFontWidth(String v) { - this.fontWidth = v; - } - - private void setColor(String value) { - this.color = value; - } - - public float getHeight() { - return height; - } - - public void setHeight(float height) { - this.height = height; - } - - public float getWidth() { - return width; - } - - public void setWidth(float width) { - this.width = width; - } - - public static String removeUnit(String value) { - String number; - if (value.indexOf("px") != -1 || value.indexOf("pt") != -1) { - number = value.substring(0, value.length() - 2); - } else { - number = value; - } - return number; - } - - public static float parseFloat(String value) { - String number = removeUnit(value); - return Float.parseFloat(number); - } - - - public String getLeft() { - return left; - } - - public void setLeft(String left) { - this.left = left; - } - - public String getTop() { - return top; - } - - public void setTop(String top) { - this.top = top; - } - - - public float getFontSize() { - return fontSize; - } - - public void setFontSize(float fontSize) { - this.fontSize = fontSize; - } - - public String getFontFamily() { - return fontFamily; - } - - public void setFontFamily(String fontFamily) { - this.fontFamily = fontFamily; - } - - public String getColor() { - return this.color; - } - - public String getFontWidth() { - return fontWidth; - } -} - - diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/SvgToVMLConverter.java b/wise-webapp/src/main/java/com/wisemapping/xml/SvgToVMLConverter.java deleted file mode 100644 index e0136a62..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/SvgToVMLConverter.java +++ /dev/null @@ -1,442 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -package com.wisemapping.xml; - -import com.wisemapping.xml.svgmap.*; -import com.wisemapping.xml.svgmap.ObjectFactory; -import com.wisemapping.xml.vmlmap.*; -import com.wisemapping.xml.vmlmap.Line; -import com.wisemapping.xml.vmlmap.Polyline; -import com.wisemapping.xml.vmlmap.Rect; - -import javax.xml.bind.JAXBException; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; -import javax.xml.bind.Marshaller; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.List; - -public class SvgToVMLConverter { - private ObjectFactory svgObjectFactory; - private static final int CORRECTION_HANDCODE = 5; - private Object svgRootElem; - - public SvgToVMLConverter() { - this.svgObjectFactory = new ObjectFactory(); - - } - - public void convert(final InputStream vmlDocument) throws JAXBException { - - final JAXBContext vmlContext = JAXBContext.newInstance("com.wisemapping.xml.vmlmap"); - final Unmarshaller umarshaller = vmlContext.createUnmarshaller(); - final Group rootElem = (Group) umarshaller.unmarshal(vmlDocument); - - this.svgRootElem = convert(rootElem); - } - - private Svg convert(Group g) { - final Svg svgElement = svgObjectFactory.createSvg(); - svgElement.setPreserveAspectRatio("none"); - - /* - - - */ - - final String coordorigin = g.getCoordorigin(); - String coordSize = g.getCoordsize(); - svgElement.setViewBox(coordorigin + ", " + coordSize); - - final Style style = Style.parse(g.getStyle()); - float width = style.getWidth(); - svgElement.setWidth(String.valueOf(width)); - - float height = style.getHeight(); - svgElement.setHeight(String.valueOf(height)); - - // Convert connection lines ... - final List polylines = g.getPolyline(); - final List svgPolylines = svgElement.getPolyline(); - for (Polyline vmlPolyline : polylines) { - final com.wisemapping.xml.svgmap.Polyline svgPolyline = convert(vmlPolyline); - svgPolylines.add(svgPolyline); - } - - final List vmlLines = g.getLine(); - final List svgLines = svgElement.getLine(); - for (Line vmlLine : vmlLines) { - final com.wisemapping.xml.svgmap.Line svgPolyline = convert(vmlLine); - svgLines.add(svgPolyline); - } - - // Convert Topics ... - final List vmlTopics = g.getGroup(); - final List svgTopics = svgElement.getG(); - for (Group topic : vmlTopics) { - G svgTopic = convertTopicGroup(topic); - svgTopics.add(svgTopic); - } - - // Convert connectors ... - g.getOval(); - - return svgElement; - } - - private G convertTopicGroup(final Group vmlTopic) { - /** - * - * - */ - final G svgTopic = new G(); - - final String styleStr = vmlTopic.getStyle(); - final Style style = Style.parse(styleStr); - - String transform = "translate(" + style.getLeft() + ", " + style.getTop() + ") scale(1, 1)"; - svgTopic.setTransform(transform); - - float width = style.getWidth(); - svgTopic.setWidth(String.valueOf(width)); - - float height = style.getHeight(); - svgTopic.setHeight(String.valueOf(height)); - - svgTopic.setPreserveAspectRatio("none"); - - // Convert InnerShape ... - final List roundrects = vmlTopic.getRoundrect(); - float rectWidth = 0; - float rectHeight = 0; - for (Roundrect vmlRect : roundrects) { - - // Skip outerShape figure... - final Fill vmlFill = vmlRect.getFill(); - if (vmlFill == null || !"0".equals(vmlFill.getOpacity())) { - final com.wisemapping.xml.svgmap.Rect svgRect = convert(vmlRect); - svgTopic.setRect(svgRect); - final Style rectStyle = Style.parse(vmlRect.getStyle()); - - rectWidth = rectStyle.getWidth(); - rectHeight = rectStyle.getHeight(); - } - } - - final List vmlRects = vmlTopic.getRect(); - for (Rect vmlRect : vmlRects) { - - // Skip outerShape figure... - final Fill vmlFill = vmlRect.getFill(); - if (vmlFill == null || !"0".equals(vmlFill.getOpacity())) { - final com.wisemapping.xml.svgmap.Rect svgRect = convert(vmlRect); - svgTopic.setRect(svgRect); - final Style rectStyle = Style.parse(vmlRect.getStyle()); - - rectWidth = rectStyle.getWidth(); - rectHeight = rectStyle.getHeight(); - } - } - - final List vmlLines = vmlTopic.getLine(); - for (final Line vmlLine : vmlLines) { - - final String lineStyleStr = vmlLine.getStyle(); - final Style lineStyle = Style.parse(lineStyleStr); - if (lineStyle.isVisible()) { - com.wisemapping.xml.svgmap.Line line = convert(vmlLine); - svgTopic.setLine(line); - } else { - // Shape is line... - final String from = vmlLine.getFrom(); - String[] formPoints = from.split(","); - - final String to = vmlLine.getTo(); - String[] toPoints = to.split(","); - - rectWidth = Float.parseFloat(formPoints[0]) - Float.parseFloat(toPoints[0]); - rectWidth = Math.abs(rectWidth); - - rectHeight = Float.parseFloat(formPoints[1]); - } - } - - // Convert connection ovals.. - final List vmlOvals = vmlTopic.getOval(); - for (Oval vmlOval : vmlOvals) { - - // Skip outerShape figure... - final Ellipse svgElipse = convert(vmlOval); - if (svgElipse != null) { - svgTopic.setEllipse(svgElipse); - } - } - - // Convert Text ... - final List vmlTextShape = vmlTopic.getShape(); - final Text svgText = convertTextShape(vmlTextShape.get(0), rectWidth, rectHeight); - svgTopic.setText(svgText); - - return svgTopic; - } - - private com.wisemapping.xml.svgmap.Rect convert(Rect vmlRect) { - final com.wisemapping.xml.svgmap.Rect svgRect = new com.wisemapping.xml.svgmap.Rect(); - final Style style = Style.parse(vmlRect.getStyle()); - - float width = style.getWidth(); - svgRect.setWidth(String.valueOf(width)); - - float height = style.getHeight(); - svgRect.setHeight(height); - - String top = style.getTop(); - svgRect.setY(Float.parseFloat(top)); - - String left = style.getLeft(); - svgRect.setX(Float.parseFloat(left)); - - // Fill properties ... - final String fillColor = vmlRect.getFillcolor(); - svgRect.setFill(fillColor); - - // Stroke properties ... - final String strokeColor = vmlRect.getStrokecolor(); - svgRect.setStroke(strokeColor); - svgRect.setStrokeWidth("0.5px"); - return svgRect; - - } - - private Ellipse convert(final Oval vmlOval) { - - /** - * - * - * - * - * - * - * SVG: - * - */ - final Style style = Style.parse(vmlOval.getStyle()); - Ellipse svgElipse = null; - if (style.isVisible()) { - svgElipse = new Ellipse(); - - float width = style.getWidth(); - svgElipse.setWidth(width); - svgElipse.setRx(width / 2); - - float height = style.getHeight(); - svgElipse.setHeight(height); - svgElipse.setRy(height / 2); - - String top = style.getTop(); - svgElipse.setCy(Float.parseFloat(top) + (width / 2)); - - String left = style.getLeft(); - svgElipse.setCx(Float.parseFloat(left) + (height / 2)); - - // Fill properties ... - final String fillColor = vmlOval.getFillcolor(); - svgElipse.setFill(fillColor); - - // Stroke properties ... - final String strokeColor = vmlOval.getStrokecolor(); - svgElipse.setStroke(strokeColor); - svgElipse.setStrokeWidth("0.5px"); - } - return svgElipse; - } - - private com.wisemapping.xml.svgmap.Line convert(final Line vmlLine) { - /** - * VML: - * - * <:stroke dashstyle="solid"> - * - * - * SVG: - * - */ - - com.wisemapping.xml.svgmap.Line svgLine = new com.wisemapping.xml.svgmap.Line(); - final String from = vmlLine.getFrom(); - final String[] fromPoints = from.split(","); - - svgLine.setX1(Float.parseFloat(fromPoints[0])); - svgLine.setY1(Float.parseFloat(fromPoints[1])); - - final String to = vmlLine.getTo(); - final String[] toPoints = to.split(","); - - svgLine.setX2(Float.parseFloat(toPoints[0])); - svgLine.setY2(Float.parseFloat(toPoints[1])); - - String strokeweight = vmlLine.getStrokeweight(); - svgLine.setStrokeWidth(strokeweight); - - String stokeColor = vmlLine.getStrokecolor(); - svgLine.setStroke(stokeColor); - - return svgLine; - } - - private Text convertTextShape(Shape vmlTextShape, float boxWidth, float boxHeigth) { - /** - * - * - * - * Central Topic - * - * - * - * SVG: - * Central Topic - * - */ - final Text svgText = new Text(); - Textbox vmlTextBox = vmlTextShape.getTextbox(); - final String textBoxStyleStr = vmlTextBox.getStyle(); - final Style textBoxStyle = Style.parse(textBoxStyleStr); - - // @todo: Take this hardcode from javascript ... - float fontSize = textBoxStyle.getFontSize(); - float scale = vmlTextBox.getXFontScale(); - float svgFontSize = fontSize / scale; - - svgText.setFontSize(svgFontSize); - - // Set text properties... - final String textValue = vmlTextBox.getSPAN().getSPAN(); - svgText.setContent(textValue); - - final String color = textBoxStyle.getColor(); - svgText.setFill(color); - - final String fontWidth = textBoxStyle.getFontWidth(); - svgText.setFontWeight(fontWidth); - - // Positionate font... - final String textSize = vmlTextBox.getXTextSize(); - final String[] split = textSize.split(","); - float textWidth = Float.valueOf(split[0]); - float textHeight = Float.valueOf(split[1]); - - svgText.setX(boxWidth - textWidth); - svgText.setY(boxHeigth - textHeight + CORRECTION_HANDCODE); - - return svgText; - - } - - private com.wisemapping.xml.svgmap.Rect convert(Roundrect vmlRect) { - - /* - * VML: - * - * - * - * - * - * SVG: - * - * - */ - final com.wisemapping.xml.svgmap.Rect svgRect = new com.wisemapping.xml.svgmap.Rect(); - final Style style = Style.parse(vmlRect.getStyle()); - svgRect.setRy(2.7F); - svgRect.setRx(2.7F); - - float width = style.getWidth(); - svgRect.setWidth(String.valueOf(width)); - - float height = style.getHeight(); - svgRect.setHeight(height); - - String top = style.getTop(); - svgRect.setY(Float.parseFloat(top)); - - String left = style.getLeft(); - svgRect.setX(Float.parseFloat(left)); - - // Fill properties ... - final String fillColor = vmlRect.getFillcolor(); - svgRect.setFill(fillColor); - - // Stroke properties ... - final String strokeColor = vmlRect.getStrokecolor(); - svgRect.setStroke(strokeColor); - svgRect.setStrokeWidth("0.5px"); - - return svgRect; - - } - - private com.wisemapping.xml.svgmap.Polyline convert(Polyline vmlPolyline) { - - /* - * - * - * - * - * - */ - final com.wisemapping.xml.svgmap.Polyline svgPolyline = svgObjectFactory.createPolyline(); - - final String rPoints = vmlPolyline.getXPoints(); - svgPolyline.setPoints(rPoints); - - final String strokeColor = vmlPolyline.getStrokecolor(); - svgPolyline.setStroke(strokeColor); - - // @todo: Take from SVG. - svgPolyline.setFill("none"); - svgPolyline.setStrokeWidth("1px"); - svgPolyline.setStrokeOpacity("1"); - - return svgPolyline; - } - - - public void toXml(OutputStream os) throws JAXBException { - final JAXBContext svgContext = JAXBContext.newInstance("com.wisemapping.xml.svgmap"); - Marshaller m = svgContext.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); - m.marshal(svgRootElem, os); - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/VmlToSvgConverter.java b/wise-webapp/src/main/java/com/wisemapping/xml/VmlToSvgConverter.java deleted file mode 100644 index 7b75d666..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/VmlToSvgConverter.java +++ /dev/null @@ -1,450 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -package com.wisemapping.xml; - -import com.wisemapping.xml.vmlmap.*; -import com.wisemapping.xml.vmlmap.Polyline; -import com.wisemapping.xml.vmlmap.Line; -import com.wisemapping.xml.vmlmap.Rect; -import com.wisemapping.xml.svgmap.*; -import com.wisemapping.xml.svgmap.ObjectFactory; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; -import javax.xml.bind.Marshaller; -import java.io.*; -import java.util.List; - -public class VmlToSvgConverter { - private ObjectFactory svgObjectFactory; - private static final int CORRECTION_HARDCODE = 5; - private Object svgRootElem; - - public VmlToSvgConverter() { - this.svgObjectFactory = new ObjectFactory(); - - } - - public void convert(final Reader vmlDocument) throws JAXBException, IOException { - - final JAXBContext vmlContext = JAXBContext.newInstance("com.wisemapping.xml.vmlmap"); - final Unmarshaller umarshaller = vmlContext.createUnmarshaller(); - final Group rootElem = (Group) umarshaller.unmarshal(vmlDocument); - this.svgRootElem = convert(rootElem); - } - - private Svg convert(Group g) { - final Svg svgElement = svgObjectFactory.createSvg(); - svgElement.setPreserveAspectRatio("none"); - - /* - - - */ - - final String coordorigin = g.getCoordorigin(); - String coordSize = g.getCoordsize(); - svgElement.setViewBox(coordorigin + ", " + coordSize); - - final Style style = Style.parse(g.getStyle()); - float width = style.getWidth(); - svgElement.setWidth(String.valueOf(width)); - - float height = style.getHeight(); - svgElement.setHeight(String.valueOf(height)); - - // Convert connection lines ... - final List polylines = g.getPolyline(); - final List svgPolylines = svgElement.getPolyline(); - for (Polyline vmlPolyline : polylines) { - final com.wisemapping.xml.svgmap.Polyline svgPolyline = convert(vmlPolyline); - svgPolylines.add(svgPolyline); - } - - final List vmlLines = g.getLine(); - final List svgLines = svgElement.getLine(); - for (Line vmlLine : vmlLines) { - final com.wisemapping.xml.svgmap.Line svgPolyline = convert(vmlLine); - svgLines.add(svgPolyline); - } - - // Convert Topics ... - final List vmlTopics = g.getGroup(); - final List svgTopics = svgElement.getG(); - for (Group topic : vmlTopics) { - G svgTopic = convertTopicGroup(topic); - svgTopics.add(svgTopic); - } - - // Convert connectors ... - g.getOval(); - - return svgElement; - } - - private G convertTopicGroup(final Group vmlTopic) { - /** - * - * - */ - final G svgTopic = new G(); - - final String styleStr = vmlTopic.getStyle(); - final Style style = Style.parse(styleStr); - - String transform = "translate(" + style.getLeft() + ", " + style.getTop() + ") scale(1, 1)"; - svgTopic.setTransform(transform); - - float width = style.getWidth(); - svgTopic.setWidth(String.valueOf(width)); - - float height = style.getHeight(); - svgTopic.setHeight(String.valueOf(height)); - - svgTopic.setPreserveAspectRatio("none"); - - // Convert InnerShape ... - final List roundrects = vmlTopic.getRoundrect(); - float rectWidth = 0; - float rectHeight = 0; - for (Roundrect vmlRect : roundrects) { - - // Skip outerShape figure... - final Fill vmlFill = vmlRect.getFill(); - if (vmlFill == null || !"0".equals(vmlFill.getOpacity())) { - final com.wisemapping.xml.svgmap.Rect svgRect = convert(vmlRect); - svgTopic.setRect(svgRect); - final Style rectStyle = Style.parse(vmlRect.getStyle()); - - rectWidth = rectStyle.getWidth(); - rectHeight = rectStyle.getHeight(); - } - } - - final List vmlRects = vmlTopic.getRect(); - for (com.wisemapping.xml.vmlmap.Rect vmlRect : vmlRects) { - - // Skip outerShape figure... - final Fill vmlFill = vmlRect.getFill(); - if (vmlFill == null || !"0".equals(vmlFill.getOpacity())) { - final com.wisemapping.xml.svgmap.Rect svgRect = convert(vmlRect); - svgTopic.setRect(svgRect); - final Style rectStyle = Style.parse(vmlRect.getStyle()); - - rectWidth = rectStyle.getWidth(); - rectHeight = rectStyle.getHeight(); - } - } - - final List vmlLines = vmlTopic.getLine(); - for (final Line vmlLine : vmlLines) { - - final String lineStyleStr = vmlLine.getStyle(); - final Style lineStyle = Style.parse(lineStyleStr); - if (lineStyle.isVisible()) { - com.wisemapping.xml.svgmap.Line line = convert(vmlLine); - svgTopic.setLine(line); - } else { - // Shape is line... - final String from = vmlLine.getFrom(); - String[] formPoints = from.split(","); - - final String to = vmlLine.getTo(); - String[] toPoints = to.split(","); - - rectWidth = Float.parseFloat(formPoints[0]) - Float.parseFloat(toPoints[0]); - rectWidth = Math.abs(rectWidth); - - rectHeight = Float.parseFloat(formPoints[1]); - } - } - - // Convert connection ovals.. - final List vmlOvals = vmlTopic.getOval(); - for (Oval vmlOval : vmlOvals) { - - // Skip outerShape figure... - final Ellipse svgElipse = convert(vmlOval); - if (svgElipse != null) { - svgTopic.setEllipse(svgElipse); - } - } - - // Convert Text ... - final List vmlTextShape = vmlTopic.getShape(); - final Text svgText = convertTextShape(vmlTextShape.get(0), rectWidth, rectHeight); - svgTopic.setText(svgText); - - return svgTopic; - } - - private com.wisemapping.xml.svgmap.Rect convert(Rect vmlRect) { - final com.wisemapping.xml.svgmap.Rect svgRect = new com.wisemapping.xml.svgmap.Rect(); - final Style style = Style.parse(vmlRect.getStyle()); - - float width = style.getWidth(); - svgRect.setWidth(String.valueOf(width)); - - float height = style.getHeight(); - svgRect.setHeight(height); - - String top = style.getTop(); - svgRect.setY(Float.parseFloat(top)); - - String left = style.getLeft(); - svgRect.setX(Float.parseFloat(left)); - - // Fill properties ... - final String fillColor = vmlRect.getFillcolor(); - svgRect.setFill(fillColor); - - // Stroke properties ... - final String strokeColor = vmlRect.getStrokecolor(); - svgRect.setStroke(strokeColor); - svgRect.setStrokeWidth("0.5px"); - return svgRect; - - } - - private Ellipse convert(final Oval vmlOval) { - - /** - * - * - * - * - * - * - * SVG: - * - */ - final Style style = Style.parse(vmlOval.getStyle()); - Ellipse svgElipse = null; - if (style.isVisible()) { - svgElipse = new Ellipse(); - - float width = style.getWidth(); - svgElipse.setWidth(width); - svgElipse.setRx(width / 2); - - float height = style.getHeight(); - svgElipse.setHeight(height); - svgElipse.setRy(height / 2); - - String top = style.getTop(); - svgElipse.setCy(Float.parseFloat(top) + (width / 2)); - - String left = style.getLeft(); - svgElipse.setCx(Float.parseFloat(left) + (height / 2)); - - // Fill properties ... - final String fillColor = vmlOval.getFillcolor(); - svgElipse.setFill(fillColor); - - // Stroke properties ... - final String strokeColor = vmlOval.getStrokecolor(); - svgElipse.setStroke(strokeColor); - svgElipse.setStrokeWidth("0.5px"); - } - return svgElipse; - } - - private com.wisemapping.xml.svgmap.Line convert(final Line vmlLine) { - /** - * VML: - * - * <:stroke dashstyle="solid"> - * - * - * SVG: - * - */ - - com.wisemapping.xml.svgmap.Line svgLine = new com.wisemapping.xml.svgmap.Line(); - final String from = vmlLine.getFrom(); - final String[] fromPoints = from.split(","); - - svgLine.setX1(Float.parseFloat(fromPoints[0])); - svgLine.setY1(Float.parseFloat(fromPoints[1])); - - final String to = vmlLine.getTo(); - final String[] toPoints = to.split(","); - - svgLine.setX2(Float.parseFloat(toPoints[0])); - svgLine.setY2(Float.parseFloat(toPoints[1])); - - String strokeweight = vmlLine.getStrokeweight(); - svgLine.setStrokeWidth(strokeweight); - - String stokeColor = vmlLine.getStrokecolor(); - svgLine.setStroke(stokeColor); - - return svgLine; - } - - private Text convertTextShape(Shape vmlTextShape, float boxWidth, float boxHeigth) { - /** - * - * - * - * Central Topic - * - * - * - * SVG: - * Central Topic - * - */ - final Text svgText = new Text(); - Textbox vmlTextBox = vmlTextShape.getTextbox(); - final String textBoxStyleStr = vmlTextBox.getStyle(); - final Style textBoxStyle = Style.parse(textBoxStyleStr); - - String fontStyle = svgText.getFontStyle(); - svgText.setFontStyle(fontStyle); - - // @todo: Take this hardcode from javascript ... - float fontSize = textBoxStyle.getFontSize(); - float scale = vmlTextBox.getXFontScale(); - float svgFontSize = fontSize / scale; - - svgText.setFontSize(svgFontSize); - - // Set text properties... - final String textValue = vmlTextBox.getSPAN().getSPAN(); - svgText.setContent(textValue); - - final String color = textBoxStyle.getColor(); - svgText.setFill(color); - - final String style = textBoxStyle.getFontWidth(); - svgText.setFontWeight(style); - - // Positionate font... - final String textSize = vmlTextBox.getXTextSize(); - final String[] split = textSize.split(","); - float textWidth = Float.valueOf(split[0]); - float textHeight = Float.valueOf(split[1]); - - svgText.setX(boxWidth - textWidth); - svgText.setY(boxHeigth - textHeight + CORRECTION_HARDCODE); - - return svgText; - - } - - private com.wisemapping.xml.svgmap.Rect convert(Roundrect vmlRect) { - - /* - * VML: - * - * - * - * - * - * SVG: - * - * - */ - final com.wisemapping.xml.svgmap.Rect svgRect = new com.wisemapping.xml.svgmap.Rect(); - final Style style = Style.parse(vmlRect.getStyle()); - svgRect.setRy(2.7F); - svgRect.setRx(2.7F); - - float width = style.getWidth(); - svgRect.setWidth(String.valueOf(width)); - - float height = style.getHeight(); - svgRect.setHeight(height); - - String top = style.getTop(); - svgRect.setY(Float.parseFloat(top)); - - String left = style.getLeft(); - svgRect.setX(Float.parseFloat(left)); - - // Fill properties ... - final String fillColor = vmlRect.getFillcolor(); - svgRect.setFill(fillColor); - - // Stroke properties ... - final String strokeColor = vmlRect.getStrokecolor(); - svgRect.setStroke(strokeColor); - svgRect.setStrokeWidth("0.5px"); - - return svgRect; - - } - - private com.wisemapping.xml.svgmap.Polyline convert(Polyline vmlPolyline) { - - /* - * - * - * - * - * - */ - final com.wisemapping.xml.svgmap.Polyline svgPolyline = svgObjectFactory.createPolyline(); - - final String rPoints = vmlPolyline.getXPoints(); - svgPolyline.setPoints(rPoints); - - final String strokeColor = vmlPolyline.getStrokecolor(); - svgPolyline.setStroke(strokeColor); - - // @todo: Take from SVG. - svgPolyline.setFill("none"); - svgPolyline.setStrokeWidth("1px"); - svgPolyline.setStrokeOpacity("1"); - - return svgPolyline; - } - - - public void toXml(OutputStream os) throws JAXBException { - final JAXBContext svgContext = JAXBContext.newInstance("com.wisemapping.xml.svgmap"); - Marshaller m = svgContext.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); - m.marshal(svgRootElem, os); - } - - public void toXml(Writer os) throws JAXBException { - final JAXBContext svgContext = JAXBContext.newInstance("com.wisemapping.xml.svgmap"); - Marshaller m = svgContext.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); - m.marshal(svgRootElem, os); - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Arrowlink.java b/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Arrowlink.java deleted file mode 100644 index 81e68519..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Arrowlink.java +++ /dev/null @@ -1,229 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.10 at 02:12:59 PM ART -// - - -package com.wisemapping.xml.freemind; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="COLOR" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="DESTINATION" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="ENDARROW" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="ENDINCLINATION" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="ID" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="STARTARROW" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="STARTINCLINATION" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@XmlRootElement(name = "arrowlink") -public class Arrowlink { - - @XmlAttribute(name = "COLOR") - protected String color; - @XmlAttribute(name = "DESTINATION", required = true) - protected String destination; - @XmlAttribute(name = "ENDARROW") - protected String endarrow; - @XmlAttribute(name = "ENDINCLINATION") - protected String endinclination; - @XmlAttribute(name = "ID") - protected String id; - @XmlAttribute(name = "STARTARROW") - protected String startarrow; - @XmlAttribute(name = "STARTINCLINATION") - protected String startinclination; - - /** - * Gets the value of the color property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCOLOR() { - return color; - } - - /** - * Sets the value of the color property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCOLOR(String value) { - this.color = value; - } - - /** - * Gets the value of the destination property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getDESTINATION() { - return destination; - } - - /** - * Sets the value of the destination property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setDESTINATION(String value) { - this.destination = value; - } - - /** - * Gets the value of the endarrow property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getENDARROW() { - return endarrow; - } - - /** - * Sets the value of the endarrow property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setENDARROW(String value) { - this.endarrow = value; - } - - /** - * Gets the value of the endinclination property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getENDINCLINATION() { - return endinclination; - } - - /** - * Sets the value of the endinclination property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setENDINCLINATION(String value) { - this.endinclination = value; - } - - /** - * Gets the value of the id property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getID() { - return id; - } - - /** - * Sets the value of the id property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setID(String value) { - this.id = value; - } - - /** - * Gets the value of the startarrow property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSTARTARROW() { - return startarrow; - } - - /** - * Sets the value of the startarrow property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSTARTARROW(String value) { - this.startarrow = value; - } - - /** - * Gets the value of the startinclination property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSTARTINCLINATION() { - return startinclination; - } - - /** - * Sets the value of the startinclination property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSTARTINCLINATION(String value) { - this.startinclination = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Cloud.java b/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Cloud.java deleted file mode 100644 index 232f52aa..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Cloud.java +++ /dev/null @@ -1,67 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.10 at 02:12:59 PM ART -// - - -package com.wisemapping.xml.freemind; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="COLOR" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@XmlRootElement(name = "cloud") -public class Cloud { - - @XmlAttribute(name = "COLOR") - protected String color; - - /** - * Gets the value of the color property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCOLOR() { - return color; - } - - /** - * Sets the value of the color property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCOLOR(String value) { - this.color = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Edge.java b/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Edge.java deleted file mode 100644 index e1ba66fd..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Edge.java +++ /dev/null @@ -1,121 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.10 at 02:12:59 PM ART -// - - -package com.wisemapping.xml.freemind; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="COLOR" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="STYLE" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="WIDTH" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@XmlRootElement(name = "edge") -public class Edge { - - @XmlAttribute(name = "COLOR") - protected String color; - @XmlAttribute(name = "STYLE") - protected String style; - @XmlAttribute(name = "WIDTH") - protected String width; - - /** - * Gets the value of the color property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCOLOR() { - return color; - } - - /** - * Sets the value of the color property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCOLOR(String value) { - this.color = value; - } - - /** - * Gets the value of the style property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSTYLE() { - return style; - } - - /** - * Sets the value of the style property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSTYLE(String value) { - this.style = value; - } - - /** - * Gets the value of the width property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getWIDTH() { - return width; - } - - /** - * Sets the value of the width property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setWIDTH(String value) { - this.width = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Font.java b/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Font.java deleted file mode 100644 index 059950b4..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Font.java +++ /dev/null @@ -1,162 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.10 at 02:12:59 PM ART -// - - -package com.wisemapping.xml.freemind; - -import java.math.BigInteger; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="BOLD">
- *         <simpleType>
- *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *             <enumeration value="true"/>
- *           </restriction>
- *         </simpleType>
- *       </attribute>
- *       <attribute name="ITALIC">
- *         <simpleType>
- *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *             <enumeration value="true"/>
- *             <enumeration value="false"/>
- *           </restriction>
- *         </simpleType>
- *       </attribute>
- *       <attribute name="NAME" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="SIZE" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@XmlRootElement(name = "font") -public class Font { - - @XmlAttribute(name = "BOLD") - protected String bold; - @XmlAttribute(name = "ITALIC") - protected String italic; - @XmlAttribute(name = "NAME", required = true) - protected String name; - @XmlAttribute(name = "SIZE", required = true) - protected BigInteger size; - - /** - * Gets the value of the bold property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getBOLD() { - return bold; - } - - /** - * Sets the value of the bold property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setBOLD(String value) { - this.bold = value; - } - - /** - * Gets the value of the italic property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getITALIC() { - return italic; - } - - /** - * Sets the value of the italic property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setITALIC(String value) { - this.italic = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getNAME() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setNAME(String value) { - this.name = value; - } - - /** - * Gets the value of the size property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getSIZE() { - return size; - } - - /** - * Sets the value of the size property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setSIZE(BigInteger value) { - this.size = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Hook.java b/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Hook.java deleted file mode 100644 index fdca9e18..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Hook.java +++ /dev/null @@ -1,126 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.10 at 02:12:59 PM ART -// - - -package com.wisemapping.xml.freemind; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{}Parameters" minOccurs="0"/>
- *         <element ref="{}text" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="NAME" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "parameters", - "text" -}) -@XmlRootElement(name = "hook") -public class Hook { - - @XmlElement(name = "Parameters") - protected Parameters parameters; - protected String text; - @XmlAttribute(name = "NAME", required = true) - protected String name; - - /** - * Gets the value of the parameters property. - * - * @return - * possible object is - * {@link Parameters } - * - */ - public Parameters getParameters() { - return parameters; - } - - /** - * Sets the value of the parameters property. - * - * @param value - * allowed object is - * {@link Parameters } - * - */ - public void setParameters(Parameters value) { - this.parameters = value; - } - - /** - * Gets the value of the text property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getText() { - return text; - } - - /** - * Sets the value of the text property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setText(String value) { - this.text = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getNAME() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setNAME(String value) { - this.name = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Html.java b/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Html.java deleted file mode 100644 index 0e0e2140..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Html.java +++ /dev/null @@ -1,79 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.10 at 02:12:59 PM ART -// - - -package com.wisemapping.xml.freemind; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import org.w3c.dom.Element; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <any processContents='skip' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "any" -}) -@XmlRootElement(name = "html") -public class Html { - - @XmlAnyElement - protected List any; - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Icon.java b/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Icon.java deleted file mode 100644 index fed3fcae..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Icon.java +++ /dev/null @@ -1,67 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.10 at 02:12:59 PM ART -// - - -package com.wisemapping.xml.freemind; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="BUILTIN" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@XmlRootElement(name = "icon") -public class Icon { - - @XmlAttribute(name = "BUILTIN", required = true) - protected String builtin; - - /** - * Gets the value of the builtin property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getBUILTIN() { - return builtin; - } - - /** - * Sets the value of the builtin property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setBUILTIN(String value) { - this.builtin = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Map.java b/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Map.java deleted file mode 100644 index 0f9657e7..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Map.java +++ /dev/null @@ -1,99 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.10 at 02:12:59 PM ART -// - - -package com.wisemapping.xml.freemind; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{}node"/>
- *       </sequence>
- *       <attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "node" -}) -@XmlRootElement(name = "map") -public class Map { - - @XmlElement(required = true) - protected Node node; - @XmlAttribute(required = true) - protected String version; - - /** - * Gets the value of the node property. - * - * @return - * possible object is - * {@link Node } - * - */ - public Node getNode() { - return node; - } - - /** - * Sets the value of the node property. - * - * @param value - * allowed object is - * {@link Node } - * - */ - public void setNode(Node value) { - this.node = value; - } - - /** - * Gets the value of the version property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getVersion() { - return version; - } - - /** - * Sets the value of the version property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setVersion(String value) { - this.version = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Node.java b/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Node.java deleted file mode 100644 index e2daf0c8..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Node.java +++ /dev/null @@ -1,466 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.10 at 02:12:59 PM ART -// - - -package com.wisemapping.xml.freemind; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElements; -import javax.xml.bind.annotation.XmlID; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <choice maxOccurs="unbounded" minOccurs="0">
- *         <element ref="{}arrowlink"/>
- *         <element ref="{}cloud"/>
- *         <element ref="{}edge"/>
- *         <element ref="{}font"/>
- *         <element ref="{}hook"/>
- *         <element ref="{}icon"/>
- *         <element ref="{}node"/>
- *         <element ref="{}richcontent"/>
- *       </choice>
- *       <attribute name="BACKGROUND_COLOR" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="COLOR" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="FOLDED">
- *         <simpleType>
- *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *             <enumeration value="true"/>
- *             <enumeration value="false"/>
- *           </restriction>
- *         </simpleType>
- *       </attribute>
- *       <attribute name="ID" type="{http://www.w3.org/2001/XMLSchema}ID" />
- *       <attribute name="LINK" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="POSITION">
- *         <simpleType>
- *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *             <enumeration value="left"/>
- *             <enumeration value="right"/>
- *           </restriction>
- *         </simpleType>
- *       </attribute>
- *       <attribute name="STYLE" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="TEXT" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="CREATED" type="{http://www.w3.org/2001/XMLSchema}integer" />
- *       <attribute name="MODIFIED" type="{http://www.w3.org/2001/XMLSchema}integer" />
- *       <attribute name="HGAP" type="{http://www.w3.org/2001/XMLSchema}integer" />
- *       <attribute name="VGAP" type="{http://www.w3.org/2001/XMLSchema}integer" />
- *       <attribute name="VSHIFT" type="{http://www.w3.org/2001/XMLSchema}integer" />
- *       <attribute name="ENCRYPTED_CONTENT" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "arrowlinkOrCloudOrEdge" -}) -@XmlRootElement(name = "node") -public class Node { - - @XmlElements({ - @XmlElement(name = "icon", type = Icon.class), - @XmlElement(name = "node", type = Node.class), - @XmlElement(name = "edge", type = Edge.class), - @XmlElement(name = "arrowlink", type = Arrowlink.class), - @XmlElement(name = "font", type = Font.class), - @XmlElement(name = "hook", type = Hook.class), - @XmlElement(name = "richcontent", type = Richcontent.class), - @XmlElement(name = "cloud", type = Cloud.class) - }) - protected List arrowlinkOrCloudOrEdge; - @XmlAttribute(name = "BACKGROUND_COLOR") - protected String backgroundcolor; - @XmlAttribute(name = "COLOR") - protected String color; - @XmlAttribute(name = "FOLDED") - protected String folded; - @XmlAttribute(name = "ID") - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlID - @XmlSchemaType(name = "ID") - protected String id; - @XmlAttribute(name = "LINK") - protected String link; - @XmlAttribute(name = "POSITION") - protected String position; - @XmlAttribute(name = "STYLE") - protected String style; - @XmlAttribute(name = "TEXT", required = true) - protected String text; - @XmlAttribute(name = "CREATED") - protected BigInteger created; - @XmlAttribute(name = "MODIFIED") - protected BigInteger modified; - @XmlAttribute(name = "HGAP") - protected BigInteger hgap; - @XmlAttribute(name = "VGAP") - protected BigInteger vgap; - - @XmlAttribute(name = "VSHIFT") - protected BigInteger vshift; - @XmlAttribute(name = "ENCRYPTED_CONTENT") - protected String encryptedcontent; - - // Wise Extensions - @XmlAttribute(name = "wCOORDS") - protected String wcoords; - @XmlAttribute(name = "wORDER") - protected BigInteger worder; - - /** - * Gets the value of the arrowlinkOrCloudOrEdge property. - *

- *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the arrowlinkOrCloudOrEdge property. - *

- *

- * For example, to add a new item, do as follows: - *

-     *    getArrowlinkOrCloudOrEdge().add(newItem);
-     * 
- *

- *

- *

- * Objects of the following type(s) are allowed in the list - * {@link Icon } - * {@link Node } - * {@link Edge } - * {@link Arrowlink } - * {@link Font } - * {@link Hook } - * {@link Richcontent } - * {@link Cloud } - */ - public List getArrowlinkOrCloudOrEdge() { - if (arrowlinkOrCloudOrEdge == null) { - arrowlinkOrCloudOrEdge = new ArrayList(); - } - return this.arrowlinkOrCloudOrEdge; - } - - /** - * Gets the value of the backgroundcolor property. - * - * @return possible object is - * {@link String } - */ - public String getBACKGROUNDCOLOR() { - return backgroundcolor; - } - - /** - * Sets the value of the backgroundcolor property. - * - * @param value allowed object is - * {@link String } - */ - public void setBACKGROUNDCOLOR(String value) { - this.backgroundcolor = value; - } - - /** - * Gets the value of the color property. - * - * @return possible object is - * {@link String } - */ - public String getCOLOR() { - return color; - } - - public BigInteger getWorder() { - return worder; - } - - public void setWorder(BigInteger worder) { - this.worder = worder; - } - - /** - * Sets the value of the color property. - * - * @param value allowed object is - * {@link String } - */ - public void setCOLOR(String value) { - this.color = value; - } - - /** - * Gets the value of the folded property. - * - * @return possible object is - * {@link String } - */ - public String getFOLDED() { - return folded; - } - - /** - * Sets the value of the folded property. - * - * @param value allowed object is - * {@link String } - */ - public void setFOLDED(String value) { - this.folded = value; - } - - /** - * Gets the value of the id property. - * - * @return possible object is - * {@link String } - */ - public String getID() { - return id; - } - - /** - * Sets the value of the id property. - * - * @param value allowed object is - * {@link String } - */ - public void setID(String value) { - this.id = value; - } - - /** - * Gets the value of the link property. - * - * @return possible object is - * {@link String } - */ - public String getLINK() { - return link; - } - - /** - * Sets the value of the link property. - * - * @param value allowed object is - * {@link String } - */ - public void setLINK(String value) { - this.link = value; - } - - /** - * Gets the value of the position property. - * - * @return possible object is - * {@link String } - */ - public String getPOSITION() { - return position; - } - - /** - * Sets the value of the position property. - * - * @param value allowed object is - * {@link String } - */ - public void setPOSITION(String value) { - this.position = value; - } - - /** - * Gets the value of the style property. - * - * @return possible object is - * {@link String } - */ - public String getSTYLE() { - return style; - } - - /** - * Sets the value of the style property. - * - * @param value allowed object is - * {@link String } - */ - public void setSTYLE(String value) { - this.style = value; - } - - /** - * Gets the value of the text property. - * - * @return possible object is - * {@link String } - */ - public String getTEXT() { - return text; - } - - /** - * Sets the value of the text property. - * - * @param value allowed object is - * {@link String } - */ - public void setTEXT(String value) { - this.text = value; - } - - /** - * Gets the value of the created property. - * - * @return possible object is - * {@link BigInteger } - */ - public BigInteger getCREATED() { - return created; - } - - /** - * Sets the value of the created property. - * - * @param value allowed object is - * {@link BigInteger } - */ - public void setCREATED(BigInteger value) { - this.created = value; - } - - /** - * Gets the value of the modified property. - * - * @return possible object is - * {@link BigInteger } - */ - public BigInteger getMODIFIED() { - return modified; - } - - public String getWcoords() { - return wcoords; - } - - public void setWcoords(String wcoords) { - this.wcoords = wcoords; - } - - /** - * Sets the value of the modified property. - * - * @param value allowed object is - * {@link BigInteger } - */ - public void setMODIFIED(BigInteger value) { - this.modified = value; - } - - /** - * Gets the value of the hgap property. - * - * @return possible object is - * {@link BigInteger } - */ - public BigInteger getHGAP() { - return hgap; - } - - /** - * Sets the value of the hgap property. - * - * @param value allowed object is - * {@link BigInteger } - */ - public void setHGAP(BigInteger value) { - this.hgap = value; - } - - /** - * Gets the value of the vgap property. - * - * @return possible object is - * {@link BigInteger } - */ - public BigInteger getVGAP() { - return vgap; - } - - /** - * Sets the value of the vgap property. - * - * @param value allowed object is - * {@link BigInteger } - */ - public void setVGAP(BigInteger value) { - this.vgap = value; - } - - /** - * Gets the value of the vshift property. - * - * @return possible object is - * {@link BigInteger } - */ - public BigInteger getVSHIFT() { - return vshift; - } - - /** - * Sets the value of the vshift property. - * - * @param value allowed object is - * {@link BigInteger } - */ - public void setVSHIFT(BigInteger value) { - this.vshift = value; - } - - /** - * Gets the value of the encryptedcontent property. - * - * @return possible object is - * {@link String } - */ - public String getENCRYPTEDCONTENT() { - return encryptedcontent; - } - - /** - * Sets the value of the encryptedcontent property. - * - * @param value allowed object is - * {@link String } - */ - public void setENCRYPTEDCONTENT(String value) { - this.encryptedcontent = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/ObjectFactory.java b/wise-webapp/src/main/java/com/wisemapping/xml/freemind/ObjectFactory.java deleted file mode 100644 index 0273f823..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/ObjectFactory.java +++ /dev/null @@ -1,140 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.10 at 02:12:59 PM ART -// - - -package com.wisemapping.xml.freemind; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the com.wisemapping.xml.freemind package. - *

An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private final static QName _Text_QNAME = new QName("", "text"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.wisemapping.xml.freemind - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link Cloud } - * - */ - public Cloud createCloud() { - return new Cloud(); - } - - /** - * Create an instance of {@link Richcontent } - * - */ - public Richcontent createRichcontent() { - return new Richcontent(); - } - - /** - * Create an instance of {@link Hook } - * - */ - public Hook createHook() { - return new Hook(); - } - - /** - * Create an instance of {@link Arrowlink } - * - */ - public Arrowlink createArrowlink() { - return new Arrowlink(); - } - - /** - * Create an instance of {@link Parameters } - * - */ - public Parameters createParameters() { - return new Parameters(); - } - - /** - * Create an instance of {@link Edge } - * - */ - public Edge createEdge() { - return new Edge(); - } - - /** - * Create an instance of {@link Html } - * - */ - public Html createHtml() { - return new Html(); - } - - /** - * Create an instance of {@link Node } - * - */ - public Node createNode() { - return new Node(); - } - - /** - * Create an instance of {@link Icon } - * - */ - public Icon createIcon() { - return new Icon(); - } - - /** - * Create an instance of {@link Map } - * - */ - public Map createMap() { - return new Map(); - } - - /** - * Create an instance of {@link Font } - * - */ - public Font createFont() { - return new Font(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "text") - public JAXBElement createText(String value) { - return new JAXBElement(_Text_QNAME, String.class, null, value); - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Parameters.java b/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Parameters.java deleted file mode 100644 index 1343aa61..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Parameters.java +++ /dev/null @@ -1,68 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.10 at 02:12:59 PM ART -// - - -package com.wisemapping.xml.freemind; - -import java.math.BigInteger; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="REMINDUSERAT" type="{http://www.w3.org/2001/XMLSchema}integer" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@XmlRootElement(name = "Parameters") -public class Parameters { - - @XmlAttribute(name = "REMINDUSERAT") - protected BigInteger reminduserat; - - /** - * Gets the value of the reminduserat property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getREMINDUSERAT() { - return reminduserat; - } - - /** - * Sets the value of the reminduserat property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setREMINDUSERAT(BigInteger value) { - this.reminduserat = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Richcontent.java b/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Richcontent.java deleted file mode 100644 index b93e6f1e..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/freemind/Richcontent.java +++ /dev/null @@ -1,106 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.10 at 02:12:59 PM ART -// - - -package com.wisemapping.xml.freemind; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{}html"/>
- *       </sequence>
- *       <attribute name="TYPE" use="required">
- *         <simpleType>
- *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *             <enumeration value="NODE"/>
- *             <enumeration value="NOTE"/>
- *           </restriction>
- *         </simpleType>
- *       </attribute>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "html" -}) -@XmlRootElement(name = "richcontent") -public class Richcontent { - - @XmlElement(required = true) - protected Html html; - @XmlAttribute(name = "TYPE", required = true) - protected String type; - - /** - * Gets the value of the html property. - * - * @return - * possible object is - * {@link Html } - * - */ - public Html getHtml() { - return html; - } - - /** - * Sets the value of the html property. - * - * @param value - * allowed object is - * {@link Html } - * - */ - public void setHtml(Html value) { - this.html = value; - } - - /** - * Gets the value of the type property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getTYPE() { - return type; - } - - /** - * Sets the value of the type property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTYPE(String value) { - this.type = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap.xsd b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap.xsd deleted file mode 100755 index 8fb70df6..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap.xsd +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Icon.java b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Icon.java deleted file mode 100644 index bc53f2d3..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Icon.java +++ /dev/null @@ -1,92 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.16 at 11:06:29 AM ART -// - - -package com.wisemapping.xml.mindmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for icon complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="icon">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="order" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "icon") -public class Icon { - - @XmlAttribute - protected String id; - @XmlAttribute - protected String order; - - /** - * Gets the value of the id property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getId() { - return id; - } - - /** - * Sets the value of the id property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets the value of the order property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getOrder() { - return order; - } - - /** - * Sets the value of the order property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setOrder(String value) { - this.order = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Link.java b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Link.java deleted file mode 100644 index 9c21d363..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Link.java +++ /dev/null @@ -1,92 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.16 at 11:06:29 AM ART -// - - -package com.wisemapping.xml.mindmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for link complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="link">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="url" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="order" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "link") -public class Link { - - @XmlAttribute - protected String url; - @XmlAttribute - protected String order; - - /** - * Gets the value of the url property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getUrl() { - return url; - } - - /** - * Sets the value of the url property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setUrl(String value) { - this.url = value; - } - - /** - * Gets the value of the order property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getOrder() { - return order; - } - - /** - * Sets the value of the order property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setOrder(String value) { - this.order = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Map.java b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Map.java deleted file mode 100644 index dd5389ec..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Map.java +++ /dev/null @@ -1,165 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.16 at 11:06:29 AM ART -// - - -package com.wisemapping.xml.mindmap; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{}topic" maxOccurs="unbounded"/>
- *         <element ref="{}relationship" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "topic", - "relationship" -}) -@XmlRootElement(name = "map") -public class Map { - - @XmlElement(required = true) - protected List topic; - protected List relationship; - @XmlAttribute - protected String name; - @XmlAttribute - protected String version; - - /** - * Gets the value of the topic property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the topic property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getTopic().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link TopicType } - * - * - */ - public List getTopic() { - if (topic == null) { - topic = new ArrayList(); - } - return this.topic; - } - - /** - * Gets the value of the relationship property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the relationship property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getRelationship().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link RelationshipType } - * - * - */ - public List getRelationship() { - if (relationship == null) { - relationship = new ArrayList(); - } - return this.relationship; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the version property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getVersion() { - return version; - } - - /** - * Sets the value of the version property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setVersion(String value) { - this.version = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Note.java b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Note.java deleted file mode 100644 index d141a706..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Note.java +++ /dev/null @@ -1,65 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.16 at 11:06:29 AM ART -// - - -package com.wisemapping.xml.mindmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for note complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="note">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="text" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "note") -public class Note { - - @XmlAttribute - protected String text; - - /** - * Gets the value of the text property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getText() { - return text; - } - - /** - * Sets the value of the text property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setText(String value) { - this.text = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/ObjectFactory.java b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/ObjectFactory.java deleted file mode 100644 index 483b9e71..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/ObjectFactory.java +++ /dev/null @@ -1,110 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.16 at 11:06:29 AM ART -// - - -package com.wisemapping.xml.mindmap; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the com.wisemapping.xml.mindmap package. - *

An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private final static QName _Topic_QNAME = new QName("", "topic"); - private final static QName _Relationship_QNAME = new QName("", "relationship"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.wisemapping.xml.mindmap - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link Note } - * - */ - public Note createNote() { - return new Note(); - } - - /** - * Create an instance of {@link Icon } - * - */ - public Icon createIcon() { - return new Icon(); - } - - /** - * Create an instance of {@link TopicType } - * - */ - public TopicType createTopicType() { - return new TopicType(); - } - - /** - * Create an instance of {@link Map } - * - */ - public Map createMap() { - return new Map(); - } - - /** - * Create an instance of {@link RelationshipType } - * - */ - public RelationshipType createRelationshipType() { - return new RelationshipType(); - } - - /** - * Create an instance of {@link Link } - * - */ - public Link createLink() { - return new Link(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link TopicType }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "topic") - public JAXBElement createTopic(TopicType value) { - return new JAXBElement(_Topic_QNAME, TopicType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link RelationshipType }{@code >}} - * - */ - @XmlElementDecl(namespace = "", name = "relationship") - public JAXBElement createRelationship(RelationshipType value) { - return new JAXBElement(_Relationship_QNAME, RelationshipType.class, null, value); - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/RelationshipType.java b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/RelationshipType.java deleted file mode 100644 index 88c0d1a2..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/RelationshipType.java +++ /dev/null @@ -1,254 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.16 at 11:06:29 AM ART -// - - -package com.wisemapping.xml.mindmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for relationshipType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="relationshipType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="srcTopicId" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="destTopicId" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="lineType" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="srcCtrlPoint" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="destCtrlPoint" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="endArrow" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="startArrow" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "relationshipType") -public class RelationshipType { - - @XmlAttribute - protected String id; - @XmlAttribute - protected String srcTopicId; - @XmlAttribute - protected String destTopicId; - @XmlAttribute - protected String lineType; - @XmlAttribute - protected String srcCtrlPoint; - @XmlAttribute - protected String destCtrlPoint; - @XmlAttribute - protected Boolean endArrow; - @XmlAttribute - protected Boolean startArrow; - - /** - * Gets the value of the id property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getId() { - return id; - } - - /** - * Sets the value of the id property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets the value of the srcTopicId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSrcTopicId() { - return srcTopicId; - } - - /** - * Sets the value of the srcTopicId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSrcTopicId(String value) { - this.srcTopicId = value; - } - - /** - * Gets the value of the destTopicId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getDestTopicId() { - return destTopicId; - } - - /** - * Sets the value of the destTopicId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setDestTopicId(String value) { - this.destTopicId = value; - } - - /** - * Gets the value of the lineType property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getLineType() { - return lineType; - } - - /** - * Sets the value of the lineType property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setLineType(String value) { - this.lineType = value; - } - - /** - * Gets the value of the srcCtrlPoint property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSrcCtrlPoint() { - return srcCtrlPoint; - } - - /** - * Sets the value of the srcCtrlPoint property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSrcCtrlPoint(String value) { - this.srcCtrlPoint = value; - } - - /** - * Gets the value of the destCtrlPoint property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getDestCtrlPoint() { - return destCtrlPoint; - } - - /** - * Sets the value of the destCtrlPoint property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setDestCtrlPoint(String value) { - this.destCtrlPoint = value; - } - - /** - * Gets the value of the endArrow property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public Boolean isEndArrow() { - return endArrow; - } - - /** - * Sets the value of the endArrow property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setEndArrow(Boolean value) { - this.endArrow = value; - } - - /** - * Gets the value of the startArrow property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public Boolean isStartArrow() { - return startArrow; - } - - /** - * Sets the value of the startArrow property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setStartArrow(Boolean value) { - this.startArrow = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/TopicType.java b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/TopicType.java deleted file mode 100644 index 62b38bbc..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/TopicType.java +++ /dev/null @@ -1,431 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.16 at 11:06:29 AM ART -// - - -package com.wisemapping.xml.mindmap; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for topicType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="topicType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="icon" type="{}icon" maxOccurs="unbounded" minOccurs="0"/>
- *         <element name="link" type="{}link" minOccurs="0"/>
- *         <element name="note" type="{}note" minOccurs="0"/>
- *         <element ref="{}topic" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="text" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="shape" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="bgColor" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="brColor" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="order" type="{http://www.w3.org/2001/XMLSchema}int" />
- *       <attribute name="position" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="central" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="shrink" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "topicType", propOrder = { - "icon", - "link", - "note", - "topic" -}) -public class TopicType { - - protected List icon; - protected Link link; - protected Note note; - protected List topic; - @XmlAttribute - protected String text; - @XmlAttribute - protected String shape; - @XmlAttribute - protected String fontStyle; - @XmlAttribute - protected String bgColor; - @XmlAttribute - protected String brColor; - @XmlAttribute - protected Integer order; - @XmlAttribute - protected String position; - @XmlAttribute - protected Boolean central; - @XmlAttribute - protected String id; - @XmlAttribute - protected Boolean shrink; - - /** - * Gets the value of the icon property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the icon property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getIcon().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Icon } - * - * - */ - public List getIcon() { - if (icon == null) { - icon = new ArrayList(); - } - return this.icon; - } - - /** - * Gets the value of the link property. - * - * @return - * possible object is - * {@link Link } - * - */ - public Link getLink() { - return link; - } - - /** - * Sets the value of the link property. - * - * @param value - * allowed object is - * {@link Link } - * - */ - public void setLink(Link value) { - this.link = value; - } - - /** - * Gets the value of the note property. - * - * @return - * possible object is - * {@link Note } - * - */ - public Note getNote() { - return note; - } - - /** - * Sets the value of the note property. - * - * @param value - * allowed object is - * {@link Note } - * - */ - public void setNote(Note value) { - this.note = value; - } - - /** - * Gets the value of the topic property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the topic property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getTopic().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link TopicType } - * - * - */ - public List getTopic() { - if (topic == null) { - topic = new ArrayList(); - } - return this.topic; - } - - /** - * Gets the value of the text property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getText() { - return text; - } - - /** - * Sets the value of the text property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setText(String value) { - this.text = value; - } - - /** - * Gets the value of the shape property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getShape() { - return shape; - } - - /** - * Sets the value of the shape property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setShape(String value) { - this.shape = value; - } - - /** - * Gets the value of the fontStyle property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getFontStyle() { - return fontStyle; - } - - /** - * Sets the value of the fontStyle property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setFontStyle(String value) { - this.fontStyle = value; - } - - /** - * Gets the value of the bgColor property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getBgColor() { - return bgColor; - } - - /** - * Sets the value of the bgColor property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setBgColor(String value) { - this.bgColor = value; - } - - /** - * Gets the value of the brColor property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getBrColor() { - return brColor; - } - - /** - * Sets the value of the brColor property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setBrColor(String value) { - this.brColor = value; - } - - /** - * Gets the value of the order property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getOrder() { - return order; - } - - /** - * Sets the value of the order property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setOrder(Integer value) { - this.order = value; - } - - /** - * Gets the value of the position property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getPosition() { - return position; - } - - /** - * Sets the value of the position property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPosition(String value) { - this.position = value; - } - - /** - * Gets the value of the central property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public Boolean isCentral() { - return central; - } - - /** - * Sets the value of the central property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setCentral(Boolean value) { - this.central = value; - } - - /** - * Gets the value of the id property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getId() { - return id; - } - - /** - * Sets the value of the id property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets the value of the shrink property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public Boolean isShrink() { - return shrink; - } - - /** - * Sets the value of the shrink property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setShrink(Boolean value) { - this.shrink = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Ellipse.java b/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Ellipse.java deleted file mode 100644 index d115f2c6..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Ellipse.java +++ /dev/null @@ -1,269 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:27:07 PM ART -// - - -package com.wisemapping.xml.svgmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="cx" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
- *       <attribute name="cy" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
- *       <attribute name="fill" use="required" type="{http://www.w3.org/2001/XMLSchema}string" fixed="#E0E5EF" />
- *       <attribute name="height" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
- *       <attribute name="rx" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
- *       <attribute name="ry" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
- *       <attribute name="stroke" use="required" type="{http://www.w3.org/2001/XMLSchema}string" fixed="#023BB9" />
- *       <attribute name="stroke-width" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" />
- *       <attribute name="visibility" use="required">
- *         <simpleType>
- *           <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
- *             <enumeration value="hidden"/>
- *             <enumeration value="visible"/>
- *           </restriction>
- *         </simpleType>
- *       </attribute>
- *       <attribute name="width" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@XmlRootElement(name = "ellipse") -public class Ellipse { - - @XmlAttribute(required = true) - protected float cx; - @XmlAttribute(required = true) - protected float cy; - @XmlAttribute(required = true) - protected String fill; - @XmlAttribute(required = true) - protected float height; - @XmlAttribute(required = true) - protected float rx; - @XmlAttribute(required = true) - protected float ry; - @XmlAttribute(required = true) - protected String stroke; - @XmlAttribute(name = "stroke-width", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String strokeWidth; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String visibility; - @XmlAttribute(required = true) - protected float width; - - /** - * Gets the value of the cx property. - */ - public float getCx() { - return cx; - } - - /** - * Sets the value of the cx property. - */ - public void setCx(float value) { - this.cx = value; - } - - /** - * Gets the value of the cy property. - */ - public float getCy() { - return cy; - } - - /** - * Sets the value of the cy property. - */ - public void setCy(float value) { - this.cy = value; - } - - /** - * Gets the value of the fill property. - * - * @return possible object is - * {@link String } - */ - public String getFill() { - if (fill == null) { - return "#E0E5EF"; - } else { - return fill; - } - } - - /** - * Sets the value of the fill property. - * - * @param value allowed object is - * {@link String } - */ - public void setFill(String value) { - this.fill = value; - } - - /** - * Gets the value of the height property. - */ - public float getHeight() { - return height; - } - - /** - * Sets the value of the height property. - */ - public void setHeight(float value) { - this.height = value; - } - - /** - * Gets the value of the rx property. - */ - public float getRx() { - return rx; - } - - /** - * Sets the value of the rx property. - */ - public void setRx(float value) { - this.rx = value; - } - - /** - * Gets the value of the ry property. - */ - public float getRy() { - return ry; - } - - /** - * Sets the value of the ry property. - */ - public void setRy(float value) { - this.ry = value; - } - - /** - * Gets the value of the stroke property. - * - * @return possible object is - * {@link String } - */ - public String getStroke() { - if (stroke == null) { - return "#023BB9"; - } else { - return stroke; - } - } - - /** - * Sets the value of the stroke property. - * - * @param value allowed object is - * {@link String } - */ - public void setStroke(String value) { - this.stroke = value; - } - - /** - * Gets the value of the strokeWidth property. - * - * @return possible object is - * {@link String } - */ - public String getStrokeWidth() { - return strokeWidth; - } - - /** - * Sets the value of the strokeWidth property. - * - * @param value allowed object is - * {@link String } - */ - public void setStrokeWidth(String value) { - this.strokeWidth = value; - } - - /** - * Gets the value of the visibility property. - * - * @return possible object is - * {@link String } - */ - public String getVisibility() { - return visibility; - } - - /** - * Sets the value of the visibility property. - * - * @param value allowed object is - * {@link String } - */ - public void setVisibility(String value) { - this.visibility = value; - } - - /** - * Gets the value of the width property. - */ - public float getWidth() { - return width; - } - - /** - * Sets the value of the width property. - */ - public void setWidth(float value) { - this.width = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/G.java b/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/G.java deleted file mode 100644 index b4cc8094..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/G.java +++ /dev/null @@ -1,288 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:27:07 PM ART -// - - -package com.wisemapping.xml.svgmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <choice>
- *         <element ref="{http://www.w3.org/2000/svg}ellipse"/>
- *         <element ref="{http://www.w3.org/2000/svg}line"/>
- *         <element ref="{http://www.w3.org/2000/svg}rect"/>
- *         <element ref="{http://www.w3.org/2000/svg}text"/>
- *       </choice>
- *       <attribute name="focusable" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" fixed="true" />
- *       <attribute name="height" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" fixed="100" />
- *       <attribute name="preserveAspectRatio" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" fixed="none" />
- *       <attribute name="transform" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="width" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" fixed="100" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "ellipse", - "line", - "rect", - "text" - }) -@XmlRootElement(name = "g") -public class G { - - protected Ellipse ellipse; - protected Line line; - protected Rect rect; - protected Text text; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String focusable; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String height; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String preserveAspectRatio; - @XmlAttribute(required = true) - protected String transform; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String width; - - /** - * Gets the value of the ellipse property. - * - * @return possible object is - * {@link Ellipse } - */ - public Ellipse getEllipse() { - return ellipse; - } - - /** - * Sets the value of the ellipse property. - * - * @param value allowed object is - * {@link Ellipse } - */ - public void setEllipse(Ellipse value) { - this.ellipse = value; - } - - /** - * Gets the value of the line property. - * - * @return possible object is - * {@link Line } - */ - public Line getLine() { - return line; - } - - /** - * Sets the value of the line property. - * - * @param value allowed object is - * {@link Line } - */ - public void setLine(Line value) { - this.line = value; - } - - /** - * Gets the value of the rect property. - * - * @return possible object is - * {@link Rect } - */ - public Rect getRect() { - return rect; - } - - /** - * Sets the value of the rect property. - * - * @param value allowed object is - * {@link Rect } - */ - public void setRect(Rect value) { - this.rect = value; - } - - /** - * Gets the value of the text property. - * - * @return possible object is - * {@link Text } - */ - public Text getText() { - return text; - } - - /** - * Sets the value of the text property. - * - * @param value allowed object is - * {@link Text } - */ - public void setText(Text value) { - this.text = value; - } - - /** - * Gets the value of the focusable property. - * - * @return possible object is - * {@link String } - */ - public String getFocusable() { - if (focusable == null) { - return "true"; - } else { - return focusable; - } - } - - /** - * Sets the value of the focusable property. - * - * @param value allowed object is - * {@link String } - */ - public void setFocusable(String value) { - this.focusable = value; - } - - /** - * Gets the value of the height property. - * - * @return possible object is - * {@link String } - */ - public String getHeight() { - if (height == null) { - return "100"; - } else { - return height; - } - } - - /** - * Sets the value of the height property. - * - * @param value allowed object is - * {@link String } - */ - public void setHeight(String value) { - this.height = value; - } - - /** - * Gets the value of the preserveAspectRatio property. - * - * @return possible object is - * {@link String } - */ - public String getPreserveAspectRatio() { - if (preserveAspectRatio == null) { - return "none"; - } else { - return preserveAspectRatio; - } - } - - /** - * Sets the value of the preserveAspectRatio property. - * - * @param value allowed object is - * {@link String } - */ - public void setPreserveAspectRatio(String value) { - this.preserveAspectRatio = value; - } - - /** - * Gets the value of the transform property. - * - * @return possible object is - * {@link String } - */ - public String getTransform() { - return transform; - } - - /** - * Sets the value of the transform property. - * - * @param value allowed object is - * {@link String } - */ - public void setTransform(String value) { - this.transform = value; - } - - /** - * Gets the value of the width property. - * - * @return possible object is - * {@link String } - */ - public String getWidth() { - if (width == null) { - return "100"; - } else { - return width; - } - } - - /** - * Sets the value of the width property. - * - * @param value allowed object is - * {@link String } - */ - public void setWidth(String value) { - this.width = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Line.java b/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Line.java deleted file mode 100644 index 321370d8..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Line.java +++ /dev/null @@ -1,278 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:27:07 PM ART -// - - -package com.wisemapping.xml.svgmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="fill-opacity" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" />
- *       <attribute name="stroke" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="stroke-opacity" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" />
- *       <attribute name="stroke-width" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" fixed="1px" />
- *       <attribute name="style" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="visibility">
- *         <simpleType>
- *           <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
- *             <enumeration value="hidden"/>
- *           </restriction>
- *         </simpleType>
- *       </attribute>
- *       <attribute name="x1" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
- *       <attribute name="x2" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
- *       <attribute name="y1" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
- *       <attribute name="y2" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@XmlRootElement(name = "line") -public class Line { - - @XmlAttribute(name = "fill-opacity") - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String fillOpacity; - @XmlAttribute(required = true) - protected String stroke; - @XmlAttribute(name = "stroke-opacity") - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String strokeOpacity; - @XmlAttribute(name = "stroke-width", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String strokeWidth; - @XmlAttribute - protected String style; - @XmlAttribute - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String visibility; - @XmlAttribute(required = true) - protected float x1; - @XmlAttribute(required = true) - protected float x2; - @XmlAttribute(required = true) - protected float y1; - @XmlAttribute(required = true) - protected float y2; - - /** - * Gets the value of the fillOpacity property. - * - * @return possible object is - * {@link String } - */ - public String getFillOpacity() { - return fillOpacity; - } - - /** - * Sets the value of the fillOpacity property. - * - * @param value allowed object is - * {@link String } - */ - public void setFillOpacity(String value) { - this.fillOpacity = value; - } - - /** - * Gets the value of the stroke property. - * - * @return possible object is - * {@link String } - */ - public String getStroke() { - return stroke; - } - - /** - * Sets the value of the stroke property. - * - * @param value allowed object is - * {@link String } - */ - public void setStroke(String value) { - this.stroke = value; - } - - /** - * Gets the value of the strokeOpacity property. - * - * @return possible object is - * {@link String } - */ - public String getStrokeOpacity() { - return strokeOpacity; - } - - /** - * Sets the value of the strokeOpacity property. - * - * @param value allowed object is - * {@link String } - */ - public void setStrokeOpacity(String value) { - this.strokeOpacity = value; - } - - /** - * Gets the value of the strokeWidth property. - * - * @return possible object is - * {@link String } - */ - public String getStrokeWidth() { - if (strokeWidth == null) { - return "1px"; - } else { - return strokeWidth; - } - } - - /** - * Sets the value of the strokeWidth property. - * - * @param value allowed object is - * {@link String } - */ - public void setStrokeWidth(String value) { - this.strokeWidth = value; - } - - /** - * Gets the value of the style property. - * - * @return possible object is - * {@link String } - */ - public String getStyle() { - return style; - } - - /** - * Sets the value of the style property. - * - * @param value allowed object is - * {@link String } - */ - public void setStyle(String value) { - this.style = value; - } - - /** - * Gets the value of the visibility property. - * - * @return possible object is - * {@link String } - */ - public String getVisibility() { - return visibility; - } - - /** - * Sets the value of the visibility property. - * - * @param value allowed object is - * {@link String } - */ - public void setVisibility(String value) { - this.visibility = value; - } - - /** - * Gets the value of the x1 property. - */ - public float getX1() { - return x1; - } - - /** - * Sets the value of the x1 property. - */ - public void setX1(float value) { - this.x1 = value; - } - - /** - * Gets the value of the x2 property. - */ - public float getX2() { - return x2; - } - - /** - * Sets the value of the x2 property. - */ - public void setX2(float value) { - this.x2 = value; - } - - /** - * Gets the value of the y1 property. - */ - public float getY1() { - return y1; - } - - /** - * Sets the value of the y1 property. - */ - public void setY1(float value) { - this.y1 = value; - } - - /** - * Gets the value of the y2 property. - */ - public float getY2() { - return y2; - } - - /** - * Sets the value of the y2 property. - */ - public void setY2(float value) { - this.y2 = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/ObjectFactory.java b/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/ObjectFactory.java deleted file mode 100644 index 36bedcb8..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/ObjectFactory.java +++ /dev/null @@ -1,104 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:27:07 PM ART -// - - -package com.wisemapping.xml.svgmap; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the com.mindmap.xml.svgmap package. - *

An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - */ -@XmlRegistry -public class ObjectFactory { - - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.mindmap.xml.svgmap - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link Rect } - */ - public Rect createRect() { - return new Rect(); - } - - /** - * Create an instance of {@link Svg } - */ - public Svg createSvg() { - return new Svg(); - } - - /** - * Create an instance of {@link Text } - */ - public Text createText() { - return new Text(); - } - - /** - * Create an instance of {@link Ellipse } - */ - public Ellipse createEllipse() { - return new Ellipse(); - } - - /** - * Create an instance of {@link Line } - */ - public Line createLine() { - return new Line(); - } - - /** - * Create an instance of {@link Polyline } - */ - public Polyline createPolyline() { - return new Polyline(); - } - - /** - * Create an instance of {@link G } - */ - public G createG() { - return new G(); - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Polyline.java b/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Polyline.java deleted file mode 100644 index 0b17955d..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Polyline.java +++ /dev/null @@ -1,239 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:27:07 PM ART -// - - -package com.wisemapping.xml.svgmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="fill" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" fixed="none" />
- *       <attribute name="fill-opacity" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" />
- *       <attribute name="points" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="stroke" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="stroke-opacity" use="required">
- *         <simpleType>
- *           <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
- *             <enumeration value="0.4"/>
- *             <enumeration value="1"/>
- *           </restriction>
- *         </simpleType>
- *       </attribute>
- *       <attribute name="stroke-width" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" fixed="1px" />
- *       <attribute name="visibility" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@XmlRootElement(name = "polyline") -public class Polyline { - - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String fill; - @XmlAttribute(name = "fill-opacity") - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String fillOpacity; - @XmlAttribute - protected String points; - @XmlAttribute(required = true) - protected String stroke; - @XmlAttribute(name = "stroke-opacity", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String strokeOpacity; - @XmlAttribute(name = "stroke-width", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String strokeWidth; - @XmlAttribute - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String visibility; - - /** - * Gets the value of the fill property. - * - * @return possible object is - * {@link String } - */ - public String getFill() { - if (fill == null) { - return "none"; - } else { - return fill; - } - } - - /** - * Sets the value of the fill property. - * - * @param value allowed object is - * {@link String } - */ - public void setFill(String value) { - this.fill = value; - } - - /** - * Gets the value of the fillOpacity property. - * - * @return possible object is - * {@link String } - */ - public String getFillOpacity() { - return fillOpacity; - } - - /** - * Sets the value of the fillOpacity property. - * - * @param value allowed object is - * {@link String } - */ - public void setFillOpacity(String value) { - this.fillOpacity = value; - } - - /** - * Gets the value of the points property. - * - * @return possible object is - * {@link String } - */ - public String getPoints() { - return points; - } - - /** - * Sets the value of the points property. - * - * @param value allowed object is - * {@link String } - */ - public void setPoints(String value) { - this.points = value; - } - - /** - * Gets the value of the stroke property. - * - * @return possible object is - * {@link String } - */ - public String getStroke() { - return stroke; - } - - /** - * Sets the value of the stroke property. - * - * @param value allowed object is - * {@link String } - */ - public void setStroke(String value) { - this.stroke = value; - } - - /** - * Gets the value of the strokeOpacity property. - * - * @return possible object is - * {@link String } - */ - public String getStrokeOpacity() { - return strokeOpacity; - } - - /** - * Sets the value of the strokeOpacity property. - * - * @param value allowed object is - * {@link String } - */ - public void setStrokeOpacity(String value) { - this.strokeOpacity = value; - } - - /** - * Gets the value of the strokeWidth property. - * - * @return possible object is - * {@link String } - */ - public String getStrokeWidth() { - if (strokeWidth == null) { - return "1px"; - } else { - return strokeWidth; - } - } - - /** - * Sets the value of the strokeWidth property. - * - * @param value allowed object is - * {@link String } - */ - public void setStrokeWidth(String value) { - this.strokeWidth = value; - } - - /** - * Gets the value of the visibility property. - * - * @return possible object is - * {@link String } - */ - public String getVisibility() { - return visibility; - } - - /** - * Sets the value of the visibility property. - * - * @param value allowed object is - * {@link String } - */ - public void setVisibility(String value) { - this.visibility = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Rect.java b/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Rect.java deleted file mode 100644 index e18bc5c8..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Rect.java +++ /dev/null @@ -1,341 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:27:07 PM ART -// - - -package com.wisemapping.xml.svgmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="fill" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="fill-opacity" type="{http://www.w3.org/2001/XMLSchema}float" />
- *       <attribute name="height" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
- *       <attribute name="rx" type="{http://www.w3.org/2001/XMLSchema}float" />
- *       <attribute name="ry" type="{http://www.w3.org/2001/XMLSchema}float" />
- *       <attribute name="stroke" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="stroke-opacity" type="{http://www.w3.org/2001/XMLSchema}float" />
- *       <attribute name="stroke-width" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="style" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="visibility" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" />
- *       <attribute name="width" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" />
- *       <attribute name="x" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
- *       <attribute name="y" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@XmlRootElement(name = "rect") -public class Rect { - - @XmlAttribute(required = true) - protected String fill; - @XmlAttribute(name = "fill-opacity") - protected Float fillOpacity; - @XmlAttribute(required = true) - protected float height; - @XmlAttribute - protected Float rx; - @XmlAttribute - protected Float ry; - @XmlAttribute(required = true) - protected String stroke; - @XmlAttribute(name = "stroke-opacity") - protected Float strokeOpacity; - @XmlAttribute(name = "stroke-width", required = true) - protected String strokeWidth; - @XmlAttribute - protected String style; - @XmlAttribute - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String visibility; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String width; - @XmlAttribute(required = true) - protected float x; - @XmlAttribute(required = true) - protected float y; - - /** - * Gets the value of the fill property. - * - * @return possible object is - * {@link String } - */ - public String getFill() { - return fill; - } - - /** - * Sets the value of the fill property. - * - * @param value allowed object is - * {@link String } - */ - public void setFill(String value) { - this.fill = value; - } - - /** - * Gets the value of the fillOpacity property. - * - * @return possible object is - * {@link Float } - */ - public Float getFillOpacity() { - return fillOpacity; - } - - /** - * Sets the value of the fillOpacity property. - * - * @param value allowed object is - * {@link Float } - */ - public void setFillOpacity(Float value) { - this.fillOpacity = value; - } - - /** - * Gets the value of the height property. - */ - public float getHeight() { - return height; - } - - /** - * Sets the value of the height property. - */ - public void setHeight(float value) { - this.height = value; - } - - /** - * Gets the value of the rx property. - * - * @return possible object is - * {@link Float } - */ - public Float getRx() { - return rx; - } - - /** - * Sets the value of the rx property. - * - * @param value allowed object is - * {@link Float } - */ - public void setRx(Float value) { - this.rx = value; - } - - /** - * Gets the value of the ry property. - * - * @return possible object is - * {@link Float } - */ - public Float getRy() { - return ry; - } - - /** - * Sets the value of the ry property. - * - * @param value allowed object is - * {@link Float } - */ - public void setRy(Float value) { - this.ry = value; - } - - /** - * Gets the value of the stroke property. - * - * @return possible object is - * {@link String } - */ - public String getStroke() { - return stroke; - } - - /** - * Sets the value of the stroke property. - * - * @param value allowed object is - * {@link String } - */ - public void setStroke(String value) { - this.stroke = value; - } - - /** - * Gets the value of the strokeOpacity property. - * - * @return possible object is - * {@link Float } - */ - public Float getStrokeOpacity() { - return strokeOpacity; - } - - /** - * Sets the value of the strokeOpacity property. - * - * @param value allowed object is - * {@link Float } - */ - public void setStrokeOpacity(Float value) { - this.strokeOpacity = value; - } - - /** - * Gets the value of the strokeWidth property. - * - * @return possible object is - * {@link String } - */ - public String getStrokeWidth() { - return strokeWidth; - } - - /** - * Sets the value of the strokeWidth property. - * - * @param value allowed object is - * {@link String } - */ - public void setStrokeWidth(String value) { - this.strokeWidth = value; - } - - /** - * Gets the value of the style property. - * - * @return possible object is - * {@link String } - */ - public String getStyle() { - return style; - } - - /** - * Sets the value of the style property. - * - * @param value allowed object is - * {@link String } - */ - public void setStyle(String value) { - this.style = value; - } - - /** - * Gets the value of the visibility property. - * - * @return possible object is - * {@link String } - */ - public String getVisibility() { - return visibility; - } - - /** - * Sets the value of the visibility property. - * - * @param value allowed object is - * {@link String } - */ - public void setVisibility(String value) { - this.visibility = value; - } - - /** - * Gets the value of the width property. - * - * @return possible object is - * {@link String } - */ - public String getWidth() { - return width; - } - - /** - * Sets the value of the width property. - * - * @param value allowed object is - * {@link String } - */ - public void setWidth(String value) { - this.width = value; - } - - /** - * Gets the value of the x property. - */ - public float getX() { - return x; - } - - /** - * Sets the value of the x property. - */ - public void setX(float value) { - this.x = value; - } - - /** - * Gets the value of the y property. - */ - public float getY() { - return y; - } - - /** - * Sets the value of the y property. - */ - public void setY(float value) { - this.y = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Svg.java b/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Svg.java deleted file mode 100644 index f29330b9..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Svg.java +++ /dev/null @@ -1,331 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:27:07 PM ART -// - - -package com.wisemapping.xml.svgmap; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://www.w3.org/2000/svg}polyline" maxOccurs="unbounded"/>
- *         <element ref="{http://www.w3.org/2000/svg}line" maxOccurs="unbounded"/>
- *         <element ref="{http://www.w3.org/2000/svg}g" maxOccurs="unbounded"/>
- *         <element ref="{http://www.w3.org/2000/svg}rect" maxOccurs="unbounded"/>
- *       </sequence>
- *       <attribute name="focusable" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" />
- *       <attribute name="height" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" />
- *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" />
- *       <attribute name="preserveAspectRatio" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" />
- *       <attribute name="viewBox" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="width" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "polyline", - "line", - "g", - "rect" - }) -@XmlRootElement(name = "svg") -public class Svg { - - @XmlElement(required = true) - protected List polyline; - @XmlElement(required = true) - protected List line; - @XmlElement(required = true) - protected List g; - @XmlElement(required = true) - protected List rect; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String focusable; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String height; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String id; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String preserveAspectRatio; - @XmlAttribute(required = true) - protected String viewBox; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String width; - - /** - * Gets the value of the polyline property. - *

- *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the polyline property. - *

- *

- * For example, to add a new item, do as follows: - *

-     *    getPolyline().add(newItem);
-     * 
- *

- *

- *

- * Objects of the following type(s) are allowed in the list - * {@link Polyline } - */ - public List getPolyline() { - if (polyline == null) { - polyline = new ArrayList(); - } - return this.polyline; - } - - /** - * Gets the value of the line property. - *

- *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the line property. - *

- *

- * For example, to add a new item, do as follows: - *

-     *    getLine().add(newItem);
-     * 
- *

- *

- *

- * Objects of the following type(s) are allowed in the list - * {@link Line } - */ - public List getLine() { - if (line == null) { - line = new ArrayList(); - } - return this.line; - } - - /** - * Gets the value of the g property. - *

- *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the g property. - *

- *

- * For example, to add a new item, do as follows: - *

-     *    getG().add(newItem);
-     * 
- *

- *

- *

- * Objects of the following type(s) are allowed in the list - * {@link G } - */ - public List getG() { - if (g == null) { - g = new ArrayList(); - } - return this.g; - } - - /** - * Gets the value of the rect property. - *

- *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the rect property. - *

- *

- * For example, to add a new item, do as follows: - *

-     *    getRect().add(newItem);
-     * 
- *

- *

- *

- * Objects of the following type(s) are allowed in the list - * {@link Rect } - */ - public List getRect() { - if (rect == null) { - rect = new ArrayList(); - } - return this.rect; - } - - /** - * Gets the value of the focusable property. - * - * @return possible object is - * {@link String } - */ - public String getFocusable() { - return focusable; - } - - /** - * Sets the value of the focusable property. - * - * @param value allowed object is - * {@link String } - */ - public void setFocusable(String value) { - this.focusable = value; - } - - /** - * Gets the value of the height property. - * - * @return possible object is - * {@link String } - */ - public String getHeight() { - return height; - } - - /** - * Sets the value of the height property. - * - * @param value allowed object is - * {@link String } - */ - public void setHeight(String value) { - this.height = value; - } - - /** - * Gets the value of the id property. - * - * @return possible object is - * {@link String } - */ - public String getId() { - return id; - } - - /** - * Sets the value of the id property. - * - * @param value allowed object is - * {@link String } - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets the value of the preserveAspectRatio property. - * - * @return possible object is - * {@link String } - */ - public String getPreserveAspectRatio() { - return preserveAspectRatio; - } - - /** - * Sets the value of the preserveAspectRatio property. - * - * @param value allowed object is - * {@link String } - */ - public void setPreserveAspectRatio(String value) { - this.preserveAspectRatio = value; - } - - /** - * Gets the value of the viewBox property. - * - * @return possible object is - * {@link String } - */ - public String getViewBox() { - return viewBox; - } - - /** - * Sets the value of the viewBox property. - * - * @param value allowed object is - * {@link String } - */ - public void setViewBox(String value) { - this.viewBox = value; - } - - /** - * Gets the value of the width property. - * - * @return possible object is - * {@link String } - */ - public String getWidth() { - return width; - } - - /** - * Sets the value of the width property. - * - * @param value allowed object is - * {@link String } - */ - public void setWidth(String value) { - this.width = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Text.java b/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Text.java deleted file mode 100644 index b538eef6..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/Text.java +++ /dev/null @@ -1,298 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:27:07 PM ART -// - - -package com.wisemapping.xml.svgmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="fill" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="focusable" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" fixed="true" />
- *       <attribute name="font-family" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" fixed="verdana" />
- *       <attribute name="font-size" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
- *       <attribute name="font-style" use="required">
- *         <simpleType>
- *           <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
- *             <enumeration value="italic"/>
- *             <enumeration value="normal"/>
- *           </restriction>
- *         </simpleType>
- *       </attribute>
- *       <attribute name="font-weight" use="required">
- *         <simpleType>
- *           <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
- *             <enumeration value="bold"/>
- *             <enumeration value="normal"/>
- *           </restriction>
- *         </simpleType>
- *       </attribute>
- *       <attribute name="style" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="x" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
- *       <attribute name="y" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "content" - }) -@XmlRootElement(name = "text") -public class Text { - - @XmlValue - protected String content; - @XmlAttribute(required = true) - protected String fill; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String focusable; - @XmlAttribute(name = "font-family", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String fontFamily; - @XmlAttribute(name = "font-size", required = true) - protected float fontSize; - @XmlAttribute(name = "font-style", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String fontStyle; - @XmlAttribute(name = "font-weight", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String fontWeight; - @XmlAttribute(required = true) - protected String style; - @XmlAttribute(required = true) - protected float x; - @XmlAttribute(required = true) - protected float y; - - /** - * Gets the value of the content property. - * - * @return possible object is - * {@link String } - */ - public String getContent() { - return content; - } - - /** - * Sets the value of the content property. - * - * @param value allowed object is - * {@link String } - */ - public void setContent(String value) { - this.content = value; - } - - /** - * Gets the value of the fill property. - * - * @return possible object is - * {@link String } - */ - public String getFill() { - return fill; - } - - /** - * Sets the value of the fill property. - * - * @param value allowed object is - * {@link String } - */ - public void setFill(String value) { - this.fill = value; - } - - /** - * Gets the value of the focusable property. - * - * @return possible object is - * {@link String } - */ - public String getFocusable() { - if (focusable == null) { - return "true"; - } else { - return focusable; - } - } - - /** - * Sets the value of the focusable property. - * - * @param value allowed object is - * {@link String } - */ - public void setFocusable(String value) { - this.focusable = value; - } - - /** - * Gets the value of the fontFamily property. - * - * @return possible object is - * {@link String } - */ - public String getFontFamily() { - if (fontFamily == null) { - return "verdana"; - } else { - return fontFamily; - } - } - - /** - * Sets the value of the fontFamily property. - * - * @param value allowed object is - * {@link String } - */ - public void setFontFamily(String value) { - this.fontFamily = value; - } - - /** - * Gets the value of the fontSize property. - */ - public float getFontSize() { - return fontSize; - } - - /** - * Sets the value of the fontSize property. - */ - public void setFontSize(float value) { - this.fontSize = value; - } - - /** - * Gets the value of the fontStyle property. - * - * @return possible object is - * {@link String } - */ - public String getFontStyle() { - return fontStyle; - } - - /** - * Sets the value of the fontStyle property. - * - * @param value allowed object is - * {@link String } - */ - public void setFontStyle(String value) { - this.fontStyle = value; - } - - /** - * Gets the value of the fontWeight property. - * - * @return possible object is - * {@link String } - */ - public String getFontWeight() { - return fontWeight; - } - - /** - * Sets the value of the fontWeight property. - * - * @param value allowed object is - * {@link String } - */ - public void setFontWeight(String value) { - this.fontWeight = value; - } - - /** - * Gets the value of the style property. - * - * @return possible object is - * {@link String } - */ - public String getStyle() { - return style; - } - - /** - * Sets the value of the style property. - * - * @param value allowed object is - * {@link String } - */ - public void setStyle(String value) { - this.style = value; - } - - /** - * Gets the value of the x property. - */ - public float getX() { - return x; - } - - /** - * Sets the value of the x property. - */ - public void setX(float value) { - this.x = value; - } - - /** - * Gets the value of the y property. - */ - public float getY() { - return y; - } - - /** - * Sets the value of the y property. - */ - public void setY(float value) { - this.y = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/package-info.java b/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/package-info.java deleted file mode 100644 index b59f5d9e..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/svgmap/package-info.java +++ /dev/null @@ -1,26 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:27:07 PM ART -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.w3.org/2000/svg", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package com.wisemapping.xml.svgmap; diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Element.java b/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Element.java deleted file mode 100644 index 7104dc30..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Element.java +++ /dev/null @@ -1,169 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:18:25 PM ART -// - - -package com.wisemapping.xml.vmlmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for element complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType name="element">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="fillcolor" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="opacity" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="strokecolor" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="strokeweight" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="style" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "element") -public class Element { - - @XmlAttribute - protected String fillcolor; - @XmlAttribute - protected String opacity; - @XmlAttribute(required = true) - protected String strokecolor; - @XmlAttribute - protected String strokeweight; - @XmlAttribute - protected String style; - - /** - * Gets the value of the fillcolor property. - * - * @return possible object is - * {@link String } - */ - public String getFillcolor() { - return fillcolor; - } - - /** - * Sets the value of the fillcolor property. - * - * @param value allowed object is - * {@link String } - */ - public void setFillcolor(String value) { - this.fillcolor = value; - } - - /** - * Gets the value of the opacity property. - * - * @return possible object is - * {@link String } - */ - public String getOpacity() { - return opacity; - } - - /** - * Sets the value of the opacity property. - * - * @param value allowed object is - * {@link String } - */ - public void setOpacity(String value) { - this.opacity = value; - } - - /** - * Gets the value of the strokecolor property. - * - * @return possible object is - * {@link String } - */ - public String getStrokecolor() { - return strokecolor; - } - - /** - * Sets the value of the strokecolor property. - * - * @param value allowed object is - * {@link String } - */ - public void setStrokecolor(String value) { - this.strokecolor = value; - } - - /** - * Gets the value of the strokeweight property. - * - * @return possible object is - * {@link String } - */ - public String getStrokeweight() { - return strokeweight; - } - - /** - * Sets the value of the strokeweight property. - * - * @param value allowed object is - * {@link String } - */ - public void setStrokeweight(String value) { - this.strokeweight = value; - } - - /** - * Gets the value of the style property. - * - * @return possible object is - * {@link String } - */ - public String getStyle() { - return style; - } - - /** - * Sets the value of the style property. - * - * @param value allowed object is - * {@link String } - */ - public void setStyle(String value) { - this.style = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Fill.java b/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Fill.java deleted file mode 100644 index f5b9e08c..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Fill.java +++ /dev/null @@ -1,79 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:18:25 PM ART -// - - -package com.wisemapping.xml.vmlmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="opacity" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@XmlRootElement(name = "fill") -public class Fill { - - @XmlAttribute - protected String opacity; - - /** - * Gets the value of the opacity property. - * - * @return possible object is - * {@link String } - */ - public String getOpacity() { - return opacity; - } - - /** - * Sets the value of the opacity property. - * - * @param value allowed object is - * {@link String } - */ - public void setOpacity(String value) { - this.opacity = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Group.java b/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Group.java deleted file mode 100644 index 276bb541..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Group.java +++ /dev/null @@ -1,318 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:18:25 PM ART -// - - -package com.wisemapping.xml.vmlmap; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <extension base="{http://mindmap.com/xml/vmlmap}element">
- *       <choice>
- *         <element ref="{http://mindmap.com/xml/vmlmap}group" maxOccurs="unbounded"/>
- *         <element ref="{http://mindmap.com/xml/vmlmap}line" maxOccurs="unbounded"/>
- *         <element ref="{http://mindmap.com/xml/vmlmap}oval" maxOccurs="unbounded"/>
- *         <element ref="{http://mindmap.com/xml/vmlmap}polyline" maxOccurs="unbounded"/>
- *         <element ref="{http://mindmap.com/xml/vmlmap}rect" maxOccurs="unbounded"/>
- *         <element ref="{http://mindmap.com/xml/vmlmap}roundrect" maxOccurs="unbounded"/>
- *         <element ref="{http://mindmap.com/xml/vmlmap}shape" maxOccurs="unbounded"/>
- *       </choice>
- *       <attribute name="coordorigin" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="coordsize" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "group", - "line", - "oval", - "polyline", - "rect", - "roundrect", - "shape" - }) -@XmlRootElement(name = "group") -public class Group - extends Element { - - protected List group; - protected List line; - protected List oval; - protected List polyline; - protected List rect; - protected List roundrect; - protected List shape; - @XmlAttribute - protected String coordorigin; - @XmlAttribute(required = true) - protected String coordsize; - - /** - * Gets the value of the group property. - *

- *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the group property. - *

- *

- * For example, to add a new item, do as follows: - *

-     *    getGroup().add(newItem);
-     * 
- *

- *

- *

- * Objects of the following type(s) are allowed in the list - * {@link Group } - */ - public List getGroup() { - if (group == null) { - group = new ArrayList(); - } - return this.group; - } - - /** - * Gets the value of the line property. - *

- *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the line property. - *

- *

- * For example, to add a new item, do as follows: - *

-     *    getLine().add(newItem);
-     * 
- *

- *

- *

- * Objects of the following type(s) are allowed in the list - * {@link Line } - */ - public List getLine() { - if (line == null) { - line = new ArrayList(); - } - return this.line; - } - - /** - * Gets the value of the oval property. - *

- *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the oval property. - *

- *

- * For example, to add a new item, do as follows: - *

-     *    getOval().add(newItem);
-     * 
- *

- *

- *

- * Objects of the following type(s) are allowed in the list - * {@link Oval } - */ - public List getOval() { - if (oval == null) { - oval = new ArrayList(); - } - return this.oval; - } - - /** - * Gets the value of the polyline property. - *

- *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the polyline property. - *

- *

- * For example, to add a new item, do as follows: - *

-     *    getPolyline().add(newItem);
-     * 
- *

- *

- *

- * Objects of the following type(s) are allowed in the list - * {@link Polyline } - */ - public List getPolyline() { - if (polyline == null) { - polyline = new ArrayList(); - } - return this.polyline; - } - - /** - * Gets the value of the rect property. - *

- *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the rect property. - *

- *

- * For example, to add a new item, do as follows: - *

-     *    getRect().add(newItem);
-     * 
- *

- *

- *

- * Objects of the following type(s) are allowed in the list - * {@link Rect } - */ - public List getRect() { - if (rect == null) { - rect = new ArrayList(); - } - return this.rect; - } - - /** - * Gets the value of the roundrect property. - *

- *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the roundrect property. - *

- *

- * For example, to add a new item, do as follows: - *

-     *    getRoundrect().add(newItem);
-     * 
- *

- *

- *

- * Objects of the following type(s) are allowed in the list - * {@link Roundrect } - */ - public List getRoundrect() { - if (roundrect == null) { - roundrect = new ArrayList(); - } - return this.roundrect; - } - - /** - * Gets the value of the shape property. - *

- *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the shape property. - *

- *

- * For example, to add a new item, do as follows: - *

-     *    getShape().add(newItem);
-     * 
- *

- *

- *

- * Objects of the following type(s) are allowed in the list - * {@link Shape } - */ - public List getShape() { - if (shape == null) { - shape = new ArrayList(); - } - return this.shape; - } - - /** - * Gets the value of the coordorigin property. - * - * @return possible object is - * {@link String } - */ - public String getCoordorigin() { - return coordorigin; - } - - /** - * Sets the value of the coordorigin property. - * - * @param value allowed object is - * {@link String } - */ - public void setCoordorigin(String value) { - this.coordorigin = value; - } - - /** - * Gets the value of the coordsize property. - * - * @return possible object is - * {@link String } - */ - public String getCoordsize() { - return coordsize; - } - - /** - * Sets the value of the coordsize property. - * - * @param value allowed object is - * {@link String } - */ - public void setCoordsize(String value) { - this.coordsize = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Line.java b/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Line.java deleted file mode 100644 index e2273d36..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Line.java +++ /dev/null @@ -1,184 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:18:25 PM ART -// - - -package com.wisemapping.xml.vmlmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <extension base="{http://mindmap.com/xml/vmlmap}element">
- *       <sequence>
- *         <element ref="{http://mindmap.com/xml/vmlmap}stroke"/>
- *         <element ref="{http://mindmap.com/xml/vmlmap}fill" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="from" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="stroked" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" fixed="t" />
- *       <attribute name="to" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "stroke", - "fill" - }) -@XmlRootElement(name = "line") -public class Line - extends Element { - - @XmlElement(required = true) - protected Stroke stroke; - protected Fill fill; - @XmlAttribute(required = true) - protected String from; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String stroked; - @XmlAttribute(required = true) - protected String to; - - /** - * Gets the value of the stroke property. - * - * @return possible object is - * {@link Stroke } - */ - public Stroke getStroke() { - return stroke; - } - - /** - * Sets the value of the stroke property. - * - * @param value allowed object is - * {@link Stroke } - */ - public void setStroke(Stroke value) { - this.stroke = value; - } - - /** - * Gets the value of the fill property. - * - * @return possible object is - * {@link Fill } - */ - public Fill getFill() { - return fill; - } - - /** - * Sets the value of the fill property. - * - * @param value allowed object is - * {@link Fill } - */ - public void setFill(Fill value) { - this.fill = value; - } - - /** - * Gets the value of the from property. - * - * @return possible object is - * {@link String } - */ - public String getFrom() { - return from; - } - - /** - * Sets the value of the from property. - * - * @param value allowed object is - * {@link String } - */ - public void setFrom(String value) { - this.from = value; - } - - /** - * Gets the value of the stroked property. - * - * @return possible object is - * {@link String } - */ - public String getStroked() { - if (stroked == null) { - return "t"; - } else { - return stroked; - } - } - - /** - * Sets the value of the stroked property. - * - * @param value allowed object is - * {@link String } - */ - public void setStroked(String value) { - this.stroked = value; - } - - /** - * Gets the value of the to property. - * - * @return possible object is - * {@link String } - */ - public String getTo() { - return to; - } - - /** - * Sets the value of the to property. - * - * @param value allowed object is - * {@link String } - */ - public void setTo(String value) { - this.to = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/ObjectFactory.java b/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/ObjectFactory.java deleted file mode 100644 index a49e029b..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/ObjectFactory.java +++ /dev/null @@ -1,139 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:18:25 PM ART -// - - -package com.wisemapping.xml.vmlmap; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the com.mindmap.xml.vmlmap package. - *

An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - */ -@XmlRegistry -public class ObjectFactory { - - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.mindmap.xml.vmlmap - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link Textbox } - */ - public Textbox createTextbox() { - return new Textbox(); - } - - /** - * Create an instance of {@link Shape } - */ - public Shape createShape() { - return new Shape(); - } - - /** - * Create an instance of {@link Roundrect } - */ - public Roundrect createRoundrect() { - return new Roundrect(); - } - - /** - * Create an instance of {@link Oval } - */ - public Oval createOval() { - return new Oval(); - } - - /** - * Create an instance of {@link Textbox.SPAN } - */ - public Textbox.SPAN createTextboxSPAN() { - return new Textbox.SPAN(); - } - - /** - * Create an instance of {@link Rect } - */ - public Rect createRect() { - return new Rect(); - } - - /** - * Create an instance of {@link Element } - */ - public Element createElement() { - return new Element(); - } - - /** - * Create an instance of {@link Line } - */ - public Line createLine() { - return new Line(); - } - - /** - * Create an instance of {@link Group } - */ - public Group createGroup() { - return new Group(); - } - - /** - * Create an instance of {@link Stroke } - */ - public Stroke createStroke() { - return new Stroke(); - } - - /** - * Create an instance of {@link Polyline } - */ - public Polyline createPolyline() { - return new Polyline(); - } - - /** - * Create an instance of {@link Fill } - */ - public Fill createFill() { - return new Fill(); - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Oval.java b/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Oval.java deleted file mode 100644 index 3250b7a6..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Oval.java +++ /dev/null @@ -1,166 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:18:25 PM ART -// - - -package com.wisemapping.xml.vmlmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <extension base="{http://mindmap.com/xml/vmlmap}element">
- *       <sequence>
- *         <element ref="{http://mindmap.com/xml/vmlmap}stroke"/>
- *         <element ref="{http://mindmap.com/xml/vmlmap}fill"/>
- *       </sequence>
- *       <attribute name="coordsize" use="required" type="{http://www.w3.org/2001/XMLSchema}string" fixed="21600,21600" />
- *       <attribute name="stroked" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" fixed="t" />
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "stroke", - "fill" - }) -@XmlRootElement(name = "oval") -public class Oval - extends Element { - - @XmlElement(required = true) - protected Stroke stroke; - @XmlElement(required = true) - protected Fill fill; - @XmlAttribute(required = true) - protected String coordsize; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String stroked; - - /** - * Gets the value of the stroke property. - * - * @return possible object is - * {@link Stroke } - */ - public Stroke getStroke() { - return stroke; - } - - /** - * Sets the value of the stroke property. - * - * @param value allowed object is - * {@link Stroke } - */ - public void setStroke(Stroke value) { - this.stroke = value; - } - - /** - * Gets the value of the fill property. - * - * @return possible object is - * {@link Fill } - */ - public Fill getFill() { - return fill; - } - - /** - * Sets the value of the fill property. - * - * @param value allowed object is - * {@link Fill } - */ - public void setFill(Fill value) { - this.fill = value; - } - - /** - * Gets the value of the coordsize property. - * - * @return possible object is - * {@link String } - */ - public String getCoordsize() { - if (coordsize == null) { - return "21600,21600"; - } else { - return coordsize; - } - } - - /** - * Sets the value of the coordsize property. - * - * @param value allowed object is - * {@link String } - */ - public void setCoordsize(String value) { - this.coordsize = value; - } - - /** - * Gets the value of the stroked property. - * - * @return possible object is - * {@link String } - */ - public String getStroked() { - if (stroked == null) { - return "t"; - } else { - return stroked; - } - } - - /** - * Sets the value of the stroked property. - * - * @param value allowed object is - * {@link String } - */ - public void setStroked(String value) { - this.stroked = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Polyline.java b/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Polyline.java deleted file mode 100644 index 17023c8c..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Polyline.java +++ /dev/null @@ -1,184 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:18:25 PM ART -// - - -package com.wisemapping.xml.vmlmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <extension base="{http://mindmap.com/xml/vmlmap}element">
- *       <sequence>
- *         <element ref="{http://mindmap.com/xml/vmlmap}stroke"/>
- *         <element ref="{http://mindmap.com/xml/vmlmap}fill" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="filled" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" fixed="f" />
- *       <attribute name="points" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="xPoints" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "stroke", - "fill" - }) -@XmlRootElement(name = "polyline") -public class Polyline - extends Element { - - @XmlElement(required = true) - protected Stroke stroke; - protected Fill fill; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String filled; - @XmlAttribute - protected String points; - @XmlAttribute - protected String xPoints; - - /** - * Gets the value of the stroke property. - * - * @return possible object is - * {@link Stroke } - */ - public Stroke getStroke() { - return stroke; - } - - /** - * Sets the value of the stroke property. - * - * @param value allowed object is - * {@link Stroke } - */ - public void setStroke(Stroke value) { - this.stroke = value; - } - - /** - * Gets the value of the fill property. - * - * @return possible object is - * {@link Fill } - */ - public Fill getFill() { - return fill; - } - - /** - * Sets the value of the fill property. - * - * @param value allowed object is - * {@link Fill } - */ - public void setFill(Fill value) { - this.fill = value; - } - - /** - * Gets the value of the filled property. - * - * @return possible object is - * {@link String } - */ - public String getFilled() { - if (filled == null) { - return "f"; - } else { - return filled; - } - } - - /** - * Sets the value of the filled property. - * - * @param value allowed object is - * {@link String } - */ - public void setFilled(String value) { - this.filled = value; - } - - /** - * Gets the value of the points property. - * - * @return possible object is - * {@link String } - */ - public String getPoints() { - return points; - } - - /** - * Sets the value of the points property. - * - * @param value allowed object is - * {@link String } - */ - public void setPoints(String value) { - this.points = value; - } - - /** - * Gets the value of the xPoints property. - * - * @return possible object is - * {@link String } - */ - public String getXPoints() { - return xPoints; - } - - /** - * Sets the value of the xPoints property. - * - * @param value allowed object is - * {@link String } - */ - public void setXPoints(String value) { - this.xPoints = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Rect.java b/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Rect.java deleted file mode 100644 index 9f69180f..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Rect.java +++ /dev/null @@ -1,158 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:18:25 PM ART -// - - -package com.wisemapping.xml.vmlmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <extension base="{http://mindmap.com/xml/vmlmap}element">
- *       <sequence>
- *         <element ref="{http://mindmap.com/xml/vmlmap}stroke"/>
- *         <element ref="{http://mindmap.com/xml/vmlmap}fill"/>
- *       </sequence>
- *       <attribute name="coordsize" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="stroked" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" />
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "stroke", - "fill" - }) -@XmlRootElement(name = "rect") -public class Rect - extends Element { - - @XmlElement(required = true) - protected Stroke stroke; - @XmlElement(required = true) - protected Fill fill; - @XmlAttribute(required = true) - protected String coordsize; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String stroked; - - /** - * Gets the value of the stroke property. - * - * @return possible object is - * {@link Stroke } - */ - public Stroke getStroke() { - return stroke; - } - - /** - * Sets the value of the stroke property. - * - * @param value allowed object is - * {@link Stroke } - */ - public void setStroke(Stroke value) { - this.stroke = value; - } - - /** - * Gets the value of the fill property. - * - * @return possible object is - * {@link Fill } - */ - public Fill getFill() { - return fill; - } - - /** - * Sets the value of the fill property. - * - * @param value allowed object is - * {@link Fill } - */ - public void setFill(Fill value) { - this.fill = value; - } - - /** - * Gets the value of the coordsize property. - * - * @return possible object is - * {@link String } - */ - public String getCoordsize() { - return coordsize; - } - - /** - * Sets the value of the coordsize property. - * - * @param value allowed object is - * {@link String } - */ - public void setCoordsize(String value) { - this.coordsize = value; - } - - /** - * Gets the value of the stroked property. - * - * @return possible object is - * {@link String } - */ - public String getStroked() { - return stroked; - } - - /** - * Sets the value of the stroked property. - * - * @param value allowed object is - * {@link String } - */ - public void setStroked(String value) { - this.stroked = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Roundrect.java b/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Roundrect.java deleted file mode 100644 index 37b1efd4..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Roundrect.java +++ /dev/null @@ -1,166 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:18:25 PM ART -// - - -package com.wisemapping.xml.vmlmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <extension base="{http://mindmap.com/xml/vmlmap}element">
- *       <sequence>
- *         <element ref="{http://mindmap.com/xml/vmlmap}stroke"/>
- *         <element ref="{http://mindmap.com/xml/vmlmap}fill"/>
- *       </sequence>
- *       <attribute name="arcsize" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" fixed="9830f" />
- *       <attribute name="coordsize" use="required" type="{http://www.w3.org/2001/XMLSchema}string" fixed="21600,21600" />
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "stroke", - "fill" - }) -@XmlRootElement(name = "roundrect") -public class Roundrect - extends Element { - - @XmlElement(required = true) - protected Stroke stroke; - @XmlElement(required = true) - protected Fill fill; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String arcsize; - @XmlAttribute(required = true) - protected String coordsize; - - /** - * Gets the value of the stroke property. - * - * @return possible object is - * {@link Stroke } - */ - public Stroke getStroke() { - return stroke; - } - - /** - * Sets the value of the stroke property. - * - * @param value allowed object is - * {@link Stroke } - */ - public void setStroke(Stroke value) { - this.stroke = value; - } - - /** - * Gets the value of the fill property. - * - * @return possible object is - * {@link Fill } - */ - public Fill getFill() { - return fill; - } - - /** - * Sets the value of the fill property. - * - * @param value allowed object is - * {@link Fill } - */ - public void setFill(Fill value) { - this.fill = value; - } - - /** - * Gets the value of the arcsize property. - * - * @return possible object is - * {@link String } - */ - public String getArcsize() { - if (arcsize == null) { - return "9830f"; - } else { - return arcsize; - } - } - - /** - * Sets the value of the arcsize property. - * - * @param value allowed object is - * {@link String } - */ - public void setArcsize(String value) { - this.arcsize = value; - } - - /** - * Gets the value of the coordsize property. - * - * @return possible object is - * {@link String } - */ - public String getCoordsize() { - if (coordsize == null) { - return "21600,21600"; - } else { - return coordsize; - } - } - - /** - * Sets the value of the coordsize property. - * - * @param value allowed object is - * {@link String } - */ - public void setCoordsize(String value) { - this.coordsize = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Shape.java b/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Shape.java deleted file mode 100644 index 4f32c253..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Shape.java +++ /dev/null @@ -1,112 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:18:25 PM ART -// - - -package com.wisemapping.xml.vmlmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <extension base="{http://mindmap.com/xml/vmlmap}element">
- *       <sequence>
- *         <element ref="{http://mindmap.com/xml/vmlmap}textbox"/>
- *       </sequence>
- *       <attribute name="coordsize" use="required" type="{http://www.w3.org/2001/XMLSchema}string" fixed="100,100" />
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "textbox" - }) -@XmlRootElement(name = "shape") -public class Shape - extends Element { - - @XmlElement(required = true) - protected Textbox textbox; - @XmlAttribute(required = true) - protected String coordsize; - - /** - * Gets the value of the textbox property. - * - * @return possible object is - * {@link Textbox } - */ - public Textbox getTextbox() { - return textbox; - } - - /** - * Sets the value of the textbox property. - * - * @param value allowed object is - * {@link Textbox } - */ - public void setTextbox(Textbox value) { - this.textbox = value; - } - - /** - * Gets the value of the coordsize property. - * - * @return possible object is - * {@link String } - */ - public String getCoordsize() { - if (coordsize == null) { - return "100,100"; - } else { - return coordsize; - } - } - - /** - * Sets the value of the coordsize property. - * - * @param value allowed object is - * {@link String } - */ - public void setCoordsize(String value) { - this.coordsize = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Stroke.java b/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Stroke.java deleted file mode 100644 index b882fdc8..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Stroke.java +++ /dev/null @@ -1,88 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:18:25 PM ART -// - - -package com.wisemapping.xml.vmlmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="dashstyle">
- *         <simpleType>
- *           <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
- *             <enumeration value="solid"/>
- *           </restriction>
- *         </simpleType>
- *       </attribute>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@XmlRootElement(name = "stroke") -public class Stroke { - - @XmlAttribute - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String dashstyle; - - /** - * Gets the value of the dashstyle property. - * - * @return possible object is - * {@link String } - */ - public String getDashstyle() { - return dashstyle; - } - - /** - * Sets the value of the dashstyle property. - * - * @param value allowed object is - * {@link String } - */ - public void setDashstyle(String value) { - this.dashstyle = value; - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Textbox.java b/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Textbox.java deleted file mode 100644 index b220c4cf..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/Textbox.java +++ /dev/null @@ -1,211 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:18:25 PM ART -// - - -package com.wisemapping.xml.vmlmap; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <complexType>
- *   <complexContent>
- *     <extension base="{http://mindmap.com/xml/vmlmap}element">
- *       <sequence>
- *         <element name="SPAN">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="SPAN" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *       <attribute name="inset" use="required" type="{http://www.w3.org/2001/XMLSchema}string" fixed="0,0,0,0" />
- *       <attribute name="xFontScale" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
- *       <attribute name="xTextSize" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "span" - }) -@XmlRootElement(name = "textbox") -public class Textbox - extends Element { - - @XmlElement(name = "SPAN", namespace = "", required = true) - protected Textbox.SPAN span; - @XmlAttribute(required = true) - protected String inset; - @XmlAttribute(required = true) - protected float xFontScale; - @XmlAttribute(required = true) - protected String xTextSize; - - /** - * Gets the value of the span property. - * - * @return possible object is - * {@link Textbox.SPAN } - */ - public Textbox.SPAN getSPAN() { - return span; - } - - /** - * Sets the value of the span property. - * - * @param value allowed object is - * {@link Textbox.SPAN } - */ - public void setSPAN(Textbox.SPAN value) { - this.span = value; - } - - /** - * Gets the value of the inset property. - * - * @return possible object is - * {@link String } - */ - public String getInset() { - if (inset == null) { - return "0,0,0,0"; - } else { - return inset; - } - } - - /** - * Sets the value of the inset property. - * - * @param value allowed object is - * {@link String } - */ - public void setInset(String value) { - this.inset = value; - } - - /** - * Gets the value of the xFontScale property. - */ - public float getXFontScale() { - return xFontScale; - } - - /** - * Sets the value of the xFontScale property. - */ - public void setXFontScale(float value) { - this.xFontScale = value; - } - - /** - * Gets the value of the xTextSize property. - * - * @return possible object is - * {@link String } - */ - public String getXTextSize() { - return xTextSize; - } - - /** - * Sets the value of the xTextSize property. - * - * @param value allowed object is - * {@link String } - */ - public void setXTextSize(String value) { - this.xTextSize = value; - } - - - /** - *

Java class for anonymous complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

- *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <sequence>
-     *         <element name="SPAN" type="{http://www.w3.org/2001/XMLSchema}string"/>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "span" - }) - public static class SPAN { - - @XmlElement(name = "SPAN", namespace = "", required = true) - protected String span; - - /** - * Gets the value of the span property. - * - * @return possible object is - * {@link String } - */ - public String getSPAN() { - return span; - } - - /** - * Sets the value of the span property. - * - * @param value allowed object is - * {@link String } - */ - public void setSPAN(String value) { - this.span = value; - } - - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/package-info.java b/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/package-info.java deleted file mode 100644 index 381607ee..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/xml/vmlmap/package-info.java +++ /dev/null @@ -1,26 +0,0 @@ -/* -* Copyright [2011] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2007.04.14 at 05:18:25 PM ART -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://wisemapping.com/xml/vmlmap", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package com.wisemapping.xml.vmlmap; diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/freemind_0_9_0.xsd b/wise-webapp/src/main/resources/freemind_0.9.0.xsd similarity index 97% rename from wise-webapp/src/main/java/com/wisemapping/xml/freemind_0_9_0.xsd rename to wise-webapp/src/main/resources/freemind_0.9.0.xsd index 7de99d23..59c54621 100755 --- a/wise-webapp/src/main/java/com/wisemapping/xml/freemind_0_9_0.xsd +++ b/wise-webapp/src/main/resources/freemind_0.9.0.xsd @@ -1,159 +1,159 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wise-webapp/src/main/resources/mindmap.xjb b/wise-webapp/src/main/resources/mindmap.xjb new file mode 100644 index 00000000..b864d5d7 --- /dev/null +++ b/wise-webapp/src/main/resources/mindmap.xjb @@ -0,0 +1,14 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/wise-webapp/src/main/resources/mindmap.xsd b/wise-webapp/src/main/resources/mindmap.xsd old mode 100755 new mode 100644 index 7928ff60..c4697b35 --- a/wise-webapp/src/main/resources/mindmap.xsd +++ b/wise-webapp/src/main/resources/mindmap.xsd @@ -1,64 +1,69 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wise-webapp/src/main/resources/wiseservices.wsdl b/wise-webapp/src/main/resources/wiseservices.wsdl deleted file mode 100644 index fc66cfec..00000000 --- a/wise-webapp/src/main/resources/wiseservices.wsdl +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/wise-webapp/src/test/data/freemind/basic.mmr b/wise-webapp/src/test/data/freemind/basic.mmr index 00c4d5b3..ccc84af8 100644 --- a/wise-webapp/src/test/data/freemind/basic.mmr +++ b/wise-webapp/src/test/data/freemind/basic.mmr @@ -1 +1,15 @@ - \ No newline at end of file + + + + + + + + + + + + + + + diff --git a/wise-webapp/src/test/data/freemind/basic.wxml b/wise-webapp/src/test/data/freemind/basic.wxml index 583599f9..2efdbb2d 100644 --- a/wise-webapp/src/test/data/freemind/basic.wxml +++ b/wise-webapp/src/test/data/freemind/basic.wxml @@ -1 +1,30 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wise-webapp/src/test/data/freemind/fonts.mmr b/wise-webapp/src/test/data/freemind/fonts.mmr index 71f8c15f..4050a195 100644 --- a/wise-webapp/src/test/data/freemind/fonts.mmr +++ b/wise-webapp/src/test/data/freemind/fonts.mmr @@ -1 +1,40 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wise-webapp/src/test/data/freemind/fonts.wxml b/wise-webapp/src/test/data/freemind/fonts.wxml index cc1b4161..ea07cdfe 100644 --- a/wise-webapp/src/test/data/freemind/fonts.wxml +++ b/wise-webapp/src/test/data/freemind/fonts.wxml @@ -1 +1,55 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wise-webapp/src/test/data/freemind/i18n.mmr b/wise-webapp/src/test/data/freemind/i18n.mmr index a1476b37..797635d7 100644 --- a/wise-webapp/src/test/data/freemind/i18n.mmr +++ b/wise-webapp/src/test/data/freemind/i18n.mmr @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/wise-webapp/src/test/data/freemind/i18n.wxml b/wise-webapp/src/test/data/freemind/i18n.wxml index 229f7e6d..b3620f4d 100644 --- a/wise-webapp/src/test/data/freemind/i18n.wxml +++ b/wise-webapp/src/test/data/freemind/i18n.wxml @@ -1 +1,15 @@ - \ No newline at end of file + + + + + + + + + + + + + + + diff --git a/wise-webapp/src/test/data/freemind/icons.mmr b/wise-webapp/src/test/data/freemind/icons.mmr index 4a5df9e2..063ba53e 100644 --- a/wise-webapp/src/test/data/freemind/icons.mmr +++ b/wise-webapp/src/test/data/freemind/icons.mmr @@ -1 +1,198 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wise-webapp/src/test/data/freemind/icons.wxml b/wise-webapp/src/test/data/freemind/icons.wxml index a0b38727..be7a188f 100644 --- a/wise-webapp/src/test/data/freemind/icons.wxml +++ b/wise-webapp/src/test/data/freemind/icons.wxml @@ -1 +1,295 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wise-webapp/src/test/data/freemind/links.mmr b/wise-webapp/src/test/data/freemind/links.mmr index e0216c6c..16df9afc 100644 --- a/wise-webapp/src/test/data/freemind/links.mmr +++ b/wise-webapp/src/test/data/freemind/links.mmr @@ -1 +1,14 @@ - \ No newline at end of file + + + + + + + + + + + + diff --git a/wise-webapp/src/test/data/freemind/links.wxml b/wise-webapp/src/test/data/freemind/links.wxml index 2263b382..9a1954ca 100644 --- a/wise-webapp/src/test/data/freemind/links.wxml +++ b/wise-webapp/src/test/data/freemind/links.wxml @@ -1 +1,18 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + diff --git a/wise-webapp/src/test/data/freemind/longnodes.mmr b/wise-webapp/src/test/data/freemind/longnodes.mmr index 5d13ccb7..26e92591 100644 --- a/wise-webapp/src/test/data/freemind/longnodes.mmr +++ b/wise-webapp/src/test/data/freemind/longnodes.mmr @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/wise-webapp/src/test/data/freemind/longnodes.wxml b/wise-webapp/src/test/data/freemind/longnodes.wxml index aa337201..006115ab 100644 --- a/wise-webapp/src/test/data/freemind/longnodes.wxml +++ b/wise-webapp/src/test/data/freemind/longnodes.wxml @@ -1 +1,9 @@ - \ No newline at end of file + + + + + + + + + diff --git a/wise-webapp/src/test/data/freemind/node-styles.mmr b/wise-webapp/src/test/data/freemind/node-styles.mmr index 260f95fe..39dd8600 100644 --- a/wise-webapp/src/test/data/freemind/node-styles.mmr +++ b/wise-webapp/src/test/data/freemind/node-styles.mmr @@ -1 +1,50 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wise-webapp/src/test/data/freemind/node-styles.wxml b/wise-webapp/src/test/data/freemind/node-styles.wxml index eeb09506..aa881c56 100644 --- a/wise-webapp/src/test/data/freemind/node-styles.wxml +++ b/wise-webapp/src/test/data/freemind/node-styles.wxml @@ -1 +1,63 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wise-webapp/src/test/data/freemind/process.mmr b/wise-webapp/src/test/data/freemind/process.mmr index fff79e47..4db388d1 100644 --- a/wise-webapp/src/test/data/freemind/process.mmr +++ b/wise-webapp/src/test/data/freemind/process.mmr @@ -1 +1,121 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wise-webapp/src/test/data/freemind/process.wxml b/wise-webapp/src/test/data/freemind/process.wxml index 60a65b85..94716e8e 100644 --- a/wise-webapp/src/test/data/freemind/process.wxml +++ b/wise-webapp/src/test/data/freemind/process.wxml @@ -1 +1,227 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wise-webapp/src/test/data/wisemaps/bigmap.mmr b/wise-webapp/src/test/data/wisemaps/bigmap.mmr index 2585b689..51ff9561 100644 --- a/wise-webapp/src/test/data/wisemaps/bigmap.mmr +++ b/wise-webapp/src/test/data/wisemaps/bigmap.mmr @@ -1 +1,276 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wise-webapp/src/test/data/wisemaps/simple-maps.mmr b/wise-webapp/src/test/data/wisemaps/simple-maps.mmr index e69de29b..41946830 100644 --- a/wise-webapp/src/test/data/wisemaps/simple-maps.mmr +++ b/wise-webapp/src/test/data/wisemaps/simple-maps.mmr @@ -0,0 +1,1214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wise-webapp/src/test/data/wisemaps/welcome.mmr b/wise-webapp/src/test/data/wisemaps/welcome.mmr new file mode 100644 index 00000000..e5840e36 --- /dev/null +++ b/wise-webapp/src/test/data/wisemaps/welcome.mmr @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wise-webapp/src/test/data/wisemaps/welcome.wxml b/wise-webapp/src/test/data/wisemaps/welcome.wxml new file mode 100644 index 00000000..250b9482 --- /dev/null +++ b/wise-webapp/src/test/data/wisemaps/welcome.wxml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wise-webapp/src/test/java/com/wisemapping/test/freemind/ExportTest.java b/wise-webapp/src/test/java/com/wisemapping/test/freemind/ExportTest.java index fece1544..646d4f80 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/freemind/ExportTest.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/freemind/ExportTest.java @@ -34,7 +34,7 @@ public class ExportTest { final StringBuilder recContent = new StringBuilder(); String line = br.readLine(); while (line != null) { - recContent.append(line); + recContent.append(line).append("\n"); line = br.readLine(); } @@ -65,14 +65,14 @@ public class ExportTest { final StringBuilder content = new StringBuilder(); String line = br.readLine(); while (line != null) { - content.append(line); + content.append(line).append("\n"); line = br.readLine(); } fis.close(); final MindMap result = new MindMap(); - result.setXml(content.toString().getBytes("UTF-8")); + result.setXmlStr(content.toString()); return result; } @@ -84,7 +84,7 @@ public class ExportTest { final File[] freeMindFiles = dataDir.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { - return name.endsWith(".xml"); + return name.endsWith(".wxml"); } }); diff --git a/wise-webapp/src/test/java/com/wisemapping/test/freemind/ImportExportTest.java b/wise-webapp/src/test/java/com/wisemapping/test/freemind/ImportExportTest.java index cb10b30a..2f28b7db 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/freemind/ImportExportTest.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/freemind/ImportExportTest.java @@ -17,6 +17,7 @@ import java.io.*; @Test public class ImportExportTest { private static final String DATA_DIR_PATH = "src/test/data/freemind/"; + private static final String UTF_8 = "UTF-8"; final private Importer importer; final private FreemindExporter exporter; @@ -30,8 +31,6 @@ public class ImportExportTest { @Test(dataProvider = "Data-Provider-Function") public void exportImportTest(@NotNull final File freeMindFile, @NotNull final File wiseFile, @NotNull final File freeRecFile) throws ImporterException, IOException, ExportException { - - final FileInputStream fileInputStream = new FileInputStream(freeMindFile.getAbsolutePath()); final MindMap mindMap = importer.importMap("basic", "basic", fileInputStream); @@ -46,7 +45,7 @@ public class ImportExportTest { } else { final FileOutputStream fos = new FileOutputStream(wiseFile); - fos.write(mindMap.getXmlStr().getBytes("UTF-8")); + fos.write(mindMap.getXmlStr().getBytes(UTF_8)); fos.close(); } @@ -59,7 +58,7 @@ public class ImportExportTest { final ByteArrayOutputStream bos = new ByteArrayOutputStream(); exporter.export(mindMap, bos); - Assert.assertEquals(bos.toByteArray(), recContent.getBytes("UTF-8")); + Assert.assertEquals(new String(bos.toByteArray(), UTF_8), recContent); } else { final FileOutputStream fos = new FileOutputStream(freeRecFile); @@ -72,13 +71,13 @@ public class ImportExportTest { private String readFile(@NotNull File file) throws IOException { // Load rec file co final FileInputStream fis = new FileInputStream(file); - final InputStreamReader isr = new InputStreamReader(fis,"UTF-8"); + final InputStreamReader isr = new InputStreamReader(fis, UTF_8); final BufferedReader br = new BufferedReader(isr); final StringBuilder result = new StringBuilder(); String line = br.readLine(); while (line != null) { - result.append(line); + result.append(line).append("\n"); line = br.readLine(); } @@ -97,7 +96,7 @@ public class ImportExportTest { final File[] freeMindFiles = dataDir.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { - return name.endsWith(".mm") && (testNameToRun==null || name.startsWith(testNameToRun)); + return name.endsWith(".mm") && (testNameToRun == null || name.startsWith(testNameToRun)); } }); diff --git a/wise-webapp/testng.xml b/wise-webapp/testng.xml index 40f9e6ea..8ad94978 100644 --- a/wise-webapp/testng.xml +++ b/wise-webapp/testng.xml @@ -7,7 +7,7 @@ - + From 2b50017971936100ddd2b025567ef94e29b74dd2 Mon Sep 17 00:00:00 2001 From: Gonzalo Bellver Date: Wed, 7 Mar 2012 16:26:06 -0300 Subject: [PATCH 29/45] Fixed editor bugs --- mindplot/src/main/javascript/layout/AbstractBasicSorter.js | 1 - 1 file changed, 1 deletion(-) diff --git a/mindplot/src/main/javascript/layout/AbstractBasicSorter.js b/mindplot/src/main/javascript/layout/AbstractBasicSorter.js index b8c71926..e78d6af7 100644 --- a/mindplot/src/main/javascript/layout/AbstractBasicSorter.js +++ b/mindplot/src/main/javascript/layout/AbstractBasicSorter.js @@ -31,7 +31,6 @@ mindplot.layout.AbstractBasicSorter = new Class({ _computeChildrenHeight : function(treeSet, node, heightCache) { var height = node.getSize().height + (this._getVerticalPadding() * 2); // 2* Top and down padding; - height += Math.abs(node.getFreeDisplacement().y); var result; var children = treeSet.getChildren(node); From 24047e02bb753fba80cc43880574f3f598b93dce Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 7 Mar 2012 01:13:50 -0300 Subject: [PATCH 30/45] Add support for Images on nodes. --- core-js/src/main/javascript/Utils.js | 40 +++--- mindplot/src/main/javascript/Designer.js | 12 +- .../src/main/javascript/DesignerKeyboard.js | 6 +- mindplot/src/main/javascript/DragConnector.js | 4 +- mindplot/src/main/javascript/DragTopic.js | 2 +- mindplot/src/main/javascript/MainTopic.js | 15 +-- mindplot/src/main/javascript/NodeGraph.js | 6 +- mindplot/src/main/javascript/Topic.js | 116 ++++++++++-------- .../src/main/javascript/model/INodeModel.js | 8 +- .../src/main/javascript/model/NodeModel.js | 8 +- .../persistence/XMLSerializer_Pela.js | 16 +++ .../src/main/javascript/peer/svg/ImagePeer.js | 1 + .../src/main/webapp/samples/welcome.xml | 4 +- wise-webapp/pom.xml | 1 + 14 files changed, 143 insertions(+), 96 deletions(-) diff --git a/core-js/src/main/javascript/Utils.js b/core-js/src/main/javascript/Utils.js index 005483d7..9c1f9651 100644 --- a/core-js/src/main/javascript/Utils.js +++ b/core-js/src/main/javascript/Utils.js @@ -145,7 +145,7 @@ core.Utils.setVisibilityAnimated = function(elems, isVisible, doneFn) { }; core.Utils.setChildrenVisibilityAnimated = function(rootElem, isVisible) { - var children = core.Utils._addInnerChildrens(rootElem); + var children = core.Utils.flattenTopicChildElements(rootElem); core.Utils.animateVisibility(children, isVisible); }; @@ -153,21 +153,21 @@ core.Utils.animateVisibility = function (elems, isVisible, doneFn) { var _fadeEffect = null; var _opacity = (isVisible ? 0 : 1); if (isVisible) { - elems.forEach(function(child, index) { + elems.forEach(function(child) { if ($defined(child)) { child.setOpacity(_opacity); - child.setVisibility(isVisible); + child.setVisibility(isVisible ? "visible" : "hidden"); } }); } - var fadeEffect = function(index) { + var fadeEffect = function() { var step = 10; if ((_opacity <= 0 && !isVisible) || (_opacity >= 1 && isVisible)) { $clear(_fadeEffect); _fadeEffect = null; - elems.forEach(function(child, index) { + elems.forEach(function(child) { if ($defined(child)) { - child.setVisibility(isVisible); + child.setVisibility(isVisible ? "visible" : "hidden"); } }); @@ -180,7 +180,7 @@ core.Utils.animateVisibility = function (elems, isVisible, doneFn) { fix = -1; } _opacity -= (1 / step) * fix; - elems.forEach(function(child, index) { + elems.forEach(function(child) { if ($defined(child)) { child.setOpacity(_opacity); } @@ -232,17 +232,21 @@ core.Utils.animatePosition = function (elems, doneFn, designer) { _moveEffect = moveEffect.periodical(10); }; -core.Utils._addInnerChildrens = function(elem) { - var children = []; - var childs = elem._getChildren(); - for (var i = 0; i < childs.length; i++) { - var child = childs[i]; - children.push(child); - children.push(child.getOutgoingLine()); +core.Utils.flattenTopicChildElements = function(topic) { + var result = []; + + var children = topic.getChildren(); + for (var i = 0; i < children.length; i++) { + + var child = children[i]; + result.push(child); + result.push(child.getOutgoingLine()); + var relationships = child.getRelationships(); - children = children.concat(relationships); - var innerChilds = core.Utils._addInnerChildrens(child); - children = children.concat(innerChilds); + result = result.concat(relationships); + + var innerChilds = core.Utils.flattenTopicChildElements(child); + result = result.concat(innerChilds); } - return children; + return result; }; \ No newline at end of file diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index 76217500..8f9e92c4 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -422,7 +422,7 @@ mindplot.Designer = new Class({ $assert(mindmapModel, "mindmapModel can not be null"); this._mindmap = mindmapModel; - try { +// try { // Init layout manager ... var size = {width:25,height:25}; var layoutManager = new mindplot.layout.LayoutManager(mindmapModel.getCentralTopic().getId(), size); @@ -459,9 +459,9 @@ mindplot.Designer = new Class({ mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout); this.fireEvent('loadSuccess'); - } catch(e) { - this.fireEvent('loadError', e); - } +// } catch(e) { +// this.fireEvent('loadError', e); +// } }, getMindmap : function() { @@ -595,8 +595,8 @@ mindplot.Designer = new Class({ node.disconnect(this._workspace); //remove children - while (node._getChildren().length > 0) { - this._removeNode(node._getChildren()[0]); + while (node.getChildren().length > 0) { + this._removeNode(node.getChildren()[0]); } this._workspace.removeChild(node); diff --git a/mindplot/src/main/javascript/DesignerKeyboard.js b/mindplot/src/main/javascript/DesignerKeyboard.js index 074dc18a..fa396b17 100644 --- a/mindplot/src/main/javascript/DesignerKeyboard.js +++ b/mindplot/src/main/javascript/DesignerKeyboard.js @@ -243,7 +243,7 @@ mindplot.DesignerKeyboard = new Class({ }, _goToBrother : function(designer, node, direction) { - var brothers = node._parent._getChildren(); + var brothers = node._parent.getChildren(); var target = node; var y = node.getPosition().y; var x = node.getPosition().x; @@ -280,7 +280,7 @@ mindplot.DesignerKeyboard = new Class({ _goToSideChild : function(designer, node, side) { - var children = node._getChildren(); + var children = node.getChildren(); if (children.length > 0) { var target = children[0]; var top = null; @@ -311,7 +311,7 @@ mindplot.DesignerKeyboard = new Class({ }, _goToChild : function(designer, node) { - var children = node._getChildren(); + var children = node.getChildren(); if (children.length > 0) { var target = children[0]; var top = target.getPosition().y; diff --git a/mindplot/src/main/javascript/DragConnector.js b/mindplot/src/main/javascript/DragConnector.js index 633636c0..6342ef60 100644 --- a/mindplot/src/main/javascript/DragConnector.js +++ b/mindplot/src/main/javascript/DragConnector.js @@ -81,8 +81,8 @@ mindplot.DragConnector = new Class({ var targetPosition = targetTopic.getPosition(); var fix = position.y > targetPosition.y; var gap = 0; - if (targetTopic._getChildren().length > 0) { - gap = Math.abs(targetPosition.y - targetTopic._getChildren()[0].getPosition().y) + if (targetTopic.getChildren().length > 0) { + gap = Math.abs(targetPosition.y - targetTopic.getChildren()[0].getPosition().y) } var yDistance = Math.abs(position.y - fix * gap - targetPosition.y); if (distance == null || yDistance < distance) { diff --git a/mindplot/src/main/javascript/DragTopic.js b/mindplot/src/main/javascript/DragTopic.js index 7e1d085e..a39a8ef3 100644 --- a/mindplot/src/main/javascript/DragTopic.js +++ b/mindplot/src/main/javascript/DragTopic.js @@ -110,7 +110,7 @@ mindplot.DragTopic = new Class({ var targetTopicModel = targetTopic.getModel(); var childTopicModel = draggedNode.getModel(); - result = targetTopicModel.canBeConnected(childTopicModel, topicPosition, 18); + result = targetTopicModel.canBeConnected(childTopicModel, topicPosition, 18, targetTopic.getSize()); } } else { result = false; diff --git a/mindplot/src/main/javascript/MainTopic.js b/mindplot/src/main/javascript/MainTopic.js index 57e6e9af..02152fa2 100644 --- a/mindplot/src/main/javascript/MainTopic.js +++ b/mindplot/src/main/javascript/MainTopic.js @@ -25,7 +25,7 @@ mindplot.MainTopic = new Class({ INNER_RECT_ATTRIBUTES : {stroke:'0.5 solid #009900'}, _buildDragShape : function() { - var innerShape = this.buildShape(this.INNER_RECT_ATTRIBUTES); + var innerShape = this._buildShape(this.INNER_RECT_ATTRIBUTES, this.getShapeType()); var size = this.getSize(); innerShape.setSize(size.width, size.height); innerShape.setPosition(0, 0); @@ -45,12 +45,13 @@ mindplot.MainTopic = new Class({ group.appendChild(innerShape); // Add Text ... - var textShape = this._buildTextShape(true); - var text = this.getText(); - textShape.setText(text); - textShape.setOpacity(0.5); - group.appendChild(textShape); - + if (this.getShapeType() != mindplot.model.TopicShape.IMAGE) { + var textShape = this._buildTextShape(true); + var text = this.getText(); + textShape.setText(text); + textShape.setOpacity(0.5); + group.appendChild(textShape); + } return group; }, diff --git a/mindplot/src/main/javascript/NodeGraph.js b/mindplot/src/main/javascript/NodeGraph.js index e12058a1..53d0771c 100644 --- a/mindplot/src/main/javascript/NodeGraph.js +++ b/mindplot/src/main/javascript/NodeGraph.js @@ -25,6 +25,7 @@ mindplot.NodeGraph = new Class({ this.setModel(nodeModel); this._onFocus = false; this._event = new Events(); + this._size = {width:50,height:20}; }, getType : function() { @@ -73,11 +74,12 @@ mindplot.NodeGraph = new Class({ }, getSize : function() { - return this._model.getSize(); + return this._size; }, setSize : function(size) { - this._model.setSize(parseInt(size.width), parseInt(size.height)); + this._size.width = parseInt(size.width); + this._size.height = parseInt(size.height); }, getModel:function() { diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js index 15ec72d8..65a8ebbb 100644 --- a/mindplot/src/main/javascript/Topic.js +++ b/mindplot/src/main/javascript/Topic.js @@ -27,7 +27,7 @@ mindplot.Topic = new Class({ this._parent = null; this._relationships = []; this._isInWorkspace = false; - this._buildShape(); + this._buildTopicShape(); // Position a topic .... var pos = model.getPosition(); @@ -90,7 +90,7 @@ mindplot.Topic = new Class({ var innerShape = this.getInnerShape(); // Update figure size ... - var size = model.getSize(); + var size = this.getSize(); this.setSize(size, true); var group = this.get2DElement(); @@ -134,7 +134,7 @@ mindplot.Topic = new Class({ getInnerShape : function() { if (!$defined(this._innerShape)) { // Create inner box. - this._innerShape = this.buildShape(mindplot.Topic.INNER_RECT_ATTRIBUTES); + this._innerShape = this._buildShape(mindplot.Topic.INNER_RECT_ATTRIBUTES, this.getShapeType()); // Update bgcolor ... var bgColor = this.getBackgroundColor(); @@ -155,24 +155,36 @@ mindplot.Topic = new Class({ return this._innerShape; }, - buildShape : function(attributes, type) { - var result; - if (!$defined(type)) { - type = this.getShapeType(); - } + _buildShape : function(attributes, shapeType) { + $assert(attributes, "attributes can not be null"); + $assert(shapeType, "shapeType can not be null"); - if (type == mindplot.model.TopicShape.RECTANGLE) { + var result; + if (shapeType == mindplot.model.TopicShape.RECTANGLE) { result = new web2d.Rect(0, attributes); - }else if(type == mindplot.model.TopicShape.IMAGE){ - throw "Must be implemented ..."; + } else if (shapeType == mindplot.model.TopicShape.IMAGE) { + var model = this.getModel(); + var url = model.getImageUrl(); + var size = model.getImageSize(); + + result = new web2d.Image(); + result.setHref(url); + result.setSize(size.width, size.height); + + result.getSize = function() { + return model.getImageSize(); + }; + + result.setPosition = function() { + }; } - else if (type == mindplot.model.TopicShape.ELLIPSE) { + else if (shapeType == mindplot.model.TopicShape.ELLIPSE) { result = new web2d.Rect(0.9, attributes); } - else if (type == mindplot.model.TopicShape.ROUNDED_RECT) { + else if (shapeType == mindplot.model.TopicShape.ROUNDED_RECT) { result = new web2d.Rect(0.3, attributes); } - else if (type == mindplot.model.TopicShape.LINE) { + else if (shapeType == mindplot.model.TopicShape.LINE) { result = new web2d.Line({strokeColor:"#495879",strokeWidth:1}); result.setSize = function(width, height) { this.size = {width:width, height:height}; @@ -191,7 +203,6 @@ mindplot.Topic = new Class({ result.setPosition = function() { }; - var setStrokeFunction = result.setStroke; result.setFill = function() { }; @@ -201,7 +212,7 @@ mindplot.Topic = new Class({ }; } else { - $assert(false, "Unsupported figure type:" + type); + $assert(false, "Unsupported figure shapeType:" + shapeType); } result.setPosition(0, 0); return result; @@ -221,7 +232,7 @@ mindplot.Topic = new Class({ getOuterShape : function() { if (!$defined(this._outerShape)) { - var rect = this.buildShape(mindplot.Topic.OUTER_SHAPE_ATTRIBUTES, mindplot.model.TopicShape.ROUNDED_RECT); + var rect = this._buildShape(mindplot.Topic.OUTER_SHAPE_ATTRIBUTES, mindplot.model.TopicShape.ROUNDED_RECT); rect.setPosition(-2, -3); rect.setOpacity(0); this._outerShape = rect; @@ -238,6 +249,7 @@ mindplot.Topic = new Class({ var text = this.getText(); this._setText(text, false); } + return this._text; }, @@ -533,7 +545,7 @@ mindplot.Topic = new Class({ return result; }, - _buildShape : function() { + _buildTopicShape : function() { var groupAttributes = {width: 100, height:100,coordSizeWidth:100,coordSizeHeight:100}; var group = new web2d.Group(groupAttributes); this._set2DElement(group); @@ -761,7 +773,7 @@ mindplot.Topic = new Class({ getIncomingLines : function() { var result = []; - var children = this._getChildren(); + var children = this.getChildren(); for (var i = 0; i < children.length; i++) { var node = children[i]; var line = node.getOutgoingLine(); @@ -868,8 +880,7 @@ mindplot.Topic = new Class({ } var textShape = this.getTextShape(); - textShape.setVisibility(value); - + textShape.setVisibility(this.getShapeType() != mindplot.model.TopicShape.IMAGE ? value : false); }, setOpacity : function(opacity) { @@ -885,7 +896,7 @@ mindplot.Topic = new Class({ _setChildrenVisibility : function(isVisible) { // Hide all children. - var children = this._getChildren(); + var children = this.getChildren(); var model = this.getModel(); isVisible = isVisible ? !model.areChildrenShrunken() : isVisible; @@ -975,7 +986,7 @@ mindplot.Topic = new Class({ } // Hide connection line?. - if (targetTopic._getChildren().length == 0) { + if (targetTopic.getChildren().length == 0) { var connector = targetTopic.getShrinkConnector(); connector.setVisibility(false); } @@ -1009,8 +1020,9 @@ mindplot.Topic = new Class({ // Create a connection line ... var outgoingLine = new mindplot.ConnectionLine(this, targetTopic); - if ($defined(isVisible)) + if ($defined(isVisible)) { outgoingLine.setVisibility(isVisible); + } this._outgoingLine = outgoingLine; workspace.appendChild(outgoingLine); @@ -1044,16 +1056,16 @@ mindplot.Topic = new Class({ }, appendChild : function(child) { - var children = this._getChildren(); + var children = this.getChildren(); children.push(child); }, removeChild : function(child) { - var children = this._getChildren(); + var children = this.getChildren(); children.erase(child); }, - _getChildren : function() { + getChildren : function() { var result = this._children; if (!$defined(result)) { this._children = []; @@ -1111,34 +1123,42 @@ mindplot.Topic = new Class({ _adjustShapes : function() { if (this._isInWorkspace) { + var textShape = this.getTextShape(); - var textWidth = textShape.getWidth(); + if (this.getShapeType() != mindplot.model.TopicShape.IMAGE) { - var textHeight = textShape.getHeight(); - textHeight = textHeight != 0 ? textHeight : 20; + var textWidth = textShape.getWidth(); - var topicPadding = this._getInnerPadding(); + var textHeight = textShape.getHeight(); + textHeight = textHeight != 0 ? textHeight : 20; - // Adjust the icon size to the size of the text ... - var iconGroup = this.getOrBuildIconGroup(); - var fontHeight = this.getTextShape().getFontHeight(); - iconGroup.setPosition(topicPadding, topicPadding); - iconGroup.seIconSize(fontHeight, fontHeight); + var topicPadding = this._getInnerPadding(); - // Add a extra padding between the text and the icons - var iconsWidth = iconGroup.getSize().width; - if (iconsWidth != 0) { + // Adjust the icon size to the size of the text ... + var iconGroup = this.getOrBuildIconGroup(); + var fontHeight = this.getTextShape().getFontHeight(); + iconGroup.setPosition(topicPadding, topicPadding); + iconGroup.seIconSize(fontHeight, fontHeight); - iconsWidth = iconsWidth + (textHeight / 4); + // Add a extra padding between the text and the icons + var iconsWidth = iconGroup.getSize().width; + if (iconsWidth != 0) { + + iconsWidth = iconsWidth + (textHeight / 4); + } + + var height = textHeight + (topicPadding * 2); + var width = textWidth + iconsWidth + (topicPadding * 2); + + this.setSize({width:width,height:height}); + + // Position node ... + textShape.setPosition(topicPadding + iconsWidth, topicPadding); + } else { + // In case of images, the size if fixed ... + var size = this.getModel().getImageSize(); + this.setSize(size); } - - var height = textHeight + (topicPadding * 2); - var width = textWidth + iconsWidth + (topicPadding * 2); - - this.setSize({width:width,height:height}); - - // Position node ... - textShape.setPosition(topicPadding + iconsWidth, topicPadding); } } diff --git a/mindplot/src/main/javascript/model/INodeModel.js b/mindplot/src/main/javascript/model/INodeModel.js index e0e98570..8ee1d1ce 100644 --- a/mindplot/src/main/javascript/model/INodeModel.js +++ b/mindplot/src/main/javascript/model/INodeModel.js @@ -69,12 +69,12 @@ mindplot.model.INodeModel = new Class({ return result; }, - setSize : function(width, height) { - this.putProperty('size', '{width:' + width + ',height:' + height + '}'); + setImageSize : function(width, height) { + this.putProperty('imageSize', '{width:' + width + ',height:' + height + '}'); }, - getSize : function() { - var value = this.getProperty('size'); + getImageSize : function() { + var value = this.getProperty('imageSize'); var result = null; if (value != null) { result = eval("(" + value + ")"); diff --git a/mindplot/src/main/javascript/model/NodeModel.js b/mindplot/src/main/javascript/model/NodeModel.js index 3cdefc32..96ddfaf6 100644 --- a/mindplot/src/main/javascript/model/NodeModel.js +++ b/mindplot/src/main/javascript/model/NodeModel.js @@ -27,7 +27,6 @@ mindplot.model.NodeModel = new Class({ this.setId(id); this.setType(type); this.areChildrenShrunken(false); - this.setSize(50, 20); this._children = []; this._feature = []; @@ -123,10 +122,12 @@ mindplot.model.NodeModel = new Class({ this._parent = parent; }, - canBeConnected : function(sourceModel, sourcePosition, targetTopicHeight) { + canBeConnected : function(sourceModel, sourcePosition, targetTopicHeight,targetTopicSize) { $assert(sourceModel != this, 'The same node can not be parent and child if itself.'); $assert(sourcePosition, 'childPosition can not be null.'); $assert(targetTopicHeight, 'childrenWidth can not be null.'); + $assert(targetTopicSize, 'targetTopicSize can not be null.'); + // Only can be connected if the node is in the left or rigth. var targetModel = this; @@ -135,8 +136,7 @@ mindplot.model.NodeModel = new Class({ var result = false; if (sourceModel.getType() == mindplot.model.INodeModel.MAIN_TOPIC_TYPE) { - // Finally, check current node ubication. - var targetTopicSize = targetModel.getSize(); + // Finally, check current node position ... var yDistance = Math.abs(sourcePosition.y - targetPosition.y); var gap = 35 + targetTopicHeight / 2; if (targetModel.getChildren().length > 0) { diff --git a/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js b/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js index d094ecbb..77e6cec1 100644 --- a/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js +++ b/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js @@ -80,6 +80,11 @@ mindplot.persistence.XMLSerializer_Pela = new Class({ var shape = topic.getShapeType(); if ($defined(shape)) { parentTopic.setAttribute('shape', shape); + + if (shape == mindplot.model.TopicShape.IMAGE) { + parentTopic.setAttribute('image', topic.getImageSize().width + "," + topic.getImageSize().height + ":" + topic.getImageUrl()); + } + } if (topic.areChildrenShrunken()) { @@ -242,9 +247,20 @@ mindplot.persistence.XMLSerializer_Pela = new Class({ if ($defined(text)) { topic.setText(text); } + var shape = domElem.getAttribute('shape'); if ($defined(shape)) { topic.setShapeType(shape); + + if (shape == mindplot.model.TopicShape.IMAGE) { + var image = domElem.getAttribute('image'); + var size = image.substring(0, image.indexOf(':')); + var url = image.substring(image.indexOf(':') + 1, image.length); + topic.setImageUrl(url); + + var split = size.split(','); + topic.setImageSize(split[0], split[1]); + } } var fontStyle = domElem.getAttribute('fontStyle'); diff --git a/web2d/src/main/javascript/peer/svg/ImagePeer.js b/web2d/src/main/javascript/peer/svg/ImagePeer.js index f1f502f6..be9eed91 100644 --- a/web2d/src/main/javascript/peer/svg/ImagePeer.js +++ b/web2d/src/main/javascript/peer/svg/ImagePeer.js @@ -23,6 +23,7 @@ web2d.peer.svg.ImagePeer = new Class({ this.parent(svgElement); this._position = {x:0,y:0}; this._href = ""; + this._native.setAttribute("preserveAspectRatio", "none"); }, setPosition : function(x, y) { diff --git a/wise-editor/src/main/webapp/samples/welcome.xml b/wise-editor/src/main/webapp/samples/welcome.xml index 2a762e44..a3ea13e9 100644 --- a/wise-editor/src/main/webapp/samples/welcome.xml +++ b/wise-editor/src/main/webapp/samples/welcome.xml @@ -42,6 +42,8 @@ - + \ No newline at end of file diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index 34ff62b2..1f411082 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -442,6 +442,7 @@ org.jvnet.jaxb2.maven2 maven-jaxb2-plugin + 0.8.1 mindmap-generate From a1f654226495c6f4bdb560a239b1898cefeae780 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 7 Mar 2012 17:40:10 -0300 Subject: [PATCH 31/45] First steps on icon drag support. --- mindplot/src/main/javascript/Designer.js | 85 ++++++++++++------- .../src/main/javascript/model/INodeModel.js | 9 ++ .../persistence/XMLSerializer_Pela.js | 10 +++ web2d/src/main/javascript/Element.js | 4 + .../main/javascript/peer/svg/ElementPeer.js | 4 + wise-editor/src/main/webapp/html/editor.html | 26 +++++- .../src/main/webapp/samples/welcome.xml | 3 - 7 files changed, 105 insertions(+), 36 deletions(-) diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index 8f9e92c4..b297f029 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -160,6 +160,7 @@ mindplot.Designer = new Class({ this._workspace.setZoom(model.getZoom(), true); }, + _buildNodeGraph : function(model, readOnly) { var workspace = this._workspace; @@ -340,6 +341,30 @@ mindplot.Designer = new Class({ return childModel; }, + addDraddedNode: function(event, options) { + $assert(event, "event can not be null"); + $assert(options, "option can not be null"); + + // Create a new node ... + var mindmap = this.getMindmap(); + var model = mindmap.createNode(mindplot.model.INodeModel.MAIN_TOPIC_TYPE); + model.setShapeType(mindplot.model.TopicShape.IMAGE); + + // Set node specified options ... + model.setImageUrl(options.imageUrl); + model.setImageSize(options.imageWidth, options.imageHeight); + model.setMetadata(options.metadata); + + // Position far from the visual area ... + model.setPosition(1000, 1000); + + this._actionDispatcher.addTopic(model, null, false); + var topic = this.getModel().findTopicById(model.getId()); + + // Simulate a mouse down event to start the dragging ... + topic.fireEvent("mousedown", event); + }, + createSiblingForSelectedNode : function() { var nodes = this.getModel().filterSelectedTopics(); if (nodes.length <= 0) { @@ -423,42 +448,42 @@ mindplot.Designer = new Class({ this._mindmap = mindmapModel; // try { - // Init layout manager ... - var size = {width:25,height:25}; - var layoutManager = new mindplot.layout.LayoutManager(mindmapModel.getCentralTopic().getId(), size); - layoutManager.addEvent('change', function(event) { - var id = event.getId(); - var topic = this.getModel().findTopicById(id); - topic.setPosition(event.getPosition()); - topic.setOrder(event.getOrder()); - }.bind(this)); - this._eventBussDispatcher.setLayoutManager(layoutManager); + // Init layout manager ... + var size = {width:25,height:25}; + var layoutManager = new mindplot.layout.LayoutManager(mindmapModel.getCentralTopic().getId(), size); + layoutManager.addEvent('change', function(event) { + var id = event.getId(); + var topic = this.getModel().findTopicById(id); + topic.setPosition(event.getPosition()); + topic.setOrder(event.getOrder()); + }.bind(this)); + this._eventBussDispatcher.setLayoutManager(layoutManager); - // Building node graph ... - var branches = mindmapModel.getBranches(); - for (var i = 0; i < branches.length; i++) { - // NodeModel -> NodeGraph ... - var nodeModel = branches[i]; - var nodeGraph = this._nodeModelToNodeGraph(nodeModel, false); + // Building node graph ... + var branches = mindmapModel.getBranches(); + for (var i = 0; i < branches.length; i++) { + // NodeModel -> NodeGraph ... + var nodeModel = branches[i]; + var nodeGraph = this._nodeModelToNodeGraph(nodeModel, false); - // Update shrink render state... - nodeGraph.setBranchVisibility(true); - } + // Update shrink render state... + nodeGraph.setBranchVisibility(true); + } - var relationships = mindmapModel.getRelationships(); - for (var j = 0; j < relationships.length; j++) { - this._relationshipModelToRelationship(relationships[j]); - } + var relationships = mindmapModel.getRelationships(); + for (var j = 0; j < relationships.length; j++) { + this._relationshipModelToRelationship(relationships[j]); + } - // Place the focus on the Central Topic - var centralTopic = this.getModel().getCentralTopic(); - this.goToNode(centralTopic); + // Place the focus on the Central Topic + var centralTopic = this.getModel().getCentralTopic(); + this.goToNode(centralTopic); - // Finally, sort the map ... - mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout); + // Finally, sort the map ... + mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout); - this.fireEvent('loadSuccess'); + this.fireEvent('loadSuccess'); // } catch(e) { // this.fireEvent('loadError', e); // } @@ -668,7 +693,7 @@ mindplot.Designer = new Class({ changeBorderColor : function(color) { var validateFunc = function(topic) { - return topic.getShapeType() != mindplot.model.TopicShape.LINE ; + return topic.getShapeType() != mindplot.model.TopicShape.LINE; }; var validateError = 'Color can not be set to line topics.'; var topicsIds = this.getModel().filterTopicsIds(validateFunc, validateError); diff --git a/mindplot/src/main/javascript/model/INodeModel.js b/mindplot/src/main/javascript/model/INodeModel.js index 8ee1d1ce..75b46df7 100644 --- a/mindplot/src/main/javascript/model/INodeModel.js +++ b/mindplot/src/main/javascript/model/INodeModel.js @@ -87,6 +87,15 @@ mindplot.model.INodeModel = new Class({ }, + getMetadata:function() { + return this.getProperty('metadata'); + }, + + setMetadata:function(json) { + this.putProperty('metadata', json); + + }, + getImageUrl:function() { return this.getProperty('imageUrl'); }, diff --git a/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js b/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js index 77e6cec1..88aa892e 100644 --- a/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js +++ b/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js @@ -127,6 +127,11 @@ mindplot.persistence.XMLSerializer_Pela = new Class({ parentTopic.setAttribute('brColor', brColor); } + var metadata = topic.getMetadata(); + if ($defined(metadata)) { + parentTopic.setAttribute('metadata', metadata); + } + // Serialize features ... var features = topic.getFeatures(); for (var i = 0; i < features.length; i++) { @@ -314,6 +319,11 @@ mindplot.persistence.XMLSerializer_Pela = new Class({ topic.setPosition(pos[0], pos[1]); } + var metadata = domElem.getAttribute('metadata'); + if ($defined(metadata)) { + topic.setMetadata(metadata); + } + //Creating icons and children nodes var children = domElem.childNodes; for (var i = 0; i < children.length; i++) { diff --git a/web2d/src/main/javascript/Element.js b/web2d/src/main/javascript/Element.js index 23488a33..3a01de69 100644 --- a/web2d/src/main/javascript/Element.js +++ b/web2d/src/main/javascript/Element.js @@ -87,6 +87,10 @@ web2d.Element = new Class({ this._peer.addEvent(type, listener); }, + fireEvent : function(type, event) { + this._peer.fireEvent(type, event); + }, + cloneEvents : function(from) { this._peer.cloneEvents(from); }, diff --git a/web2d/src/main/javascript/peer/svg/ElementPeer.js b/web2d/src/main/javascript/peer/svg/ElementPeer.js index a380f36c..4181a27b 100644 --- a/web2d/src/main/javascript/peer/svg/ElementPeer.js +++ b/web2d/src/main/javascript/peer/svg/ElementPeer.js @@ -85,6 +85,10 @@ web2d.peer.svg.ElementPeer = new Class({ this._native.addEvent(type, listener); }, + fireEvent : function(type) { + this._native.fireEvent(type, event); + }, + cloneEvents : function(from) { this._native.cloneEvents(from); }, diff --git a/wise-editor/src/main/webapp/html/editor.html b/wise-editor/src/main/webapp/html/editor.html index f3361e8d..5e12d4c5 100644 --- a/wise-editor/src/main/webapp/html/editor.html +++ b/wise-editor/src/main/webapp/html/editor.html @@ -30,9 +30,9 @@ var persistence = mindplot.PersistenceManager.getInstance(); var mindmap; // try { - mindmap = persistence.load(mapId); + mindmap = persistence.load(mapId); // } catch(e) { - // If the map could not be loaded, create a new empty map... + // If the map could not be loaded, create a new empty map... // mindmap = mindplot.model.Mindmap.buildEmpty(mapId); // } designer.loadMap(mindmap); @@ -121,7 +121,7 @@
-
+
@@ -133,6 +133,26 @@ +
diff --git a/wise-editor/src/main/webapp/samples/welcome.xml b/wise-editor/src/main/webapp/samples/welcome.xml index a3ea13e9..c26ee3fb 100644 --- a/wise-editor/src/main/webapp/samples/welcome.xml +++ b/wise-editor/src/main/webapp/samples/welcome.xml @@ -42,8 +42,5 @@ - \ No newline at end of file From eb159527853acab77360da7f65ba3a4cb219f456 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 7 Mar 2012 17:45:41 -0300 Subject: [PATCH 32/45] Fix minor typo... --- mindplot/src/main/javascript/Designer.js | 2 +- wise-editor/src/main/webapp/html/editor.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index b297f029..ac5db35a 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -341,7 +341,7 @@ mindplot.Designer = new Class({ return childModel; }, - addDraddedNode: function(event, options) { + addDraggedNode: function(event, options) { $assert(event, "event can not be null"); $assert(options, "option can not be null"); diff --git a/wise-editor/src/main/webapp/html/editor.html b/wise-editor/src/main/webapp/html/editor.html index 5e12d4c5..2d185769 100644 --- a/wise-editor/src/main/webapp/html/editor.html +++ b/wise-editor/src/main/webapp/html/editor.html @@ -149,7 +149,7 @@ imageHeight:43, metadata: "{'media':'video,'url':'http://www.youtube.com/watch?v=P3FrXftyuzw&feature=g-vrec&context=G2b4ab69RVAAAAAAAAAA'}" }; - designer.addDraddedNode(event, options); + designer.addDraggedNode(event, options); }); --> From ae9f05dd05337b074c9e67514b72cd2b4df57da9 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 7 Mar 2012 20:35:06 -0300 Subject: [PATCH 33/45] Use FX class for delete node events. --- core-js/src/main/javascript/Utils.js | 70 ---------------- mindplot/pom.xml | 1 + .../javascript/StandaloneActionDispatcher.js | 3 +- mindplot/src/main/javascript/Topic.js | 32 +++++++- .../javascript/commands/AddTopicCommand.js | 80 ++++++++----------- .../javascript/layout/EventBusDispatcher.js | 2 +- .../src/main/javascript/util/FadeEffect.js | 50 ++++++++++++ web2d/src/main/javascript/Group.js | 5 ++ .../src/main/javascript/peer/svg/GroupPeer.js | 4 + wise-editor/src/main/webapp/html/editor.html | 38 ++++----- 10 files changed, 143 insertions(+), 142 deletions(-) create mode 100644 mindplot/src/main/javascript/util/FadeEffect.js diff --git a/core-js/src/main/javascript/Utils.js b/core-js/src/main/javascript/Utils.js index 9c1f9651..ff870beb 100644 --- a/core-js/src/main/javascript/Utils.js +++ b/core-js/src/main/javascript/Utils.js @@ -140,57 +140,6 @@ core.Utils.calculateDefaultControlPoints = function(srcPos, tarPos) { return [new core.Point(-srcPos.x + x1, -srcPos.y + y1),new core.Point(-tarPos.x + x2, -tarPos.y + y2)]; }; -core.Utils.setVisibilityAnimated = function(elems, isVisible, doneFn) { - core.Utils.animateVisibility(elems, isVisible, doneFn); -}; - -core.Utils.setChildrenVisibilityAnimated = function(rootElem, isVisible) { - var children = core.Utils.flattenTopicChildElements(rootElem); - core.Utils.animateVisibility(children, isVisible); -}; - -core.Utils.animateVisibility = function (elems, isVisible, doneFn) { - var _fadeEffect = null; - var _opacity = (isVisible ? 0 : 1); - if (isVisible) { - elems.forEach(function(child) { - if ($defined(child)) { - child.setOpacity(_opacity); - child.setVisibility(isVisible ? "visible" : "hidden"); - } - }); - } - var fadeEffect = function() { - var step = 10; - if ((_opacity <= 0 && !isVisible) || (_opacity >= 1 && isVisible)) { - $clear(_fadeEffect); - _fadeEffect = null; - elems.forEach(function(child) { - if ($defined(child)) { - child.setVisibility(isVisible ? "visible" : "hidden"); - } - - }); - if ($defined(doneFn)) - doneFn.attempt(); - } - else { - var fix = 1; - if (isVisible) { - fix = -1; - } - _opacity -= (1 / step) * fix; - elems.forEach(function(child) { - if ($defined(child)) { - child.setOpacity(_opacity); - } - }); - } - - }; - _fadeEffect = fadeEffect.periodical(10); -}; - core.Utils.animatePosition = function (elems, doneFn, designer) { var _moveEffect = null; var i = 10; @@ -231,22 +180,3 @@ core.Utils.animatePosition = function (elems, doneFn, designer) { }; _moveEffect = moveEffect.periodical(10); }; - -core.Utils.flattenTopicChildElements = function(topic) { - var result = []; - - var children = topic.getChildren(); - for (var i = 0; i < children.length; i++) { - - var child = children[i]; - result.push(child); - result.push(child.getOutgoingLine()); - - var relationships = child.getRelationships(); - result = result.concat(relationships); - - var innerChilds = core.Utils.flattenTopicChildElements(child); - result = result.concat(innerChilds); - } - return result; -}; \ No newline at end of file diff --git a/mindplot/pom.xml b/mindplot/pom.xml index 2c29a931..dab5bd3c 100644 --- a/mindplot/pom.xml +++ b/mindplot/pom.xml @@ -81,6 +81,7 @@ + WiseMapping - Editor - + + + + + ---> - var options = {imageUrl:"images/logo-small.png", - imageWidth:80, - imageHeight:43, - metadata: "{'media':'video,'url':'http://www.youtube.com/watch?v=P3FrXftyuzw&feature=g-vrec&context=G2b4ab69RVAAAAAAAAAA'}" - }; - designer.addDraggedNode(event, options); - }); - --->
From 4de8eb17eceeac073a4ae8846c81e1c7e784d9e4 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 7 Mar 2012 20:52:09 -0300 Subject: [PATCH 34/45] Implement discard button. --- mindplot/src/main/javascript/LocalStorageManager.js | 4 ++++ mindplot/src/main/javascript/PersistenceManager.js | 4 ++++ mindplot/src/main/javascript/widget/IMenu.js | 8 +++++++- mindplot/src/main/javascript/widget/Menu.js | 12 +++--------- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/mindplot/src/main/javascript/LocalStorageManager.js b/mindplot/src/main/javascript/LocalStorageManager.js index f6f77ceb..3d0405e9 100644 --- a/mindplot/src/main/javascript/LocalStorageManager.js +++ b/mindplot/src/main/javascript/LocalStorageManager.js @@ -27,6 +27,10 @@ mindplot.LocalStorageManager = new Class({ events.onSuccess(); }, + discard : function(mapId) { + localStorage.removeItem(mapId + "-xml"); + }, + loadMapDom : function(mapId) { var xml = localStorage.getItem(mapId + "-xml"); if (xml == null) { diff --git a/mindplot/src/main/javascript/PersistenceManager.js b/mindplot/src/main/javascript/PersistenceManager.js index 56c596cc..10ca7b4b 100644 --- a/mindplot/src/main/javascript/PersistenceManager.js +++ b/mindplot/src/main/javascript/PersistenceManager.js @@ -47,6 +47,10 @@ mindplot.PersistenceManager = new Class({ return this.loadFromDom(mapId, domDocument); }, + discard: function(mapId) { + throw "Method must be implemented"; + }, + loadMapDom: function(mapId) { throw "Method must be implemented"; }, diff --git a/mindplot/src/main/javascript/widget/IMenu.js b/mindplot/src/main/javascript/widget/IMenu.js index 3a480550..349a043f 100644 --- a/mindplot/src/main/javascript/widget/IMenu.js +++ b/mindplot/src/main/javascript/widget/IMenu.js @@ -34,6 +34,12 @@ mindplot.widget.IMenu = new Class({ }); }, + discard: function() { + var persistenceManager = mindplot.PersistenceManager.getInstance(); + var mindmap = designer.getMindmap(); + persistenceManager.discard(mindmap.getId()); + }, + save:function (saveElem, designer, saveHistory) { // Load map content ... var mindmap = designer.getMindmap(); @@ -64,4 +70,4 @@ mindplot.widget.IMenu = new Class({ } }); } -}) \ No newline at end of file +}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/widget/Menu.js b/mindplot/src/main/javascript/widget/Menu.js index 8b9b527d..3014a08f 100644 --- a/mindplot/src/main/javascript/widget/Menu.js +++ b/mindplot/src/main/javascript/widget/Menu.js @@ -266,15 +266,9 @@ mindplot.widget.Menu = new Class({ var discardElem = $('discard'); if (discardElem) { this._addButton('discard', false, false, function() { - - if (!readOnly) { - displayLoading(); - window.document.location = "mymaps.htm"; - } else { - displayLoading(); - window.document.location = "home.htm"; - } - }); + this.discard(); + window.location.reload(); + }.bind(this)); } var tagElem = $('tagIt'); From 8a4dee47f2dda1cb041d248b6e932d87f36f26ea Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 7 Mar 2012 21:17:19 -0300 Subject: [PATCH 35/45] Add error dialog for map error during loading. --- core-js/src/main/javascript/Utils.js | 43 +--------- mindplot/src/main/javascript/Designer.js | 8 +- wise-editor/src/main/webapp/html/editor.html | 32 +++---- .../src/main/webapp/images/alert-sign.png | Bin 0 -> 5000 bytes wise-editor/src/main/webapp/js/editor.js | 81 ++++++++++++++++-- 5 files changed, 94 insertions(+), 70 deletions(-) create mode 100644 wise-editor/src/main/webapp/images/alert-sign.png diff --git a/core-js/src/main/javascript/Utils.js b/core-js/src/main/javascript/Utils.js index ff870beb..ed986bd0 100644 --- a/core-js/src/main/javascript/Utils.js +++ b/core-js/src/main/javascript/Utils.js @@ -138,45 +138,4 @@ core.Utils.calculateDefaultControlPoints = function(srcPos, tarPos) { var y2 = m * (x2 - tarPos.x) + tarPos.y; return [new core.Point(-srcPos.x + x1, -srcPos.y + y1),new core.Point(-tarPos.x + x2, -tarPos.y + y2)]; -}; - -core.Utils.animatePosition = function (elems, doneFn, designer) { - var _moveEffect = null; - var i = 10; - var step = 10; - var moveEffect = function () { - if (i > 0) { - var keys = elems.keys(); - for (var j = 0; j < keys.length; j++) { - var id = keys[j]; - var mod = elems.get(id); - var allTopics = designer.getModel().getTopics(); - var currentTopic = allTopics.filter(function(node) { - return node.getId() == id; - })[0]; - var xStep = (mod.originalPos.x - mod.newPos.x) / step; - var yStep = (mod.originalPos.y - mod.newPos.y) / step; - var newPos = currentTopic.getPosition().clone(); - newPos.x += xStep; - newPos.y += yStep; - currentTopic.setPosition(newPos, false); - } - } else { - $clear(_moveEffect); - var keys = elems.keys(); - for (var j = 0; j < keys.length; j++) { - var id = keys[j]; - var mod = elems.get(id); - var allTopics = designer.getModel().getTopics(); - var currentTopic = allTopics.filter(function(node) { - return node.getId() == id; - })[0]; - currentTopic.setPosition(mod.originalPos, false); - } - if ($defined(doneFn)) - doneFn.attempt(); - } - i--; - }; - _moveEffect = moveEffect.periodical(10); -}; +}; \ No newline at end of file diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index ac5db35a..9f78f3e0 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -447,7 +447,7 @@ mindplot.Designer = new Class({ $assert(mindmapModel, "mindmapModel can not be null"); this._mindmap = mindmapModel; -// try { + try { // Init layout manager ... var size = {width:25,height:25}; var layoutManager = new mindplot.layout.LayoutManager(mindmapModel.getCentralTopic().getId(), size); @@ -484,9 +484,9 @@ mindplot.Designer = new Class({ mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout); this.fireEvent('loadSuccess'); -// } catch(e) { -// this.fireEvent('loadError', e); -// } + } catch(e) { + this.fireEvent('loadError', e); + } }, getMindmap : function() { diff --git a/wise-editor/src/main/webapp/html/editor.html b/wise-editor/src/main/webapp/html/editor.html index 38622a98..491bc7b9 100644 --- a/wise-editor/src/main/webapp/html/editor.html +++ b/wise-editor/src/main/webapp/html/editor.html @@ -29,13 +29,7 @@ // Load map from XML file persisted on disk... var persistence = mindplot.PersistenceManager.getInstance(); - var mindmap; -// try { - mindmap = persistence.load(mapId); -// } catch(e) { - // If the map could not be loaded, create a new empty map... -// mindmap = mindplot.model.Mindmap.buildEmpty(mapId); -// } + var mindmap = mindmap = persistence.load(mapId); designer.loadMap(mindmap); }); @@ -135,22 +129,22 @@ - - - + + + - - + + - - - - - - - + + + + + + +
diff --git a/wise-editor/src/main/webapp/images/alert-sign.png b/wise-editor/src/main/webapp/images/alert-sign.png new file mode 100644 index 0000000000000000000000000000000000000000..8d3e5df04781628539abc327c1d5ad950782f587 GIT binary patch literal 5000 zcmV;36L;*1P)}o$Y+U8oDKBLwagwS8FBKF=CA-B0dc3Ay8~DGtO!+zuU+N_3voMK)UF;LagN4&*oo$ZEQsJTMRW0J^!T19fSd?( zP30{mK!7L)bs!NK6m?3}uBdX{R-gd(x5xqjTn2dx2VWT(pQh=ma)({2nO2UwBNfDt zfibn`ts@|qc$OkA<+?=|EP3(#PkioIt8e(wlbuuBpUN}N(c{swFlx*g5g0LEN8Yq* z0pm@c2wcXp88f1PTzgf|l#YYnGSfOX*o$vkeMAPGAhtB7Cce1@gx<&Zewz&P`IR4huQkb5 zsMUf$6sQhDI?USZR#xH>KI4?=b+xSs9mX~SFskroRwtkq@+z0kS<-&y>~+i0mmbAw z1TF!Sd-K@3iOCoAFmI8)KCiOkSYiSdFhpY`U`%%(V^POAGs0i4y6r}hfoDiY9qJ64 zXW(+LkV6AVvX8TFUK^QVJ`cREZHs~}z1>9+#0~S|IcH3oH?8+nYMUPc+lF%v=Ny`* zU=&I*yzpx}&tA@g714$1Am_THSb^d#Oyak*1^`Z&Y;!){v;M=#_W#3Wf~rMbj^+-{ z9i%lNf{}wT)WOqsl57DLZJhMIQN zr5?O!YUGn~ zpiwD|bB7C4UQ=!(Dwl~W?L_7A*isZkQN18m%CPxy%qb^v#--y*gM0ZK!H3927Edrl z<#eWwXeuGql_gv@VOr(9#aEoi;IsdNjU!OOWjV$wR3g%WUFeQMk_fCgBv;B4 zg!0r`Xw3l$*w|aaGtaT+?(=!{$N&2NEMsvT^J`6gBG(v8Ty7gvv)>pC2)(b$)NGVL zTz1VmiL*TfK_c0-K-5big}ro5|2FzG8%NVoR9c)ND|2An-u%ggB}4(b;R} zPM@`87DF#Sfr(>C3E)FDIk5;%jxv8wQ(OWG#xpCF|*OBaa3Tjm^UgV7-pz4#NX-=#eM_K}MqNFM0M$iPb zrnod@RJ+>Yg{{c0XZW4#I~m>2pTy(n`theebz;avIYA3>kUJhYv%Nj7a_9W>7I#jb zTVeE-XAu+Jo;swiaJfIm4wvQ}X)(hk39&++hKNxV9UtM;!p=e1ox{(cXYPAXX4VX8 z&n%y=l*Z=DkKYSqIf9^Gr`DA_?E99#ro8_JJ{V{z^U%^HWxYe#%^Qmdgkm`QDrW#qpe!fngZ2wXX|wgNo5mG1MW zbMib>N-cl!)I;~4aANSd2vBvXQNPOTxT1Yh>B41~tYUP_Ml_gwq5OW%s)%#Gio@Xi zXgESCPbs18kUY1CY{LlE1hf;>_}r=HKm_z>$nL#d@xha*4RKXlndLvd_ue<308v46 z$5(qwGt(L$KmF3xrecRk5A4E-4T9&*UsN&T5K)X#jDj(OkwDI2N^Q>o)t>|XIdnt0 zf{z^l%^D#E3Ow0I=h_YyFO8znlrL<&|DF>H36Gfob&g^M+htrcX=cZ&MdvSOblXP6 zm=^E`58n7R2u2h`iUP4cvI)d5C#Zs*6!d_`Oq(dsruc;Uh=Z-Wx%h_ZXwHRHxcGnn z>Pv4D0jh}j<=Fds%JW>p9j9M@2BqpNv>k7_($$Y-%Z=d-Th{f7~;pV$ucD-Eqg)Ei{*R`>EA)?Gc7SXp69 zT>JQg55DmPG%>$K95*k2_bTY$2FVD<;03O!*G05$4K`STb%LpY`VjF5jWJX@pqvG~ zu_vKu#A}F%fE`0r=EN*sQ=yvhr@#2Kk90YA>>CY^Z3qb5x6+idgxhB=pEhImDHBL` zzl@12Mq2?J6nh9E)(EBpbPq%?W*lh<7~}k&f_BJa>K>!8grY6=QU+?ki@Uh!%5F*} zW)X4g-!3@zMCmbV0HE~Rh?`bix(wa71#!7|djY6FCuo4y&ECWyX@b0P0NJTTZN&o* z)0lQc+4wY7CH4!)(yRf^-~~V5s0i$-5>Ik0?;S_2$|pzO@a`V1l6-xp?qS_f;z`ScdSBFcgh!SoGdc8*}3Qtk%ZQM5iFYU*ASS>lOc99RKk z8^ER6^y|msISSkM(R)!RZR2IKv)uV_cU*K#*}h{SKv88~sm)xu{NhEVyI%@Dtu4YQ z!3s>Q7z3t%6tnFhW+=m!e2ULZ0NIwn&hLY(LOu#v)lYeoy~t07V3toJ+1M`>8QW?J zuXP9bT*Kak(zqHuy&Y5s`G}1M?*U5?9w^AmiqkQ}HOBTHI%uA+H-SL9Y z#1MiU^&%)J5-C#6kbNVVVOQT5RHVzXz!1;}RKs_};k*RQ1*YT2ei85#lF^iQZ=46~ zF=5A4yO2)q=IdYFO**O%;kfmVXO5D9;8-lcapky4@w%nw%p~2j%|~;EnFkG!2#n^) z-Vw}>A#BwlZFrH2@Pj%MZ`aczI9t%AFr;vx0`vmc0?Ul=&B#D3z824DCh;|b5WXLF z#8RcFcRbY^*NWln{m(ytRCq@v;Qo~|Gf%j4$@%ll_^2OOt0GOly&mQcRgqVQum=-N zjGwUB06Y%hW8*712Y#k(d^TdoWglnX2R_Ra&z9Kv4?xX9N68ZvnQ$z~3ysny@P`s% zfWASNtu8ZpiY;aE2j70*qK*?LKy$91IJ51HMXS0<_wB+M6I`3m0!x}f-yqUAf^iNh z0dW8yO9Mz`{1(xYA=#!3UUCa7zENZGbzkI^_ua$FhpLR;`yhi4191)FQsX{r8YI9W zKJidA0;wZ%!>s9TCri217~VD1_v#Tb9#I3nwp!+A3IBf9)r%G`T9}a@Jm~$o#k;_P zQRH9^qw4o4g#CbCz61E;ykM+W8#suu z#&3EYuAw^zkbPC}{tEDg$rom8L+@GZYdMBonQ+0~t>B@4-hIP&U<7a$q6ngJZ(LYW zK`0IJJ6v%Pxlww~tdQpPB3xA+IC$8f9+m(D%S50Pz}9fR9Y$Sk$^-JWNsb-wk9en6I2PJ0j1x>+9!s z%}j@fU!Q=l_ed$vSU+Rogc-BuKsH)M`$uux`q6_m@8hj+s~8$)Z>6cnP3w7Np=@Ei zg)QIqFKPx*oNxSlm?&V%KD*Rx1uf5g9p@E>iK*4-SyLj1B?uq-TJN~m+<3Sry~D=l zrqkZh1^xSR+Xv9TVI)`I>vAY~8spps<+e?|XCg0v#zMy==z9{Lf1m-p0Ds^yc>4P= zx!Xr}r9gl!NN6TESQ#|pf|gaLP-;1IPs*4(HzG~=7;vgf(-yETBKVCp(w?V$b({KXWPJl3Pu%qG5S>Y|>bkqKO{#61do601jJ1%BLUjlhycS_!ZbK4c7{*gnBOyzuLpf=eOF{RV26L0*i|A`oh< z!(&4l&d~VRmo|ZKK4y-dWy02NbgOd5S6166*Kg1&v}(ZRl`+XfLhR0E37sWNr4 zvTzQhDOag-Rza2l_@^_at7A%h(~_mJ=_og%&6a8Cp)<0Ak!DpiP2f$l6~rD;T=D>; zN;nqhmDcN(aw~DxQun)uf;UaQQ&>R}K-JHIT)9Q9rgmQ|44 zEJiJf!_edIFg1a$Hf7BvE1A=~;@sGBa$N&V#MFsP&lzvF{St9|UPEqyw{HG^t*hY% zTLPgd1S|nWRBH6BE&0z<^503525as$AWtB#dDV|&NNWB)nGMJA{>%l?0dcb%JaiZo zr3TZwCNS80(UfgJd3-kTTokM(AKJOujq8Zfk|lLH&InEfXCRLR8wn;7h<#`(Q3P=T zvblPo62)NJP+P`CF>2d9AZcqN!Uk0pL{o4nY7^AekhBU}f|hGw6HHXaP`}-KlHW?Gwmm5HHw(fr9fBt)PR`(UjNW~8A z9QMmvg|(rWU}_>cB7#UQ3< z%DVrBzsG}cPB8(O1aK0xPQz-PI;}5Ex9A}m^uIF7!QI=_H04*d5w<~7B>0_PvDQ#R ze58FSSZTUe*BwuQhL5e`Jt&R;wR*5h@%L!0|4f4e(=ZbJZ;TTZzp{=~|GldJtcp1C zJ9Jzz{F}fQR?u=iyfp05PHuTz(-s0wtY~3-6wBs{? Date: Wed, 7 Mar 2012 23:51:37 -0300 Subject: [PATCH 36/45] Topic editor can be configured based on the shape type. --- mindplot/pom.xml | 2 +- mindplot/src/main/javascript/Designer.js | 59 ++++++++++--------- .../main/javascript/MultilineTextEditor.js | 8 ++- mindplot/src/main/javascript/Topic.js | 25 +++----- mindplot/src/main/javascript/TopicEditor.js | 45 +++++++++++++- mindplot/src/main/javascript/TopicFeature.js | 2 +- mindplot/src/main/javascript/header.js | 5 ++ wise-editor/src/main/webapp/html/editor.html | 3 +- wise-editor/src/main/webapp/js/editor.js | 10 +++- .../main/webapp/samples/welcome-reloaded.xml | 48 +++++++++++++++ 10 files changed, 149 insertions(+), 58 deletions(-) create mode 100644 wise-editor/src/main/webapp/samples/welcome-reloaded.xml diff --git a/mindplot/pom.xml b/mindplot/pom.xml index dab5bd3c..a5495371 100644 --- a/mindplot/pom.xml +++ b/mindplot/pom.xml @@ -51,7 +51,7 @@ - + diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index 9f78f3e0..5333fa5f 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -61,6 +61,7 @@ mindplot.Designer = new Class({ // Set editor working area ... this.setViewPort(options.viewPort); + mindplot.TopicEditor.configure(); }, _registerEvents : function() { @@ -448,42 +449,42 @@ mindplot.Designer = new Class({ this._mindmap = mindmapModel; try { - // Init layout manager ... - var size = {width:25,height:25}; - var layoutManager = new mindplot.layout.LayoutManager(mindmapModel.getCentralTopic().getId(), size); - layoutManager.addEvent('change', function(event) { - var id = event.getId(); - var topic = this.getModel().findTopicById(id); - topic.setPosition(event.getPosition()); - topic.setOrder(event.getOrder()); - }.bind(this)); - this._eventBussDispatcher.setLayoutManager(layoutManager); + // Init layout manager ... + var size = {width:25,height:25}; + var layoutManager = new mindplot.layout.LayoutManager(mindmapModel.getCentralTopic().getId(), size); + layoutManager.addEvent('change', function(event) { + var id = event.getId(); + var topic = this.getModel().findTopicById(id); + topic.setPosition(event.getPosition()); + topic.setOrder(event.getOrder()); + }.bind(this)); + this._eventBussDispatcher.setLayoutManager(layoutManager); - // Building node graph ... - var branches = mindmapModel.getBranches(); - for (var i = 0; i < branches.length; i++) { - // NodeModel -> NodeGraph ... - var nodeModel = branches[i]; - var nodeGraph = this._nodeModelToNodeGraph(nodeModel, false); + // Building node graph ... + var branches = mindmapModel.getBranches(); + for (var i = 0; i < branches.length; i++) { + // NodeModel -> NodeGraph ... + var nodeModel = branches[i]; + var nodeGraph = this._nodeModelToNodeGraph(nodeModel, false); - // Update shrink render state... - nodeGraph.setBranchVisibility(true); - } + // Update shrink render state... + nodeGraph.setBranchVisibility(true); + } - var relationships = mindmapModel.getRelationships(); - for (var j = 0; j < relationships.length; j++) { - this._relationshipModelToRelationship(relationships[j]); - } + var relationships = mindmapModel.getRelationships(); + for (var j = 0; j < relationships.length; j++) { + this._relationshipModelToRelationship(relationships[j]); + } - // Place the focus on the Central Topic - var centralTopic = this.getModel().getCentralTopic(); - this.goToNode(centralTopic); + // Place the focus on the Central Topic + var centralTopic = this.getModel().getCentralTopic(); + this.goToNode(centralTopic); - // Finally, sort the map ... - mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout); + // Finally, sort the map ... + mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout); - this.fireEvent('loadSuccess'); + this.fireEvent('loadSuccess'); } catch(e) { this.fireEvent('loadError', e); } diff --git a/mindplot/src/main/javascript/MultilineTextEditor.js b/mindplot/src/main/javascript/MultilineTextEditor.js index fc6f69a2..db883074 100644 --- a/mindplot/src/main/javascript/MultilineTextEditor.js +++ b/mindplot/src/main/javascript/MultilineTextEditor.js @@ -18,8 +18,8 @@ mindplot.MultilineTextEditor = new Class({ Extends: Events, - initialize:function(topic) { - this._topic = topic; + initialize:function() { + this._topic = null; }, _buildEditor : function() { @@ -133,8 +133,9 @@ mindplot.MultilineTextEditor = new Class({ } }, - show : function (text) { + show : function (topic,text) { + this._topic = topic; if (!this.isVisible()) { //Create editor ui var containerElem = this._buildEditor(); @@ -260,6 +261,7 @@ mindplot.MultilineTextEditor = new Class({ // Remove it form the screen ... this._containerElem.dispose(); this._containerElem = null; + this._topic = null; } } }); diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js index a669085e..78829339 100644 --- a/mindplot/src/main/javascript/Topic.js +++ b/mindplot/src/main/javascript/Topic.js @@ -21,8 +21,6 @@ mindplot.Topic = new Class({ Extends:mindplot.NodeGraph, initialize : function(model, options) { this.parent(model, options); - this._textEditor = new mindplot.MultilineTextEditor(this); - this._children = []; this._parent = null; this._relationships = []; @@ -51,19 +49,9 @@ mindplot.Topic = new Class({ }); this.addEvent('dblclick', function (event) { - this._textEditor.show(); + this._getTopicEditor().show(this); event.stopPropagation(true); }.bind(this)); - - this._textEditor.addEvent('input', function() { - var textShape = this.getTextShape(); -// var oldText = textShape.getText(); - -// this._setText(text, false); - // @Todo: I must resize, no change the position ... -// textShape.setText(oldText); - }.bind(this)); - }, setShapeType : function(type) { @@ -664,7 +652,7 @@ mindplot.Topic = new Class({ }, showTextEditor : function(text) { - this._textEditor.show(text); + this._getTopicEditor().show(this, {text:text}); }, showNoteEditor : function() { @@ -740,9 +728,12 @@ mindplot.Topic = new Class({ editor.show(); }, - closeEditors : function() { - this._textEditor.close(true); + this._getTopicEditor().close(true); + }, + + _getTopicEditor : function() { + return mindplot.TopicEditor.getInstance(); }, /** @@ -1123,7 +1114,7 @@ mindplot.Topic = new Class({ } // If a drag node is create for it, let's hide the editor. - this._textEditor.close(); + this._getTopicEditor().close(); return result; }, diff --git a/mindplot/src/main/javascript/TopicEditor.js b/mindplot/src/main/javascript/TopicEditor.js index 18181919..52eb0d5c 100644 --- a/mindplot/src/main/javascript/TopicEditor.js +++ b/mindplot/src/main/javascript/TopicEditor.js @@ -18,8 +18,49 @@ mindplot.TopicEditor = new Class({ Extends: Events, - initialize:function(topic) { - this._topic = topic; + Static: { + _instance: null, + + configure: function(options) { + this._instance = new mindplot.TopicEditor(); + }, + + getInstance : function() { + return this._instance; + } + }, + + initialize:function() { + this._activeEditor = null; + this._multilineEditor = new mindplot.MultilineTextEditor(); + }, + + close : function(update) { + if (this.isVisible()) { + this._activeEditor.close(update); + this._activeEditor = null; + } + }, + + show : function(topic, options) { + + // Close all previous open editor .... + if (this.isVisible()) { + this.close(); + } + + // Open the new editor ... + var model = topic.getModel(); + if (model.getShapeType() != mindplot.model.TopicShape.IMAGE) { + this._multilineEditor.show(topic, options ? options.text : null); + this._activeEditor = this._multilineEditor; + } else { + // To be implemented.... + } + }, + + isVisible: function() { + return this._activeEditor != null && this._activeEditor.isVisible(); } }); diff --git a/mindplot/src/main/javascript/TopicFeature.js b/mindplot/src/main/javascript/TopicFeature.js index 8cba25f3..5e10c37e 100644 --- a/mindplot/src/main/javascript/TopicFeature.js +++ b/mindplot/src/main/javascript/TopicFeature.js @@ -63,6 +63,6 @@ mindplot.TopicFeature = { } }; -mindplot.TopicFeature._featuresMetadataById = [mindplot.TopicFeature.Icon,mindplot.TopicFeature.Link,mindplot.TopicFeature.Note] +mindplot.TopicFeature._featuresMetadataById = [mindplot.TopicFeature.Icon,mindplot.TopicFeature.Link,mindplot.TopicFeature.Note]; diff --git a/mindplot/src/main/javascript/header.js b/mindplot/src/main/javascript/header.js index e3018861..a62941dd 100644 --- a/mindplot/src/main/javascript/header.js +++ b/mindplot/src/main/javascript/header.js @@ -29,3 +29,8 @@ mindplot.collaboration.framework = {}; mindplot.persistence = {}; mindplot.layout = {}; + +Class.Mutators.Static = function(items){ + this.extend(items); +}; + diff --git a/wise-editor/src/main/webapp/html/editor.html b/wise-editor/src/main/webapp/html/editor.html index 491bc7b9..5ac47a5f 100644 --- a/wise-editor/src/main/webapp/html/editor.html +++ b/wise-editor/src/main/webapp/html/editor.html @@ -22,7 +22,7 @@ diff --git a/wise-editor/src/main/webapp/js/editor.js b/wise-editor/src/main/webapp/js/editor.js index 3c9c3b00..93af025a 100644 --- a/wise-editor/src/main/webapp/js/editor.js +++ b/wise-editor/src/main/webapp/js/editor.js @@ -30,6 +30,7 @@ function buildDesigner(options) { window.waitDialog.destroy(); }); + // Register error handlers ... designer.addEvent('loadError', function(e) { window.waitDialog.close(); window.waitDialog.destroy(); @@ -37,7 +38,11 @@ function buildDesigner(options) { console.log(e); }); - +// window.onerror = function() +// { +// errorDialog.show(); +// }; +// // Configure default persistence manager ... var persistence; if (options.persistenceManager) { @@ -209,8 +214,7 @@ editor.FatalErrorDialog = new Class({ }.bind(this)); this.overlay.close(); }} - ) - ; + ); this.setContent(panel); }, diff --git a/wise-editor/src/main/webapp/samples/welcome-reloaded.xml b/wise-editor/src/main/webapp/samples/welcome-reloaded.xml new file mode 100644 index 00000000..cac5906b --- /dev/null +++ b/wise-editor/src/main/webapp/samples/welcome-reloaded.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 0f2af2cb74c0a057a1c1287d5551485bd524c1dc Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 8 Mar 2012 00:11:54 -0300 Subject: [PATCH 37/45] Fix Firefox bugs ... --- mindplot/src/main/javascript/Topic.js | 2 +- web2d/src/main/javascript/peer/svg/TextPeer.js | 15 +++++++++++++-- wise-editor/src/main/webapp/js/editor.js | 10 +++++----- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js index 78829339..a1c37fea 100644 --- a/mindplot/src/main/javascript/Topic.js +++ b/mindplot/src/main/javascript/Topic.js @@ -1173,7 +1173,7 @@ mindplot.Topic = new Class({ var relationships = child.getRelationships(); result = result.concat(relationships); - var innerChilds = core.Utils.flattenTopicChildElements(child); + var innerChilds = this._flatten2DElements(child); result = result.concat(innerChilds); } return result; diff --git a/web2d/src/main/javascript/peer/svg/TextPeer.js b/web2d/src/main/javascript/peer/svg/TextPeer.js index c67e2d1b..30071e50 100644 --- a/web2d/src/main/javascript/peer/svg/TextPeer.js +++ b/web2d/src/main/javascript/peer/svg/TextPeer.js @@ -155,14 +155,25 @@ web2d.peer.svg.TextPeer = new Class({ }, getWidth : function () { - var computedWidth = this._native.getBBox().width; + // Firefox hack for this issue:http://stackoverflow.com/questions/6390065/doing-ajax-updates-in-svg-breaks-getbbox-is-there-a-workaround + try { + var computedWidth = this._native.getBBox().width; + } catch(e) { + computedWidth = 10; + } + var width = parseInt(computedWidth); width = width + this._font.getWidthMargin(); return width; }, getHeight : function () { - var computedHeight = this._native.getBBox().height; + // Firefox hack for this issue:http://stackoverflow.com/questions/6390065/doing-ajax-updates-in-svg-breaks-getbbox-is-there-a-workaround + try { + var computedHeight = this._native.getBBox().height; + } catch(e) { + computedHeight = 10; + } return parseInt(computedHeight); }, diff --git a/wise-editor/src/main/webapp/js/editor.js b/wise-editor/src/main/webapp/js/editor.js index 93af025a..408f917f 100644 --- a/wise-editor/src/main/webapp/js/editor.js +++ b/wise-editor/src/main/webapp/js/editor.js @@ -38,11 +38,11 @@ function buildDesigner(options) { console.log(e); }); -// window.onerror = function() -// { -// errorDialog.show(); -// }; -// + window.onerror = function() + { + errorDialog.show(); + }; + // Configure default persistence manager ... var persistence; if (options.persistenceManager) { From 0660c7e8c36e471fe0bfbbdfd4cbf78e6e12007c Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 8 Mar 2012 00:30:27 -0300 Subject: [PATCH 38/45] Fix exception on changing central topic shape. --- mindplot/src/main/javascript/CentralTopic.js | 4 +++ .../src/main/javascript/ConnectionLine.js | 16 +++++---- mindplot/src/main/javascript/Designer.js | 8 ++--- mindplot/src/main/javascript/Topic.js | 36 +++++++++++++------ wise-editor/src/main/webapp/html/editor.html | 2 +- wise-editor/src/main/webapp/js/editor.js | 9 ++--- 6 files changed, 45 insertions(+), 30 deletions(-) diff --git a/mindplot/src/main/javascript/CentralTopic.js b/mindplot/src/main/javascript/CentralTopic.js index 3bd61009..06ba5663 100644 --- a/mindplot/src/main/javascript/CentralTopic.js +++ b/mindplot/src/main/javascript/CentralTopic.js @@ -90,5 +90,9 @@ mindplot.CentralTopic = new Class({ weight:"bold", color:"#ffffff" }; + }, + + getShrinkConnector : function() { + return null; } }); \ No newline at end of file diff --git a/mindplot/src/main/javascript/ConnectionLine.js b/mindplot/src/main/javascript/ConnectionLine.js index e5ab6570..08c38cf1 100644 --- a/mindplot/src/main/javascript/ConnectionLine.js +++ b/mindplot/src/main/javascript/ConnectionLine.js @@ -131,13 +131,15 @@ mindplot.ConnectionLine = new Class({ y = y - offset; var connector = targetTopic.getShrinkConnector(); - if (Math.sign(targetPosition.x) > 0) { - var x = targetTopicSize.width; - connector.setPosition(x, y); - } - else { - var x = -mindplot.Topic.CONNECTOR_WIDTH; - connector.setPosition(x, y); + if ($defined(connector)) { + if (Math.sign(targetPosition.x) > 0) { + var x = targetTopicSize.width; + connector.setPosition(x, y); + } + else { + var x = -mindplot.Topic.CONNECTOR_WIDTH; + connector.setPosition(x, y); + } } }, diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index 5333fa5f..b1bb69f4 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -448,7 +448,7 @@ mindplot.Designer = new Class({ $assert(mindmapModel, "mindmapModel can not be null"); this._mindmap = mindmapModel; - try { +// try { // Init layout manager ... var size = {width:25,height:25}; var layoutManager = new mindplot.layout.LayoutManager(mindmapModel.getCentralTopic().getId(), size); @@ -485,9 +485,9 @@ mindplot.Designer = new Class({ mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout); this.fireEvent('loadSuccess'); - } catch(e) { - this.fireEvent('loadError', e); - } +// } catch(e) { +// this.fireEvent('loadError', e); +// } }, getMindmap : function() { diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js index a1c37fea..1e6273ca 100644 --- a/mindplot/src/main/javascript/Topic.js +++ b/mindplot/src/main/javascript/Topic.js @@ -93,6 +93,7 @@ mindplot.Topic = new Class({ if ($defined(iconGroup)) { iconGroup.moveToFront(); } + //Move connector to front var connector = this.getShrinkConnector(); if ($defined(connector)) { @@ -489,7 +490,9 @@ mindplot.Topic = new Class({ innerShape.setFill(color); var connector = this.getShrinkConnector(); - connector.setFill(color); + if (connector) { + connector.setFill(color); + } if ($defined(updateModel) && updateModel) { var model = this.getModel(); @@ -515,8 +518,9 @@ mindplot.Topic = new Class({ innerShape.setAttribute('strokeColor', color); var connector = this.getShrinkConnector(); - connector.setAttribute('strokeColor', color); - + if (connector) { + connector.setAttribute('strokeColor', color); + } if ($defined(updateModel) && updateModel) { var model = this.getModel(); @@ -542,7 +546,6 @@ mindplot.Topic = new Class({ var outerShape = this.getOuterShape(); var innerShape = this.getInnerShape(); var textShape = this.getTextShape(); - var shrinkConnector = this.getShrinkConnector(); // Add to the group ... group.appendChild(outerShape); @@ -555,7 +558,8 @@ mindplot.Topic = new Class({ this.getOrBuildIconGroup(); } - if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { + var shrinkConnector = this.getShrinkConnector(); + if ($defined(shrinkConnector)) { shrinkConnector.addToWorkspace(group); } @@ -615,7 +619,9 @@ mindplot.Topic = new Class({ // Change render base on the state. var shrinkConnector = this.getShrinkConnector(); - shrinkConnector.changeRender(value); + if ($defined(shrinkConnector)) { + shrinkConnector.changeRender(value); + } // Do some fancy animation .... var elements = this._flatten2DElements(this); @@ -874,7 +880,9 @@ mindplot.Topic = new Class({ if (this.getIncomingLines().length > 0) { var connector = this.getShrinkConnector(); - connector.setVisibility(value); + if ($defined(connector)) { + connector.setVisibility(value); + } } var textShape = this.getTextShape(); @@ -885,8 +893,10 @@ mindplot.Topic = new Class({ var elem = this.get2DElement(); elem.setOpacity(opacity); - this.getShrinkConnector().setOpacity(opacity); - + var connector = this.getShrinkConnector(); + if ($defined(connector)) { + connector.setOpacity(opacity); + } var textShape = this.getTextShape(); textShape.setOpacity(opacity); }, @@ -986,7 +996,9 @@ mindplot.Topic = new Class({ // Hide connection line?. if (targetTopic.getChildren().length == 0) { var connector = targetTopic.getShrinkConnector(); - connector.setVisibility(false); + if ($defined(connector)) { + connector.setVisibility(false); + } } } }, @@ -1041,7 +1053,9 @@ mindplot.Topic = new Class({ // Display connection node... var connector = targetTopic.getShrinkConnector(); - connector.setVisibility(true); + if ($defined(connector)) { + connector.setVisibility(true); + } // Redraw line ... outgoingLine.redraw(); diff --git a/wise-editor/src/main/webapp/html/editor.html b/wise-editor/src/main/webapp/html/editor.html index 5ac47a5f..cc764aee 100644 --- a/wise-editor/src/main/webapp/html/editor.html +++ b/wise-editor/src/main/webapp/html/editor.html @@ -22,7 +22,7 @@