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 :
-
-`mvn package`
-
-Once this command is execute, the file /wise-webapp/target/wisemapping*.war will be generated.
-
-## Testing
-The previously generated war can be deployed locally executing within the directory /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 2638a159..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 /wise-webapp/target/wisemapping*.war will be generated.
-## Testing
+### Testing
The previously generated war can be deployed locally executing within the directory /wise-webapp the following command:
`cd wise-webapp;mvn jetty:run-war`
@@ -49,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
+ * Paulo Veiga
- $("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/hsql/atest-data.sql b/config/database/hsql/apopulate-schemas.sql
similarity index 100%
rename from config/database/hsql/atest-data.sql
rename to config/database/hsql/apopulate-schemas.sql
diff --git a/config/database/mysql/test-data.sql b/config/database/mysql/apopulate-schemas.sql
similarity index 89%
rename from config/database/mysql/test-data.sql
rename to config/database/mysql/apopulate-schemas.sql
index 960fe536..cd449f1a 100644
--- a/config/database/mysql/test-data.sql
+++ b/config/database/mysql/apopulate-schemas.sql
@@ -4,7 +4,7 @@ INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code
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)
- VALUES (2, 'Admin', 'User', 'admin', 1237, CURRENT_DATE(), 1, 'D');
+ VALUES (2, 'Admin', 'User', 'admin', 1237, CURRENT_DATE(), 1,'D');
COMMIT;
diff --git a/distribution/copy-dist.sh b/distribution/copy-dist.sh
deleted file mode 100755
index 6500a9f8..00000000
--- a/distribution/copy-dist.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-set -e
-set -u
-
-WISE_VERSION=$1
-SERVER_DOWNLOAD_DIR=/var/www/wisemapping.org/stable
-
-WISE_BIN_FILE_NAME=wisemapping-${WISE_VERSION}.zip
-WISE_BIN_FILE_PATH=./target/${WISE_BIN_FILE_NAME}
-
-#WISE_SRC_FILE_NAME=wisemapping-${WISE_VERSION}-src.tar.gz
-#WISE_SRC_FILE_PATH=./target/${WISE_SRC_FILE_NAME}
-
-#scp ${WISE_SRC_FILE_PATH} thecrow@wisemapping.com:${SERVER_DOWNLOAD_DIR}/
-scp ${WISE_BIN_FILE_PATH} thecrow@wisemapping.com:${SERVER_DOWNLOAD_DIR}
-
-# It's there ?
-cd target
-wget -S http://downloads.wisemapping.org/stable/${WISE_BIN_FILE_NAME}
-#wget -S http://downloads.wisemapping.org/stable/${WISE_SRC_FILE_NAME}
diff --git a/java.iml b/java.iml
deleted file mode 100644
index 8015fa76..00000000
--- a/java.iml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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 @@
3.1-SNAPSHOT
+ ${project.basedir}/wise-webapps4.0.0
@@ -101,12 +102,11 @@
org.apache.maven.plugins
- truemaven-compiler-plugin3.1
-
- 1.6
+
+ 1.7UTF-8
diff --git a/projectFilesBackup/wise-editor/wise-editor.iml b/projectFilesBackup/wise-editor/wise-editor.iml
deleted file mode 100644
index ab0f2e90..00000000
--- a/projectFilesBackup/wise-editor/wise-editor.iml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/projectFilesBackup/wise-webapp/wise-webapp.iml b/projectFilesBackup/wise-webapp/wise-webapp.iml
deleted file mode 100644
index 48639056..00000000
--- a/projectFilesBackup/wise-webapp/wise-webapp.iml
+++ /dev/null
@@ -1,1444 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/security/spring-security-core/3.1.0.RELEASE/spring-security-core-3.1.0.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/aopalliance/aopalliance/1.0/aopalliance-1.0.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/spring-expression/3.0.6.RELEASE/spring-expression-3.0.6.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/spring-core/3.0.6.RELEASE/spring-core-3.0.6.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/spring-asm/3.1.0.RELEASE/spring-asm-3.1.0.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/spring-aop/3.1.0.RELEASE/spring-aop-3.1.0.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/spring-beans/3.1.0.RELEASE/spring-beans-3.1.0.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/3.1.0.RELEASE/spring-context-3.1.0.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/security/spring-security-crypto/3.1.0.RELEASE/spring-security-crypto-3.1.0.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/spring-jdbc/3.1.0.RELEASE/spring-jdbc-3.1.0.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/spring-tx/3.1.0.RELEASE/spring-tx-3.1.0.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/codehaus/jackson/jackson-core-asl/1.9.4/jackson-core-asl-1.9.4.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/antlr/antlr/2.7.6/antlr-2.7.6.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.6.4/slf4j-api-1.6.4.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/javax/mail/mail/1.4/mail-1.4.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/javax/activation/activation/1.1/activation-1.1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/javax/xml/bind/jsr173_api/1.0/jsr173_api-1.0.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/spring-oxm/3.1.0.RELEASE/spring-oxm-3.1.0.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.5/commons-lang-2.5.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/spring-orm/3.1.0.RELEASE/spring-orm-3.1.0.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/security/spring-security-web/3.1.0.RELEASE/spring-security-web-3.1.0.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/spring-web/3.1.0.RELEASE/spring-web-3.1.0.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/hibernate/hibernate-core/3.6.0.Final/hibernate-core-3.6.0.Final.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/commons-collections/commons-collections/3.1/commons-collections-3.1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/hibernate/hibernate-commons-annotations/3.2.0.Final/hibernate-commons-annotations-3.2.0.Final.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/1.0.0.Final/hibernate-jpa-2.0-api-1.0.0.Final.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/testng/testng/5.8/testng-5.8-jdk15.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/junit/junit/3.8.1/junit-3.8.1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/javax/xml/bind/jaxb-api/2.0/jaxb-api-2.0.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/spring-struts/3.1.0.RELEASE/spring-struts-3.1.0.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/struts/struts/1.2.9/struts-1.2.9.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/commons-digester/commons-digester/1.6/commons-digester-1.6.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/commons-validator/commons-validator/1.1.4/commons-validator-1.1.4.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/oro/oro/2.0.8/oro-2.0.8.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/xalan/xalan/2.5.1/xalan-2.5.1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/spring-webmvc/3.1.0.RELEASE/spring-webmvc-3.1.0.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/spring-context-support/3.1.0.RELEASE/spring-context-support-3.1.0.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/commons-chain/commons-chain/1.1/commons-chain-1.1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/commons-dbcp/commons-dbcp/1.2.2/commons-dbcp-1.2.2.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/commons-pool/commons-pool/1.3/commons-pool-1.3.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/fop/0.94/fop-0.94.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/xmlgraphics-commons/1.2/xmlgraphics-commons-1.2.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/commons-io/commons-io/1.1/commons-io-1.1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/batik/batik-svg-dom/1.6-1/batik-svg-dom-1.6-1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/batik/batik-dom/1.6-1/batik-dom-1.6-1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/batik/batik-css/1.6-1/batik-css-1.6-1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/batik/batik-util/1.6-1/batik-util-1.6-1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/batik/batik-gui-util/1.6-1/batik-gui-util-1.6-1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/batik/batik-ext/1.6-1/batik-ext-1.6-1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/xml-apis/xmlParserAPIs/2.0.2/xmlParserAPIs-2.0.2.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/batik/batik-xml/1.6-1/batik-xml-1.6-1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/xerces/xercesImpl/2.10.0/xercesImpl-2.10.0.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/batik/batik-parser/1.6-1/batik-parser-1.6-1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/batik/batik-awt-util/1.6-1/batik-awt-util-1.6-1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/batik/batik-bridge/1.6-1/batik-bridge-1.6-1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/batik/batik-gvt/1.6-1/batik-gvt-1.6-1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/batik/batik-script/1.6-1/batik-script-1.6-1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/batik/batik-transcoder/1.6-1/batik-transcoder-1.6-1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/batik/batik-extension/1.6-1/batik-extension-1.6-1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/avalon/framework/avalon-framework-api/4.3.1/avalon-framework-api-4.3.1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/avalon/framework/avalon-framework-impl/4.3.1/avalon-framework-impl-4.3.1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/hsqldb/hsqldb/2.2.8/hsqldb-2.2.8.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/batik-transcoder/1.7/batik-transcoder-1.7.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/batik-awt-util/1.7/batik-awt-util-1.7.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/batik-util/1.7/batik-util-1.7.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/batik-bridge/1.7/batik-bridge-1.7.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/batik-anim/1.7/batik-anim-1.7.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/batik-dom/1.7/batik-dom-1.7.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/batik-css/1.7/batik-css-1.7.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/batik-ext/1.7/batik-ext-1.7.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/xml-apis/xml-apis-ext/1.3.04/xml-apis-ext-1.3.04.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/batik-xml/1.7/batik-xml-1.7.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/batik-parser/1.7/batik-parser-1.7.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/batik-svg-dom/1.7/batik-svg-dom-1.7.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/batik-gvt/1.7/batik-gvt-1.7.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/batik-script/1.7/batik-script-1.7.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/batik-svggen/1.7/batik-svggen-1.7.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/apache/velocity/velocity/1.5/velocity-1.5.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/net/tanesha/recaptcha4j/recaptcha4j/0.0.7/recaptcha4j-0.0.7.jar!/
-
-
-
-
-
-
-
-
-
-
-
-
- jar://$MAVEN_REPOSITORY$/javax/servlet/jstl/1.2/jstl-1.2.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/codehaus/jackson/jackson-mapper-asl/1.9.4/jackson-mapper-asl-1.9.4.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/mysql/mysql-connector-java/5.1.5/mysql-connector-java-5.1.5.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/springframework/security/spring-security-config/3.1.0.RELEASE/spring-security-config-3.1.0.RELEASE.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/com/intellij/annotations/7.0.3/annotations-7.0.3.jar!/
-
-
-
-
-
-
-
-
- jar://$MAVEN_REPOSITORY$/log4j/log4j/1.2.9/log4j-1.2.9.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/org/hibernate/hibernate-entitymanager/3.6.0.Final/hibernate-entitymanager-3.6.0.Final.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/cglib/cglib/2.2/cglib-2.2.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/asm/asm/3.1/asm-3.1.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/javassist/javassist/3.12.0.GA/javassist-3.12.0.GA.jar!/
-
-
-
-
- jar://$MAVEN_REPOSITORY$/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar!/
-
-
-
-
-
-
-
-
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/doc/REST Services.md b/wise-webapp/doc/REST Services.md
index 6831ba74..81ce44e1 100644
--- a/wise-webapp/doc/REST Services.md
+++ b/wise-webapp/doc/REST Services.md
@@ -5,14 +5,22 @@ Introduction
-------------
All WiseMapping services are exposed as REST services. Those services are the same used by the WiseMapping when you are using it.
-In the following section, all supported services are listed. The following variables should be replaced:
+In the following section, all supported services are listed.
+
+REST Console
+-------------
+
+You can learn how what are WiseMapping REST API's from using our interactive console. You can access it from here: http://localhost:8080/doc/rest/index.html.
+Important: Don't forget to configure your server host url in /WEB-INF/app.properties. By default it's configure to http://localhost:8080/wisemapping/
+
+CURL Usage Examples
+-------------
+
+The following variables should be replaced:
- host.name: Host name where WiseMapping is deployed. Default Value: localhost
- host.post: Post number where WiseMapping is deployed. Default Value: 8080
-- context.path: Context Path name where the application is deployed. Default Value: wisemapping
-
-Supported Operations
-----------------------
+- context.path: Context Path name where the application is deployed. Default Value: wisemapping
Obtaining user information by email:
* Template Path: /service/admin/users/email/{user.email}.json
@@ -30,3 +38,5 @@ Creating a new user:
* Template Path: /service/admin/users/
* Method: Post
* curl "http://{host.name}:{host.port}/{context.path}/service/admin/users" --request post --basic -u "admin@wisemapping.org:admin" -H "Content-Type:application/json" --data '{"email": "te2@mydomain.de", "lastname": "lastname", "firstname":"myfirstname","password":"password"}'
+
+
diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml
index e5a34b4c..e482c77f 100644
--- a/wise-webapp/pom.xml
+++ b/wise-webapp/pom.xml
@@ -288,7 +288,6 @@
jackson-core-asl1.9.4
-
org.codehaus.jacksonjackson-mapper-asl
@@ -319,6 +318,11 @@
jsoup1.7.1
+
+ com.mangofactory
+ swagger-springmvc
+ 0.6.6
+
@@ -340,6 +344,11 @@
+
+ mysql
+ mysql-connector-java
+ 5.1.5
+ org.hsqldbhsqldb
@@ -347,7 +356,6 @@
-
drop-schemas
@@ -363,7 +371,7 @@
config/database/hsql/drop-schemas.sqlconfig/database/hsql/create-schemas.sql
- config/database/hsql/atest-data.sql
+ config/database/hsql/apopulate-schemas.sql
@@ -506,9 +514,24 @@
- org.mortbay.jetty
+ org.apache.tomcat.maven
+ tomcat7-maven-plugin
+ 2.0
+
+ /wisemapping
+ ${project.build.directory}/wisemapping.war
+ war
+ true
+
+ ${project.build.directory}
+
+
+
+
+
+ org.eclipse.jettyjetty-maven-plugin
- 8.1.14.v20131031
+ 9.1.0.v20131115foo9999
@@ -531,7 +554,6 @@
${project.build.directory}
-
@@ -554,22 +576,6 @@
-
-
- org.apache.tomcat.maven
- tomcat7-maven-plugin
- 2.0
-
- /wisemapping
- ${project.build.directory}/wisemapping.war
- war
- true
-
- ${project.build.directory}
-
-
-
-
org.apache.maven.pluginsmaven-dependency-plugin
diff --git a/wise-webapp/src/main/java/com/wisemapping/model/User.java b/wise-webapp/src/main/java/com/wisemapping/model/User.java
index 4e34dd71..81f54cf1 100644
--- a/wise-webapp/src/main/java/com/wisemapping/model/User.java
+++ b/wise-webapp/src/main/java/com/wisemapping/model/User.java
@@ -120,7 +120,8 @@ public class User
}
public char getAutheticationTypeCode() {
- return this.authenticationType != null ? this.authenticationType.getCode() : null;
+ // Default authentication is database ....
+ return this.authenticationType != null ? this.authenticationType.getCode() : AuthenticationType.DATABASE.getCode();
}
public void setAutheticationTypeCode(char code) {
diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java
index 8a5bd969..79f56613 100644
--- a/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java
+++ b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java
@@ -18,6 +18,7 @@
package com.wisemapping.rest;
+import com.mangofactory.swagger.annotations.ApiIgnore;
import com.wisemapping.mail.NotificationService;
import com.wisemapping.model.Mindmap;
import com.wisemapping.model.User;
@@ -25,16 +26,21 @@ import com.wisemapping.rest.model.RestLogItem;
import com.wisemapping.security.Utils;
import com.wisemapping.service.MindmapService;
import com.wisemapping.service.UserService;
+import com.wordnik.swagger.annotations.Api;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseStatus;
import javax.servlet.http.HttpServletRequest;
+@Api(value="UserApi",description = "Account Account Related Objects.")
@Controller
public class AccountController extends BaseController {
@Qualifier("userService")
@@ -100,6 +106,7 @@ public class AccountController extends BaseController {
userService.updateUser(user);
}
+ @ApiIgnore
@RequestMapping(method = RequestMethod.POST, value = "logger/editor", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void logError(@RequestBody RestLogItem item, @NotNull HttpServletRequest request) {
diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java
index f9e3a696..25451064 100644
--- a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java
+++ b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java
@@ -18,18 +18,30 @@
package com.wisemapping.rest;
+import com.mangofactory.swagger.annotations.ApiModel;
import com.wisemapping.exceptions.WiseMappingException;
-import com.wisemapping.model.*;
+import com.wisemapping.model.AuthenticationType;
+import com.wisemapping.model.Collaboration;
+import com.wisemapping.model.Mindmap;
+import com.wisemapping.model.User;
import com.wisemapping.rest.model.RestUser;
import com.wisemapping.service.MindmapService;
import com.wisemapping.service.UserService;
+import com.wordnik.swagger.annotations.Api;
+import com.wordnik.swagger.annotations.ApiOperation;
+import com.wordnik.swagger.annotations.ApiParam;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.ResponseStatus;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@@ -38,40 +50,42 @@ import java.util.Calendar;
import java.util.List;
import java.util.regex.Pattern;
+@Api(value = "AdminApi", description = "Administrative Related Objects.")
@Controller
public class AdminController extends BaseController {
@Qualifier("userService")
@Autowired
private UserService userService;
-
@Qualifier("mindmapService")
@Autowired
private MindmapService mindmapService;
-
- @RequestMapping(method = RequestMethod.GET, value = "admin/users/{id}", produces = {"application/json", "text/html", "application/xml"})
+ @ApiOperation("Note: Administration permissions required.")
+ @RequestMapping(method = RequestMethod.GET, value = "admin/users/{id}", produces = {"application/json", "application/xml"})
@ResponseBody
- public ModelAndView getUserById(@PathVariable long id) throws IOException {
+ public RestUser getUserById(@PathVariable @ApiParam(required = true, value = "User Id", allowableValues = "range[1," + Long.MAX_VALUE + "]") long id) throws IOException {
final User userBy = userService.getUserBy(id);
if (userBy == null) {
throw new IllegalArgumentException("User could not be found");
}
- return new ModelAndView("userView", "user", new RestUser(userBy));
+ return new RestUser(userBy);
}
- @RequestMapping(method = RequestMethod.GET, value = "admin/users/email/{email}", produces = {"application/json", "text/html", "application/xml"})
+ @ApiOperation("Note: Administration permissions required.")
+ @RequestMapping(method = RequestMethod.GET, value = "admin/users/email/{email}", produces = {"application/json", "application/xml"})
@ResponseBody
- public ModelAndView getUserByEmail(@PathVariable String email) throws IOException {
+ public RestUser getUserByEmail(@PathVariable String email) throws IOException {
final User user = userService.getUserBy(email);
if (user == null) {
throw new IllegalArgumentException("User '" + email + "' could not be found");
}
- return new ModelAndView("userView", "user", new RestUser(user));
+ return new RestUser(user);
}
- @RequestMapping(method = RequestMethod.POST, value = "admin/users", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"})
+ @ApiOperation("Note: Administration permissions required.")
+ @RequestMapping(method = RequestMethod.POST, value = "admin/users", consumes = {"application/xml", "application/json"}, produces = {"application/json", "application/xml"})
@ResponseStatus(value = HttpStatus.CREATED)
- public void createUser(@RequestBody RestUser user, HttpServletResponse response) throws WiseMappingException {
+ public void createUser(@RequestBody @ApiParam(required = true) RestUser user, HttpServletResponse response) throws WiseMappingException {
if (user == null) {
throw new IllegalArgumentException("User could not be found");
}
@@ -100,9 +114,10 @@ public class AdminController extends BaseController {
response.setHeader("Location", "/service/admin/users/" + user.getId());
}
+ @ApiOperation("Note: Administration permissions required.")
@RequestMapping(method = RequestMethod.PUT, value = "admin/users/{id}/password", consumes = {"text/plain"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
- public void changePassword(@RequestBody String password, @PathVariable long id) throws WiseMappingException {
+ public void changePassword(@RequestBody @ApiParam(required = true) String password, @PathVariable @ApiParam(required = true, value = "User Id", allowableValues = "range[1," + Long.MAX_VALUE + "]") long id) throws WiseMappingException {
if (password == null) {
throw new IllegalArgumentException("Password can not be null");
}
@@ -115,9 +130,10 @@ public class AdminController extends BaseController {
userService.changePassword(user);
}
+ @ApiOperation("Note: Administration permissions required.")
@RequestMapping(method = RequestMethod.DELETE, value = "admin/users/{id}")
@ResponseStatus(value = HttpStatus.NO_CONTENT)
- public void getUserByEmail(@PathVariable long id) throws WiseMappingException {
+ public void getUserByEmail(@PathVariable @ApiParam(required = true, allowableValues = "range[1," + Long.MAX_VALUE + "]") long id) throws WiseMappingException {
final User user = userService.getUserBy(id);
if (user == null) {
throw new IllegalArgumentException("User '" + id + "' could not be found");
@@ -125,6 +141,7 @@ public class AdminController extends BaseController {
userService.deleteUser(user);
}
+ @ApiOperation("Note: Administration permissions required.")
@ResponseStatus(value = HttpStatus.NO_CONTENT)
@RequestMapping(method = RequestMethod.GET, value = "admin/database/purge")
public void purgeDB(@RequestParam(required = true) Integer minUid, @RequestParam(required = true) Integer maxUid, @RequestParam(required = true) Boolean apply) throws WiseMappingException, UnsupportedEncodingException {
@@ -132,7 +149,6 @@ public class AdminController extends BaseController {
for (int i = minUid; i < maxUid; i++) {
try {
-
System.out.println("Looking for user:" + i);
final User user = userService.getUserBy(i);
if (user != null) {
@@ -179,6 +195,7 @@ public class AdminController extends BaseController {
}
}
+ @ApiOperation("Note: Administration permissions required.")
@ResponseStatus(value = HttpStatus.NO_CONTENT)
@RequestMapping(method = RequestMethod.GET, value = "admin/database/purge/history")
public void purgeHistory(@RequestParam(required = true) Integer mapId) throws WiseMappingException, IOException {
@@ -186,7 +203,6 @@ public class AdminController extends BaseController {
mindmapService.purgeHistory(mapId);
}
-
private boolean isWelcomeMap(@NotNull Mindmap mindmap) throws UnsupportedEncodingException {
// Is welcome map ?
final String xmlStr = mindmap.getXmlStr();
diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java
index 009a732e..b97f65e1 100644
--- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java
+++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java
@@ -18,20 +18,37 @@
package com.wisemapping.rest;
-
-import com.wisemapping.exceptions.*;
+import com.mangofactory.swagger.annotations.ApiIgnore;
+import com.wisemapping.exceptions.ImportUnexpectedException;
+import com.wisemapping.exceptions.MapCouldNotFoundException;
+import com.wisemapping.exceptions.MultipleSessionsOpenException;
+import com.wisemapping.exceptions.SessionExpiredException;
+import com.wisemapping.exceptions.WiseMappingException;
import com.wisemapping.importer.ImportFormat;
import com.wisemapping.importer.Importer;
import com.wisemapping.importer.ImporterException;
import com.wisemapping.importer.ImporterFactory;
-import com.wisemapping.model.*;
-import com.wisemapping.rest.model.*;
+import com.wisemapping.model.Collaboration;
+import com.wisemapping.model.CollaborationProperties;
+import com.wisemapping.model.CollaborationRole;
+import com.wisemapping.model.MindMapHistory;
+import com.wisemapping.model.Mindmap;
+import com.wisemapping.model.User;
+import com.wisemapping.rest.model.RestCollaboration;
+import com.wisemapping.rest.model.RestCollaborationList;
+import com.wisemapping.rest.model.RestMindmap;
+import com.wisemapping.rest.model.RestMindmapHistory;
+import com.wisemapping.rest.model.RestMindmapHistoryList;
+import com.wisemapping.rest.model.RestMindmapInfo;
+import com.wisemapping.rest.model.RestMindmapList;
import com.wisemapping.security.Utils;
import com.wisemapping.service.CollaborationException;
import com.wisemapping.service.LockInfo;
import com.wisemapping.service.LockManager;
import com.wisemapping.service.MindmapService;
import com.wisemapping.validator.MapInfoValidator;
+import com.wordnik.swagger.annotations.Api;
+import com.wordnik.swagger.annotations.ApiParam;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
@@ -39,15 +56,28 @@ import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BeanPropertyBindingResult;
import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.IOException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+@Api(value = "mindmap", description = "User Mindmap Objects.")
@Controller
public class MindmapController extends BaseController {
@@ -58,12 +88,10 @@ public class MindmapController extends BaseController {
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/json", "application/xml", "text/html"})
@ResponseBody
- public ModelAndView retrieve(@PathVariable int id) throws WiseMappingException {
+ public RestMindmap retrieve(@PathVariable int id) throws WiseMappingException {
final User user = Utils.getUser();
final Mindmap mindMap = findMindmapById(id);
- final RestMindmap map = new RestMindmap(mindMap, user);
-
- return new ModelAndView("mapView", "map", map);
+ return new RestMindmap(mindMap, user);
}
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/wisemapping+xml"}, params = {"download=wxml"})
@@ -88,7 +116,6 @@ public class MindmapController extends BaseController {
return new ModelAndView("transformViewFreemind", values);
}
-
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"text/plain"}, params = {"download=txt"})
@ResponseBody
public ModelAndView retrieveDocumentAsText(@PathVariable int id) throws IOException, MapCouldNotFoundException {
@@ -109,7 +136,6 @@ public class MindmapController extends BaseController {
return new ModelAndView("transformViewMMap", values);
}
-
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/vnd.ms-excel"}, params = {"download=xls"})
@ResponseBody
public ModelAndView retrieveDocumentAsExcel(@PathVariable int id) throws IOException, MapCouldNotFoundException {
@@ -130,9 +156,8 @@ public class MindmapController extends BaseController {
return new ModelAndView("transformViewOdt", values);
}
-
- @RequestMapping(method = RequestMethod.GET, value = "/maps/", produces = {"application/json", "text/html", "application/xml"})
- public ModelAndView retrieveList(@RequestParam(required = false) String q) throws IOException {
+ @RequestMapping(method = RequestMethod.GET, value = "/maps/", produces = {"application/json", "application/xml"})
+ public RestMindmapList retrieveList(@RequestParam(required = false) String q) throws IOException {
final User user = Utils.getUser();
final MindmapFilter filter = MindmapFilter.parse(q);
@@ -145,22 +170,19 @@ public class MindmapController extends BaseController {
mindmaps.add(mindmap);
}
}
- final RestMindmapList restMindmapList = new RestMindmapList(mindmaps, user);
- return new ModelAndView("mapsView", "list", restMindmapList);
+ return new RestMindmapList(mindmaps, user);
}
-
- @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/history", produces = {"application/json", "text/html", "application/xml"})
- public ModelAndView retrieveHistory(@PathVariable int id) throws IOException {
+ @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/history", produces = {"application/json", "application/xml"})
+ public RestMindmapHistoryList retrieveHistory(@PathVariable int id) throws IOException {
final List histories = mindmapService.findMindmapHistory(id);
final RestMindmapHistoryList result = new RestMindmapHistoryList();
for (MindMapHistory history : histories) {
result.addHistory(new RestMindmapHistory(history));
}
- return new ModelAndView("historyView", "list", result);
+ return result;
}
-
@RequestMapping(value = "maps/{id}/history/{hid}", method = RequestMethod.POST)
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateRevertMindmap(@PathVariable int id, @PathVariable String hid) throws WiseMappingException, IOException {
@@ -180,9 +202,9 @@ public class MindmapController extends BaseController {
}
}
- @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/document", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"})
+ @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/document", consumes = {"application/xml", "application/json"}, produces = {"application/json", "application/xml"})
@ResponseBody
- public long updateDocument(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor, @RequestParam(required = false) Long timestamp, @RequestParam(required = false) Long session) throws WiseMappingException, IOException {
+ public Long updateDocument(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor, @RequestParam(required = false) Long timestamp, @RequestParam(required = false) Long session) throws WiseMappingException, IOException {
final Mindmap mindmap = findMindmapById(id);
final User user = Utils.getUser();
@@ -194,7 +216,9 @@ public class MindmapController extends BaseController {
}
// Could the map be updated ?
- verifyLock(mindmap, user, session, timestamp);
+ if (session != null) {
+ verifyLock(mindmap, user, session, timestamp);
+ }
// Update collaboration properties ...
final CollaborationProperties collaborationProperties = mindmap.findCollaborationProperties(user);
@@ -212,10 +236,15 @@ public class MindmapController extends BaseController {
// Update edition timeout ...
final LockManager lockManager = mindmapService.getLockManager();
- final LockInfo lockInfo = lockManager.updateExpirationTimeout(mindmap, user);
- return lockInfo.getTimestamp();
+ long result = -1;
+ if (session != null) {
+ final LockInfo lockInfo = lockManager.updateExpirationTimeout(mindmap, user);
+ result = lockInfo.getTimestamp();
+ }
+ return result;
}
+ @ApiIgnore
@RequestMapping(method = RequestMethod.GET, value = {"/maps/{id}/document/xml", "/maps/{id}/document/xml-pub"}, consumes = {"text/plain"}, produces = {"application/xml"})
@ResponseBody
public byte[] retrieveDocument(@PathVariable int id, @NotNull HttpServletResponse response) throws WiseMappingException, IOException {
@@ -227,6 +256,22 @@ public class MindmapController extends BaseController {
return xmlStr.getBytes("UTF-8");
}
+ @ApiIgnore
+ @RequestMapping(method = RequestMethod.PUT, value = {"/maps/{id}/document/xml"}, consumes = {"text/plain"})
+ @ResponseBody
+ public void updateDocument(@PathVariable int id, @RequestBody String xmlDoc) throws WiseMappingException, IOException {
+
+ final Mindmap mindmap = findMindmapById(id);
+ final User user = Utils.getUser();
+ if (xmlDoc != null && !xmlDoc.isEmpty()) {
+ mindmap.setXmlStr(xmlDoc);
+ }
+
+ mindmap.setXmlStr(xmlDoc);
+ saveMindmapDocument(false,mindmap,user);
+ }
+
+
@RequestMapping(method = RequestMethod.GET, value = {"/maps/{id}/{hid}/document/xml"}, consumes = {"text/plain"}, produces = {"application/xml"})
@ResponseBody
public byte[] retrieveDocument(@PathVariable int id, @PathVariable int hid, @NotNull HttpServletResponse response) throws WiseMappingException, IOException {
@@ -236,7 +281,6 @@ public class MindmapController extends BaseController {
return mindmapHistory.getUnzipXml();
}
-
private void verifyLock(@NotNull Mindmap mindmap, @NotNull User user, long session, long timestamp) throws WiseMappingException {
// The lock was lost, reclaim as the ownership of it.
@@ -267,9 +311,9 @@ public class MindmapController extends BaseController {
/**
* The intention of this method is the update of several properties at once ...
*/
- @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"})
+ @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}", consumes = {"application/xml", "application/json"}, produces = {"application/json", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
- public void update(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor) throws IOException, WiseMappingException {
+ public void updateProperties(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor) throws IOException, WiseMappingException {
final Mindmap mindmap = findMindmapById(id);
final User user = Utils.getUser();
@@ -319,8 +363,7 @@ public class MindmapController extends BaseController {
return result;
}
-
- @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/title", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
+ @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/title", consumes = {"text/plain"}, produces = {"application/json", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateTitle(@RequestBody String title, @PathVariable int id) throws WiseMappingException {
@@ -339,7 +382,7 @@ public class MindmapController extends BaseController {
mindmapService.updateMindmap(mindMap, !true);
}
- @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/collabs", consumes = {"application/json", "application/xml"}, produces = {"application/json", "text/html", "application/xml"})
+ @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/collabs", consumes = {"application/json", "application/xml"}, produces = {"application/json", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateCollabs(@PathVariable int id, @NotNull @RequestBody RestCollaborationList restCollabs) throws CollaborationException, MapCouldNotFoundException {
final Mindmap mindMap = findMindmapById(id);
@@ -379,9 +422,8 @@ public class MindmapController extends BaseController {
}
}
-
- @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/collabs", produces = {"application/json", "text/html", "application/xml"})
- public ModelAndView retrieveList(@PathVariable int id) throws MapCouldNotFoundException {
+ @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/collabs", produces = {"application/json", "application/xml"})
+ public RestCollaborationList retrieveList(@PathVariable int id) throws MapCouldNotFoundException {
final Mindmap mindMap = findMindmapById(id);
final Set collaborations = mindMap.getCollaborations();
@@ -390,14 +432,13 @@ public class MindmapController extends BaseController {
collabs.add(new RestCollaboration(collaboration));
}
- final RestCollaborationList restCollaborationList = new RestCollaborationList();
- restCollaborationList.setCollaborations(collabs);
+ final RestCollaborationList result = new RestCollaborationList();
+ result.setCollaborations(collabs);
- return new ModelAndView("collabsView", "list", restCollaborationList);
+ return result;
}
-
- @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/description", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
+ @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/description", consumes = {"text/plain"}, produces = {"application/json", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateDescription(@RequestBody String description, @PathVariable int id) throws WiseMappingException {
@@ -410,7 +451,7 @@ public class MindmapController extends BaseController {
mindmapService.updateMindmap(mindMap, !true);
}
- @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/publish", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
+ @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/publish", consumes = {"text/plain"}, produces = {"application/json", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updatePublishState(@RequestBody String value, @PathVariable int id) throws WiseMappingException {
@@ -435,9 +476,9 @@ public class MindmapController extends BaseController {
mindmapService.removeMindmap(mindmap, user);
}
- @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/starred", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
+ @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/starred", consumes = {"text/plain"}, produces = {"application/json", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
- public void updateStarredState(@RequestBody String value, @PathVariable int id) throws WiseMappingException {
+ public void updateStarredState(@RequestBody @ApiParam(defaultValue = "false", allowableValues = "true,false") String value, @PathVariable int id) throws WiseMappingException {
final Mindmap mindmap = findMindmapById(id);
final User user = Utils.getUser();
@@ -452,7 +493,8 @@ public class MindmapController extends BaseController {
mindmapService.updateCollaboration(user, collaboration);
}
- @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/lock", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
+ @ApiIgnore
+ @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/lock", consumes = {"text/plain"}, produces = {"application/json", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateMapLock(@RequestBody String value, @PathVariable int id) throws IOException, WiseMappingException {
final User user = Utils.getUser();
@@ -467,6 +509,7 @@ public class MindmapController extends BaseController {
}
}
+ @ApiIgnore
@RequestMapping(method = RequestMethod.DELETE, value = "/maps/batch")
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void batchDelete(@RequestParam(required = true) String ids) throws IOException, WiseMappingException {
@@ -535,7 +578,7 @@ public class MindmapController extends BaseController {
createMap(new RestMindmap(mindMap, null), response, title, description);
}
- @RequestMapping(method = RequestMethod.POST, value = "/maps/{id}", consumes = {"application/xml", "application/json"})
+ @RequestMapping(method = RequestMethod.POST, value = "/maps/{id}", consumes = {"application/xml", "application/json"},produces = {"application/xml", "application/json","text/plain"})
@ResponseStatus(value = HttpStatus.CREATED)
public void createDuplicate(@RequestBody RestMindmapInfo restMindmap, @PathVariable int id, @NotNull HttpServletResponse response) throws IOException, WiseMappingException {
// Validate ...
diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/ValidationException.java b/wise-webapp/src/main/java/com/wisemapping/rest/ValidationException.java
index c21a0b3e..469b6585 100644
--- a/wise-webapp/src/main/java/com/wisemapping/rest/ValidationException.java
+++ b/wise-webapp/src/main/java/com/wisemapping/rest/ValidationException.java
@@ -27,7 +27,7 @@ public class ValidationException extends WiseMappingException{
private Errors errors;
public ValidationException(@NotNull Errors errors) {
- super("Validation Exceptions");
+ super("Validation Exceptions:"+errors);
this.errors = errors;
}
diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java
index 804f465e..f90506c2 100644
--- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java
+++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java
@@ -20,18 +20,23 @@ package com.wisemapping.rest.model;
import com.wisemapping.exceptions.WiseMappingException;
-import com.wisemapping.model.*;
+import com.wisemapping.model.CollaborationProperties;
+import com.wisemapping.model.CollaborationRole;
+import com.wisemapping.model.Collaborator;
+import com.wisemapping.model.Mindmap;
+import com.wisemapping.model.User;
import com.wisemapping.util.TimeUtils;
-import org.codehaus.jackson.annotate.*;
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonIgnore;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import javax.xml.bind.annotation.*;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
import java.io.IOException;
-import java.text.SimpleDateFormat;
import java.util.Calendar;
-import java.util.Date;
-import java.util.TimeZone;
@XmlRootElement(name = "map")
@XmlAccessorType(XmlAccessType.PROPERTY)
@@ -65,6 +70,9 @@ public class RestMindmap {
}
}
+ public void setCreationTime(final String creationTime){
+ // Ignore
+ }
public String getCreationTime() {
final Calendar creationTime = mindmap.getCreationTime();
@@ -79,22 +87,43 @@ public class RestMindmap {
return mindmap.getDescription();
}
+ public void setDescription(String description) {
+ mindmap.setDescription(description);
+ }
+
public String getTags() {
return mindmap.getTags();
}
+ public void setTags(String tags) {
+ mindmap.setTags(tags);
+ }
+
public String getTitle() {
return mindmap.getTitle();
}
+ public void setTitle(String title) {
+ mindmap.setTitle(title);
+ }
+
public int getId() {
return mindmap.getId();
}
- public String getCreator() {
- return mindmap.getCreator().getEmail();
+ public void setId(int id) {
+ mindmap.setId(id);
}
+ public String getCreator() {
+ final User creator = mindmap.getCreator();
+ return creator != null ? creator.getEmail() : null;
+ }
+
+ public void setCreator(String creatorUser) {
+ }
+
+
public RestCollaborator getLastModifierUser() {
final User lastEditor = mindmap.getLastEditor();
@@ -105,6 +134,9 @@ public class RestMindmap {
return result;
}
+ public void setLastModifierUser(RestUser lastModifierUser) {
+ }
+
public String getLastModificationTime() {
final Calendar date = mindmap.getLastModificationTime();
String result = null;
@@ -114,11 +146,13 @@ public class RestMindmap {
return result;
}
+ public void setLastModificationTime(final String value) {
+ }
+
public boolean isPublic() {
return mindmap.isPublic();
}
-
public void setPublic(boolean value) {
// return mindmap.isPublic();
}
@@ -127,50 +161,19 @@ public class RestMindmap {
return mindmap.getXmlStr();
}
-
public void setXml(@Nullable String xml) throws IOException {
if (xml != null)
mindmap.setXmlStr(xml);
}
- public void setId(int id) {
- mindmap.setId(id);
- }
-
- public void setTitle(String title) {
- mindmap.setTitle(title);
- }
-
- public void setTags(String tags) {
- mindmap.setTags(tags);
- }
-
- public void setDescription(String description) {
- mindmap.setDescription(description);
- }
-
- public void setOwner(String owner) {
-
- }
-
public String getOwner() {
final User owner = mindmap.getCreator();
return owner != null ? owner.getEmail() : null;
}
- public void setCreator(String creatorUser) {
- }
+ public void setOwner(String owner) {
-
- public void setProperties(@Nullable String properties) {
- this.properties = properties;
- }
-
- public void setLastModificationTime(final String value) {
- }
-
- public void setLastModifierUser(String lastModifierUser) {
}
@Nullable
@@ -178,6 +181,10 @@ public class RestMindmap {
return properties;
}
+ public void setProperties(@Nullable String properties) {
+ this.properties = properties;
+ }
+
public boolean getStarred() {
boolean result = false;
if (collaborator != null) {
diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapInfo.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapInfo.java
index 1b3db88e..d1dad7ce 100644
--- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapInfo.java
+++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapInfo.java
@@ -25,17 +25,16 @@ import com.wisemapping.model.Mindmap;
import com.wisemapping.model.User;
import com.wisemapping.security.Utils;
import com.wisemapping.util.TimeUtils;
-import org.codehaus.jackson.annotate.*;
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonIgnore;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
-import java.text.SimpleDateFormat;
import java.util.Calendar;
-import java.util.Date;
-import java.util.TimeZone;
@XmlRootElement(name = "map")
@XmlAccessorType(XmlAccessType.PROPERTY)
@@ -62,28 +61,53 @@ public class RestMindmapInfo {
this.collaborator = collaborator;
}
+ public void setCreationTime(String value){
+ // Ignore
+ }
+
public String getCreationTime() {
- return TimeUtils.toISO8601(mindmap.getCreationTime().getTime());
+ final Calendar creationTime = mindmap.getCreationTime();
+ return creationTime != null ? TimeUtils.toISO8601(creationTime.getTime()) : null;
}
public String getDescription() {
return mindmap.getDescription();
}
+ public void setDescription(String description) {
+ mindmap.setDescription(description);
+ }
+
public String getTags() {
return mindmap.getTags();
}
+ public void setTags(String tags) {
+ mindmap.setTags(tags);
+ }
+
public String getTitle() {
return mindmap.getTitle();
}
+ public void setTitle(String title) {
+ mindmap.setTitle(title);
+ }
+
public int getId() {
return mindmap.getId();
}
+ public void setId(int id) {
+ }
+
public String getCreator() {
- return mindmap.getCreator().getFullName();
+ final User creator = mindmap.getCreator();
+ return creator!=null?creator.getFullName():null;
+ }
+
+ public void setCreator(String email) {
+
}
public void setCreator() {
@@ -95,7 +119,7 @@ public class RestMindmapInfo {
return collaboration != null ? collaboration.getRole().getLabel() : "none";
}
- public void setRole() {
+ public void setRole(String value) {
// Do nothing ...
}
@@ -104,48 +128,29 @@ public class RestMindmapInfo {
return user != null ? user.getFullName() : "unknown";
}
+ public void setLastModifierUser(String value) {
+ }
+
public String getLastModificationTime() {
final Calendar calendar = mindmap.getLastModificationTime();
- return TimeUtils.toISO8601(calendar.getTime());
+ return calendar!=null?TimeUtils.toISO8601(calendar.getTime()):null;
+ }
+
+ public void setLastModificationTime(String value) {
}
public boolean isPublic() {
return mindmap.isPublic();
}
- public void setId(int id) {
- }
-
public boolean getStarred() {
return mindmap.isStarred(collaborator);
}
- public void setStarred(int value) {
+ public void setStarred(boolean value) {
}
- public void setTitle(String title) {
- mindmap.setTitle(title);
- }
-
- public void setTags(String tags) {
- mindmap.setTags(tags);
- }
-
- public void setDescription(String description) {
- mindmap.setDescription(description);
- }
-
- public void setCreator(String email) {
-
- }
-
- public void setLastModificationTime(String value) {
- }
-
- public void setLastModifierUser(String value) {
- }
-
@JsonIgnore
public Mindmap getDelegated() {
return this.mindmap;
diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestUser.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestUser.java
index 310fecf0..a74f8972 100644
--- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestUser.java
+++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestUser.java
@@ -31,6 +31,8 @@ import javax.xml.bind.annotation.XmlRootElement;
import java.util.Calendar;
import java.util.Set;
+
+
@XmlRootElement(name = "user")
@XmlAccessorType(XmlAccessType.PROPERTY)
@JsonAutoDetect(
diff --git a/wise-webapp/src/main/webapp/WEB-INF/app.properties b/wise-webapp/src/main/webapp/WEB-INF/app.properties
index aea43dc6..45912ceb 100755
--- a/wise-webapp/src/main/webapp/WEB-INF/app.properties
+++ b/wise-webapp/src/main/webapp/WEB-INF/app.properties
@@ -142,6 +142,13 @@ security.ldap.firstName.attribute=givenName
# Enable OpenId Authentication.
security.openid.enabled=false
+# REST Documentation
+#
+# This properties are used for REST API Documentation( http://localhost:8080/doc/rest/index.html)
+# Change the URL for proper documentation console setup.
+documentation.services.basePath=http://localhost:8080/wisemapping/service
+documentation.services.version=3.0.1
+
diff --git a/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/mapView.jsp b/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/mapView.jsp
deleted file mode 100644
index 95e23838..00000000
--- a/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/mapView.jsp
+++ /dev/null
@@ -1,48 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
-<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-
-
-
- Mindmap Detail
-
-
-
Details for map with id '${map.id}'
-
-
-
-
Id:
-
${map.id}
-
-
-
Title:
-
${map.title}
-
-
-
Description:
-
${map.description}
-
-
-
Owner:
-
${map.owner}
-
-
-
Xml:
-
-
-
-
-
Last Modified:
-
${map.lastModifierUser}
-
-
-
Creator:
-
${map.creator}
-
-
-
Public:
-
${map.public}
-
-
-
-
-
\ No newline at end of file
diff --git a/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/mapsView.jsp b/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/mapsView.jsp
deleted file mode 100644
index 2a40ceb2..00000000
--- a/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/mapsView.jsp
+++ /dev/null
@@ -1,51 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
-<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-
-
-
- Mindmaps List
-
-
-
Mindmaps List
-
-
-
-
-
Id:
-
${map.id}
-
-
-
Title:
-
${map.title}
-
-
-
Description:
-
${map.description}
-
-
-
Owner:
-
${map.owner}
-
-
-
Xml:
-
-
-
-
-
Last Modified:
-
${map.lastModifierUser}
-
-
-
Creator:
-
${map.creator}
-
-
-
Public:
-
${map.public}
-
-
-
-
-
-
-
\ 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
deleted file mode 100644
index 46c69913..00000000
--- a/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/responseView.jsp
+++ /dev/null
@@ -1,11 +0,0 @@
-<%@ 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/jsp-rest/userView.jsp b/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/userView.jsp
deleted file mode 100644
index 7c568172..00000000
--- a/wise-webapp/src/main/webapp/WEB-INF/jsp-rest/userView.jsp
+++ /dev/null
@@ -1,35 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
-<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-
-
-
- Mindmap Detail
-
-
-
Details for User with id '${user.id}'
-
-
-
-
Email:
-
${user.email}
-
-
-
Fist Name:
-
${user.firstname}
-
-
-
Last Name:
-
${user.lastname}
-
-
-
Username:
-
${user.username}
-
-
-
Active:
-
${user.active}
-
-
-
-
-
\ No newline at end of file
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 a83725f1..53384828 100644
--- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml
+++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml
@@ -52,7 +52,6 @@