Merge remote-tracking branch 'origin/feature-WISE-78-pom-improvements' into feature/WISE-16-remove_user

This commit is contained in:
Claudio Barril 2014-01-19 18:25:03 -03:00
commit 2e7aa144b2
9 changed files with 192 additions and 129 deletions

View File

@ -37,6 +37,76 @@ This will start the application on the URL: [http://localhost:8080/wise-webapp/]
User: test@wisemapping.org User: test@wisemapping.org
Password: test 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 ## Authors
* Pablo Luna * Pablo Luna

View File

@ -1,9 +1,9 @@
DROP TABLE ACCESS_AUDITORY; DROP TABLE IF EXISTS ACCESS_AUDITORY;
DROP TABLE TAG; DROP TABLE IF EXISTS TAG;
DROP TABLE COLLABORATION; DROP TABLE IF EXISTS COLLABORATION;
DROP TABLE COLLABORATION_PROPERTIES; DROP TABLE IF EXISTS COLLABORATION_PROPERTIES;
DROP TABLE MINDMAP_HISTORY; DROP TABLE IF EXISTS MINDMAP_HISTORY;
DROP TABLE MINDMAP; DROP TABLE IF EXISTS MINDMAP;
DROP TABLE USER; DROP TABLE IF EXISTS USER;
DROP TABLE COLLABORATOR; DROP TABLE IF EXISTS COLLABORATOR;
COMMIT; COMMIT;

View File

@ -1,6 +1,7 @@
CREATE DATABASE wisemapping DROP DATABASE IF EXISTS wisemapping;
CREATE DATABASE IF NOT EXISTS wisemapping
CHARACTER SET = 'utf8' CHARACTER SET = 'utf8'
COLLATE = 'utf8_unicode_ci'; COLLATE = 'utf8_unicode_ci';
CREATE USER 'wisemapping'@'localhost'
IDENTIFIED BY 'password';
GRANT ALL ON wisemapping.* TO 'wisemapping'@'localhost'; GRANT ALL ON wisemapping.* TO 'wisemapping'@'localhost';
SET PASSWORD FOR 'wisemapping'@'localhost' = PASSWORD('password');

View File

@ -1,3 +1,5 @@
USE wisemapping;
CREATE TABLE COLLABORATOR ( CREATE TABLE COLLABORATOR (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
email VARCHAR(255) email VARCHAR(255)

View File

@ -1,9 +1,9 @@
DROP TABLE TAG; DROP TABLE IF EXISTS TAG;
DROP TABLE ACCESS_AUDITORY; DROP TABLE IF EXISTS ACCESS_AUDITORY;
DROP TABLE COLLABORATION; DROP TABLE IF EXISTS COLLABORATION;
DROP TABLE COLLABORATION_PROPERTIES; DROP TABLE IF EXISTS COLLABORATION_PROPERTIES;
DROP TABLE MINDMAP_HISTORY; DROP TABLE IF EXISTS MINDMAP_HISTORY;
DROP TABLE MINDMAP; DROP TABLE IF EXISTS MINDMAP;
DROP TABLE USER; DROP TABLE IF EXISTS USER;
DROP TABLE COLLABORATOR; DROP TABLE IF EXISTS COLLABORATOR;
COMMIT; COMMIT;

View File

@ -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'); 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 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') 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); VALUES (2, 'Admin', 'User', 'admin', 1237, CURRENT_DATE(), 1, 'D');
COMMIT; COMMIT;

View File

@ -14,10 +14,6 @@
<source>mindplot/target/classes/mindplot-min.js</source> <source>mindplot/target/classes/mindplot-min.js</source>
<outputDirectory>/js</outputDirectory> <outputDirectory>/js</outputDirectory>
</file> </file>
<file>
<source>mindplot/target/classes/mindplot.js</source>
<outputDirectory>/js</outputDirectory>
</file>
</files> </files>
<fileSets> <fileSets>
<fileSet> <fileSet>

View File

@ -27,62 +27,5 @@
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<webApp>${project.build.directory}/wise-editor-${com.wisemapping.version}.war</webApp>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<warSourceExcludes>js/mindplot-min.js</warSourceExcludes>
<overlays>
<overlay>
<groupId>org.wisemapping</groupId>
<artifactId>core-js</artifactId>
<type>jar</type>
<targetPath>js</targetPath>
<includes>
<include>*.js</include>
</includes>
</overlay>
<overlay>
<groupId>org.wisemapping</groupId>
<artifactId>mindplot</artifactId>
<type>jar</type>
<targetPath>css</targetPath>
<includes>
<include>**/*.css</include>
<include>**/*.html</include>
</includes>
</overlay>
<overlay>
<groupId>org.wisemapping</groupId>
<artifactId>mindplot</artifactId>
<type>jar</type>
<targetPath>js</targetPath>
<includes>
<include>*.js</include>
</includes>
</overlay>
</overlays>
</configuration>
</plugin>
</plugins>
</build>
</project> </project>

View File

@ -320,6 +320,12 @@
<version>1.7.1</version> <version>1.7.1</version>
</dependency> </dependency>
</dependencies> </dependencies>
<profiles>
<profile>
<id>hsqldb</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
@ -334,11 +340,6 @@
</configuration> </configuration>
<dependencies> <dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.5</version>
</dependency>
<dependency> <dependency>
<groupId>org.hsqldb</groupId> <groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId> <artifactId>hsqldb</artifactId>
@ -346,6 +347,7 @@
</dependency> </dependency>
</dependencies> </dependencies>
<executions> <executions>
<execution> <execution>
<id>drop-schemas</id> <id>drop-schemas</id>
@ -368,6 +370,55 @@
</execution> </execution>
</executions> </executions>
</plugin> </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&amp;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> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>native2ascii-maven-plugin</artifactId> <artifactId>native2ascii-maven-plugin</artifactId>