From 52fdefb57e29f317606c81d6649aefbfb63c0279 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 17 Feb 2024 11:18:43 -0800 Subject: [PATCH] Fixed. --- config/database/migration/5.0->6.0.sql | 5 ++ .../config/common/CommonConfig.java | 4 +- .../wisemapping/config/common/JPAConfig.java | 4 +- .../com/wisemapping/dao/LabelManager.java | 16 +++--- .../com/wisemapping/dao/LabelManagerImpl.java | 28 +++++----- .../com/wisemapping/dao/MindmapManager.java | 6 +-- .../wisemapping/dao/MindmapManagerImpl.java | 6 +-- .../java/com/wisemapping/dao/UserManager.java | 18 +++---- .../com/wisemapping/dao/UserManagerImpl.java | 34 ++++++------ .../AccessDeniedSecurityException.java | 1 - .../wisemapping/exceptions/LockException.java | 4 +- .../exceptions/SessionExpiredException.java | 6 +-- .../listener/UnlockOnExpireListener.java | 4 +- .../com/wisemapping/model/AccessAuditory.java | 6 +-- .../model/{User.java => Account.java} | 8 +-- .../com/wisemapping/model/Collaboration.java | 2 +- .../com/wisemapping/model/MindMapHistory.java | 6 +-- .../java/com/wisemapping/model/Mindmap.java | 27 +++++----- .../model/{Label.java => MindmapLabel.java} | 20 +++---- .../wisemapping/rest/AccountController.java | 21 ++++---- .../com/wisemapping/rest/AdminController.java | 12 ++--- .../com/wisemapping/rest/BaseController.java | 4 +- .../com/wisemapping/rest/LabelController.java | 20 +++---- .../wisemapping/rest/MindmapController.java | 52 +++++++++---------- .../com/wisemapping/rest/MindmapFilter.java | 16 +++--- .../wisemapping/rest/OAuth2Controller.java | 4 +- .../com/wisemapping/rest/UserController.java | 8 ++- .../com/wisemapping/rest/model/RestLabel.java | 14 ++--- .../wisemapping/rest/model/RestLabelList.java | 6 +-- .../wisemapping/rest/model/RestLockInfo.java | 4 +- .../wisemapping/rest/model/RestMindmap.java | 9 ++-- .../rest/model/RestMindmapHistory.java | 4 +- .../rest/model/RestMindmapInfo.java | 8 +-- .../com/wisemapping/rest/model/RestUser.java | 10 ++-- .../rest/model/RestUserRegistration.java | 8 ++- .../security/AuthenticationProvider.java | 4 +- .../GoogleAuthenticationProvider.java | 4 +- .../MapAccessPermissionEvaluation.java | 8 +-- .../MapPermissionsSecurityAdvice.java | 6 +-- .../security/ReadSecurityAdvise.java | 6 +-- .../security/UpdateSecurityAdvise.java | 6 +-- .../com/wisemapping/security/UserDetails.java | 8 +-- .../security/UserDetailsService.java | 4 +- .../java/com/wisemapping/security/Utils.java | 9 ++-- .../com/wisemapping/service/LabelService.java | 14 ++--- .../wisemapping/service/LabelServiceImpl.java | 14 ++--- .../com/wisemapping/service/LockInfo.java | 8 +-- .../com/wisemapping/service/LockManager.java | 11 ++-- .../wisemapping/service/LockManagerImpl.java | 12 ++--- .../wisemapping/service/MailerService.java | 25 +++++---- .../wisemapping/service/MindmapService.java | 16 +++--- .../service/MindmapServiceImpl.java | 22 ++++---- .../service/NotificationService.java | 22 ++++---- .../com/wisemapping/service/UserService.java | 22 ++++---- .../wisemapping/service/UserServiceImpl.java | 32 ++++++------ .../wisemapping/validator/LabelValidator.java | 14 ++--- .../validator/MapInfoValidator.java | 4 +- .../wisemapping/view/CollaboratorBean.java | 6 +-- .../com/wisemapping/view/MindMapBean.java | 5 +- .../java/com/wisemapping/view/UserBean.java | 6 +-- wise-api/src/main/resources/application.yml | 2 +- wise-api/src/main/resources/data-hsqldb.sql | 2 +- wise-api/src/main/resources/data-mysql.sql | 2 +- .../src/main/resources/data-postgresql.sql | 14 ++--- wise-api/src/main/resources/ehcache.xml | 4 +- wise-api/src/main/resources/schema-hsqldb.sql | 2 +- wise-api/src/main/resources/schema-mysql.sql | 24 ++++----- .../test/rest/RestUserControllerTest.java | 6 +-- 68 files changed, 373 insertions(+), 376 deletions(-) create mode 100644 config/database/migration/5.0->6.0.sql rename wise-api/src/main/java/com/wisemapping/model/{User.java => Account.java} (97%) rename wise-api/src/main/java/com/wisemapping/model/{Label.java => MindmapLabel.java} (85%) diff --git a/config/database/migration/5.0->6.0.sql b/config/database/migration/5.0->6.0.sql new file mode 100644 index 00000000..585ec37d --- /dev/null +++ b/config/database/migration/5.0->6.0.sql @@ -0,0 +1,5 @@ +RENAME TABLE USER TO ACCOUNT; +RENAME TABLE LABEL TO MINDMAP_LABEL; + +ALTER TABLE COLLABORATION +RENAME COLUMN colaboration_id to collaboration_id diff --git a/wise-api/src/main/java/com/wisemapping/config/common/CommonConfig.java b/wise-api/src/main/java/com/wisemapping/config/common/CommonConfig.java index 561fce36..d068f10c 100644 --- a/wise-api/src/main/java/com/wisemapping/config/common/CommonConfig.java +++ b/wise-api/src/main/java/com/wisemapping/config/common/CommonConfig.java @@ -1,7 +1,7 @@ package com.wisemapping.config.common; import com.wisemapping.dao.LabelManagerImpl; -import com.wisemapping.model.User; +import com.wisemapping.model.Account; import com.wisemapping.security.AuthenticationProvider; import com.wisemapping.security.Utils; import com.wisemapping.service.MindmapServiceImpl; @@ -26,7 +26,7 @@ public class CommonConfig { return new AcceptHeaderLocaleResolver() { @Override public Locale resolveLocale(@NotNull HttpServletRequest request) { - final User user = Utils.getUser(); + final Account user = Utils.getUser(); Locale result; if (user != null && user.getLocale() != null) { String locale = user.getLocale(); diff --git a/wise-api/src/main/java/com/wisemapping/config/common/JPAConfig.java b/wise-api/src/main/java/com/wisemapping/config/common/JPAConfig.java index 9f68abdc..87796cdf 100644 --- a/wise-api/src/main/java/com/wisemapping/config/common/JPAConfig.java +++ b/wise-api/src/main/java/com/wisemapping/config/common/JPAConfig.java @@ -1,7 +1,7 @@ package com.wisemapping.config.common; import com.wisemapping.dao.MindmapManagerImpl; -import com.wisemapping.model.User; +import com.wisemapping.model.Account; import com.wisemapping.service.MindmapServiceImpl; import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.context.annotation.Configuration; @@ -10,7 +10,7 @@ import org.springframework.data.jpa.repository.config.EnableJpaRepositories; @Configuration @EnableJpaRepositories(basePackageClasses={MindmapServiceImpl.class, MindmapManagerImpl.class}) -@EntityScan(basePackageClasses= User.class) +@EntityScan(basePackageClasses= Account.class) public class JPAConfig { } diff --git a/wise-api/src/main/java/com/wisemapping/dao/LabelManager.java b/wise-api/src/main/java/com/wisemapping/dao/LabelManager.java index 7d0363dc..8a6f1c6d 100644 --- a/wise-api/src/main/java/com/wisemapping/dao/LabelManager.java +++ b/wise-api/src/main/java/com/wisemapping/dao/LabelManager.java @@ -1,7 +1,7 @@ package com.wisemapping.dao; -import com.wisemapping.model.Label; -import com.wisemapping.model.User; +import com.wisemapping.model.MindmapLabel; +import com.wisemapping.model.Account; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -9,18 +9,18 @@ import java.util.List; public interface LabelManager { - void addLabel(@NotNull final Label label); + void addLabel(@NotNull final MindmapLabel label); - void saveLabel(@NotNull final Label label); + void saveLabel(@NotNull final MindmapLabel label); @NotNull - List