diff --git a/Compiling-and-running.md b/Compiling-and-running.md deleted file mode 100644 index 53d0ab77..00000000 --- a/Compiling-and-running.md +++ /dev/null @@ -1,36 +0,0 @@ -# Compiling and Running - -## Prerequisites - -The following products must be installed: - - * Java Development Kit 7 or higher ([http://www.oracle.com/technetwork/java/javase/downloads/index.html]) - * Maven 3.x or higher ([http://maven.apache.org/]) - -## Compiling - -WiseMapping uses Maven as packaging and project management. It's composed of 5 maven sub-modules: - - * core-js: Utilities JavaScript classes - * web2d: JavaScript 2D SVG abstraction library used by the mind map editor - * mindplot: JavaScript mindmap designer core - * wise-editor: Mindmap Editor standalone distribution - * wise-webapp: J2EE web application - -The full compilation of the project can be performed executing within <project-dir>: - -`mvn package` - -Once this command is execute, the file <project-dir>/wise-webapp/target/wisemapping*.war will be generated. - -## Testing -The previously generated war can be deployed locally executing within the directory <project-dir>/wise-webapp the following command: - -`cd wise-webapp;mvn jetty:run-war` - -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 - -Enjoy :) \ No newline at end of file diff --git a/Home.textile b/Home.textile deleted file mode 100644 index 416bff08..00000000 --- a/Home.textile +++ /dev/null @@ -1,20 +0,0 @@ -h1. What is WiseMapping Open Source? - -WiseMapping is a free web based mindmapping application. The goal of this project is to provide a high quality product that can be deployed by educational and academic institutions, private and public companies and anyone who needs to have a mindmapping application. WiseMapping is based on the same code source supporting WiseMapping.com. - - -h1. Why Open Source ? - -In the last years, we have received hundred of mails from different persons asking for: -Integrating wisemapping.com with their sites -Deploying a private instance of wisemapping.com -Participating in the development of the site -All this make us wonder "Why if we share our product to all this people and invite them to participate with us in this journey ?" . - -h1. Who are we ? - -We’re a couple of friends working on an idea: “Create the best on-line collaborative mind mapping tool ever created”. This has been our idea since the first day we started. - -h1. [[Documentation]] - -h1. [[Compiling and Running]] diff --git a/README.md b/README.md index 24e4574a..350f0fc4 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ -## Project Information +# Project Information The goal of this project is to provide a high quality product that can be deployed by educational and academic institutions, private and public companies and anyone who needs to have a mindmapping application. WiseMapping is based on the same code source supporting WiseMapping.com. More info: www.wisemapping.org -# Compiling and Running +## Compiling and Running -## Prerequisites +### Prerequisites The following products must be installed: * Java Development Kit 7 or higher ([http://www.oracle.com/technetwork/java/javase/downloads/index.html]) * Maven 3.x or higher ([http://maven.apache.org/]) -## Compiling +### Compiling WiseMapping uses Maven as packaging and project management. It's composed of 5 maven sub-modules: @@ -27,7 +27,7 @@ The full compilation of the project can be performed executing within <project-d Once this command is execute, the file <project-dir>/wise-webapp/target/wisemapping*.war will be generated. -## Testing +### Testing The previously generated war can be deployed locally executing within the directory <project-dir>/wise-webapp the following command: `cd wise-webapp;mvn jetty:run-war` @@ -37,8 +37,6 @@ 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: @@ -51,70 +49,21 @@ To test the javascript frontend you then do: Now open a browser using the URL http://localhost:8000/wise-editor/src/main/webapp/ -### Attaching drag and drop events. +## Members -1) Support for dragging TextNodes: +### Founders -The following code is an example of how to add attach to the div dragImageNode the support for node dragging. + * Pablo Luna <pveiga@wisemapping.com> + * Paulo Veiga <pablo@wisemapping.com> - $("dragTextNode").addEvent('mousedown', function(event) { - event.preventDefault(); +### Individual Controbutors - // 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); + * Ezequiel Bergamaschi - // Add link ... - var link = node.createFeature(mindplot.TopicFeature.Link.id, {url:"http://www.wisemapping.com"}); - node.addFeature(link); +### Past Individual Contributors - // 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 - * Paulo Veiga - -Past Collaborators: Ignacio Manzano, Nicolas Damonte + * Ignacio Manzano + * Nicolas Damonte ## License diff --git a/config/database/mysql/apopulate-schemas.sql b/config/database/mysql/apopulate-schemas.sql index 29db4553..a08621a2 100644 --- a/config/database/mysql/apopulate-schemas.sql +++ b/config/database/mysql/apopulate-schemas.sql @@ -1,3 +1,7 @@ +# +# Command: mysql -u root -p < apopulate_schemas.sql +# + INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (1, 'test@wisemapping.org', CURRENT_DATE()); INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) VALUES (1, 'Test', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURRENT_DATE(), 1,'D'); diff --git a/config/database/mysql/create-database.sql b/config/database/mysql/create-database.sql index 52a7cd2f..6d2cd226 100644 --- a/config/database/mysql/create-database.sql +++ b/config/database/mysql/create-database.sql @@ -1,3 +1,6 @@ +# +# Command: mysql -u root -p < create_database.sql +# DROP DATABASE IF EXISTS wisemapping; CREATE DATABASE IF NOT EXISTS wisemapping diff --git a/config/database/mysql/create-schemas.sql b/config/database/mysql/create-schemas.sql index 4e26a3fc..c9164ad0 100644 --- a/config/database/mysql/create-schemas.sql +++ b/config/database/mysql/create-schemas.sql @@ -1,3 +1,7 @@ +# +# Command: mysql -u root -p < create_schemas.sql +# + USE wisemapping; CREATE TABLE COLLABORATOR ( diff --git a/java.iml b/java.iml deleted file mode 100644 index 8015fa76..00000000 --- a/java.iml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> - <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false"> - <output url="file://$MODULE_DIR$/target/classes" /> - <output-test url="file://$MODULE_DIR$/target/test-classes" /> - <exclude-output /> - <content url="file://$MODULE_DIR$"> - <excludeFolder url="file://$MODULE_DIR$/target" /> - </content> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - </component> -</module> - diff --git a/license.txt b/license.txt index 3f5065af..fa41cbdd 100644 --- a/license.txt +++ b/license.txt @@ -1,4 +1,4 @@ - Copyright [2012] [wisemapping] + Copyright [2014] [wisemapping] Licensed under WiseMapping Public License, Version 1.0 (the "License"). * It is basically the Apache License, Version 2.0 (the "License") plus the diff --git a/pom.xml b/pom.xml index e5cdbc9f..bce1d823 100644 --- a/pom.xml +++ b/pom.xml @@ -5,6 +5,7 @@ <properties> <com.wisemapping.version>3.1-SNAPSHOT</com.wisemapping.version> + <superpom.dir>${project.basedir}/wise-webapps</superpom.dir> </properties> <modelVersion>4.0.0</modelVersion> @@ -101,12 +102,11 @@ </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> - <inherited>true</inherited> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> - <source>1.6</source> - <target>1.6</target> + <source>1.7</source> + <target>1.7</target> <encoding>UTF-8</encoding> </configuration> </plugin> diff --git a/setup.sh b/setup.sh new file mode 100644 index 00000000..fbd65887 --- /dev/null +++ b/setup.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +export MAVEN_OPTS="-XX:MaxPermSize=128M" diff --git a/wise-editor/doc/Integration.md b/wise-editor/doc/Integration.md new file mode 100644 index 00000000..dcca093b --- /dev/null +++ b/wise-editor/doc/Integration.md @@ -0,0 +1,71 @@ +JS Editor Integration +--------------------- + +## 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); + } }); \ No newline at end of file diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index 183272ce..a788a2a6 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -324,54 +324,109 @@ <version>0.6.6</version> </dependency> </dependencies> + <profiles> + <profile> + <id>hsqldb</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>sql-maven-plugin</artifactId> + <version>1.5</version> + + <configuration> + <driver>org.hsqldb.jdbc.JDBCDriver</driver> + <url>jdbc:hsqldb:file:${project.build.directory}/db/wisemapping</url> + <username>sa</username> + </configuration> + + <dependencies> + <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + <version>5.1.5</version> + </dependency> + <dependency> + <groupId>org.hsqldb</groupId> + <artifactId>hsqldb</artifactId> + <version>2.2.8</version> + </dependency> + </dependencies> + + <executions> + <execution> + <id>drop-schemas</id> + <phase>prepare-package</phase> + <goals> + <goal>execute</goal> + </goals> + <configuration> + <onError>continue</onError> + <orderFile>descending</orderFile> + <fileset> + <basedir>${project.basedir}</basedir> + <includes> + <include>config/database/hsql/drop-schemas.sql</include> + <include>config/database/hsql/create-schemas.sql</include> + <include>config/database/hsql/apopulate-schemas.sql</include> + </includes> + </fileset> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>mysqldb</id> + <activation> + <activeByDefault>false</activeByDefault> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>sql-maven-plugin</artifactId> + <version>1.5</version> + <dependencies> + <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + <version>5.1.5</version> + </dependency> + </dependencies> + <executions> + <execution> + <id>init-schema</id> + <goals> + <goal>execute</goal> + </goals> + <phase>prepare-package</phase> + </execution> + </executions> + <configuration> + <driver>com.mysql.jdbc.Driver</driver> + <username>root</username> + <password></password> + <url>jdbc:mysql://127.0.0.1:3306/?useUnicode=true&characterEncoding=UTF-8</url> + <autocommit>false</autocommit> + <srcFiles> + <srcFile>config/database/mysql/create-database.sql</srcFile> + <srcFile>config/database/mysql/create-schemas.sql</srcFile> + <srcFile>config/database/mysql/test-data.sql</srcFile> + </srcFiles> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> <build> <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>sql-maven-plugin</artifactId> - <version>1.5</version> - - <configuration> - <driver>org.hsqldb.jdbc.JDBCDriver</driver> - <url>jdbc:hsqldb:file:${project.build.directory}/db/wisemapping</url> - <username>sa</username> - </configuration> - - <dependencies> - <dependency> - <groupId>mysql</groupId> - <artifactId>mysql-connector-java</artifactId> - <version>5.1.5</version> - </dependency> - <dependency> - <groupId>org.hsqldb</groupId> - <artifactId>hsqldb</artifactId> - <version>2.2.8</version> - </dependency> - </dependencies> - - <executions> - <execution> - <id>drop-schemas</id> - <phase>prepare-package</phase> - <goals> - <goal>execute</goal> - </goals> - <configuration> - <onError>continue</onError> - <orderFile>descending</orderFile> - <fileset> - <basedir>${project.basedir}</basedir> - <includes> - <include>config/database/hsql/drop-schemas.sql</include> - <include>config/database/hsql/create-schemas.sql</include> - <include>config/database/hsql/apopulate-schemas.sql</include> - </includes> - </fileset> - </configuration> - </execution> - </executions> - </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>native2ascii-maven-plugin</artifactId> @@ -452,15 +507,42 @@ </webResources> </configuration> </plugin> - <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> </plugin> - + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>0.6.4.201312101107</version> + <executions> + <!-- + Prepares the property pointing to the JaCoCo runtime agent which + is passed as VM argument when Maven the Surefire plugin is executed. + --> + <execution> + <id>pre-unit-test</id> + <goals> + <goal>prepare-agent</goal> + </goals> + </execution> + <!-- + Ensures that the code coverage report for unit tests is created after + unit tests have been run. + --> + <execution> + <id>post-unit-test</id> + <phase>test</phase> + <goals> + <goal>report</goal> + </goals> + </execution> + </executions> + </plugin> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> + <version>2.0</version> <configuration> <path>/wisemapping</path> <warFile>${project.build.directory}/wisemapping.war</warFile> @@ -473,9 +555,9 @@ </plugin> <plugin> - <groupId>org.mortbay.jetty</groupId> + <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> - <version>8.1.14.v20131031</version> + <version>9.1.0.v20131115</version> <configuration> <stopKey>foo</stopKey> <stopPort>9999</stopPort> @@ -498,7 +580,6 @@ <value>${project.build.directory}</value> </systemProperty> </systemProperties> - <!--<scanIntervalSeconds>10</scanIntervalSeconds>--> </configuration> <executions> <execution>