From 3736f48efa98b6b9f11302494a2beabc11e32f85 Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Sun, 19 Jan 2014 18:21:18 -0300 Subject: [PATCH 1/5] adding missing info to README.md --- README.md | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/README.md b/README.md index 9cef7e88..2638a159 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,76 @@ This will start the application on the URL: [http://localhost:8080/wise-webapp/] User: test@wisemapping.org Password: test +## Running the JS only version + +Start by creating the .zip file: + +`mvn assembly:assembly -Dmaven.test.skip=true` + +To test the javascript frontend you then do: + + ruby -rwebrick -e 'WEBrick::HTTPServer.new(:Port=>8000,:DocumentRoot=>".").start' + +Now open a browser using the URL http://localhost:8000/wise-editor/src/main/webapp/ + +### Attaching drag and drop events. + +1) Support for dragging TextNodes: + +The following code is an example of how to add attach to the div dragImageNode the support for node dragging. + + $("dragTextNode").addEvent('mousedown', function(event) { + event.preventDefault(); + + // Create a image node ... + var mindmap = designer.getMindmap(); + var node = mindmap.createNode(); + node.setText("Node Text !!!!"); + node.setMetadata("{'media':'test'}"); + node.setShapeType(mindplot.model.TopicShape.RECTANGLE); + + // Add link ... + var link = node.createFeature(mindplot.TopicFeature.Link.id, {url:"http://www.wisemapping.com"}); + node.addFeature(link); + + // Add Note ... + var note = node.createFeature(mindplot.TopicFeature.Note.id, {text:"This is a note"}); + node.addFeature(note); + + designer.addDraggedNode(event, node); + }); + +In the example, a new node is created with text "Node Text !!!!" and a note and a link associated to it when the user drop the node. Something to pay attention is the node.setMetadata("{}"), this delegated will be persisted during the serialization. Here you can store all the data you need. + +2) Support for dragging Images: Similar to the point 1,drag support is registered to the div dragImageNode. + + $("dragImageNode").addEvent('mousedown', function(event) { + event.preventDefault(); + + // Create a image node ... + var mindmap = designer.getMindmap(); + var node = mindmap.createNode(); + node.setImageSize(80, 43); + node.setMetadata("{'media':'video,'url':'http://www.youtube.com/watch?v=P3FrXftyuzw&feature=g-vrec&context=G2b4ab69RVAAAAAAAAAA'}"); + node.setImageUrl("images/logo-small.png"); + node.setShapeType(mindplot.model.TopicShape.IMAGE); + + designer.addDraggedNode(event, node); + }); + +The node.setShapeType(mindplot.model.TopicShape.IMAGE) defines a image node. This makes mandatory the set of setImageUrl and setImageSize properties in the node. + +3) An event registration mechanism for Image nodes edit events: The next snipped show how to register a custom edition handler. + + designer.addEvent("editnode", function(event) { + var node = event.model; + + alert("Node Id:" + node.getId()); + alert("Node Metadata:" + node.getMetadata()); + alert("Is Read Only:" + event.readOnly); + } }); + + ## Authors * Pablo Luna From 5d231249c73fe19c7962986933e13184213ee37b Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Sun, 19 Jan 2014 18:21:38 -0300 Subject: [PATCH 2/5] updating jetty plugin on pom --- wise-editor/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wise-editor/pom.xml b/wise-editor/pom.xml index a7972f77..9f6efa4f 100644 --- a/wise-editor/pom.xml +++ b/wise-editor/pom.xml @@ -31,8 +31,8 @@ org.mortbay.jetty - maven-jetty-plugin - 6.1.26 + jetty-maven-plugin + 8.1.14.v20131031 From 808660cfbb9615602c89e3e02085aad7fe617684 Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Sun, 19 Jan 2014 18:22:13 -0300 Subject: [PATCH 3/5] remove wrong js file on standalone-editor.xml --- distribution/assembly/standalone-editor.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/distribution/assembly/standalone-editor.xml b/distribution/assembly/standalone-editor.xml index 53ee6976..39f278c9 100644 --- a/distribution/assembly/standalone-editor.xml +++ b/distribution/assembly/standalone-editor.xml @@ -6,7 +6,7 @@ zip - + core-js/target/classes/core.js /js @@ -14,10 +14,6 @@ mindplot/target/classes/mindplot-min.js /js - - mindplot/target/classes/mindplot.js - /js - From 947fd30fa2ce71032b4a5a88fd5eae87509bf454 Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Sun, 19 Jan 2014 18:22:47 -0300 Subject: [PATCH 4/5] removing unnecesary build --- wise-editor/pom.xml | 57 --------------------------------------------- 1 file changed, 57 deletions(-) diff --git a/wise-editor/pom.xml b/wise-editor/pom.xml index 9f6efa4f..6c8b8935 100644 --- a/wise-editor/pom.xml +++ b/wise-editor/pom.xml @@ -27,62 +27,5 @@ - - - - org.mortbay.jetty - jetty-maven-plugin - 8.1.14.v20131031 - - - - 8080 - 60000 - - - ${project.build.directory}/wise-editor-${com.wisemapping.version}.war - - - - - maven-war-plugin - 2.1.1 - - js/mindplot-min.js - - - org.wisemapping - core-js - jar - js - - *.js - - - - org.wisemapping - mindplot - jar - css - - **/*.css - **/*.html - - - - org.wisemapping - mindplot - jar - js - - *.js - - - - - - - - From b401a53a21327264e88a27b69ffc03f46070866a Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Sun, 29 Dec 2013 16:41:10 -0300 Subject: [PATCH 5/5] addding tomcat plugin --- wise-webapp/pom.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index 44322a5b..c6b2f10c 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -555,6 +555,20 @@ + + org.apache.tomcat.maven + tomcat7-maven-plugin + + /wisemapping + ${project.build.directory}/wisemapping.war + war + true + + ${project.build.directory} + + + + org.apache.maven.plugins maven-dependency-plugin