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;