From e4af8acdc27c9bc84a9ffa8c2d078eeb9587cfa4 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 7 Nov 2020 11:56:38 -0800 Subject: [PATCH] Initial commit --- core-js/pom.xml | 2 +- distribution/docker-conf/app.properties | 49 +++++++---- mindplot/pom.xml | 2 +- pom.xml | 4 +- web2d/pom.xml | 2 +- wise-editor/pom.xml | 2 +- wise-webapp/pom.xml | 25 +++++- .../com/wisemapping/dao/LabelManagerImpl.java | 38 +++++++-- .../wisemapping/dao/MindmapManagerImpl.java | 82 ++++++++++++------- .../com/wisemapping/dao/UserManagerImpl.java | 75 ++++++++++------- .../java/com/wisemapping/mail/Mailer.java | 46 +++++------ .../wisemapping/rest/MindmapController.java | 66 +++++++-------- .../wisemapping/rest/view/TransformView.java | 47 +++++------ .../security/AuthenticationProvider.java | 39 ++++----- .../security/CustomPasswordEncoder.java | 68 +++++++-------- .../wisemapping/service/UserServiceImpl.java | 60 ++++++-------- .../wisemapping/util/VelocityEngineUtils.java | 38 +++++++++ .../util/VelocityEngineWrapper.java | 24 ++++++ wise-webapp/src/main/webapp/WEB-INF/web.xml | 2 +- .../main/webapp/WEB-INF/wisemapping-aop.xml | 10 +-- .../main/webapp/WEB-INF/wisemapping-dao.xml | 29 +++---- .../main/webapp/WEB-INF/wisemapping-rest.xml | 6 +- .../WEB-INF/wisemapping-security-db.xml | 4 +- .../WEB-INF/wisemapping-security-ldap.xml | 4 +- .../webapp/WEB-INF/wisemapping-security.xml | 4 +- .../webapp/WEB-INF/wisemapping-service.xml | 28 ++----- .../webapp/WEB-INF/wisemapping-servlet.xml | 8 +- 27 files changed, 436 insertions(+), 328 deletions(-) create mode 100644 wise-webapp/src/main/java/com/wisemapping/util/VelocityEngineUtils.java create mode 100644 wise-webapp/src/main/java/com/wisemapping/util/VelocityEngineWrapper.java diff --git a/core-js/pom.xml b/core-js/pom.xml index 2d8eda6a..84e1398a 100644 --- a/core-js/pom.xml +++ b/core-js/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 4.0.6-SNAPSHOT + 5.0.0-SNAPSHOT scm:git:git@bitbucket.org:wisemapping/wisemapping-open-source.git diff --git a/distribution/docker-conf/app.properties b/distribution/docker-conf/app.properties index db8ada22..9620b810 100644 --- a/distribution/docker-conf/app.properties +++ b/distribution/docker-conf/app.properties @@ -2,25 +2,44 @@ # Database Configuration ################################################################################## -# MySQL 5.X configuration properties -database.url=jdbc:mysql://localhost/wisemapping?useUnicode=yes&characterEncoding=UTF-8 -database.driver=com.mysql.jdbc.Driver -database.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect +# MariaDB configuration properties +database.url=jdbc:mariadb://localhost/wisemapping?useUnicode=yes&characterEncoding=UTF-8 +database.driver=org.mariadb.jdbc.Driver +database.hibernate.dialect=org.hibernate.dialect.MariaDBDialect database.username=wisemapping -database.password=password +database.password=mappingwise database.validation.enabled=true database.validation.query=SELECT 1 -## PostgreSQL configuration properties -#database.url=jdbc:postgresql:///wisemapping -#database.driver=org.postgresql.Driver -#database.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect -#database.username= -#database.password= +# MySQL 5.X configuration properties +#database.url=jdbc:mysql://localhost/wisemapping?useUnicode=yes&characterEncoding=UTF-8 +#database.driver=com.mysql.jdbc.Driver +#database.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect +#database.username=wisemapping +#database.password=password #database.validation.enabled=true +#database.validation.query=SELECT 1 + + +## PostgreSQL configuration properties +#database.url=jdbc:mariadb://localhost:3306/wisemapping +#database.driver=org.mariadb.jdbc.Driver +#database.hibernate.dialect=org.hibernate.dialect.MariaDBDialect +#database.username=wisemapping +#database.password=password #database.validation.query= #database.validation.enabled=false + +# HSQL Configuration properties +#database.url=jdbc:hsqldb:file:${database.base.url}/db/wisemapping +#database.driver=org.hsqldb.jdbc.JDBCDriver +#database.hibernate.dialect=org.hibernate.dialect.HSQLDialect +#database.username=sa +#database.password= +#database.validation.enabled=false +#database.validation.query= + ################################################################################## # Mail configuration. Must be configured to enable user registration confirmation. ################################################################################## @@ -135,13 +154,7 @@ security.openid.enabled=false # # This properties are used for REST API Documentation( http://localhost:8080/wisemapping/doc/rest/index.html) # Change the URL for proper documentation console setup. -documentation.services.basePath=http://localhost:8080/wisemapping/service +documentation.services.basePath=http://localhost:8080/service documentation.services.version=3.0.1 - - - - - - diff --git a/mindplot/pom.xml b/mindplot/pom.xml index b99f3d5e..6ad88e9b 100644 --- a/mindplot/pom.xml +++ b/mindplot/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 4.0.6-SNAPSHOT + 5.0.0-SNAPSHOT diff --git a/pom.xml b/pom.xml index e211621c..25e2cbd6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 4.0.6-SNAPSHOT + 5.0.0-SNAPSHOT ${project.basedir}/wise-webapps @@ -16,7 +16,7 @@ org.wisemapping wisemapping WiseMapping Project - 4.0.6-SNAPSHOT + 5.0.0-SNAPSHOT pom diff --git a/web2d/pom.xml b/web2d/pom.xml index 5017df69..87166f03 100644 --- a/web2d/pom.xml +++ b/web2d/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 4.0.6-SNAPSHOT + 5.0.0-SNAPSHOT diff --git a/wise-editor/pom.xml b/wise-editor/pom.xml index dddf61f4..3aea50d7 100644 --- a/wise-editor/pom.xml +++ b/wise-editor/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 4.0.6-SNAPSHOT + 5.0.0-SNAPSHOT diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index ec0abb55..698dd9fc 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 4.0.6-SNAPSHOT + 5.0.0-SNAPSHOT @@ -28,8 +28,10 @@ - 4.3.29.RELEASE - 4.2.9.RELEASE + 5.2.10.RELEASE + 5.2.5.RELEASE + 5.4.23.Final + @@ -101,6 +103,23 @@ ${org.springframework.version} compile + + + org.hibernate + hibernate-entitymanager + ${hibernate.version} + + + org.hibernate + hibernate-core + ${hibernate.version} + + + org.springframework + spring-orm + ${org.springframework.version} + compile + org.springframework spring-context diff --git a/wise-webapp/src/main/java/com/wisemapping/dao/LabelManagerImpl.java b/wise-webapp/src/main/java/com/wisemapping/dao/LabelManagerImpl.java index 926134ff..e241b043 100644 --- a/wise-webapp/src/main/java/com/wisemapping/dao/LabelManagerImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/dao/LabelManagerImpl.java @@ -1,10 +1,27 @@ +/* + * Copyright [2015] [wisemapping] + * + * Licensed under WiseMapping Public License, Version 1.0 (the "License"). + * It is basically the Apache License, Version 2.0 (the "License") plus the + * "powered by wisemapping" text requirement on every single page; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the license at + * + * http://www.wisemapping.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.wisemapping.dao; import com.wisemapping.model.Label; import com.wisemapping.model.User; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.orm.hibernate5.support.HibernateDaoSupport; import java.util.List; @@ -18,27 +35,34 @@ public class LabelManagerImpl extends HibernateDaoSupport @Override public void saveLabel(@NotNull final Label label) { - getSession().save(label); + currentSession().save(label); } @NotNull @Override + @SuppressWarnings("unchecked") public List