From de5febaf1593d21c84fccfef1aca47e419fda033 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 27 Mar 2022 15:04:19 -0300 Subject: [PATCH 01/19] Bump up version --- pom.xml | 4 ++-- wise-ui/pom.xml | 2 +- wise-webapp/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index d292e7a1..840a59a0 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 5.0.10 + 5.0.11-SNAPSHOT ${project.basedir}/wise-webapps @@ -16,7 +16,7 @@ org.wisemapping wisemapping WiseMapping Project - 5.0.10 + 5.0.11-SNAPSHOT pom diff --git a/wise-ui/pom.xml b/wise-ui/pom.xml index 554593f2..9a7d97fe 100644 --- a/wise-ui/pom.xml +++ b/wise-ui/pom.xml @@ -12,7 +12,7 @@ org.wisemapping wisemapping ../pom.xml - 5.0.10 + 5.0.11-SNAPSHOT diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index 4108de7f..f96ce222 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 5.0.10 + 5.0.11-SNAPSHOT From 5fa6a82b3ad3c4e27ed03f0f505933feb92462ce Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 27 Mar 2022 20:05:21 -0300 Subject: [PATCH 02/19] Update java dependencies. --- wise-webapp/pom.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index f96ce222..901f1d66 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -189,9 +189,9 @@ compile - javax.mail - mail - 1.4.3 + com.sun.mail + javax.mail + 1.6.2 mysql @@ -247,6 +247,7 @@ javax.servlet jstl 1.2 + provided org.slf4j From e9ff9b36fc078e72a994476ff6f1e048b77ab06b Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 27 Mar 2022 22:44:53 -0300 Subject: [PATCH 03/19] Exclude version in collition --- wise-webapp/pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index 901f1d66..2c5d299d 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -192,6 +192,13 @@ com.sun.mail javax.mail 1.6.2 + + + + javax.activation + activation + + mysql From 1ac332a18e1982fee0e4a43490eeb9780a94f370 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 27 Mar 2022 22:46:34 -0300 Subject: [PATCH 04/19] Revert "Exclude version in collition" This reverts commit e9ff9b36fc078e72a994476ff6f1e048b77ab06b. --- wise-webapp/pom.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index 2c5d299d..901f1d66 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -192,13 +192,6 @@ com.sun.mail javax.mail 1.6.2 - - - - javax.activation - activation - - mysql From 6508b9eb67a343c1bba7ff520d76b87322ac2f82 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 27 Mar 2022 22:52:08 -0300 Subject: [PATCH 05/19] Revert jslt scope change --- wise-webapp/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index 901f1d66..57add0c3 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -244,10 +244,10 @@ 2.13.1 + javax.servlet jstl 1.2 - provided org.slf4j From 8a5bd2de94c9e4a5540b9e542d0f32fa3e620851 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 27 Mar 2022 22:55:44 -0300 Subject: [PATCH 06/19] Remove junit unsed dependency --- wise-webapp/pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index 57add0c3..d3b2d722 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -271,12 +271,6 @@ fluent-hc 4.5.13 - - junit - junit - RELEASE - test - From 6f19323292ba2b8abd2e23e43c9dbaefa6dba6e9 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 28 Mar 2022 08:15:46 -0300 Subject: [PATCH 07/19] Add debug information. --- .../java/com/wisemapping/rest/MindmapController.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 1a02e06b..c64c3b9e 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -454,9 +454,15 @@ public class MindmapController extends BaseController { public void batchDelete(@RequestParam() String ids) throws IOException, WiseMappingException { final User user = Utils.getUser(); final String[] mapsIds = ids.split(","); - for (final String mapId : mapsIds) { - final Mindmap mindmap = findMindmapById(Integer.parseInt(mapId)); - mindmapService.removeMindmap(mindmap, user); + try { + for (final String mapId : mapsIds) { + final Mindmap mindmap = findMindmapById(Integer.parseInt(mapId)); + mindmapService.removeMindmap(mindmap, user); + } + } catch (Exception e) { + final AccessDeniedSecurityException accessDenied = new AccessDeniedSecurityException("Map could not be deleted. Maps to be deleted:" + ids); + accessDenied.initCause(e); + throw accessDenied; } } From 8248e162fe27ddeae84371c107ed2049a5fb2bca Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 29 Mar 2022 22:41:21 -0300 Subject: [PATCH 08/19] Enable base url discovery. --- .../com/wisemapping/filter/RequestPropertiesInterceptor.java | 2 +- wise-webapp/src/main/webapp/WEB-INF/app.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/filter/RequestPropertiesInterceptor.java b/wise-webapp/src/main/java/com/wisemapping/filter/RequestPropertiesInterceptor.java index b3b02b47..4317910a 100644 --- a/wise-webapp/src/main/java/com/wisemapping/filter/RequestPropertiesInterceptor.java +++ b/wise-webapp/src/main/java/com/wisemapping/filter/RequestPropertiesInterceptor.java @@ -48,7 +48,7 @@ public class RequestPropertiesInterceptor implements HandlerInterceptor { @Value("${site.homepage}") private String siteHomepage; - @Value("${site.baseurl:http://localhost:8080}") + @Value("${site.baseurl}") private String siteUrl; @Value("${security.type}") diff --git a/wise-webapp/src/main/webapp/WEB-INF/app.properties b/wise-webapp/src/main/webapp/WEB-INF/app.properties index 3cf6d17c..3a01ea34 100755 --- a/wise-webapp/src/main/webapp/WEB-INF/app.properties +++ b/wise-webapp/src/main/webapp/WEB-INF/app.properties @@ -89,7 +89,7 @@ google.recaptcha2.secretKey = 6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe admin.user = admin@wisemapping.org # Base URL where WiseMapping is deployed. By default, It will be automatically inferred. -site.baseurl = http://localhost:8080 +#site.baseurl = http://localhost:8080 # Site Homepage URL. This will be used as URL for homepage location. site.homepage = c/login From 641bcbbe177c3576e6b453eee0545a55c310c1ae Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 30 Mar 2022 07:45:15 -0300 Subject: [PATCH 09/19] Fix reset passwod issue on message. --- wise-webapp/src/main/resources/messages_de.properties | 2 +- wise-webapp/src/main/resources/messages_en.properties | 2 +- wise-webapp/src/main/resources/messages_es.properties | 2 +- wise-webapp/src/main/resources/messages_fr.properties | 2 +- wise-webapp/src/main/resources/messages_zh.properties | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wise-webapp/src/main/resources/messages_de.properties b/wise-webapp/src/main/resources/messages_de.properties index 6b96a056..c35402f2 100644 --- a/wise-webapp/src/main/resources/messages_de.properties +++ b/wise-webapp/src/main/resources/messages_de.properties @@ -56,7 +56,7 @@ REGISTRATION.EMAIL_TITLE=Ihr Konto wurde erfolgreich erstellt REGISTRATION.EMAIL_BODY=

Vielen Dank für Ihr Interesse an WiseMapping. Klicken Sie hier, um mit dem Erstellen und Teilen neuer Mindmaps zu beginnen. Wenn Sie Feedback oder Ideen haben, senden Sie uns eine E-Mail an feedback@wisemapping.com. Wir würden uns freuen, von Ihnen zu hören.

CHANGE_PASSWORD.EMAIL_SUBJECT=Dein Passwort wurde zurück gesetzt CHANGE_PASSWORD.EMAIL_TITLE=Ein temporäres Passwort wurde generiert -CHANGE_PASSWORD.EMAIL_BODY=

Jemand, höchstwahrscheinlich Sie selbst, hat ein neues Passwort für Ihr WiseMapping-Konto angefordert.

Hier ist Ihr neues Passwort: {0}

Sie können sich anmelden, indem Sie hier klicken . Wir empfehlen Ihnen dringend, das Passwort so schnell wie möglich zu ändern.

+CHANGE_PASSWORD.EMAIL_BODY=

Jemand, höchstwahrscheinlich Sie selbst, hat ein neues Passwort für Ihr WiseMapping-Konto angefordert.

Hier ist Ihr neues Passwort: {0}

Sie können sich anmelden, indem Sie hier klicken . Wir empfehlen Ihnen dringend, das Passwort so schnell wie möglich zu ändern.

PASSWORD_CHANGED.EMAIL_SUBJECT=Ihr Passwort wurde geändert PASSWORD_CHANGED.EMAIL_TITLE=Ihr Passwort wurde erfolgreich geändert PASSWORD_CHANGED.EMAIL_BODY=

Dies ist nur eine Benachrichtigung, dass Ihr Passwort geändert wurde. Es sind keine weiteren Maßnahmen erforderlich.

diff --git a/wise-webapp/src/main/resources/messages_en.properties b/wise-webapp/src/main/resources/messages_en.properties index 319a950a..fb31e8a4 100644 --- a/wise-webapp/src/main/resources/messages_en.properties +++ b/wise-webapp/src/main/resources/messages_en.properties @@ -62,7 +62,7 @@ REGISTRATION.EMAIL_TITLE=Your account has been created successfully REGISTRATION.EMAIL_BODY=

Thank you for your interest in WiseMapping. Click here to start creating and sharing new mind maps. If have any feedback or idea, send us an email to feedback@wisemapping.com .We'd love to hear from you.

CHANGE_PASSWORD.EMAIL_SUBJECT=Your password has been reset CHANGE_PASSWORD.EMAIL_TITLE=A temporal password has been generated -CHANGE_PASSWORD.EMAIL_BODY=

Someone, most likely you, requested a new password for your WiseMapping account.

Here is your new password: {0}

You can login clicking here. We strongly encourage you to change the password as soon as possible.

+CHANGE_PASSWORD.EMAIL_BODY=

Someone, most likely you, requested a new password for your WiseMapping account.

Here is your new password: {0}

You can login clicking here. We strongly encourage you to change the password as soon as possible.

PASSWORD_CHANGED.EMAIL_SUBJECT=Your password has been changed PASSWORD_CHANGED.EMAIL_TITLE=Your password has been changed successfully PASSWORD_CHANGED.EMAIL_BODY=

This is only an notification that your password has been changed. No further action is required.

diff --git a/wise-webapp/src/main/resources/messages_es.properties b/wise-webapp/src/main/resources/messages_es.properties index 7241c22e..7802504f 100644 --- a/wise-webapp/src/main/resources/messages_es.properties +++ b/wise-webapp/src/main/resources/messages_es.properties @@ -61,7 +61,7 @@ REGISTRATION.EMAIL_TITLE=Tu cuenta ha sido creada exitosamente REGISTRATION.EMAIL_BODY=

Gracias por tu interest en WiseMapping. Hace click aqui para empezar a crear y compatir tus mapas mentales. Ideas y sugerencias, no dudes en contactarnos a feedback@wisemapping.com.

CHANGE_PASSWORD.EMAIL_SUBJECT=Su contraseña ha sido restablecida CHANGE_PASSWORD.EMAIL_TITLE=Se ha generado una contraseña temporal -CHANGE_PASSWORD.EMAIL_BODY=

Alguien, muy probablemente usted, solicitó una nueva contraseña para su cuenta de WiseMapping.

Esta es su nueva contraseña: {0}

Puede iniciar sesión haciendo clic aquí . Te recomendamos que cambie la contraseña lo antes posible.

+CHANGE_PASSWORD.EMAIL_BODY=

Alguien, muy probablemente usted, solicitó una nueva contraseña para su cuenta de WiseMapping.

Esta es su nueva contraseña: {0}

Puede iniciar sesión haciendo clic aquí . Te recomendamos que cambie la contraseña lo antes posible.

PASSWORD_CHANGED.EMAIL_SUBJECT=Su contraseña ha sido cambiada PASSWORD_CHANGED.EMAIL_TITLE=Su contraseña ha sido cambiada con éxito PASSWORD_CHANGED.EMAIL_BODY=

Esto es solo una notificación de que su contraseña ha sido cambiada. No se requiere ninguna otra acción.

diff --git a/wise-webapp/src/main/resources/messages_fr.properties b/wise-webapp/src/main/resources/messages_fr.properties index c9989962..bf56770e 100644 --- a/wise-webapp/src/main/resources/messages_fr.properties +++ b/wise-webapp/src/main/resources/messages_fr.properties @@ -56,7 +56,7 @@ REGISTRATION.EMAIL_TITLE=Votre compte a été créé avec succès REGISTRATION.EMAIL_BODY=

Merci de l'intérêt que vous portez à WiseMapping. Cliquez ici pour commencer à créer et partager de nouvelles cartes mentales. Si vous avez des commentaires ou des idées, envoyez-nous un e-mail à feedback@wisemapping.com. Nous aimerions avoir de vos nouvelles.

CHANGE_PASSWORD.EMAIL_SUBJECT=Votre mot de passe a été réinitialisé CHANGE_PASSWORD.EMAIL_TITLE=Un mot de passe temporaire a été généré -CHANGE_PASSWORD.EMAIL_BODY=

Quelqu'un, probablement vous, a demandé un nouveau mot de passe pour votre compte WiseMapping.

Voici votre nouveau mot de passe : {0}

Vous pouvez vous connecter en cliquant sur ici . Nous vous recommandons de changer votre mot de passe dès que possible.

+CHANGE_PASSWORD.EMAIL_BODY=

Quelqu''un, probablement vous, a demandé un nouveau mot de passe pour votre compte WiseMapping.

Voici votre nouveau mot de passe : {0}

Vous pouvez vous connecter en cliquant sur ici . Nous vous recommandons de changer votre mot de passe dès que possible.

PASSWORD_CHANGED.EMAIL_SUBJECT=Votre mot de passe a été changé PASSWORD_CHANGED.EMAIL_TITLE=Votre mot de passe a été changé avec succès PASSWORD_CHANGED.EMAIL_BODY=

Il s'agit simplement d'une notification indiquant que votre mot de passe a été modifié. Aucune autre action n'est requise.

diff --git a/wise-webapp/src/main/resources/messages_zh.properties b/wise-webapp/src/main/resources/messages_zh.properties index 417e7599..b6509a07 100644 --- a/wise-webapp/src/main/resources/messages_zh.properties +++ b/wise-webapp/src/main/resources/messages_zh.properties @@ -61,7 +61,7 @@ REGISTRATION.EMAIL_TITLE=您的帐户已成功创建 REGISTRATION.EMAIL_BODY=

感谢您对 WiseMapping 的关注。点击这里开始创建和分享新的思维导图。如果有任何反馈或想法,请给我们发送电子邮件至 feedback@wisemapping.com。我们很乐意听取您的意见。

CHANGE_PASSWORD.EMAIL_SUBJECT=您的密码已重置 CHANGE_PASSWORD.EMAIL_TITLE=已生成临时密码 -CHANGE_PASSWORD.EMAIL_BODY=

有人(很可能是您)为您的 WiseMapping 帐户申请了新密码。

这是您的新密码:{0}

您可以点击此处登录。我们强烈建议您尽快更改密码

+CHANGE_PASSWORD.EMAIL_BODY=

有人(很可能是您)为您的 WiseMapping 帐户申请了新密码。

这是您的新密码:{0}

您可以点击此处登录。我们强烈建议您尽快更改密码

PASSWORD_CHANGED.EMAIL_SUBJECT=您的密码已被更改 PASSWORD_CHANGED.EMAIL_TITLE=你已经成功更改密码 PASSWORD_CHANGED.EMAIL_BODY=

这只是您的密码已更改的通知。无需进一步操作。

From accf252e7886c2df98f50e6a9730da9196ff5dad Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 30 Mar 2022 07:50:42 -0300 Subject: [PATCH 10/19] Fix email encodding problem. --- .../java/com/wisemapping/mail/Mailer.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/mail/Mailer.java b/wise-webapp/src/main/java/com/wisemapping/mail/Mailer.java index 2c7e9133..04b05f52 100644 --- a/wise-webapp/src/main/java/com/wisemapping/mail/Mailer.java +++ b/wise-webapp/src/main/java/com/wisemapping/mail/Mailer.java @@ -26,7 +26,7 @@ import org.springframework.mail.javamail.JavaMailSender; import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.mail.javamail.MimeMessagePreparator; -import javax.mail.internet.MimeMessage; +import java.nio.charset.StandardCharsets; import java.util.Map; public final class Mailer { @@ -54,17 +54,14 @@ public final class Mailer { public void sendEmail(final String from, final String to, final String subject, final Map model, @NotNull final String templateMail) { final MimeMessagePreparator preparator = - new MimeMessagePreparator() { - public void prepare(MimeMessage mimeMessage) - throws Exception { - final MimeMessageHelper message = new MimeMessageHelper(mimeMessage); - message.setTo(to); - message.setFrom(from); - message.setSubject(subject); + mimeMessage -> { + final MimeMessageHelper message = new MimeMessageHelper(mimeMessage, StandardCharsets.UTF_8.name()); + message.setTo(to); + message.setFrom(from); + message.setSubject(subject); - final String messageBody = VelocityEngineUtils.mergeTemplateIntoString(velocityEngineWrapper.getVelocityEngine(), "/mail/" + templateMail, model); - message.setText(messageBody, true); - } + final String messageBody = VelocityEngineUtils.mergeTemplateIntoString(velocityEngineWrapper.getVelocityEngine(), "/mail/" + templateMail, model); + message.setText(messageBody, true); }; this.mailSender.send(preparator); From ad20d06d197b85c8ce79d8636e77a0818f891091 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 2 Apr 2022 12:22:25 -0300 Subject: [PATCH 11/19] Update spring framework version. --- wise-webapp/pom.xml | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index d3b2d722..f2a391fd 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -13,8 +13,8 @@ - 5.3.14 - 5.3.5.RELEASE + 5.3.18 + 5.6.2 5.6.5.Final 6.0.21.Final 5.6.1 @@ -396,23 +396,6 @@ - - org.codehaus.mojo - native2ascii-maven-plugin - - - - native2ascii - - - - - UTF-8 - - messages*.properties - - - org.apache.maven.plugins maven-war-plugin From a618849afcc7706661928372940c86fadf1a32f0 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 2 Apr 2022 12:59:54 -0300 Subject: [PATCH 12/19] Remove REST API application/xml type support --- .../wisemapping/rest/AccountController.java | 2 +- .../com/wisemapping/rest/AdminController.java | 6 +-- .../com/wisemapping/rest/LabelController.java | 4 +- .../wisemapping/rest/MindmapController.java | 30 ++++++------ .../rest/TransformerController.java | 46 ------------------- .../com/wisemapping/rest/UserController.java | 4 +- .../rest/model/RestCollaboration.java | 6 --- .../rest/model/RestCollaborationList.java | 7 --- .../rest/model/RestCollaborator.java | 2 - .../wisemapping/rest/model/RestErrors.java | 2 - .../com/wisemapping/rest/model/RestLabel.java | 6 --- .../wisemapping/rest/model/RestLabelList.java | 5 -- .../wisemapping/rest/model/RestLockInfo.java | 7 --- .../wisemapping/rest/model/RestLogItem.java | 6 --- .../wisemapping/rest/model/RestMindmap.java | 2 - .../rest/model/RestMindmapHistory.java | 5 -- .../rest/model/RestMindmapHistoryList.java | 7 --- .../rest/model/RestMindmapInfo.java | 6 --- .../rest/model/RestMindmapList.java | 2 - .../com/wisemapping/rest/model/RestUser.java | 5 -- .../rest/model/RestUserRegistration.java | 7 --- .../main/webapp/WEB-INF/wisemapping-rest.xml | 22 --------- .../com/wisemapping/test/rest/RestHelper.java | 2 +- .../test/rest/RestMindmapITCase.java | 10 +--- 24 files changed, 25 insertions(+), 176 deletions(-) delete mode 100644 wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java 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 b56605b4..0d6acbd0 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java @@ -68,7 +68,7 @@ public class AccountController extends BaseController { userService.changePassword(user); } - @RequestMapping(method = RequestMethod.GET, value = "/account", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.GET, value = "/account", produces = {"application/json"}) public RestUser fetchAccount() { final User user = Utils.getUser(true); return new RestUser(user); 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 c8e8deb2..ca516dda 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java @@ -50,7 +50,7 @@ public class AdminController extends BaseController { @Autowired private MindmapService mindmapService; - @RequestMapping(method = RequestMethod.GET, value = "admin/users/{id}", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.GET, value = "admin/users/{id}", produces = {"application/json"}) @ResponseBody public RestUser getUserById(@PathVariable int id) throws IOException { final User userBy = userService.getUserBy(id); @@ -60,7 +60,7 @@ public class AdminController extends BaseController { return new RestUser(userBy); } - @RequestMapping(method = RequestMethod.GET, value = "admin/users/email/{email:.+}", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.GET, value = "admin/users/email/{email:.+}", produces = {"application/json"}) @ResponseBody public RestUser getUserByEmail(@PathVariable String email) throws IOException { final User user = userService.getUserBy(email); @@ -70,7 +70,7 @@ public class AdminController extends BaseController { return new RestUser(user); } - @RequestMapping(method = RequestMethod.POST, value = "admin/users", consumes = {"application/xml", "application/json"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.POST, value = "admin/users", consumes = { "application/json"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.CREATED) public void createUser(@RequestBody RestUser user, HttpServletResponse response) throws WiseMappingException { if (user == null) { diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/LabelController.java b/wise-webapp/src/main/java/com/wisemapping/rest/LabelController.java index c4ec9117..7b801bb7 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/LabelController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/LabelController.java @@ -46,7 +46,7 @@ public class LabelController extends BaseController { private LabelService labelService; - @RequestMapping(method = RequestMethod.POST, value = "/labels", consumes = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.POST, value = "/labels", consumes = {"application/json"}) @ResponseStatus(value = HttpStatus.CREATED) public void createLabel(@RequestBody RestLabel restLabel, @NotNull HttpServletResponse response, @RequestParam(required = false) String title) throws WiseMappingException { // Overwrite title if it was specified by parameter. @@ -64,7 +64,7 @@ public class LabelController extends BaseController { response.setHeader("ResourceId", Long.toString(label.getId())); } - @RequestMapping(method = RequestMethod.GET, value = "/labels", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.GET, value = "/labels", produces = {"application/json"}) public RestLabelList retrieveList() { final User user = Utils.getUser(); assert user != null; 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 c64c3b9e..c59eb0f2 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -58,7 +58,7 @@ public class MindmapController extends BaseController { @Autowired private LabelService labelService; - @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/json", "application/xml", "text/html"}) + @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/json"}) @ResponseBody public RestMindmap retrieve(@PathVariable int id) throws WiseMappingException { final User user = Utils.getUser(); @@ -66,7 +66,7 @@ public class MindmapController extends BaseController { return new RestMindmap(mindMap, user); } - @RequestMapping(method = RequestMethod.GET, value = "/maps/", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.GET, value = "/maps/", produces = {"application/json"}) public RestMindmapList retrieveList(@RequestParam(required = false) String q) throws IOException { final User user = Utils.getUser(); @@ -80,7 +80,7 @@ public class MindmapController extends BaseController { return new RestMindmapList(mindmaps, user); } - @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/history/", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/history/", produces = {"application/json"}) public RestMindmapHistoryList fetchHistory(@PathVariable int id) { final List histories = mindmapService.findMindmapHistory(id); final RestMindmapHistoryList result = new RestMindmapHistoryList(); @@ -109,7 +109,7 @@ public class MindmapController extends BaseController { } } - @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/document", consumes = {"application/xml", "application/json"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/document", consumes = {"application/json"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void updateDocument(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor) throws WiseMappingException, IOException { @@ -169,7 +169,7 @@ 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", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}", consumes = { "application/json"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void updateProperties(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor) throws IOException, WiseMappingException { @@ -223,7 +223,7 @@ public class MindmapController extends BaseController { return result; } - @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/title", consumes = {"text/plain"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/title", consumes = {"text/plain"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void updateTitle(@RequestBody String title, @PathVariable int id) throws WiseMappingException { @@ -241,7 +241,7 @@ public class MindmapController extends BaseController { mindmapService.updateMindmap(mindMap, false); } - @RequestMapping(method = RequestMethod.POST, value = "/maps/{id}/collabs/", consumes = {"application/json", "application/xml"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.POST, value = "/maps/{id}/collabs/", consumes = {"application/json"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void updateCollabs(@PathVariable int id, @NotNull @RequestBody RestCollaborationList restCollabs) throws CollaborationException, MapCouldNotFoundException, AccessDeniedSecurityException, InvalidEmailException { final Mindmap mindMap = findMindmapById(id); @@ -288,7 +288,7 @@ public class MindmapController extends BaseController { } } - @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/collabs/", consumes = {"application/json", "application/xml"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/collabs/", consumes = {"application/json"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void addCollab(@PathVariable int id, @NotNull @RequestBody RestCollaborationList restCollabs) throws CollaborationException, MapCouldNotFoundException, AccessDeniedSecurityException, InvalidEmailException { final Mindmap mindMap = findMindmapById(id); @@ -351,7 +351,7 @@ public class MindmapController extends BaseController { } - @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/collabs", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/collabs", produces = {"application/json"}) public RestCollaborationList retrieveList(@PathVariable int id) throws MapCouldNotFoundException, AccessDeniedSecurityException { final Mindmap mindMap = findMindmapById(id); @@ -367,7 +367,7 @@ public class MindmapController extends BaseController { return result; } - @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/description", consumes = {"text/plain"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/description", consumes = {"text/plain"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void updateDescription(@RequestBody String description, @PathVariable int id) throws WiseMappingException { final Mindmap mindmap = findMindmapById(id); @@ -375,7 +375,7 @@ public class MindmapController extends BaseController { mindmapService.updateMindmap(mindmap, false); } - @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/publish", consumes = {"text/plain"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/publish", consumes = {"text/plain"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void updatePublishState(@RequestBody String value, @PathVariable int id) throws WiseMappingException { @@ -431,7 +431,7 @@ public class MindmapController extends BaseController { } } - @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/starred", consumes = {"text/plain"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/starred", consumes = {"text/plain"}, produces = {"application/json"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void updateStarredState(@RequestBody String value, @PathVariable int id) throws WiseMappingException { @@ -503,7 +503,7 @@ public class MindmapController extends BaseController { response.setHeader("ResourceId", Integer.toString(mindmap.getId())); } - @RequestMapping(method = RequestMethod.POST, value = "/maps/{id}", consumes = {"application/xml", "application/json"}, produces = {"application/xml", "application/json", "text/plain"}) + @RequestMapping(method = RequestMethod.POST, value = "/maps/{id}", consumes = {"application/json"}, produces = { "application/json", "text/plain"}) @ResponseStatus(value = HttpStatus.CREATED) public void createDuplicate(@RequestBody RestMindmapInfo restMindmap, @PathVariable int id, @NotNull HttpServletResponse response) throws IOException, WiseMappingException { // Validate ... @@ -558,7 +558,7 @@ public class MindmapController extends BaseController { mindmapService.updateMindmap(mindmap, false); } - @RequestMapping(method = RequestMethod.POST, value = "/maps/{id}/labels", consumes = {"application/xml", "application/json"}) + @RequestMapping(method = RequestMethod.POST, value = "/maps/{id}/labels", consumes = {"application/json"}) @ResponseStatus(value = HttpStatus.OK) public void updateLabel(@PathVariable int id, @RequestBody int lid) throws WiseMappingException { final User user = Utils.getUser(); @@ -572,7 +572,7 @@ public class MindmapController extends BaseController { mindmapService.updateMindmap(mindmap, false); } - @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/lock", consumes = {"text/plain"}, produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/lock", consumes = {"text/plain"}, produces = {"application/json"}) public ResponseEntity lockMindmap(@RequestBody String value, @PathVariable int id) throws WiseMappingException { final User user = Utils.getUser(); final LockManager lockManager = mindmapService.getLockManager(); diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java b/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java deleted file mode 100644 index 62d4b2c5..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/rest/TransformerController.java +++ /dev/null @@ -1,46 +0,0 @@ -/* -* Copyright [2022] [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.rest; - -import org.jetbrains.annotations.Nullable; -import org.springframework.stereotype.Controller; -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.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -@Controller -public class TransformerController extends BaseController { - - @RequestMapping(method = RequestMethod.POST, value = "/transform", produces = {"application/freemind"}, consumes = {"application/xml"}) - @ResponseBody - public ModelAndView transformFreemind(@RequestBody @Nullable final String content) throws IOException { - final Map values = new HashMap(); - if (content == null || content.length() == 0) { - throw new IllegalArgumentException("Body can not be null."); - } - values.put("content", content); - return new ModelAndView("transformViewFreemind", values); - } -} diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/UserController.java b/wise-webapp/src/main/java/com/wisemapping/rest/UserController.java index 76dbe9f5..64260877 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/UserController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/UserController.java @@ -55,7 +55,7 @@ public class UserController extends BaseController { private static final Logger logger = Logger.getLogger(UserController.class); private static final String REAL_IP_ADDRESS_HEADER = "X-Real-IP"; - @RequestMapping(method = RequestMethod.POST, value = "/users", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.POST, value = "/users", produces = {"application/json"}) @ResponseStatus(value = HttpStatus.CREATED) public void registerUser(@RequestBody RestUserRegistration registration, @NotNull HttpServletRequest request, @NotNull HttpServletResponse response) throws WiseMappingException, BindException { logger.debug("Register new user:" + registration.getEmail()); @@ -80,7 +80,7 @@ public class UserController extends BaseController { response.setHeader("Location", "/service/users/" + user.getId()); } - @RequestMapping(method = RequestMethod.PUT, value = "/users/resetPassword", produces = {"application/json", "application/xml"}) + @RequestMapping(method = RequestMethod.PUT, value = "/users/resetPassword", produces = {"application/json"}) @ResponseStatus(value = HttpStatus.OK) public void resetPassword(@RequestParam String email) throws InvalidAuthSchemaException, EmailNotExistsException { try { diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaboration.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaboration.java index 8abbc2d7..34f3691b 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaboration.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaboration.java @@ -24,12 +24,6 @@ import com.wisemapping.model.Collaboration; import com.wisemapping.model.CollaborationRole; import org.jetbrains.annotations.NotNull; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "collaboration") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaborationList.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaborationList.java index 37b26d47..ad9b7af9 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaborationList.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaborationList.java @@ -22,15 +22,9 @@ package com.wisemapping.rest.model; import com.fasterxml.jackson.annotation.JsonAutoDetect; import org.jetbrains.annotations.NotNull; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; import java.util.ArrayList; import java.util.List; -@XmlRootElement(name = "collaborations") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, @@ -52,7 +46,6 @@ public class RestCollaborationList { } - @XmlElement(name = "collaborations") public List getCollaborations() { return collaborations; } diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaborator.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaborator.java index ec876ce1..1593af01 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaborator.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaborator.java @@ -29,8 +29,6 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import java.util.Calendar; -@XmlRootElement(name = "collaborator") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestErrors.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestErrors.java index e156b63c..daf4a213 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestErrors.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestErrors.java @@ -35,8 +35,6 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import java.util.*; -@XmlRootElement(name = "errors") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabel.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabel.java index 159061fa..416d72f2 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabel.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabel.java @@ -7,15 +7,9 @@ import com.wisemapping.model.Label; 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 static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; -@XmlRootElement(name = "label") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = NONE, setterVisibility = PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabelList.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabelList.java index 0c03bfdb..10f7f8f4 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabelList.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabelList.java @@ -4,15 +4,10 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.wisemapping.model.Label; import org.jetbrains.annotations.NotNull; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; import java.util.ArrayList; import java.util.List; -@XmlRootElement(name = "labels") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLockInfo.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLockInfo.java index 7da4b783..ad1d6a88 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLockInfo.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLockInfo.java @@ -21,18 +21,11 @@ package com.wisemapping.rest.model; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.wisemapping.model.Collaborator; import com.wisemapping.model.User; import com.wisemapping.service.LockInfo; 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; - -@XmlRootElement(name = "lock") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLogItem.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLogItem.java index 5894962c..3500d843 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLogItem.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLogItem.java @@ -22,12 +22,6 @@ package com.wisemapping.rest.model; import com.fasterxml.jackson.annotation.JsonAutoDetect; import org.jetbrains.annotations.NotNull; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "logitem") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, 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 98a74342..660fbb28 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 @@ -35,8 +35,6 @@ import javax.xml.bind.annotation.XmlRootElement; import java.io.IOException; import java.util.Calendar; -@XmlRootElement(name = "map") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistory.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistory.java index cd464824..bcf4efb2 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistory.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistory.java @@ -25,16 +25,11 @@ import com.wisemapping.model.MindMapHistory; import com.wisemapping.model.User; import org.jetbrains.annotations.NotNull; -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 = "history") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistoryList.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistoryList.java index cfb9e3b6..dac1efeb 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistoryList.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistoryList.java @@ -22,15 +22,9 @@ package com.wisemapping.rest.model; import com.fasterxml.jackson.annotation.JsonAutoDetect; import org.jetbrains.annotations.NotNull; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; import java.util.ArrayList; import java.util.List; -@XmlRootElement(name = "history") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, @@ -51,7 +45,6 @@ public class RestMindmapHistoryList { } - @XmlElement(name = "changes") public List getChanges() { return changes; } 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 fc13611b..c919a917 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 @@ -28,17 +28,11 @@ import com.wisemapping.util.TimeUtils; 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.util.Calendar; -import java.util.List; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; -@XmlRootElement(name = "mapinfo") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapList.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapList.java index f3b5179f..e2a642a8 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapList.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapList.java @@ -33,8 +33,6 @@ import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -@XmlRootElement(name = "maps") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, 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 8cf64298..949d3aea 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 @@ -26,14 +26,9 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.wisemapping.model.User; import org.jetbrains.annotations.NotNull; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; import java.util.Calendar; -@XmlRootElement(name = "user") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestUserRegistration.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestUserRegistration.java index 9a9bc750..dca77ea3 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestUserRegistration.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestUserRegistration.java @@ -24,13 +24,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.wisemapping.model.User; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - - -@XmlRootElement(name = "user") -@XmlAccessorType(XmlAccessType.PROPERTY) @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, 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 3999bb07..913667ce 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml @@ -22,25 +22,6 @@ - - - - com.wisemapping.rest.model.RestMindmap - com.wisemapping.rest.model.RestMindmapInfo - com.wisemapping.rest.model.RestMindmapList - com.wisemapping.rest.model.RestUser - com.wisemapping.rest.model.RestErrors - com.wisemapping.rest.model.RestCollaboration - com.wisemapping.rest.model.RestCollaborationList - com.wisemapping.rest.model.RestLogItem - com.wisemapping.rest.model.RestLockInfo - com.wisemapping.rest.model.RestLabel - com.wisemapping.rest.model.RestLabelList - com.wisemapping.rest.model.RestUserRegistration - - - - @@ -66,9 +47,6 @@ - - - diff --git a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestHelper.java b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestHelper.java index 7430e5a4..2209b1ad 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestHelper.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestHelper.java @@ -46,7 +46,7 @@ public class RestHelper { @DataProvider(name = "ContentType-Provider-Function") static Object[][] contentTypes() { - return new Object[][]{{MediaType.APPLICATION_XML}, {MediaType.APPLICATION_JSON}}; + return new Object[][]{{MediaType.APPLICATION_JSON}}; } } diff --git a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestMindmapITCase.java b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestMindmapITCase.java index bc6cf281..b87d3c30 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestMindmapITCase.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestMindmapITCase.java @@ -201,10 +201,6 @@ public class RestMindmapITCase { @Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function") public void updateMap(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { // Configure media types ... - if (MediaType.APPLICATION_XML == mediaType) { - throw new SkipException("Some research need to check why it's falling."); - } - final HttpHeaders requestHeaders = createHeaders(mediaType); final RestTemplate template = createTemplate(userEmail); @@ -223,7 +219,7 @@ public class RestMindmapITCase { // Update map ... final String resourceUrl = HOST_PORT + resourceUri.toString() + "/document"; - requestHeaders.setContentType(MediaType.APPLICATION_XML); + requestHeaders.setContentType(MediaType.APPLICATION_JSON); final HttpEntity updateEntity = new HttpEntity<>(mapToUpdate, requestHeaders); template.put(resourceUrl, updateEntity); @@ -396,10 +392,6 @@ public class RestMindmapITCase { @Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function") public void addLabelToMindmap(final @NotNull MediaType mediaType) throws IOException, WiseMappingException { // Configure media types ... - if (MediaType.APPLICATION_XML == mediaType) { - throw new SkipException("Some research need to check why it's falling."); - } - final HttpHeaders requestHeaders = createHeaders(mediaType); final RestTemplate template = createTemplate(userEmail); From 86a0a876cadf1162a442ab2685cf1b72b29c7272 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 3 Apr 2022 22:02:20 -0300 Subject: [PATCH 13/19] Fix error trying to delete account with labels created. --- .../wisemapping/rest/AccountController.java | 57 ++++++++++++------- 1 file changed, 37 insertions(+), 20 deletions(-) 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 0d6acbd0..b9f6d93c 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java @@ -1,31 +1,33 @@ /* -* Copyright [2022] [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. -*/ + * Copyright [2022] [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.rest; import com.wisemapping.exceptions.WiseMappingException; import com.wisemapping.mail.NotificationService; import com.wisemapping.model.Collaboration; +import com.wisemapping.model.Label; import com.wisemapping.model.Mindmap; import com.wisemapping.model.User; import com.wisemapping.rest.model.RestLogItem; import com.wisemapping.rest.model.RestUser; import com.wisemapping.security.Utils; +import com.wisemapping.service.LabelService; import com.wisemapping.service.MindmapService; import com.wisemapping.service.UserService; import org.apache.log4j.Logger; @@ -52,6 +54,10 @@ public class AccountController extends BaseController { @Autowired private MindmapService mindmapService; + @Qualifier("labelService") + @Autowired + private LabelService labelService; + @Autowired private NotificationService notificationService; @@ -113,15 +119,26 @@ public class AccountController extends BaseController { @RequestMapping(method = RequestMethod.DELETE, value = "account") @ResponseStatus(value = HttpStatus.NO_CONTENT) - public void deleteUser() throws WiseMappingException - - { + public void deleteUser() throws WiseMappingException { + // Delete collaborations ... final User user = Utils.getUser(true); final List collaborations = mindmapService.findCollaborations(user); for (Collaboration collaboration : collaborations) { final Mindmap mindmap = collaboration.getMindMap(); - mindmapService.removeMindmap(mindmap,user); + mindmapService.removeMindmap(mindmap, user); } + + // Delete labels .... + List