From abede3c0104c7b5e496faa0dd9fc216052922990 Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Sun, 19 Jan 2014 12:32:02 -0300 Subject: [PATCH 01/12] add if exists to hsql statements --- config/database/hsql/drop-schemas.sql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config/database/hsql/drop-schemas.sql b/config/database/hsql/drop-schemas.sql index cf40ac87..a0de242f 100644 --- a/config/database/hsql/drop-schemas.sql +++ b/config/database/hsql/drop-schemas.sql @@ -1,9 +1,9 @@ -DROP TABLE ACCESS_AUDITORY; -DROP TABLE TAG; -DROP TABLE COLLABORATION; -DROP TABLE COLLABORATION_PROPERTIES; -DROP TABLE MINDMAP_HISTORY; -DROP TABLE MINDMAP; -DROP TABLE USER; -DROP TABLE COLLABORATOR; +DROP TABLE IF EXISTS ACCESS_AUDITORY; +DROP TABLE IF EXISTS TAG; +DROP TABLE IF EXISTS COLLABORATION; +DROP TABLE IF EXISTS COLLABORATION_PROPERTIES; +DROP TABLE IF EXISTS MINDMAP_HISTORY; +DROP TABLE IF EXISTS MINDMAP; +DROP TABLE IF EXISTS USER; +DROP TABLE IF EXISTS COLLABORATOR; COMMIT; From f20b3a7a4644ccb972f8e30625110677e21cd114 Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Sun, 19 Jan 2014 12:32:23 -0300 Subject: [PATCH 02/12] add if not exists to mysql database creation --- config/database/mysql/create-database.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/database/mysql/create-database.sql b/config/database/mysql/create-database.sql index 32203224..a31b97ca 100644 --- a/config/database/mysql/create-database.sql +++ b/config/database/mysql/create-database.sql @@ -1,4 +1,4 @@ -CREATE DATABASE wisemapping +CREATE DATABASE IF NOT EXISTS wisemapping CHARACTER SET = 'utf8' COLLATE = 'utf8_unicode_ci'; CREATE USER 'wisemapping'@'localhost' From 7eda354f8f57ca8c2de44664c17453e4680b75fb Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Sun, 19 Jan 2014 12:32:50 -0300 Subject: [PATCH 03/12] select database wisemapping in mysql tables creation --- config/database/mysql/create-schemas.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/database/mysql/create-schemas.sql b/config/database/mysql/create-schemas.sql index 97e62c74..4e26a3fc 100644 --- a/config/database/mysql/create-schemas.sql +++ b/config/database/mysql/create-schemas.sql @@ -1,3 +1,5 @@ +USE wisemapping; + CREATE TABLE COLLABORATOR ( id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, email VARCHAR(255) From c6aed4bf6e8c0f8917be05e1915477af7d10e024 Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Sun, 19 Jan 2014 12:33:08 -0300 Subject: [PATCH 04/12] add if exists to mysql statements --- config/database/mysql/drop-schemas.sql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config/database/mysql/drop-schemas.sql b/config/database/mysql/drop-schemas.sql index a6bfa760..6a5af0e5 100644 --- a/config/database/mysql/drop-schemas.sql +++ b/config/database/mysql/drop-schemas.sql @@ -1,9 +1,9 @@ -DROP TABLE TAG; -DROP TABLE ACCESS_AUDITORY; -DROP TABLE COLLABORATION; -DROP TABLE COLLABORATION_PROPERTIES; -DROP TABLE MINDMAP_HISTORY; -DROP TABLE MINDMAP; -DROP TABLE USER; -DROP TABLE COLLABORATOR; +DROP TABLE IF EXISTS TAG; +DROP TABLE IF EXISTS ACCESS_AUDITORY; +DROP TABLE IF EXISTS COLLABORATION; +DROP TABLE IF EXISTS COLLABORATION_PROPERTIES; +DROP TABLE IF EXISTS MINDMAP_HISTORY; +DROP TABLE IF EXISTS MINDMAP; +DROP TABLE IF EXISTS USER; +DROP TABLE IF EXISTS COLLABORATOR; COMMIT; \ No newline at end of file From 3828a1afdb9f5abc556202f02159f0415116f3a4 Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Sun, 19 Jan 2014 12:33:39 -0300 Subject: [PATCH 05/12] fix mysql test-data statements --- config/database/mysql/test-data.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/database/mysql/test-data.sql b/config/database/mysql/test-data.sql index 6301d7af..960fe536 100644 --- a/config/database/mysql/test-data.sql +++ b/config/database/mysql/test-data.sql @@ -3,8 +3,8 @@ INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code VALUES (1, 'Test', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURRENT_DATE(), 1,'D'); INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemapping.org', CURRENT_DATE()); -INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type,'D') - VALUES (2, 'Admin', 'User', 'admin', 1237, CURRENT_DATE(), 1); +INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) + VALUES (2, 'Admin', 'User', 'admin', 1237, CURRENT_DATE(), 1, 'D'); COMMIT; From 541d07c46cacea0a41999e610119ad093dcdbbe6 Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Sun, 19 Jan 2014 12:33:56 -0300 Subject: [PATCH 06/12] creating mysql and hsql maven profiles --- wise-webapp/pom.xml | 143 ++++++++++++++++++++++++++++++-------------- 1 file changed, 97 insertions(+), 46 deletions(-) diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index 3e479cd0..44322a5b 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -320,54 +320,105 @@ 1.7.1 + + + hsqldb + + true + + + + + org.codehaus.mojo + sql-maven-plugin + 1.5 + + + org.hsqldb.jdbc.JDBCDriver + jdbc:hsqldb:file:${project.build.directory}/db/wisemapping + sa + + + + + org.hsqldb + hsqldb + 2.2.8 + + + + + + + drop-schemas + prepare-package + + execute + + + continue + descending + + ${project.basedir} + + config/database/hsql/drop-schemas.sql + config/database/hsql/create-schemas.sql + config/database/hsql/atest-data.sql + + + + + + + + + + + mysqldb + + false + + + + + org.codehaus.mojo + sql-maven-plugin + 1.5 + + + mysql + mysql-connector-java + 5.1.5 + + + + + init-schema + + execute + + prepare-package + + + + com.mysql.jdbc.Driver + root + + jdbc:mysql://127.0.0.1:3306/?useUnicode=true&characterEncoding=UTF-8 + false + + config/database/mysql/create-database.sql + config/database/mysql/create-schemas.sql + config/database/mysql/test-data.sql + + + + + + + - - org.codehaus.mojo - sql-maven-plugin - 1.5 - - - org.hsqldb.jdbc.JDBCDriver - jdbc:hsqldb:file:${project.build.directory}/db/wisemapping - sa - - - - - mysql - mysql-connector-java - 5.1.5 - - - org.hsqldb - hsqldb - 2.2.8 - - - - - - drop-schemas - prepare-package - - execute - - - continue - descending - - ${project.basedir} - - config/database/hsql/drop-schemas.sql - config/database/hsql/create-schemas.sql - config/database/hsql/atest-data.sql - - - - - - org.codehaus.mojo native2ascii-maven-plugin From 2e24032d1c10238e4986727c4c7372c531554c8b Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Sun, 19 Jan 2014 12:39:42 -0300 Subject: [PATCH 07/12] fix mysql database and user creation --- config/database/mysql/create-database.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/database/mysql/create-database.sql b/config/database/mysql/create-database.sql index a31b97ca..52a7cd2f 100644 --- a/config/database/mysql/create-database.sql +++ b/config/database/mysql/create-database.sql @@ -1,6 +1,7 @@ +DROP DATABASE IF EXISTS wisemapping; + CREATE DATABASE IF NOT EXISTS wisemapping CHARACTER SET = 'utf8' COLLATE = 'utf8_unicode_ci'; -CREATE USER 'wisemapping'@'localhost' - IDENTIFIED BY 'password'; GRANT ALL ON wisemapping.* TO 'wisemapping'@'localhost'; +SET PASSWORD FOR 'wisemapping'@'localhost' = PASSWORD('password'); \ No newline at end of file From 9639b9e113fae05257a54531c6e6fa604b9e6662 Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Sun, 19 Jan 2014 18:21:18 -0300 Subject: [PATCH 08/12] 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 242827f7e6ba507709b0e4900dfd075a228c5cec Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Sun, 19 Jan 2014 18:21:38 -0300 Subject: [PATCH 09/12] 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 9d2cf7e1ffcbadc212adde508a34a5f816d3ea16 Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Sun, 19 Jan 2014 18:22:13 -0300 Subject: [PATCH 10/12] 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 52cac830ae8b97dd1487be294b1d8f3eeee3f331 Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Sun, 19 Jan 2014 18:22:47 -0300 Subject: [PATCH 11/12] 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 0c103fc3a229327cfec7dfcf8dbd903632a16b76 Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Sun, 29 Dec 2013 16:41:10 -0300 Subject: [PATCH 12/12] 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