From 19ae88e93f824ce9f7866e186ee3ba67aab53e20 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Fri, 11 Feb 2022 23:56:53 -0800 Subject: [PATCH 05/31] Improve JS error loggin --- .../wisemapping/mail/NotificationService.java | 22 +++++++++---------- .../main/resources/mail/errorNotification.vm | 18 --------------- 2 files changed, 10 insertions(+), 30 deletions(-) delete mode 100644 wise-webapp/src/main/resources/mail/errorNotification.vm diff --git a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java index a735b1b6..30a1932d 100644 --- a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java +++ b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java @@ -37,6 +37,7 @@ import java.io.StringWriter; import java.io.UnsupportedEncodingException; import java.util.HashMap; import java.util.Map; +import java.util.stream.Collectors; final public class NotificationService { final private static Logger logger = Logger.getLogger(Mailer.class); @@ -65,7 +66,7 @@ final public class NotificationService { final String subject = "[WiseMapping] " + user.getFullName() + " has shared a mindmap with you"; // Fill template properties ... - final Map model = new HashMap(); + final Map model = new HashMap<>(); model.put("mindmap", mindmap); model.put("message", "message"); model.put("ownerName", user.getFirstname()); @@ -93,12 +94,6 @@ final public class NotificationService { sendTemplateMail(user, mailSubject, messageTitle, messageBody); } - private void logErrorMessage(final Map model, - @NotNull final String templateMail) { - final String messageBody = VelocityEngineUtils.mergeTemplateIntoString(velocityEngineWrapper.getVelocityEngine(), "/mail/" + templateMail, model); - logger.error("Unexpected editor error => " + messageBody); - } - public void passwordChanged(@NotNull User user) { final String mailSubject = "[WiseMapping] Your password has been changed"; @@ -120,7 +115,7 @@ final public class NotificationService { private void sendTemplateMail(@NotNull User user, @NotNull String mailSubject, @NotNull String messageTitle, @NotNull String messageBody) { try { - final Map model = new HashMap(); + final Map model = new HashMap<>(); model.put("firstName", user.getFirstname()); model.put("messageTitle", messageTitle); model.put("messageBody", messageBody); @@ -145,7 +140,7 @@ final public class NotificationService { public void activateAccount(@NotNull User user) { - final Map model = new HashMap(); + final Map model = new HashMap<>(); model.put("user", user); mailer.sendEmail(mailer.getServerSenderEmail(), user.getEmail(), "[WiseMapping] Active account", model, "activationAccountMail.vm"); } @@ -194,12 +189,15 @@ final public class NotificationService { model.put("method", request.getMethod()); model.put("remoteAddress", request.getRemoteAddr()); - logErrorMessage(model, - "errorNotification.vm"); + String errorAsString = model.keySet().stream() + .map(key -> key + "=" + model.get(key)) + .collect(Collectors.joining(", ", "{", "}")); + + logger.error("Unexpected editor error => " + errorAsString); } public void reportJavaException(@NotNull Throwable exception, @Nullable User user, @NotNull HttpServletRequest request) { - final Map model = new HashMap(); + final Map model = new HashMap<>(); model.put("errorMsg", stackTraceToString(exception)); logError(model, user, request); diff --git a/wise-webapp/src/main/resources/mail/errorNotification.vm b/wise-webapp/src/main/resources/mail/errorNotification.vm deleted file mode 100644 index baa62254..00000000 --- a/wise-webapp/src/main/resources/mail/errorNotification.vm +++ /dev/null @@ -1,18 +0,0 @@ -User Name: ${fullName} - -Email: ${email} - -Server: ${server} - -RequestURI: ${requestURI} - -Method: ${method} - -User Agent: ${userAgent} - -Remote Address: ${remoteAddress} - -#if($mapId) - Mindmap Id: ${mapId} - -#end -#if($mapTitle) - Mindmap Title: ${mapTitle} - -#end -${errorMsg} - -#if($mapXML) -${mapXML} -#end \ No newline at end of file From 0da8c73d740baa8648b870b5b471f1e13b7bc5e4 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Feb 2022 00:12:03 -0800 Subject: [PATCH 06/31] Clean up google analytics initialization --- wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp | 1 - wise-webapp/src/main/webapp/jsp/reactInclude.jsp | 2 -- 2 files changed, 3 deletions(-) diff --git a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp index 95a67fec..89cea8d6 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp @@ -46,7 +46,6 @@ var accountEmail = '${principal.email}'; var mapTitle = '${mindmap.title}'; - <%@ include file="/jsp/googleAnalytics.jsf" %> diff --git a/wise-webapp/src/main/webapp/jsp/reactInclude.jsp b/wise-webapp/src/main/webapp/jsp/reactInclude.jsp index 94c7789f..bce78910 100644 --- a/wise-webapp/src/main/webapp/jsp/reactInclude.jsp +++ b/wise-webapp/src/main/webapp/jsp/reactInclude.jsp @@ -23,8 +23,6 @@ }; - <%@ include file="/jsp/googleAnalytics.jsf" %> - From 607418dcf71d91d97dc11f3ead24bf46bc21c390 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Feb 2022 00:27:24 -0800 Subject: [PATCH 07/31] Add missing message resource. --- wise-webapp/src/main/resources/messages_de.properties | 4 +++- wise-webapp/src/main/resources/messages_en.properties | 4 +++- wise-webapp/src/main/resources/messages_es.properties | 5 ++++- wise-webapp/src/main/resources/messages_fr.properties | 4 +++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/wise-webapp/src/main/resources/messages_de.properties b/wise-webapp/src/main/resources/messages_de.properties index a28e1cb1..e45cf2f1 100644 --- a/wise-webapp/src/main/resources/messages_de.properties +++ b/wise-webapp/src/main/resources/messages_de.properties @@ -48,4 +48,6 @@ MINDMAP_IS_LOCKED = Mindmap ist für die Bearbeitung gesperrt. # Confirmed RESET_PASSWORD_INVALID_EMAIL = Die angegebene E-Mail-Adresse ist kein gültiges Benutzerkonto. Bitte versuchen Sie es erneut mit einer gültigen E-Mail-Adresse. TRY_WELCOME = Dieser Ausgabebereich zeigt einige der Mindmap-Editor-Funktionen \!. -UNEXPECTED_ERROR_DETAILS = Unerwarteter Fehler bei der Verarbeitung der Anforderung. \ No newline at end of file +UNEXPECTED_ERROR_DETAILS = Unerwarteter Fehler bei der Verarbeitung der Anforderung. +NO_ENOUGH_PERMISSIONS=Diese map ist nicht mehr verfügbar. +NO_ENOUGH_PERMISSIONS_DETAILS=Sie haben nicht die erforderlichen Rechte, um sich diese map anzusehen. Diese map ist entweder privat oder wurde gelöscht. diff --git a/wise-webapp/src/main/resources/messages_en.properties b/wise-webapp/src/main/resources/messages_en.properties index e433a59e..5c38e35c 100644 --- a/wise-webapp/src/main/resources/messages_en.properties +++ b/wise-webapp/src/main/resources/messages_en.properties @@ -48,4 +48,6 @@ MINDMAP_IS_LOCKED = Mindmap is locked for edition. # Confirmed RESET_PASSWORD_INVALID_EMAIL = The email provided is not a valid user account. Please, try again with a valid email. TRY_WELCOME = This edition space showcases some of the mindmap editor capabilities \!. -UNEXPECTED_ERROR_DETAILS = Unexpected error processing request. \ No newline at end of file +UNEXPECTED_ERROR_DETAILS = Unexpected error processing request. +NO_ENOUGH_PERMISSIONS=This mind map can opened. +NO_ENOUGH_PERMISSIONS_DETAILS=You do not have enough right access to see this map. This map has been changed to private or deleted. diff --git a/wise-webapp/src/main/resources/messages_es.properties b/wise-webapp/src/main/resources/messages_es.properties index df2ba5db..bc69547d 100644 --- a/wise-webapp/src/main/resources/messages_es.properties +++ b/wise-webapp/src/main/resources/messages_es.properties @@ -48,4 +48,7 @@ MINDMAP_IS_LOCKED = Mindmap está bloqueado para la edición. # Confirmed RESET_PASSWORD_INVALID_EMAIL = El correo electrónico proporcionado no es una cuenta de usuario válida. Por favor, intente nuevamente con un correo electrónico válido. TRY_WELCOME = ¡Este espacio de edición muestra algunas de las capacidades del editor de mapas mentales\!. -UNEXPECTED_ERROR_DETAILS = Error inesperado procesando tu pedido. \ No newline at end of file +UNEXPECTED_ERROR_DETAILS = Error inesperado procesando tu pedido. +NO_ENOUGH_PERMISSIONS=El mapa buscado no se encuentra disponible. +NO_ENOUGH_PERMISSIONS_DETAILS=No tiene suficiente permisos de acceso para ver este mapa. El mapa no es mas publico o ha sido borrado. + diff --git a/wise-webapp/src/main/resources/messages_fr.properties b/wise-webapp/src/main/resources/messages_fr.properties index 3eb317da..9882ffea 100644 --- a/wise-webapp/src/main/resources/messages_fr.properties +++ b/wise-webapp/src/main/resources/messages_fr.properties @@ -48,4 +48,6 @@ MINDMAP_IS_LOCKED = Mindmap est verrouillé pour l'édition. # Confirmed RESET_PASSWORD_INVALID_EMAIL = L'e-mail fourni n'est pas un compte d'utilisateur valide. Veuillez réessayer avec un e-mail valide. TRY_WELCOME = Cet espace d'édition présente certaines des fonctionnalités de l'éditeur de cartes mentales \!. -UNEXPECTED_ERROR_DETAILS = Erreur inattendue lors du traitement de la demande. \ No newline at end of file +UNEXPECTED_ERROR_DETAILS = Erreur inattendue lors du traitement de la demande. +NO_ENOUGH_PERMISSIONS=Cette carte n'est plus accessible. +NO_ENOUGH_PERMISSIONS_DETAILS=Vous n'avez pas les droits d'accès suffisants pour voir cette carte. Cette carte est devenue privée, ou a été détruite. From ea1349c5188e71ae05397c8ff845bd57152472ff Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Feb 2022 00:33:50 -0800 Subject: [PATCH 08/31] Clean up code. --- .../webmvc/PublicPagesController.java | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/webmvc/PublicPagesController.java b/wise-webapp/src/main/java/com/wisemapping/webmvc/PublicPagesController.java index 55e8048f..f65cb811 100644 --- a/wise-webapp/src/main/java/com/wisemapping/webmvc/PublicPagesController.java +++ b/wise-webapp/src/main/java/com/wisemapping/webmvc/PublicPagesController.java @@ -18,32 +18,14 @@ package com.wisemapping.webmvc; -import com.wisemapping.service.MindmapService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; @Controller public class PublicPagesController { - @Qualifier("mindmapService") - @Autowired - private MindmapService mindmapService; - - @RequestMapping(value = "keyboard") - public String newsPage() { - return "keyboard"; - } @RequestMapping(value = "home") public String home() { return "homepage"; } - - @RequestMapping(value = "iframeWrapper") - public ModelAndView showIframePage(@RequestParam(required = true) String url) { - return new ModelAndView("iframeWrapper", "url", url); - } } From 9af7247072c626ccfe8567273de2061a62efc451 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Feb 2022 07:52:16 -0800 Subject: [PATCH 09/31] Fix captcha error list --- .../wisemapping/service/RecaptchaService.java | 36 +++++-------------- .../com/wisemapping/validator/Messages.java | 2 ++ .../src/main/resources/messages_en.properties | 1 + 3 files changed, 11 insertions(+), 28 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/service/RecaptchaService.java b/wise-webapp/src/main/java/com/wisemapping/service/RecaptchaService.java index 041a5384..d50e35e0 100644 --- a/wise-webapp/src/main/java/com/wisemapping/service/RecaptchaService.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/RecaptchaService.java @@ -1,6 +1,7 @@ package com.wisemapping.service; import com.fasterxml.jackson.databind.ObjectMapper; +import com.wisemapping.validator.Messages; import org.apache.commons.lang.StringUtils; import org.apache.http.NameValuePair; import org.apache.http.client.fluent.Form; @@ -51,9 +52,14 @@ public class RecaptchaService { logger.warn("Response from recaptcha after parse: " + responseBody); final Boolean success = (Boolean) responseBody.get("success"); - if (success!=null && !success) { + if (success != null && !success) { final List errorCodes = (List) responseBody.get("error-codes"); - result = RecaptchaUtil.codeToDescription(errorCodes.get(0)); + if (errorCodes.get(0).equals("timeout-or-duplicate")) { + result = Messages.CAPTCHA_TIMEOUT_OUT_DUPLICATE; + } else { + result = Messages.CAPTCHA_LOADING_ERROR; + logger.error("Unexpected error during catch resolution:" + errorCodes); + } } } catch (IOException e) { logger.error(e.getMessage(), e); @@ -68,30 +74,4 @@ public class RecaptchaService { public void setRecaptchaSecret(String recaptchaSecret) { this.recaptchaSecret = recaptchaSecret; } -} - -class RecaptchaUtil { - - private static final Map - RECAPTCHA_ERROR_CODE = new HashMap<>(); - - static String codeToDescription(final String code) - { - return RECAPTCHA_ERROR_CODE.getOrDefault(code,"Unexpected error validating code. Please, refresh the page and try again."); - } - - static { - RECAPTCHA_ERROR_CODE.put("missing-input-secret", - "The secret parameter is missing"); - RECAPTCHA_ERROR_CODE.put("invalid-input-secret", - "The secret parameter is invalid or malformed"); - RECAPTCHA_ERROR_CODE.put("missing-input-response", - "The response parameter is missing"); - RECAPTCHA_ERROR_CODE.put("invalid-input-response", - "The response parameter is invalid or malformed"); - RECAPTCHA_ERROR_CODE.put("bad-request", - "The request is invalid or malformed"); - RECAPTCHA_ERROR_CODE.put("timeout-or-duplicate", - "Please, refresh the page and try again."); - } } \ No newline at end of file diff --git a/wise-webapp/src/main/java/com/wisemapping/validator/Messages.java b/wise-webapp/src/main/java/com/wisemapping/validator/Messages.java index 043eb172..36aee920 100644 --- a/wise-webapp/src/main/java/com/wisemapping/validator/Messages.java +++ b/wise-webapp/src/main/java/com/wisemapping/validator/Messages.java @@ -26,4 +26,6 @@ public interface Messages { String LABEL_TITLE_ALREADY_EXISTS = "LABEL_TITLE_ALREADY_EXISTS"; String PASSWORD_MISMATCH = "PASSWORD_MISMATCH"; String CAPTCHA_LOADING_ERROR = "CAPTCHA_LOADING_ERROR"; + + String CAPTCHA_TIMEOUT_OUT_DUPLICATE = "CAPTCHA_TIMEOUT_OUT_DUPLICATE"; } diff --git a/wise-webapp/src/main/resources/messages_en.properties b/wise-webapp/src/main/resources/messages_en.properties index 5c38e35c..01a8a88d 100644 --- a/wise-webapp/src/main/resources/messages_en.properties +++ b/wise-webapp/src/main/resources/messages_en.properties @@ -51,3 +51,4 @@ TRY_WELCOME = This edition space showcases some of the mindmap editor capabiliti UNEXPECTED_ERROR_DETAILS = Unexpected error processing request. NO_ENOUGH_PERMISSIONS=This mind map can opened. NO_ENOUGH_PERMISSIONS_DETAILS=You do not have enough right access to see this map. This map has been changed to private or deleted. +CAPTCHA_TIMEOUT_OUT_DUPLICATE="Please, refresh the page and try again." \ No newline at end of file From 6c808dfc2a91c48ceaedd7dad53641fc44bcbde5 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Feb 2022 08:04:16 -0800 Subject: [PATCH 10/31] Disable ; strict control --- .../src/main/webapp/WEB-INF/wisemapping-security.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml index 8db06e2d..25accb2f 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml @@ -8,6 +8,13 @@ http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd"> + + + + + + + From b67cd407a412bfb1e60f1113bd3c7549597e4be4 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Feb 2022 08:29:53 -0800 Subject: [PATCH 11/31] Improve captcha error processing. --- .../main/java/com/wisemapping/service/RecaptchaService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/service/RecaptchaService.java b/wise-webapp/src/main/java/com/wisemapping/service/RecaptchaService.java index d50e35e0..c97ebc85 100644 --- a/wise-webapp/src/main/java/com/wisemapping/service/RecaptchaService.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/RecaptchaService.java @@ -23,6 +23,8 @@ public class RecaptchaService { "https://www.google.com/recaptcha/api/siteverify"; private final static ObjectMapper objectMapper = new ObjectMapper(); + public static final String CATCH_ERROR_CODE_TIMEOUT_OR_DUPLICATE = "timeout-or-duplicate"; + public static final String CATCHA_ERROR_CODE_INPUT_RESPONSE = "invalid-input-response"; private String recaptchaSecret; @Nullable @@ -54,7 +56,8 @@ public class RecaptchaService { final Boolean success = (Boolean) responseBody.get("success"); if (success != null && !success) { final List errorCodes = (List) responseBody.get("error-codes"); - if (errorCodes.get(0).equals("timeout-or-duplicate")) { + String errorCode = errorCodes.get(0); + if (errorCode.equals(CATCH_ERROR_CODE_TIMEOUT_OR_DUPLICATE) || errorCodes.equals(CATCHA_ERROR_CODE_INPUT_RESPONSE)) { result = Messages.CAPTCHA_TIMEOUT_OUT_DUPLICATE; } else { result = Messages.CAPTCHA_LOADING_ERROR; From 609fdd71443414ba761551a380f7714db07df290 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Feb 2022 08:35:29 -0800 Subject: [PATCH 12/31] Split error message on browser error. --- .../java/com/wisemapping/mail/NotificationService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java index 30a1932d..124e17f5 100644 --- a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java +++ b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java @@ -167,8 +167,10 @@ final public class NotificationService { final Map model = new HashMap<>(); model.put("errorMsg", jsErrorMsg); + + String mindmapXML = ""; try { - model.put("mapXML", StringEscapeUtils.escapeXml(mindmap == null ? "map not found" : mindmap.getXmlStr())); + mindmapXML = StringEscapeUtils.escapeXml(mindmap == null ? "map not found" : mindmap.getXmlStr()); } catch (UnsupportedEncodingException e) { // Ignore ... } @@ -176,6 +178,7 @@ final public class NotificationService { model.put("mapTitle", mindmap.getTitle()); logError(model, user, request); + logger.error("Unexpected editor mindmap => " + mindmapXML); } private void logError(@NotNull Map model, @Nullable User user, @NotNull HttpServletRequest request) { @@ -193,7 +196,7 @@ final public class NotificationService { .map(key -> key + "=" + model.get(key)) .collect(Collectors.joining(", ", "{", "}")); - logger.error("Unexpected editor error => " + errorAsString); + logger.error("Unexpected editor info => " + errorAsString); } public void reportJavaException(@NotNull Throwable exception, @Nullable User user, @NotNull HttpServletRequest request) { From f35d145fb8284c5d54a4aa9cfd3dcb4e3d96d15f Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Feb 2022 09:15:18 -0800 Subject: [PATCH 13/31] Improve JS error loggin --- .../main/java/com/wisemapping/mail/NotificationService.java | 6 ++++-- .../main/java/com/wisemapping/rest/AccountController.java | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java index 124e17f5..33f4596b 100644 --- a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java +++ b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java @@ -22,6 +22,7 @@ import com.wisemapping.filter.SupportedUserAgent; import com.wisemapping.model.Collaboration; import com.wisemapping.model.Mindmap; import com.wisemapping.model.User; +import com.wisemapping.rest.model.RestLogItem; import com.wisemapping.util.VelocityEngineUtils; import com.wisemapping.util.VelocityEngineWrapper; import org.apache.commons.io.IOUtils; @@ -163,10 +164,11 @@ final public class NotificationService { this.velocityEngineWrapper = engine; } - public void reportJavascriptException(@Nullable Mindmap mindmap, @Nullable User user, @Nullable String jsErrorMsg, @NotNull HttpServletRequest request) { + public void reportJavascriptException(@Nullable Mindmap mindmap, @Nullable User user, @NotNull RestLogItem errorItem, @NotNull HttpServletRequest request) { final Map model = new HashMap<>(); - model.put("errorMsg", jsErrorMsg); + model.put("JS-MSG", errorItem.getJsErrorMsg()); + model.put("JS-STACK", errorItem.getJsStack()); String mindmapXML = ""; try { 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 e396ac18..630f274c 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java @@ -133,8 +133,8 @@ public class AccountController extends BaseController { public void logError(@RequestBody RestLogItem item, @NotNull HttpServletRequest request) { final Mindmap mindmap = mindmapService.findMindmapById(item.getMapId()); final User user = Utils.getUser(); - logger.error("Unexpected editor error - " + item.getJsErrorMsg()); - notificationService.reportJavascriptException(mindmap, user, item.getJsErrorMsg() + "\n" + item.getJsStack(), request); + + notificationService.reportJavascriptException(mindmap, user, item, request); } } From 83cff3f66d83fa3b3706ab22a8d6560e761b288f Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Feb 2022 09:17:52 -0800 Subject: [PATCH 14/31] Split error message --- .../com/wisemapping/mail/NotificationService.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java index 33f4596b..c9bcb7ae 100644 --- a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java +++ b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java @@ -166,9 +166,9 @@ final public class NotificationService { public void reportJavascriptException(@Nullable Mindmap mindmap, @Nullable User user, @NotNull RestLogItem errorItem, @NotNull HttpServletRequest request) { - final Map model = new HashMap<>(); - model.put("JS-MSG", errorItem.getJsErrorMsg()); - model.put("JS-STACK", errorItem.getJsStack()); + final Map summary = new HashMap<>(); + summary.put("JS-MSG", errorItem.getJsErrorMsg()); + summary.put("JS-STACK", errorItem.getJsStack()); String mindmapXML = ""; try { @@ -176,11 +176,12 @@ final public class NotificationService { } catch (UnsupportedEncodingException e) { // Ignore ... } - model.put("mapId", Integer.toString(mindmap.getId())); - model.put("mapTitle", mindmap.getTitle()); + summary.put("mapId", Integer.toString(mindmap.getId())); + summary.put("mapTitle", mindmap.getTitle()); - logError(model, user, request); + logError(summary, user, request); logger.error("Unexpected editor mindmap => " + mindmapXML); + logger.error("Unexpected editor JS Stack => " + errorItem.getJsErrorMsg() + "-" + errorItem.getJsStack()); } private void logError(@NotNull Map model, @Nullable User user, @NotNull HttpServletRequest request) { From ccc0b10ea023f4e2a4c02a50f32386768bf924a3 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Feb 2022 10:33:05 -0800 Subject: [PATCH 15/31] Improve captch erorr handling on invalid input --- .../main/java/com/wisemapping/service/RecaptchaService.java | 5 ++++- .../src/main/java/com/wisemapping/validator/Messages.java | 1 + wise-webapp/src/main/resources/messages_en.properties | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/service/RecaptchaService.java b/wise-webapp/src/main/java/com/wisemapping/service/RecaptchaService.java index c97ebc85..f5e1e6ce 100644 --- a/wise-webapp/src/main/java/com/wisemapping/service/RecaptchaService.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/RecaptchaService.java @@ -57,8 +57,11 @@ public class RecaptchaService { if (success != null && !success) { final List errorCodes = (List) responseBody.get("error-codes"); String errorCode = errorCodes.get(0); - if (errorCode.equals(CATCH_ERROR_CODE_TIMEOUT_OR_DUPLICATE) || errorCodes.equals(CATCHA_ERROR_CODE_INPUT_RESPONSE)) { + if (errorCode.equals(CATCH_ERROR_CODE_TIMEOUT_OR_DUPLICATE)) { result = Messages.CAPTCHA_TIMEOUT_OUT_DUPLICATE; + + } else if (errorCode.equals("invalid-input-response")) { + result = Messages.CAPTCHA_INVALID_INPUT_RESPONSE; } else { result = Messages.CAPTCHA_LOADING_ERROR; logger.error("Unexpected error during catch resolution:" + errorCodes); diff --git a/wise-webapp/src/main/java/com/wisemapping/validator/Messages.java b/wise-webapp/src/main/java/com/wisemapping/validator/Messages.java index 36aee920..ac28ad7e 100644 --- a/wise-webapp/src/main/java/com/wisemapping/validator/Messages.java +++ b/wise-webapp/src/main/java/com/wisemapping/validator/Messages.java @@ -28,4 +28,5 @@ public interface Messages { String CAPTCHA_LOADING_ERROR = "CAPTCHA_LOADING_ERROR"; String CAPTCHA_TIMEOUT_OUT_DUPLICATE = "CAPTCHA_TIMEOUT_OUT_DUPLICATE"; + String CAPTCHA_INVALID_INPUT_RESPONSE = "CAPTCHA_INVALID_INPUT_RESPONSE"; } diff --git a/wise-webapp/src/main/resources/messages_en.properties b/wise-webapp/src/main/resources/messages_en.properties index 01a8a88d..99bfe252 100644 --- a/wise-webapp/src/main/resources/messages_en.properties +++ b/wise-webapp/src/main/resources/messages_en.properties @@ -51,4 +51,5 @@ TRY_WELCOME = This edition space showcases some of the mindmap editor capabiliti UNEXPECTED_ERROR_DETAILS = Unexpected error processing request. NO_ENOUGH_PERMISSIONS=This mind map can opened. NO_ENOUGH_PERMISSIONS_DETAILS=You do not have enough right access to see this map. This map has been changed to private or deleted. -CAPTCHA_TIMEOUT_OUT_DUPLICATE="Please, refresh the page and try again." \ No newline at end of file +CAPTCHA_TIMEOUT_OUT_DUPLICATE=Please, refresh the page and try again. +CAPTCHA_INVALID_INPUT_RESPONSE="Invalid input response, refresh the page and try again. \ No newline at end of file From 89dd7e0193ecc5b8674208e1e50b1474e41e162b Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Feb 2022 12:34:30 -0800 Subject: [PATCH 16/31] Remove hackcode forze of lazy loading. --- .../com/wisemapping/model/Collaboration.java | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/model/Collaboration.java b/wise-webapp/src/main/java/com/wisemapping/model/Collaboration.java index 79a06344..42395542 100644 --- a/wise-webapp/src/main/java/com/wisemapping/model/Collaboration.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/Collaboration.java @@ -1,20 +1,20 @@ /* -* 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. -*/ + * 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.model; @@ -29,22 +29,24 @@ public class Collaboration implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) - private int id;; + private int id; + ; - @Column(name = "role_id",unique = true,nullable = true) + @Column(name = "role_id", unique = true) private CollaborationRole role; @ManyToOne - @JoinColumn(name="mindmap_id",nullable = false) + @JoinColumn(name = "mindmap_id", nullable = false) private Mindmap mindMap; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name="colaborator_id",nullable = false) + @JoinColumn(name = "colaborator_id", nullable = false) private Collaborator collaborator; @ManyToOne(cascade = CascadeType.ALL) - @JoinColumn(name="properties_id",nullable = false, unique = true) - private CollaborationProperties collaborationProperties = new CollaborationProperties();; + @JoinColumn(name = "properties_id", nullable = false, unique = true) + private CollaborationProperties collaborationProperties = new CollaborationProperties(); + ; public Collaboration() { } @@ -129,10 +131,9 @@ public class Collaboration implements Serializable { @Override public int hashCode() { - int result = (int) (id ^ (id >>> 32)); + int result = id ^ (id >>> 32); result = 31 * result + (role != null ? role.hashCode() : 0); result = 31 * result + (mindMap != null ? mindMap.hashCode() : 0); - result = 31 * result + (collaborator != null ? collaborator.hashCode() : 0); return result; } } From c269cd9edb84a3b35c9d9b0a34dbf1505623abe4 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Feb 2022 12:47:54 -0800 Subject: [PATCH 17/31] Remove support for admin to remove mindmaps --- .../main/java/com/wisemapping/service/MindmapServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java b/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java index 3dd0d9ad..09a0ac23 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java @@ -156,7 +156,7 @@ public class MindmapServiceImpl @Override public void removeMindmap(@NotNull Mindmap mindmap, @NotNull User user) throws WiseMappingException { - if (mindmap.getCreator().identityEquality(user) || isAdmin(user)) { + if (mindmap.getCreator().identityEquality(user)) { mindmapManager.removeMindmap(mindmap); } else { final Optional collaboration = mindmap.findCollaboration(user); From fb1755768c9a228b797d09ba47cccc1e2711b712 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 13 Feb 2022 08:25:09 -0800 Subject: [PATCH 18/31] Adjust log level --- wise-webapp/src/main/java/com/wisemapping/mail/Mailer.java | 4 ++-- .../main/java/com/wisemapping/mail/NotificationService.java | 2 +- .../src/main/java/com/wisemapping/rest/UserController.java | 2 +- .../main/java/com/wisemapping/service/RecaptchaService.java | 2 +- 4 files changed, 5 insertions(+), 5 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 6891642c..348da0ca 100644 --- a/wise-webapp/src/main/java/com/wisemapping/mail/Mailer.java +++ b/wise-webapp/src/main/java/com/wisemapping/mail/Mailer.java @@ -41,7 +41,7 @@ public final class Mailer { //~ Methods .............................................................................................. - public Mailer(@NotNull String siteEmail, @NotNull String supportEmail,@NotNull String errorReporterEmail) { + public Mailer(@NotNull String siteEmail, @NotNull String supportEmail, @NotNull String errorReporterEmail) { this.serverFromEmail = siteEmail; this.supportEmail = supportEmail; this.errorReporterEmail = errorReporterEmail; @@ -51,7 +51,7 @@ public final class Mailer { return serverFromEmail; } - public void sendEmail(final String from, final String to, final String subject, final Map model, + public void sendEmail(final String from, final String to, final String subject, final Map model, @NotNull final String templateMail) { final MimeMessagePreparator preparator = new MimeMessagePreparator() { diff --git a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java index c9bcb7ae..ea86ee65 100644 --- a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java +++ b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java @@ -141,7 +141,7 @@ final public class NotificationService { public void activateAccount(@NotNull User user) { - final Map model = new HashMap<>(); + final Map model = new HashMap<>(); model.put("user", user); mailer.sendEmail(mailer.getServerSenderEmail(), user.getEmail(), "[WiseMapping] Active account", model, "activationAccountMail.vm"); } 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 4332ce2e..3f69e152 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/UserController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/UserController.java @@ -58,7 +58,7 @@ public class UserController extends BaseController { @RequestMapping(method = RequestMethod.POST, value = "/users", produces = {"application/json", "application/xml"}) @ResponseStatus(value = HttpStatus.CREATED) public void registerUser(@RequestBody RestUserRegistration registration, @NotNull HttpServletRequest request, @NotNull HttpServletResponse response) throws WiseMappingException, BindException { - logger.info("Register new user:" + registration.getEmail()); + logger.debug("Register new user:" + registration.getEmail()); // If tomcat is behind a reverse proxy, ip needs to be found in other header. String remoteIp = request.getHeader(REAL_IP_ADDRESS_HEADER); diff --git a/wise-webapp/src/main/java/com/wisemapping/service/RecaptchaService.java b/wise-webapp/src/main/java/com/wisemapping/service/RecaptchaService.java index f5e1e6ce..91ba8406 100644 --- a/wise-webapp/src/main/java/com/wisemapping/service/RecaptchaService.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/RecaptchaService.java @@ -51,7 +51,7 @@ public class RecaptchaService { .asBytes(); final Map responseBody = objectMapper.readValue(body, HashMap.class); - logger.warn("Response from recaptcha after parse: " + responseBody); + logger.debug("Response from recaptcha after parse: " + responseBody); final Boolean success = (Boolean) responseBody.get("success"); if (success != null && !success) { From ff4c7d2949eb4e3abd5979d9200c2421c5656081 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 13 Feb 2022 10:21:56 -0800 Subject: [PATCH 19/31] Fix distribution --- wise-ui/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wise-ui/pom.xml b/wise-ui/pom.xml index b9fa0b63..380116bc 100644 --- a/wise-ui/pom.xml +++ b/wise-ui/pom.xml @@ -42,7 +42,7 @@ - + From 6f205e04ce85968a15ee2cf7434df6a720c4290c Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 13 Feb 2022 10:29:28 -0800 Subject: [PATCH 20/31] Add newrelic config --- distribution/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/Dockerfile b/distribution/Dockerfile index bac83127..db3f3267 100644 --- a/distribution/Dockerfile +++ b/distribution/Dockerfile @@ -10,7 +10,7 @@ ARG WEBAPP_TARGET_DIR="/usr/local/tomcat/webapps/ROOT" ARG DB_BASE_DIR="/var/lib/wisemapping" # Defautl ENV configurations ... -ENV JAVA_OPTS="-XX:+PrintFlagsFinal -XX:InitialRAMPercentage=30 -XX:MaxRAMPercentage=80" +ENV JAVA_OPTS="-XX:+PrintFlagsFinal -XX:InitialRAMPercentage=30 -XX:MaxRAMPercentage=80 -javaagent:/opt/newrelic/newrelic.jar" ENV database.base.url=${DB_BASE_DIR} # Copy wisemapping distribution ... From 188b280bf2068fa4fb559c285dd695c40e1d11a3 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 13 Feb 2022 21:35:26 -0800 Subject: [PATCH 21/31] Add ads.txt file. --- wise-webapp/src/main/webapp/ads.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 wise-webapp/src/main/webapp/ads.txt diff --git a/wise-webapp/src/main/webapp/ads.txt b/wise-webapp/src/main/webapp/ads.txt new file mode 100644 index 00000000..63aef506 --- /dev/null +++ b/wise-webapp/src/main/webapp/ads.txt @@ -0,0 +1 @@ +google.com, pub-4996113942657337, DIRECT, f08c47fec0942fa0 \ No newline at end of file From 5c0c18eba037d38c4e90155982dc3cd161977420 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 14 Feb 2022 19:59:36 -0800 Subject: [PATCH 22/31] Add email validation on collaborators. --- wise-webapp/pom.xml | 16 +++++----- .../wisemapping/rest/MindmapController.java | 30 +++++++++++++++++-- .../webapp/WEB-INF/wisemapping-servlet.xml | 6 ---- 3 files changed, 36 insertions(+), 16 deletions(-) diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index c64e66c9..4377a8b4 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -213,12 +213,6 @@ commons-dbcp2 2.9.0 - - commons-fileupload - commons-fileupload - 1.2.1 - runtime - org.hibernate hibernate-ehcache @@ -240,6 +234,12 @@ 1.2.17 compile + + + commons-validator + commons-validator + 1.7 + org.hsqldb @@ -250,7 +250,7 @@ com.fasterxml.jackson.core jackson-databind - 2.11.3 + 2.13.1 javax.servlet @@ -277,7 +277,7 @@ org.apache.httpcomponents fluent-hc - 4.5.5 + 4.5.13 junit 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 65e7a05e..dd918e93 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -27,6 +27,7 @@ import com.wisemapping.rest.model.*; import com.wisemapping.security.Utils; import com.wisemapping.service.*; import com.wisemapping.validator.MapInfoValidator; +import org.apache.commons.validator.routines.EmailValidator; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; @@ -296,7 +297,14 @@ public class MindmapController extends BaseController { // Compare one by one if some of the elements has been changed .... final Set collabsToRemove = new HashSet<>(mindMap.getCollaborations()); for (RestCollaboration restCollab : restCollabs.getCollaborations()) { - final Collaboration collaboration = mindMap.findCollaboration(restCollab.getEmail()); + final String email = restCollab.getEmail(); + + // Is a valid email address ? + if (!EmailValidator.getInstance().isValid(email)) { + throw new IllegalArgumentException(email + " is not valid email address"); + } + + final Collaboration collaboration = mindMap.findCollaboration(email); // Validate role format ... String roleStr = restCollab.getRole(); if (roleStr == null) { @@ -333,6 +341,17 @@ public class MindmapController extends BaseController { throw new IllegalArgumentException("No enough permissions"); } + // Is valid email address ? + final EmailValidator emailValidator = EmailValidator.getInstance(); + restCollabs + .getCollaborations() + .forEach(collab -> { + // Is a valid email address ? + if (!emailValidator.isValid(collab.getEmail())) { + throw new IllegalArgumentException(collab.getEmail() + " is not valid email address"); + } + }); + // Has any role changed ?. Just removed it. final Map mapsByEmail = mindMap .getCollaborations() @@ -432,6 +451,12 @@ public class MindmapController extends BaseController { public void deleteCollabByEmail(@PathVariable int id, @RequestParam(required = false) String email) throws IOException, WiseMappingException { logger.debug("Deleting permission for email:" + email); + // Is a valid email address ? + final EmailValidator emailValidator = EmailValidator.getInstance(); + if (!emailValidator.isValid(email)) { + throw new IllegalArgumentException(email + " is not valid email address"); + } + final Mindmap mindmap = findMindmapById(id); final User user = Utils.getUser(); @@ -495,6 +520,7 @@ public class MindmapController extends BaseController { mindmapService.removeMindmap(mindmap, user); } } + @RequestMapping(method = RequestMethod.POST, value = "/maps", consumes = {"application/xml", "application/json"}) @ResponseStatus(value = HttpStatus.CREATED) public void createMap(@RequestBody(required = false) String mapXml, @NotNull HttpServletResponse response, @RequestParam(required = false) String title, @RequestParam(required = false) String description) throws IOException, WiseMappingException { @@ -506,7 +532,7 @@ public class MindmapController extends BaseController { if (description != null && !description.isEmpty()) { mindmap.setDescription(description); - }else { + } else { mindmap.setDescription("description"); } diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml index 073c65bb..62da4794 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml @@ -64,12 +64,6 @@ class="org.springframework.web.servlet.i18n.SessionLocaleResolver"> - - - - - From 7d7373768f5a5ce9c453482d2737de00ea7325a5 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 14 Feb 2022 20:06:21 -0800 Subject: [PATCH 23/31] Update dependencies --- wise-webapp/pom.xml | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index 4377a8b4..7da5ddf8 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -11,26 +11,11 @@ ../pom.xml 5.0.4 - - - - maven2-repository.dev.java.net - Java.net Repository for Maven - http://download.java.net/maven/2/ - default - - - maven2-repository.jahia.org - Jahia Repository for Maven - http://maven.jahia.org/maven2/ - default - - - + 5.3.14 5.3.5.RELEASE - 5.6.3.Final + 5.6.5.Final 6.0.21.Final @@ -205,7 +190,7 @@ mysql mysql-connector-java - 8.0.27 + 8.0.28 runtime From d69373f563da976f591421648bf56e77829af7af Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 15 Feb 2022 19:38:12 -0800 Subject: [PATCH 24/31] Update GA JS --- wise-webapp/pom.xml | 2 +- .../src/main/webapp/jsp/googleAnalytics.jsf | 19 ++-- .../main/webapp/jsp/mindmapEditorToolbar.jsf | 95 ------------------- 3 files changed, 12 insertions(+), 104 deletions(-) delete mode 100644 wise-webapp/src/main/webapp/jsp/mindmapEditorToolbar.jsf diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index 7da5ddf8..334bf342 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -11,7 +11,7 @@ ../pom.xml 5.0.4 - + 5.3.14 5.3.5.RELEASE diff --git a/wise-webapp/src/main/webapp/jsp/googleAnalytics.jsf b/wise-webapp/src/main/webapp/jsp/googleAnalytics.jsf index 81230068..cc4cc0c0 100644 --- a/wise-webapp/src/main/webapp/jsp/googleAnalytics.jsf +++ b/wise-webapp/src/main/webapp/jsp/googleAnalytics.jsf @@ -1,13 +1,16 @@ <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - + + + diff --git a/wise-webapp/src/main/webapp/jsp/mindmapEditorToolbar.jsf b/wise-webapp/src/main/webapp/jsp/mindmapEditorToolbar.jsf deleted file mode 100644 index e2e4af0e..00000000 --- a/wise-webapp/src/main/webapp/jsp/mindmapEditorToolbar.jsf +++ /dev/null @@ -1,95 +0,0 @@ -<%--@elvariable id="mindmap" type="com.wisemapping.model.Mindmap"--%> - -
-
- -
- -
-
- -
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
- -
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
\ No newline at end of file From 5d7e7f8d301a5d61d9520f32965ae4a175cf6e0e Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 15 Feb 2022 20:36:17 -0800 Subject: [PATCH 25/31] Parametrize GA key --- wise-webapp/src/main/webapp/jsp/googleAnalytics.jsf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wise-webapp/src/main/webapp/jsp/googleAnalytics.jsf b/wise-webapp/src/main/webapp/jsp/googleAnalytics.jsf index cc4cc0c0..2161cee1 100644 --- a/wise-webapp/src/main/webapp/jsp/googleAnalytics.jsf +++ b/wise-webapp/src/main/webapp/jsp/googleAnalytics.jsf @@ -8,7 +8,7 @@ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); - ga('create', 'UA-2347723-1', 'auto'); + ga('create', '${requestScope['google.analytics.account']}', 'auto'); ga('send', 'pageview'); From 7fd227d56f253f4c8a9fbacbfd6ed1256e26fcc2 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 15 Feb 2022 21:00:35 -0800 Subject: [PATCH 26/31] Fix version to be downloaded --- wise-webapp/src/main/webapp/jsp/mindmapViewonly.jsp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wise-webapp/src/main/webapp/jsp/mindmapViewonly.jsp b/wise-webapp/src/main/webapp/jsp/mindmapViewonly.jsp index 214a9efd..4ab9866c 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapViewonly.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapViewonly.jsp @@ -52,8 +52,9 @@ +