From 805f5eed7fd2d1e79680163cb11790f747321ef4 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 9 Jan 2014 22:38:59 -0300 Subject: [PATCH 01/17] Bug WISE-16 fixed. Backed completed. --- .../wisemapping/rest/AccountController.java | 23 ++++++++++++++++++- .../com/wisemapping/rest/AdminController.java | 9 +++++++- .../wisemapping/service/UserServiceImpl.java | 13 ++++++++--- .../src/main/webapp/jsp/accountSettings.jsp | 23 +++++++++++++++++++ 4 files changed, 63 insertions(+), 5 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 8a5bd969..6084fafb 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java @@ -18,7 +18,9 @@ package com.wisemapping.rest; +import com.wisemapping.exceptions.WiseMappingException; import com.wisemapping.mail.NotificationService; +import com.wisemapping.model.Collaboration; import com.wisemapping.model.Mindmap; import com.wisemapping.model.User; import com.wisemapping.rest.model.RestLogItem; @@ -31,9 +33,13 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseStatus; import javax.servlet.http.HttpServletRequest; +import java.util.List; @Controller public class AccountController extends BaseController { @@ -100,6 +106,21 @@ public class AccountController extends BaseController { userService.updateUser(user); } + @RequestMapping(method = RequestMethod.DELETE, value = "account", consumes = {"text/plain"}) + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void deleleteUser() throws WiseMappingException + + { + 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); + } + userService.deleteUser(user); + } + + @RequestMapping(method = RequestMethod.POST, value = "logger/editor", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void logError(@RequestBody RestLogItem item, @NotNull HttpServletRequest request) { diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java index 8cbdd537..c6688255 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java @@ -117,11 +117,18 @@ public class AdminController extends BaseController { @RequestMapping(method = RequestMethod.DELETE, value = "admin/users/{id}", consumes = {"text/plain"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) - public void getUserByEmail(@PathVariable long id) throws WiseMappingException { + public void deleteUserByEmail(@PathVariable long id) throws WiseMappingException { final User user = userService.getUserBy(id); if (user == null) { throw new IllegalArgumentException("User '" + id + "' could not be found"); } + + final List collaborations = mindmapService.findCollaborations(user); + for (Collaboration collaboration : collaborations) { + final Mindmap mindmap = collaboration.getMindMap(); + mindmapService.removeMindmap(mindmap,user); + } + userService.deleteUser(user); } diff --git a/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java b/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java index 2842f6f8..6364d3a7 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java @@ -21,7 +21,11 @@ package com.wisemapping.service; import com.wisemapping.dao.UserManager; import com.wisemapping.exceptions.WiseMappingException; import com.wisemapping.mail.NotificationService; -import com.wisemapping.model.*; +import com.wisemapping.model.AccessAuditory; +import com.wisemapping.model.AuthenticationType; +import com.wisemapping.model.Collaborator; +import com.wisemapping.model.Mindmap; +import com.wisemapping.model.User; import org.apache.velocity.app.VelocityEngine; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -29,8 +33,11 @@ import org.springframework.context.MessageSource; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.ui.velocity.VelocityEngineUtils; -import java.io.IOException; -import java.util.*; +import java.util.Calendar; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.UUID; public class UserServiceImpl implements UserService { diff --git a/wise-webapp/src/main/webapp/jsp/accountSettings.jsp b/wise-webapp/src/main/webapp/jsp/accountSettings.jsp index 5c1bf789..268caa07 100755 --- a/wise-webapp/src/main/webapp/jsp/accountSettings.jsp +++ b/wise-webapp/src/main/webapp/jsp/accountSettings.jsp @@ -88,6 +88,18 @@ +
+
+
+
+
+ + + "/> +
+
+
@@ -95,6 +107,7 @@ $('#changePasswordMsg').hide(); $('#changeInfoMsg').hide(); $('#languageMsg').hide(); + $('#deleteAccountMsg').hide(); function postChange(url, postBody, msgContainerId, successMsg) { // Change success message ... @@ -144,4 +157,14 @@ postChange("c/restful/account/locale", locale, 'languageMsg', ""); event.preventDefault(); }); + + $('#deleteAccountForm').submit(function (event) { + + var locale = $('#deleteAccountForm option:selected').val(); + + postChange("c/restful/account/locale", locale, 'languageMsg', ""); + event.preventDefault(); + }); + + From 24417d4fd0e60b4ee97f0ae80303d2381fec64ec Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Mon, 20 Jan 2014 23:10:15 -0300 Subject: [PATCH 02/17] DELETE__ACCOUNT message property (en and es languages) --- wise-webapp/src/main/resources/messages_en.properties | 1 + wise-webapp/src/main/resources/messages_es.properties | 1 + 2 files changed, 2 insertions(+) diff --git a/wise-webapp/src/main/resources/messages_en.properties b/wise-webapp/src/main/resources/messages_en.properties index ea58bc52..034851d6 100644 --- a/wise-webapp/src/main/resources/messages_en.properties +++ b/wise-webapp/src/main/resources/messages_en.properties @@ -15,6 +15,7 @@ LOGOUT=Logout PASSWORD=Password NEW_PASSWORD=New password CONFIRM_NEW_PASSWORD=Confirm new password +DELETE__ACCOUNT=Delete account MY_WISEMAPS=My Wisemaps RETYPE_PASSWORD=Retype Password REGISTER=Register diff --git a/wise-webapp/src/main/resources/messages_es.properties b/wise-webapp/src/main/resources/messages_es.properties index 8a1f5c49..e054ac57 100644 --- a/wise-webapp/src/main/resources/messages_es.properties +++ b/wise-webapp/src/main/resources/messages_es.properties @@ -120,6 +120,7 @@ SAVING=Grabando ... PUBLIC_MAPS=Mapas Publicos MY_MAPS=Mis Mapas NEW_PASSWORD=Nueva Contraseña +DELETE__ACCOUNT=Eliminar cuenta LANGUAGE=Idioma SHARED_WITH_ME=Compartidos ACCEPT=Aceptar From f30106ab39bb51084bc1119d80d2d1727b4a9f76 Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Mon, 20 Jan 2014 23:10:57 -0300 Subject: [PATCH 03/17] delete account lash in account settings --- wise-webapp/src/main/webapp/jsp/accountSettings.jsp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wise-webapp/src/main/webapp/jsp/accountSettings.jsp b/wise-webapp/src/main/webapp/jsp/accountSettings.jsp index 268caa07..86083608 100755 --- a/wise-webapp/src/main/webapp/jsp/accountSettings.jsp +++ b/wise-webapp/src/main/webapp/jsp/accountSettings.jsp @@ -8,6 +8,7 @@
  • +
  • @@ -93,8 +94,7 @@
    - - + "/>
    @@ -162,7 +162,7 @@ var locale = $('#deleteAccountForm option:selected').val(); - postChange("c/restful/account/locale", locale, 'languageMsg', ""); + postChange("c/restful/account/locale", locale, 'deleteAccountMsg', ""); event.preventDefault(); }); From c3d2739293d4695045d5a19ac2da5db19608d730 Mon Sep 17 00:00:00 2001 From: ezequiel Date: Fri, 24 Jan 2014 00:20:13 -0300 Subject: [PATCH 04/17] more users.. --- config/database/hsql/atest-data.sql | 16 ++++++++++++++++ config/database/mysql/test-data.sql | 15 +++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/config/database/hsql/atest-data.sql b/config/database/hsql/atest-data.sql index 746ec7ae..d9982c8b 100644 --- a/config/database/hsql/atest-data.sql +++ b/config/database/hsql/atest-data.sql @@ -6,6 +6,22 @@ INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemappin INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) VALUES (2, 'Admin', 'User', 'admin', 1237, CURDATE(), 1,'D'); +INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (3, 'homer@wisemapping.org', CURDATE()); +INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) + VALUES (3, 'Homer', 'Simpson', 'homer', 1237, CURDATE(), 1, 'D'); + +INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (4, 'marge@wisemapping.org', CURDATE()); +INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) + VALUES (4, 'Marge', 'Bouvier', 'marge', 1237, CURDATE(), 1, 'D'); + +INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (5, 'bart@wisemapping.org', CURDATE()); +INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) + VALUES (5, 'Bart', 'Simpson', 'bart', 1237, CURDATE(), 1, 'D'); + +INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (6, 'lisa@wisemapping.org', CURDATE()); +INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) + VALUES (6, 'Lisa', 'Simpson', 'lisa', 1237, CURDATE(), 1, 'D'); + COMMIT; SHUTDOWN; \ No newline at end of file diff --git a/config/database/mysql/test-data.sql b/config/database/mysql/test-data.sql index 960fe536..b92d2554 100644 --- a/config/database/mysql/test-data.sql +++ b/config/database/mysql/test-data.sql @@ -6,5 +6,20 @@ INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemappin INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) VALUES (2, 'Admin', 'User', 'admin', 1237, CURRENT_DATE(), 1, 'D'); +INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (3, 'homer@wisemapping.org', CURRENT_DATE()); +INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) + VALUES (3, 'Homer', 'Simpson', 'homer', 1237, CURRENT_DATE(), 1, 'D'); + +INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (4, 'marge@wisemapping.org', CURRENT_DATE()); +INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) + VALUES (4, 'Marge', 'Bouvier', 'marge', 1237, CURRENT_DATE(), 1, 'D'); + +INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (5, 'bart@wisemapping.org', CURRENT_DATE()); +INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) + VALUES (5, 'Bart', 'Simpson', 'bart', 1237, CURRENT_DATE(), 1, 'D'); + +INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (6, 'lisa@wisemapping.org', CURRENT_DATE()); +INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) + VALUES (6, 'Lisa', 'Simpson', 'lisa', 1237, CURRENT_DATE(), 1, 'D'); COMMIT; From d1004f291989dd73706ad2a2f06d094d3034364b Mon Sep 17 00:00:00 2001 From: ezequiel Date: Fri, 24 Jan 2014 00:21:27 -0300 Subject: [PATCH 05/17] adding warning msg on delete user popup --- wise-webapp/src/main/resources/messages_en.properties | 1 + wise-webapp/src/main/webapp/jsp/accountSettings.jsp | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/wise-webapp/src/main/resources/messages_en.properties b/wise-webapp/src/main/resources/messages_en.properties index 034851d6..3f5935f0 100644 --- a/wise-webapp/src/main/resources/messages_en.properties +++ b/wise-webapp/src/main/resources/messages_en.properties @@ -32,6 +32,7 @@ YOUR_ROLE=Your Role FORGOT_PASSWORD=Forgot Password ? CHANGE_PASSWORD=Change Password CHANGE_LANGUAGE=Change Language +WARNING_DELETE_USER=Warning! This action cannot be undone. FAQ=Frequent Asked Questions SHORT_FAQ=FAQ LOGIN=Login diff --git a/wise-webapp/src/main/webapp/jsp/accountSettings.jsp b/wise-webapp/src/main/webapp/jsp/accountSettings.jsp index 86083608..7e08e920 100755 --- a/wise-webapp/src/main/webapp/jsp/accountSettings.jsp +++ b/wise-webapp/src/main/webapp/jsp/accountSettings.jsp @@ -90,8 +90,7 @@
    -
    -
    +
    @@ -107,7 +106,6 @@ $('#changePasswordMsg').hide(); $('#changeInfoMsg').hide(); $('#languageMsg').hide(); - $('#deleteAccountMsg').hide(); function postChange(url, postBody, msgContainerId, successMsg) { // Change success message ... From 31aab0bd486a3db15515bb5a6fac74e3bc515ccd Mon Sep 17 00:00:00 2001 From: ezequiel Date: Fri, 24 Jan 2014 00:21:43 -0300 Subject: [PATCH 06/17] api rest call --- .../com/wisemapping/dao/UserManagerImpl.java | 4 +--- .../src/main/webapp/jsp/accountSettings.jsp | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java b/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java index e43ff3ed..5bac8dc3 100644 --- a/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java @@ -110,9 +110,7 @@ public class UserManagerImpl } @Override - public void deleteUser(@NotNull User user) { - final Collaborator collaborator = this.getCollaboratorBy(user.getEmail()); - getHibernateTemplate().delete(collaborator); + public void deleteUser(@NotNull final User user) { getHibernateTemplate().delete(user); getHibernateTemplate().flush(); } diff --git a/wise-webapp/src/main/webapp/jsp/accountSettings.jsp b/wise-webapp/src/main/webapp/jsp/accountSettings.jsp index 7e08e920..7d826b0a 100755 --- a/wise-webapp/src/main/webapp/jsp/accountSettings.jsp +++ b/wise-webapp/src/main/webapp/jsp/accountSettings.jsp @@ -159,8 +159,21 @@ $('#deleteAccountForm').submit(function (event) { var locale = $('#deleteAccountForm option:selected').val(); - - postChange("c/restful/account/locale", locale, 'deleteAccountMsg', ""); +//FIXME: este metodo hay que unificarlo con postChange, con callbacks o eventos para los success and error y pasandole el type + jQuery.ajax("c/restful/account", { + async: false, + dataType: 'json', + data: locale, + type: 'DELETE', + contentType: "text/plain; charset=utf-8", + success: function (data, textStatus, jqXHR) { + window.location.href = "/c/logout" + }, + error: function (jqXHR, textStatus, errorThrown) { + $('#' + 'deleteAccountMsg').removeClass('alert-info').addClass('alert-error').show(); + $('#' + 'deleteAccountMsg').text(textStatus); + } + }); event.preventDefault(); }); From adfc6c08f2d854f2a68e90bcc1522b1ee3512863 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 25 Jan 2014 12:31:14 -0300 Subject: [PATCH 07/17] Improve delete message. Add unit test. --- .../java/com/wisemapping/dao/UserManager.java | 2 +- .../com/wisemapping/dao/UserManagerImpl.java | 3 +- .../wisemapping/rest/AccountController.java | 8 +- .../com/wisemapping/rest/AdminController.java | 3 +- .../java/com/wisemapping/security/Utils.java | 5 +- .../wisemapping/service/MindmapService.java | 2 - .../service/MindmapServiceImpl.java | 22 --- .../com/wisemapping/service/UserService.java | 2 +- .../wisemapping/service/UserServiceImpl.java | 6 +- .../src/main/resources/messages_en.properties | 4 +- .../test/rest/RestAccountITCase.java | 158 ++++++++++++++++++ 11 files changed, 173 insertions(+), 42 deletions(-) create mode 100644 wise-webapp/src/test/java/com/wisemapping/test/rest/RestAccountITCase.java diff --git a/wise-webapp/src/main/java/com/wisemapping/dao/UserManager.java b/wise-webapp/src/main/java/com/wisemapping/dao/UserManager.java index 6e169473..5efdbc51 100644 --- a/wise-webapp/src/main/java/com/wisemapping/dao/UserManager.java +++ b/wise-webapp/src/main/java/com/wisemapping/dao/UserManager.java @@ -45,6 +45,6 @@ public interface UserManager { public User createUser(User user, Collaborator col); - public void deleteUser(User user); + public void removeUser(@NotNull User user); } diff --git a/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java b/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java index 5bac8dc3..f093cc45 100644 --- a/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java @@ -110,9 +110,8 @@ public class UserManagerImpl } @Override - public void deleteUser(@NotNull final User user) { + public void removeUser(@NotNull final User user) { getHibernateTemplate().delete(user); - getHibernateTemplate().flush(); } public void auditLogin(@NotNull AccessAuditory accessAuditory) { 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 52413781..1262c45b 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java @@ -79,7 +79,7 @@ public class AccountController extends BaseController { throw new IllegalArgumentException("Firstname can not be null"); } - final User user = Utils.getUser(); + final User user = Utils.getUser(true); user.setFirstname(firstname); userService.updateUser(user); } @@ -91,7 +91,7 @@ public class AccountController extends BaseController { throw new IllegalArgumentException("lastname can not be null"); } - final User user = Utils.getUser(); + final User user = Utils.getUser(true); user.setLastname(lastname); userService.updateUser(user); } @@ -109,7 +109,7 @@ public class AccountController extends BaseController { userService.updateUser(user); } - @RequestMapping(method = RequestMethod.DELETE, value = "account", consumes = {"text/plain"}) + @RequestMapping(method = RequestMethod.DELETE, value = "account") @ResponseStatus(value = HttpStatus.NO_CONTENT) public void deleleteUser() throws WiseMappingException @@ -120,7 +120,7 @@ public class AccountController extends BaseController { final Mindmap mindmap = collaboration.getMindMap(); mindmapService.removeMindmap(mindmap,user); } - userService.deleteUser(user); + userService.removeUser(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 36f4620a..212d5a00 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java @@ -18,7 +18,6 @@ package com.wisemapping.rest; -import com.mangofactory.swagger.annotations.ApiModel; import com.wisemapping.exceptions.WiseMappingException; import com.wisemapping.model.AuthenticationType; import com.wisemapping.model.Collaboration; @@ -146,7 +145,7 @@ public class AdminController extends BaseController { mindmapService.removeMindmap(mindmap,user); } - userService.deleteUser(user); + userService.removeUser(user); } @ApiOperation("Note: Administration permissions required.") diff --git a/wise-webapp/src/main/java/com/wisemapping/security/Utils.java b/wise-webapp/src/main/java/com/wisemapping/security/Utils.java index d9327800..1c7f1225 100644 --- a/wise-webapp/src/main/java/com/wisemapping/security/Utils.java +++ b/wise-webapp/src/main/java/com/wisemapping/security/Utils.java @@ -21,12 +21,9 @@ package com.wisemapping.security; import com.wisemapping.model.User; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.springframework.security.authentication.AbstractAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; -import javax.servlet.http.HttpServletRequest; - final public class Utils { private Utils() { } @@ -37,7 +34,7 @@ final public class Utils { return getUser(false); } - @Nullable + @NotNull public static User getUser(boolean forceCheck) { User result = null; final Authentication auth = SecurityContextHolder.getContext().getAuthentication(); diff --git a/wise-webapp/src/main/java/com/wisemapping/service/MindmapService.java b/wise-webapp/src/main/java/com/wisemapping/service/MindmapService.java index a08b132d..dfa2da45 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/MindmapService.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/MindmapService.java @@ -46,8 +46,6 @@ public interface MindmapService { void removeCollaboration(@NotNull Mindmap mindmap, @NotNull Collaboration collaboration) throws CollaborationException; - void addTags(@NotNull Mindmap mindmap, String tags); - void removeMindmap(@NotNull final Mindmap mindmap, @NotNull final User user) throws WiseMappingException; List search(MindMapCriteria criteria); 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 2974474d..c7f7f4bd 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java @@ -231,28 +231,6 @@ public class MindmapServiceImpl return collaborator; } - @Override - public void addTags(@NotNull Mindmap mindmap, String tags) { - mindmap.setTags(tags); - mindmapManager.updateMindmap(mindmap, false); - if (tags != null && tags.length() > 0) { - final String tag[] = tags.split(TAG_SEPARATOR); - final User user = mindmap.getCreator(); - // Add new Tags to User - boolean updateUser = false; - for (String userTag : tag) { - if (!user.getTags().contains(userTag)) { - user.getTags().add(userTag); - updateUser = true; - } - } - if (updateUser) { - //update user - userService.updateUser(user); - } - } - } - @Override public List findMindmapHistory(int mindmapId) { diff --git a/wise-webapp/src/main/java/com/wisemapping/service/UserService.java b/wise-webapp/src/main/java/com/wisemapping/service/UserService.java index 9426d246..95451445 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/UserService.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/UserService.java @@ -38,7 +38,7 @@ public interface UserService { public void resetPassword(@NotNull String email) throws InvalidUserEmailException, InvalidAuthSchemaException; - public void deleteUser(@NotNull User user); + public void removeUser(@NotNull User user); public void auditLogin(@NotNull User user); diff --git a/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java b/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java index 6364d3a7..f9a314cb 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java @@ -102,8 +102,10 @@ public class UserServiceImpl } @Override - public void deleteUser(@NotNull User user) { - userManager.deleteUser(user); + public void removeUser(@NotNull User user) { + // Force object reload before removing.... + final User userBy = userManager.getUserBy(user.getEmail()); + userManager.removeUser(userBy); } @Override diff --git a/wise-webapp/src/main/resources/messages_en.properties b/wise-webapp/src/main/resources/messages_en.properties index 3f5935f0..2a47748f 100644 --- a/wise-webapp/src/main/resources/messages_en.properties +++ b/wise-webapp/src/main/resources/messages_en.properties @@ -15,7 +15,7 @@ LOGOUT=Logout PASSWORD=Password NEW_PASSWORD=New password CONFIRM_NEW_PASSWORD=Confirm new password -DELETE__ACCOUNT=Delete account +DELETE__ACCOUNT=Delete My Account MY_WISEMAPS=My Wisemaps RETYPE_PASSWORD=Retype Password REGISTER=Register @@ -32,7 +32,7 @@ YOUR_ROLE=Your Role FORGOT_PASSWORD=Forgot Password ? CHANGE_PASSWORD=Change Password CHANGE_LANGUAGE=Change Language -WARNING_DELETE_USER=Warning! This action cannot be undone. +WARNING_DELETE_USER=If you do not think you will use WiseMapping again and would like your account deleted, we can take care of this for you. Keep in mind that you will not be able retrieve any mindmap you have added.

    If you would still like your account deleted, click "Delete My Account". FAQ=Frequent Asked Questions SHORT_FAQ=FAQ LOGIN=Login diff --git a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestAccountITCase.java b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestAccountITCase.java new file mode 100644 index 00000000..53b3646f --- /dev/null +++ b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestAccountITCase.java @@ -0,0 +1,158 @@ +/* +* Copyright [2012] [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.test.rest; + + +import com.wisemapping.rest.model.RestUser; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.http.client.SimpleClientHttpRequestFactory; +import org.springframework.security.crypto.codec.Base64; +import org.springframework.web.client.RestTemplate; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; + +import static org.testng.Assert.assertEquals; + + +@Test +public class RestAccountITCase { + + @NonNls + private static final String HOST_PORT = "http://localhost:8080"; + private static final String BASE_REST_URL = HOST_PORT + "/service"; + private static final String ADMIN_CREDENTIALS = "admin@wisemapping.org" + ":" + "admin"; + + + @Test(dataProvider = "ContentType-Provider-Function") + public void deleteUser(final @NotNull MediaType mediaType) { // Configure media types ... + final HttpHeaders requestHeaders = createHeaders(mediaType); + final RestTemplate adminTemplate = createTemplate(ADMIN_CREDENTIALS); + + final RestUser dummyUser = createDummyUser(); + createUser(requestHeaders, adminTemplate, dummyUser); + + // Delete user ... + final RestTemplate dummyTemplate = createTemplate(dummyUser.getEmail() + ":fooPassword"); + dummyTemplate.delete(BASE_REST_URL + "/account"); + + // Is the user there ? + // Check that the user has been created ... +// try { +// findUser(requestHeaders, adminTemplate, location); +// fail("User could not be deleted !"); +// } catch (Exception e) { +// } + } + + public String createNewUser(final @NotNull MediaType mediaType) { + + // Configure media types ... + final HttpHeaders requestHeaders = createHeaders(mediaType); + final RestTemplate templateRest = createTemplate(ADMIN_CREDENTIALS); + + // Fill user data ... + final RestUser restUser = createDummyUser(); + + // Create a new user ... + final URI location = createUser(requestHeaders, templateRest, restUser); + + // Check that the user has been created ... + ResponseEntity result = findUser(requestHeaders, templateRest, location); + assertEquals(result.getBody().getEmail(), restUser.getEmail(), "Returned object object seems not be the same."); + + // Find by email and check ... + result = findUserByEmail(requestHeaders, templateRest, restUser.getEmail()); + assertEquals(result.getBody().getEmail(), restUser.getEmail(), "Returned object object seems not be the same."); + + return restUser.getEmail(); + } + + + private ResponseEntity findUser(HttpHeaders requestHeaders, RestTemplate templateRest, URI location) { + HttpEntity findUserEntity = new HttpEntity(requestHeaders); + final String url = HOST_PORT + location; + return templateRest.exchange(url, HttpMethod.GET, findUserEntity, RestUser.class); + } + + private ResponseEntity findUserByEmail(HttpHeaders requestHeaders, RestTemplate templateRest, final String email) { + HttpEntity findUserEntity = new HttpEntity(requestHeaders); + + // Add extension only to avoid the fact that the last part is extracted ... + final String url = BASE_REST_URL + "/admin/users/email/{email}.json"; + return templateRest.exchange(url, HttpMethod.GET, findUserEntity, RestUser.class, email); + } + + private URI createUser(HttpHeaders requestHeaders, RestTemplate templateRest, RestUser restUser) { + HttpEntity createUserEntity = new HttpEntity(restUser, requestHeaders); + return templateRest.postForLocation(BASE_REST_URL + "/admin/users", createUserEntity); + } + + private HttpHeaders createHeaders(@NotNull MediaType mediaType) { + List acceptableMediaTypes = new ArrayList(); + acceptableMediaTypes.add(mediaType); + + final HttpHeaders result = new HttpHeaders(); + result.setAccept(acceptableMediaTypes); + result.setContentType(mediaType); + return result; + } + + private RestTemplate createTemplate(@NotNull final String authorisation) { + SimpleClientHttpRequestFactory s = new SimpleClientHttpRequestFactory() { + @Override + protected void prepareConnection(HttpURLConnection connection, String httpMethod) throws IOException { + super.prepareConnection(connection, httpMethod); + + byte[] encodedAuthorisation = Base64.encode(authorisation.getBytes()); + connection.setRequestProperty("Authorization", "Basic " + new String(encodedAuthorisation)); + } + + }; + return new RestTemplate(s); + } + + private RestUser createDummyUser() { + final RestUser restUser = new RestUser(); + final String username = "foo-to-delete" + System.nanoTime(); + final String email = username + "@example.org"; + restUser.setEmail(email); + restUser.setFirstname("foo first name"); + restUser.setLastname("foo last name"); + restUser.setPassword("fooPassword"); + return restUser; + } + + + @DataProvider(name = "ContentType-Provider-Function") + public Object[][] contentTypes() { + return new Object[][]{{MediaType.APPLICATION_XML}, {MediaType.APPLICATION_JSON}}; + } +} From 9a9dabc0abcd39faab833e4ee7ca08094a86ec2e Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Sat, 25 Jan 2014 19:50:46 -0300 Subject: [PATCH 08/17] fix typo --- .../src/main/java/com/wisemapping/rest/AccountController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 1262c45b..e20a9c0e 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java @@ -111,7 +111,7 @@ public class AccountController extends BaseController { @RequestMapping(method = RequestMethod.DELETE, value = "account") @ResponseStatus(value = HttpStatus.NO_CONTENT) - public void deleleteUser() throws WiseMappingException + public void deleteUser() throws WiseMappingException { final User user = Utils.getUser(true); From 43d5779d5f66714a55ef2f3ddc50485f177ed510 Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Wed, 29 Jan 2014 22:15:26 -0300 Subject: [PATCH 09/17] deleting user id field and adding collaborator foreing key from access --- config/database/hsql/create-schemas.sql | 8 +++++--- config/database/mysql/create-schemas.sql | 8 +++++--- config/database/mysql/v3.0-to-v3.2.sql | 7 +++++++ config/database/postgres/create-schemas.sql | 6 +++--- 4 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 config/database/mysql/v3.0-to-v3.2.sql diff --git a/config/database/hsql/create-schemas.sql b/config/database/hsql/create-schemas.sql index 69bf4c0e..8a4297b3 100644 --- a/config/database/hsql/create-schemas.sql +++ b/config/database/hsql/create-schemas.sql @@ -4,8 +4,7 @@ CREATE TABLE COLLABORATOR ( creation_date DATE); CREATE TABLE USER ( - id INTEGER NOT NULL IDENTITY, - colaborator_id INTEGER NOT NULL, + colaborator_id INTEGER NOT NULL IDENTITY, authentication_type CHAR(1) NOT NULL, authenticator_uri VARCHAR(255) NULL, firstname VARCHAR(255) NOT NULL, @@ -68,7 +67,10 @@ CREATE TABLE TAG CREATE TABLE ACCESS_AUDITORY ( id INTEGER NOT NULL IDENTITY, user_id INTEGER NOT NULL, - login_date DATE + login_date DATE, + FOREIGN KEY (user_id) REFERENCES USER (colaborator_id) + ON DELETE CASCADE + ON UPDATE NO ACTION ); COMMIT; diff --git a/config/database/mysql/create-schemas.sql b/config/database/mysql/create-schemas.sql index c9164ad0..8831d086 100644 --- a/config/database/mysql/create-schemas.sql +++ b/config/database/mysql/create-schemas.sql @@ -13,8 +13,7 @@ CREATE TABLE COLLABORATOR ( CHARACTER SET utf8; CREATE TABLE USER ( - id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, - colaborator_id INTEGER NOT NULL, + colaborator_id INTEGER NOT NULL PRIMARY KEY, authentication_type CHAR(1) CHARACTER SET utf8 NOT NULL, authenticator_uri VARCHAR(255) @@ -103,7 +102,10 @@ CREATE TABLE TAG ( CREATE TABLE ACCESS_AUDITORY ( id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, login_date DATE, - user_id INTEGER NOT NULL + user_id INTEGER NOT NULL, + FOREIGN KEY (user_id) REFERENCES USER (colaborator_id) + ON DELETE CASCADE + ON UPDATE NO ACTION ) CHARACTER SET utf8; diff --git a/config/database/mysql/v3.0-to-v3.2.sql b/config/database/mysql/v3.0-to-v3.2.sql new file mode 100644 index 00000000..c3570244 --- /dev/null +++ b/config/database/mysql/v3.0-to-v3.2.sql @@ -0,0 +1,7 @@ +ALTER TABLE `USER` DROP COLUMN `id`; + +ALTER TABLE `ACCESS_AUDITORY` + ADD CONSTRAINT + FOREIGN KEY (user_id) REFERENCES USER (colaborator_id) + ON DELETE CASCADE + ON UPDATE NO ACTION; \ No newline at end of file diff --git a/config/database/postgres/create-schemas.sql b/config/database/postgres/create-schemas.sql index 723cc2dd..544f11f3 100644 --- a/config/database/postgres/create-schemas.sql +++ b/config/database/postgres/create-schemas.sql @@ -5,10 +5,9 @@ CREATE TABLE COLLABORATOR ( ); CREATE TABLE "user" ( - id SERIAL NOT NULL PRIMARY KEY, authentication_type TEXT NOT NULL, authenticator_uri VARCHAR(255), - colaborator_id INTEGER NOT NULL, + colaborator_id INTEGER NOT NULL PRIMARY KEY, firstname VARCHAR(255) NOT NULL, lastname VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, @@ -73,7 +72,8 @@ CREATE TABLE TAG ( CREATE TABLE ACCESS_AUDITORY ( id SERIAL NOT NULL PRIMARY KEY, login_date DATE, - user_id INTEGER NOT NULL + user_id INTEGER NOT NULL, + FOREIGN KEY (user_id) REFERENCES "user" (colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION ); From f0e056c298a9ca2d393101e5f6e712b0be5255ac Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Wed, 29 Jan 2014 22:15:45 -0300 Subject: [PATCH 10/17] changing jetty version --- wise-webapp/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index fba5bf53..0987bd0c 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -555,9 +555,9 @@ - org.eclipse.jetty + org.mortbay.jetty jetty-maven-plugin - 9.1.0.v20131115 + 8.1.14.v20131031 foo 9999 From 26138188ea4b71b5630f8e6c223639214d78cfec Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Wed, 29 Jan 2014 22:17:25 -0300 Subject: [PATCH 11/17] callback functions and type added to postChange function --- .../src/main/webapp/jsp/accountSettings.jsp | 104 ++++++++++++------ 1 file changed, 72 insertions(+), 32 deletions(-) diff --git a/wise-webapp/src/main/webapp/jsp/accountSettings.jsp b/wise-webapp/src/main/webapp/jsp/accountSettings.jsp index 7d826b0a..ca8e5620 100755 --- a/wise-webapp/src/main/webapp/jsp/accountSettings.jsp +++ b/wise-webapp/src/main/webapp/jsp/accountSettings.jsp @@ -107,75 +107,115 @@ $('#changeInfoMsg').hide(); $('#languageMsg').hide(); - function postChange(url, postBody, msgContainerId, successMsg) { + function postChange(url, postBody, onSuccess, onError, type) { // Change success message ... jQuery.ajax(url, { async: false, dataType: 'json', data: postBody, - type: 'PUT', + type: type ? type : 'PUT', contentType: "text/plain; charset=utf-8", success: function (data, textStatus, jqXHR) { - $('#' + msgContainerId).removeClass('alert-error').addClass('alert-info').show(); - $('#' + msgContainerId).text(successMsg); + onSuccess() }, error: function (jqXHR, textStatus, errorThrown) { - $('#' + msgContainerId).removeClass('alert-info').addClass('alert-error').show(); - $('#' + msgContainerId).text(textStatus); + onError(textStatus) } }); } $('#changePasswordForm').submit(function (event) { - var inputVal = $('#changePasswordForm #password').val(); var rinputVal = $('#changePasswordForm #repassword').val(); + var changePasswordMsg = $('#changePasswordMsg'); if (inputVal != rinputVal) { // Password mismatch message ... - $('#changePasswordMsg').removeClass('alert-info').addClass('alert-error').show(); - $('#changePasswordMsg').text(''); + changePasswordMsg.removeClass('alert-info').addClass('alert-error').show(); + changePasswordMsg.text(''); } else { - postChange("c/restful/account/password", inputVal, 'changePasswordMsg', ""); + postChange( + "c/restful/account/password", + inputVal, + function() { + changePasswordMsg.removeClass('alert-error').addClass('alert-info').show(); + changePasswordMsg.text(''); + }, + function(textStatus) { + changePasswordMsg.removeClass('alert-info').addClass('alert-error').show(); + changePasswordMsg.text(textStatus); + } + ); } event.preventDefault(); }); $('#changeUserForm').submit(function (event) { - - var fistname = $('#changeUserForm #firstname').val(); + var firstname = $('#changeUserForm #firstname').val(); var lastname = $('#changeUserForm #lastname').val(); - postChange("c/restful/account/firstname", fistname, 'changeInfoMsg', ""); - postChange("c/restful/account/lastname", lastname, 'changeInfoMsg', ""); + var changeInfoMsg = $('#changeInfoMsg'); + postChange( + "c/restful/account/firstname", + firstname, + function() { + var changeInfoMsg = $('#changeInfoMsg'); + changeInfoMsg.removeClass('alert-error').addClass('alert-info').show(); + changeInfoMsg.text(''); + }, + function(textStatus) { + changeInfoMsg.removeClass('alert-info').addClass('alert-error').show(); + changeInfoMsg.text(textStatus); + } + ); + postChange( + "c/restful/account/lastname", + lastname, + function() { + changeInfoMsg.removeClass('alert-error').addClass('alert-info').show(); + changeInfoMsg.text(''); + }, + function(textStatus) { + changeInfoMsg.removeClass('alert-info').addClass('alert-error').show(); + changeInfoMsg.text(textStatus); + } + ); event.preventDefault(); }); $('#languageForm').submit(function (event) { var locale = $('#languageForm option:selected').val(); - postChange("c/restful/account/locale", locale, 'languageMsg', ""); + var languageMsg = $('#languageMsg'); + postChange( + "c/restful/account/locale", + locale, + function() { + languageMsg.removeClass('alert-error').addClass('alert-info').show(); + languageMsg.text(''); + }, + function(textStatus) { + languageMsg.removeClass('alert-info').addClass('alert-error').show(); + languageMsg.text(textStatus); + } + ); event.preventDefault(); }); $('#deleteAccountForm').submit(function (event) { - var locale = $('#deleteAccountForm option:selected').val(); -//FIXME: este metodo hay que unificarlo con postChange, con callbacks o eventos para los success and error y pasandole el type - jQuery.ajax("c/restful/account", { - async: false, - dataType: 'json', - data: locale, - type: 'DELETE', - contentType: "text/plain; charset=utf-8", - success: function (data, textStatus, jqXHR) { - window.location.href = "/c/logout" - }, - error: function (jqXHR, textStatus, errorThrown) { - $('#' + 'deleteAccountMsg').removeClass('alert-info').addClass('alert-error').show(); - $('#' + 'deleteAccountMsg').text(textStatus); - } - }); + postChange( + "c/restful/account", + locale, + function() { + window.location.href = "/c/logout" + }, + function(textStatus) { + var deleteAccountMsg = $('#deleteAccountMsg'); + deleteAccountMsg.removeClass('alert-info').addClass('alert-error').show(); + deleteAccountMsg.text(textStatus); + }, + 'DELETE' + ) event.preventDefault(); }); - From 136dc1154b43760c6939795cd2d7882cb1abc26f Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Thu, 30 Jan 2014 00:03:06 -0300 Subject: [PATCH 12/17] Revert "changing jetty version" This reverts commit 558aa31516bd1383cf011cd3f859436492c6102f. --- wise-webapp/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index 0987bd0c..fba5bf53 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -555,9 +555,9 @@ - org.mortbay.jetty + org.eclipse.jetty jetty-maven-plugin - 8.1.14.v20131031 + 9.1.0.v20131115 foo 9999 From 10fb98cdaa52e2c3efb6bfc9ea84e18a2d7d5df9 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 1 Feb 2014 19:47:33 -0300 Subject: [PATCH 13/17] Change the unexpecter error message. --- wise-webapp/src/main/resources/messages_ca.properties | 1 - wise-webapp/src/main/resources/messages_de.properties | 1 - 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 | 1 - wise-webapp/src/main/resources/messages_it.properties | 1 - wise-webapp/src/main/resources/messages_pt_BR.properties | 1 - wise-webapp/src/main/resources/messages_zh_CN.properties | 1 - wise-webapp/src/main/resources/messages_zh_TW.properties | 1 - 9 files changed, 2 insertions(+), 9 deletions(-) diff --git a/wise-webapp/src/main/resources/messages_ca.properties b/wise-webapp/src/main/resources/messages_ca.properties index bdba622f..e8244e85 100644 --- a/wise-webapp/src/main/resources/messages_ca.properties +++ b/wise-webapp/src/main/resources/messages_ca.properties @@ -108,7 +108,6 @@ YOUR_ROLE=El teu rol CHANGE_PASSWORD_SUCCESS=Contrasenya canviada amb èxit CONFIRM_NEW_PASSWORD=Confirmar Contrasenya COPYRIGHT=Impulsat per WiseMapping -UNEXPECTED_ERROR_SERVER_ERROR=Ho sentim, s'ha produït un error i no és possible processar la seva comanda. Torni-ho a intentar i si el problema continua, contacti amb nosaltres a support@wisemapping.com SHARE=Compartir SEND_ME_A_NEW_PASSWORD=Enviar nova Contrasenya ALL_MAPS=Tots diff --git a/wise-webapp/src/main/resources/messages_de.properties b/wise-webapp/src/main/resources/messages_de.properties index 6c5a26df..ab854356 100644 --- a/wise-webapp/src/main/resources/messages_de.properties +++ b/wise-webapp/src/main/resources/messages_de.properties @@ -97,7 +97,6 @@ HISTORY=Historie SHARE=Veröffentlichen UNEXPECTED_ERROR=Outch!!. Ein unerwarteter Fehler ist aufgetreten. UNEXPECTED_ERROR_DETAILS=Es tut uns Leid! Es ist ein Fehler aufgetreten der es uns nicht ermöglicht Ihre Anfrage zu bearbeiten. Bitte versuchen Sie es noch einmal oder gehen Sie zur Anfangsseite. -UNEXPECTED_ERROR_SERVER_ERROR=Es tut uns Leid! Es ist ein Fehler aufgetreten der es uns nicht ermöglicht Ihre Anfrage zu bearbeiten. Aktualisieren Sie diese Seite und versuchen es erneut. Falls der Fehler wieder auftritt, kontaktieren Sie bitte support@wisemapping.com NO_ENOUGH_PERMISSIONS=Outch!!. 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. IMPORT_MINDMAP_INFO=Sie können FreeMind 0.9 und WiseMapping maps in Ihre List von maps importieren. Wählen Sie die Datei zum Import. diff --git a/wise-webapp/src/main/resources/messages_en.properties b/wise-webapp/src/main/resources/messages_en.properties index 749fd5d1..bb095aae 100644 --- a/wise-webapp/src/main/resources/messages_en.properties +++ b/wise-webapp/src/main/resources/messages_en.properties @@ -97,7 +97,7 @@ HISTORY=History SHARE=Share UNEXPECTED_ERROR=Outch!!. An unexpected error has occurred. UNEXPECTED_ERROR_DETAILS=We're sorry, an error has occurred and we can't process your request. Please try again, or go to the home page. -UNEXPECTED_ERROR_SERVER_ERROR=We're sorry, an error has occurred and we can't process your request. Refresh the page and try again. If the problem persist, contactenos a support@wisemapping.com +UNEXPECTED_ERROR_SERVER_ERROR=We're sorry, an error has occurred and we can't process your request. Refresh the page and try again. If the problem persist, click below on "Raise a Issue" to report a ticket. NO_ENOUGH_PERMISSIONS=Outch!!. This map is not available anymore. NO_ENOUGH_PERMISSIONS_DETAILS=You do not have enough right access to see this map. This map has been changed to private or deleted. IMPORT_MINDMAP_INFO=You can import FreeMind 0.9 and WiseMapping maps to your list of maps. Select the file you want to import. diff --git a/wise-webapp/src/main/resources/messages_es.properties b/wise-webapp/src/main/resources/messages_es.properties index 9ac487bb..7fa9be95 100644 --- a/wise-webapp/src/main/resources/messages_es.properties +++ b/wise-webapp/src/main/resources/messages_es.properties @@ -108,7 +108,7 @@ YOUR_ROLE=Tu Role CHANGE_PASSWORD_SUCCESS=Contraseña cambiada exitosamente CONFIRM_NEW_PASSWORD=Confirmar Contraseña COPYRIGHT=Impulsado por WiseMapping -UNEXPECTED_ERROR_SERVER_ERROR=Lo sentimos, un error ha ocurrido y no es posible procesar su pedido. Recargue la página y intentelo nuevamente. Si el problema persiste, contactenos a support@wisemapping.com +UNEXPECTED_ERROR_SERVER_ERROR=Lo sentimos, un error ha ocurrido y no es posible procesar su pedido. Recargue la página y intentelo nuevamente. Si el problema persiste, hace un click en "Reportar un Problema" para abrir un ticket. SHARE=Compartir SEND_ME_A_NEW_PASSWORD=Enviar Nueva Contraseña ALL_MAPS=Todos diff --git a/wise-webapp/src/main/resources/messages_fr.properties b/wise-webapp/src/main/resources/messages_fr.properties index da8758d7..37499b38 100644 --- a/wise-webapp/src/main/resources/messages_fr.properties +++ b/wise-webapp/src/main/resources/messages_fr.properties @@ -102,7 +102,6 @@ HISTORY=Historique SHARE=Partager UNEXPECTED_ERROR=Aïe!!. Une erreur inattendue est survenue. UNEXPECTED_ERROR_DETAILS=Désolé, une erreur s'est produite et nous ne pouvons pas exécuter votre demande. Essayez à nouveau, ou retournez à la page d'accueil. -UNEXPECTED_ERROR_SERVER_ERROR=Désolé, une erreur s'est produite et nous ne pouvons pas exécuter votre demande. Rafraîchissez la page et essayez à nouveau. Si le problème persiste, contactez-nous à support@wisemapping.com NO_ENOUGH_PERMISSIONS=Aïe!!. 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. IMPORT_MINDMAP_INFO=Vous pouvez importer des cartes FreeMind 0.9 et WiseMapping dans votre liste de cartes. Choisissez le fichier à importer. diff --git a/wise-webapp/src/main/resources/messages_it.properties b/wise-webapp/src/main/resources/messages_it.properties index 9720aec2..f1886328 100644 --- a/wise-webapp/src/main/resources/messages_it.properties +++ b/wise-webapp/src/main/resources/messages_it.properties @@ -97,7 +97,6 @@ HISTORY=Cronologia SHARE=Condividi UNEXPECTED_ERROR=Oops!! Si è verificato un errore inaspettato. UNEXPECTED_ERROR_DETAILS=Siamo spiacenti, si è verificato un errore e non possiamo procedere nella tua richiesta. Prego, provare più tardi o torna alla home page. -UNEXPECTED_ERROR_SERVER_ERROR=Siamo spiacenti, si è verificato un errore e non possiamo procedere alla sua richiesta. Aggiornare la pagina e provare di nuovo. Se il problema persiste, contattare support@wisemapping.com NO_ENOUGH_PERMISSIONS=Oops!!. Questa mappa non è più disponibile. NO_ENOUGH_PERMISSIONS_DETAILS=Non hai sufficienti diritti per visualizzare questa mappa. Il suo stato è cambiato in Privato oppure è stata eliminata. IMPORT_MINDMAP_INFO=Puoi importare mappe da FreeMind 0.9 e da WiseMapping sulla tua lista di mappe. Seleziona il file da importare. diff --git a/wise-webapp/src/main/resources/messages_pt_BR.properties b/wise-webapp/src/main/resources/messages_pt_BR.properties index 93e299e3..0fcd3c98 100644 --- a/wise-webapp/src/main/resources/messages_pt_BR.properties +++ b/wise-webapp/src/main/resources/messages_pt_BR.properties @@ -95,7 +95,6 @@ HISTORY=História SHARE=Compartilhar UNEXPECTED_ERROR=Opa!!. Ocorreu um erro inesperado. UNEXPECTED_ERROR_DETAILS=Lamentamos, ocorreu um erro e não podemos processar a sua solicitação. Por favor, tente novamente ou vá para a página Inicial. -UNEXPECTED_ERROR_SERVER_ERROR=Lamentamos, ocorreu um erro e não podemos processar a sua solicitação. Atualize a página e tente novamente. Se o problema persistir, contacte-nos em support@wisemapping.com NO_ENOUGH_PERMISSIONS=Opa!!. Este mapa não está mais disponível. NO_ENOUGH_PERMISSIONS_DETAILS=Você não tem privilégios suficientes para ver este mapa. Este mapa foi alterado para privado ou deletado. IMPORT_MINDMAP_INFO=Você pode importar mapas do FreeMind 0.9 e do WiseMapping para sua lista de mapas. Selecione o arquivo que você quer importar. diff --git a/wise-webapp/src/main/resources/messages_zh_CN.properties b/wise-webapp/src/main/resources/messages_zh_CN.properties index 6fbe7de4..d1ce031a 100644 --- a/wise-webapp/src/main/resources/messages_zh_CN.properties +++ b/wise-webapp/src/main/resources/messages_zh_CN.properties @@ -97,7 +97,6 @@ HISTORY=历史 SHARE=共享 UNEXPECTED_ERROR=晕!!不可预知的错误。 UNEXPECTED_ERROR_DETAILS=抱歉,突遭错误,我们无法处理你的请求。 请重试或者访问首页。 -UNEXPECTED_ERROR_SERVER_ERROR=抱歉,突遭错误,我们无法处理你的请求。 刷新并重试。如果问题依然存在请联系support@wisemapping.com NO_ENOUGH_PERMISSIONS=晕!!此图不可访问。 NO_ENOUGH_PERMISSIONS_DETAILS=你没有权限访问这张图。此图已修改访问权限或者已删除。 IMPORT_MINDMAP_INFO=你可以导入 FreeMind 0.9 和 WiseMapping 格式的思维导图。选择你想要导入的文件。 diff --git a/wise-webapp/src/main/resources/messages_zh_TW.properties b/wise-webapp/src/main/resources/messages_zh_TW.properties index a29ab284..55845eb1 100644 --- a/wise-webapp/src/main/resources/messages_zh_TW.properties +++ b/wise-webapp/src/main/resources/messages_zh_TW.properties @@ -97,7 +97,6 @@ HISTORY=歷史 SHARE=共用 UNEXPECTED_ERROR=暈!!不可預知的錯誤。 UNEXPECTED_ERROR_DETAILS=抱歉,突遭錯誤,我們無法處理你的請求。 請重試或者訪問首頁。 -UNEXPECTED_ERROR_SERVER_ERROR=抱歉,突遭錯誤,我們無法處理你的請求。 刷新並重試。如果問題依然存在請聯繫support@wisemapping.com NO_ENOUGH_PERMISSIONS=暈!!此圖不可訪問。 NO_ENOUGH_PERMISSIONS_DETAILS=你沒有許可權訪問這張圖。此圖已修改訪問許可權或者已刪除。 IMPORT_MINDMAP_INFO=你可以導入 FreeMind 0.9 和 WiseMapping 格式的思維導圖。選擇你想要導入的檔。 From f56751346840f70122990a0bebad8a347512a47c Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 1 Feb 2014 19:50:37 -0300 Subject: [PATCH 14/17] Fix minor typo. --- wise-webapp/src/main/resources/messages_en.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wise-webapp/src/main/resources/messages_en.properties b/wise-webapp/src/main/resources/messages_en.properties index bb095aae..7e211d1b 100644 --- a/wise-webapp/src/main/resources/messages_en.properties +++ b/wise-webapp/src/main/resources/messages_en.properties @@ -97,7 +97,7 @@ HISTORY=History SHARE=Share UNEXPECTED_ERROR=Outch!!. An unexpected error has occurred. UNEXPECTED_ERROR_DETAILS=We're sorry, an error has occurred and we can't process your request. Please try again, or go to the home page. -UNEXPECTED_ERROR_SERVER_ERROR=We're sorry, an error has occurred and we can't process your request. Refresh the page and try again. If the problem persist, click below on "Raise a Issue" to report a ticket. +UNEXPECTED_ERROR_SERVER_ERROR=We're sorry, an error has occurred and we can't process your request. Refresh the page and try again. If the problem persist, click below on "Raise An Issue" to report a ticket. NO_ENOUGH_PERMISSIONS=Outch!!. This map is not available anymore. NO_ENOUGH_PERMISSIONS_DETAILS=You do not have enough right access to see this map. This map has been changed to private or deleted. IMPORT_MINDMAP_INFO=You can import FreeMind 0.9 and WiseMapping maps to your list of maps. Select the file you want to import. From 94b043ecf5c221e87a8b0d1ab3e33e27f4b54e72 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 1 Feb 2014 19:54:31 -0300 Subject: [PATCH 15/17] Fix another typo. --- wise-webapp/src/main/resources/messages_en.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wise-webapp/src/main/resources/messages_en.properties b/wise-webapp/src/main/resources/messages_en.properties index 7e211d1b..98760efc 100644 --- a/wise-webapp/src/main/resources/messages_en.properties +++ b/wise-webapp/src/main/resources/messages_en.properties @@ -97,7 +97,7 @@ HISTORY=History SHARE=Share UNEXPECTED_ERROR=Outch!!. An unexpected error has occurred. UNEXPECTED_ERROR_DETAILS=We're sorry, an error has occurred and we can't process your request. Please try again, or go to the home page. -UNEXPECTED_ERROR_SERVER_ERROR=We're sorry, an error has occurred and we can't process your request. Refresh the page and try again. If the problem persist, click below on "Raise An Issue" to report a ticket. +UNEXPECTED_ERROR_SERVER_ERROR=We're sorry, an error has occurred and we can't process your request. Refresh the page and try again. If the problem persist, click below on "Raise An Issue" to open a ticket. NO_ENOUGH_PERMISSIONS=Outch!!. This map is not available anymore. NO_ENOUGH_PERMISSIONS_DETAILS=You do not have enough right access to see this map. This map has been changed to private or deleted. IMPORT_MINDMAP_INFO=You can import FreeMind 0.9 and WiseMapping maps to your list of maps. Select the file you want to import. From d6656dffc0f2e6934939014c010d4e6a55f23000 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 1 Feb 2014 22:48:01 -0300 Subject: [PATCH 16/17] Fix jQuery resturn status. --- wise-webapp/src/main/webapp/js/mindmapList.js | 96 +++++++++++-------- 1 file changed, 55 insertions(+), 41 deletions(-) diff --git a/wise-webapp/src/main/webapp/js/mindmapList.js b/wise-webapp/src/main/webapp/js/mindmapList.js index b01f7a49..f261946f 100644 --- a/wise-webapp/src/main/webapp/js/mindmapList.js +++ b/wise-webapp/src/main/webapp/js/mindmapList.js @@ -98,6 +98,53 @@ jQuery.fn.dialogForm = function (options) { $('#' + containerId + ' input').each(function (index, elem) { formData[elem.name] = elem.value; }); + + // Success actions ... + var onSuccess = function (jqXHR, textStatus,data) { + if (options.redirect) { + var resourceId = jqXHR.getResponseHeader("ResourceId"); + var redirectUrl = options.redirect; + redirectUrl = redirectUrl.replace("{header.resourceId}", resourceId); + + // Hack: IE ignore the base href tag ... + var baseUrl = window.location.href.substring(0, window.location.href.lastIndexOf("c/maps/")); + window.open(baseUrl + redirectUrl, '_self'); + + } else if (options.postUpdate) { + options.postUpdate(formData); + } + dialogElem.modal('hide'); + }; + + // On error message + var onFailure = function(jqXHR,textStatus, data){ + var errors = JSON.parse(jqXHR.responseText); + // Mark fields with errors ... + var fieldErrors = errors.fieldErrors; + if (fieldErrors) { + for (var fieldName in fieldErrors) { + // Mark the field with errors ... + var message = fieldErrors[fieldName]; + var inputField = $("#" + containerId + " input[name='" + fieldName + "']"); + + $("#" + containerId).find(".errorMessage").text(message).addClass("alert alert-error"); + inputField.parent().addClass('error'); + } + } + var acceptBtn = $('#' + containerId + ' .btn-accept'); + acceptBtn.button('reset'); + }; + + var onError = function (jqXHR, textStatus, errorThrown) { + console.log(errorThrown); + console.log(jqXHR); + dialogElem.modal('hide'); + $('#messagesPanel div div').text(errorThrown); + $('#messagesPanel').show() + var acceptBtn = $('#' + containerId + ' .btn-accept'); + acceptBtn.button('reset'); + }; + $(acceptBtn).button('loading'); var dialogElem = this; jQuery.ajax(url, { @@ -106,47 +153,14 @@ jQuery.fn.dialogForm = function (options) { data:JSON.stringify(formData), type:options.type ? options.type : 'POST', contentType:"application/json; charset=utf-8", - success:function (data, textStatus, jqXHR) { - if (options.redirect) { - var resourceId = jqXHR.getResponseHeader("ResourceId"); - var redirectUrl = options.redirect; - redirectUrl = redirectUrl.replace("{header.resourceId}", resourceId); - - // Hack: IE ignore the base href tag ... - var baseUrl = window.location.href.substring(0, window.location.href.lastIndexOf("c/maps/")); - window.open(baseUrl + redirectUrl, '_self'); - - } else if (options.postUpdate) { - options.postUpdate(formData); - } - dialogElem.modal('hide'); - }, - error:function (jqXHR, textStatus, errorThrown) { - if (jqXHR.status == 400) { - var errors = JSON.parse(jqXHR.responseText); - // Mark fields with errors ... - var fieldErrors = errors.fieldErrors; - if (fieldErrors) { - for (var fieldName in fieldErrors) { - // Mark the field with errors ... - var message = fieldErrors[fieldName]; - var inputField = $("#" + containerId + " input[name='" + fieldName + "']"); - - $("#" + containerId).find(".errorMessage").text(message).addClass("alert alert-error"); - inputField.parent().addClass('error'); - } - } - - } else { - console.log(errorThrown); - console.log(jqXHR); - dialogElem.modal('hide'); - $('#messagesPanel div div').text(errorThrown); - $('#messagesPanel').show() - } - var acceptBtn = $('#' + containerId + ' .btn-accept'); - acceptBtn.button('reset'); - + statusCode:{ + 200: onSuccess, + 201: onSuccess, + 204: onSuccess, + 400: onFailure, + 444: onError, + 500: onError, + 501: onError } }); }.bind(this)); From 560ceffaaf2dfeb2d039dac6f348114fda275b60 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 3 Feb 2014 22:01:38 -0300 Subject: [PATCH 17/17] Bug https://wisemapping.atlassian.net/browse/WISE-209 fixed. --- wise-webapp/src/main/webapp/js/mindmapList.js | 125 +++++++++--------- 1 file changed, 65 insertions(+), 60 deletions(-) diff --git a/wise-webapp/src/main/webapp/js/mindmapList.js b/wise-webapp/src/main/webapp/js/mindmapList.js index f261946f..86905fb0 100644 --- a/wise-webapp/src/main/webapp/js/mindmapList.js +++ b/wise-webapp/src/main/webapp/js/mindmapList.js @@ -1,3 +1,8 @@ +// Hack for bootstrap issue with IE10. https://github.com/twbs/bootstrap/issues/3672 +if ($.browser.msie && $.browser.version > 9) { + $('.modal').removeClass('fade'); +} + $.fn.dataTableExt.oApi.fnReloadAjax = function (oSettings, sNewSource, fnCallback, bStandingRedraw) { if (typeof sNewSource != 'undefined' && sNewSource != null) { oSettings.sAjaxSource = sNewSource; @@ -100,60 +105,60 @@ jQuery.fn.dialogForm = function (options) { }); // Success actions ... - var onSuccess = function (jqXHR, textStatus,data) { - if (options.redirect) { - var resourceId = jqXHR.getResponseHeader("ResourceId"); - var redirectUrl = options.redirect; - redirectUrl = redirectUrl.replace("{header.resourceId}", resourceId); + var onSuccess = function (jqXHR, textStatus, data) { + if (options.redirect) { + var resourceId = jqXHR.getResponseHeader("ResourceId"); + var redirectUrl = options.redirect; + redirectUrl = redirectUrl.replace("{header.resourceId}", resourceId); - // Hack: IE ignore the base href tag ... - var baseUrl = window.location.href.substring(0, window.location.href.lastIndexOf("c/maps/")); - window.open(baseUrl + redirectUrl, '_self'); + // Hack: IE ignore the base href tag ... + var baseUrl = window.location.href.substring(0, window.location.href.lastIndexOf("c/maps/")); + window.open(baseUrl + redirectUrl, '_self'); - } else if (options.postUpdate) { - options.postUpdate(formData); - } - dialogElem.modal('hide'); + } else if (options.postUpdate) { + options.postUpdate(formData); + } + dialogElem.modal('hide'); }; // On error message - var onFailure = function(jqXHR,textStatus, data){ - var errors = JSON.parse(jqXHR.responseText); - // Mark fields with errors ... - var fieldErrors = errors.fieldErrors; - if (fieldErrors) { - for (var fieldName in fieldErrors) { - // Mark the field with errors ... - var message = fieldErrors[fieldName]; - var inputField = $("#" + containerId + " input[name='" + fieldName + "']"); + var onFailure = function (jqXHR, textStatus, data) { + var errors = JSON.parse(jqXHR.responseText); + // Mark fields with errors ... + var fieldErrors = errors.fieldErrors; + if (fieldErrors) { + for (var fieldName in fieldErrors) { + // Mark the field with errors ... + var message = fieldErrors[fieldName]; + var inputField = $("#" + containerId + " input[name='" + fieldName + "']"); - $("#" + containerId).find(".errorMessage").text(message).addClass("alert alert-error"); - inputField.parent().addClass('error'); - } - } - var acceptBtn = $('#' + containerId + ' .btn-accept'); - acceptBtn.button('reset'); - }; + $("#" + containerId).find(".errorMessage").text(message).addClass("alert alert-error"); + inputField.parent().addClass('error'); + } + } + var acceptBtn = $('#' + containerId + ' .btn-accept'); + acceptBtn.button('reset'); + }; - var onError = function (jqXHR, textStatus, errorThrown) { - console.log(errorThrown); - console.log(jqXHR); - dialogElem.modal('hide'); - $('#messagesPanel div div').text(errorThrown); - $('#messagesPanel').show() - var acceptBtn = $('#' + containerId + ' .btn-accept'); - acceptBtn.button('reset'); + var onError = function (jqXHR, textStatus, errorThrown) { + console.log(errorThrown); + console.log(jqXHR); + dialogElem.modal('hide'); + $('#messagesPanel div div').text(errorThrown); + $('#messagesPanel').show() + var acceptBtn = $('#' + containerId + ' .btn-accept'); + acceptBtn.button('reset'); }; $(acceptBtn).button('loading'); var dialogElem = this; jQuery.ajax(url, { - async:false, - dataType:'json', - data:JSON.stringify(formData), - type:options.type ? options.type : 'POST', - contentType:"application/json; charset=utf-8", - statusCode:{ + async: false, + dataType: 'json', + data: JSON.stringify(formData), + type: options.type ? options.type : 'POST', + contentType: "application/json; charset=utf-8", + statusCode: { 200: onSuccess, 201: onSuccess, 204: onSuccess, @@ -227,12 +232,12 @@ function updateStarred(spanElem) { } jQuery.ajax("c/restful/maps/" + mapId + "/starred", { - async:false, - dataType:'json', - data:"" + starred, - type:'PUT', - contentType:"text/plain", - success:function () { + async: false, + dataType: 'json', + data: "" + starred, + type: 'PUT', + contentType: "text/plain", + success: function () { if (starred) { $(spanElem).removeClass('starredOff'); $(spanElem).addClass('starredOn'); @@ -241,7 +246,7 @@ function updateStarred(spanElem) { $(spanElem).addClass('starredOff'); } }, - error:function (jqXHR, textStatus, errorThrown) { + error: function (jqXHR, textStatus, errorThrown) { $('#messagesPanel div').text(errorThrown).parent().show(); } }); @@ -263,8 +268,8 @@ $(function () { $("#newBtn").click( function () { $("#new-dialog-modal").dialogForm({ - redirect:"c/maps/{header.resourceId}/edit", - url:"c/restful/maps" + redirect: "c/maps/{header.resourceId}/edit", + url: "c/restful/maps" }); }); @@ -283,8 +288,8 @@ $(function () { // Initialize dialog ... $("#duplicate-dialog-modal").dialogForm({ - redirect:"c/maps/{header.resourceId}/edit", - url:"c/restful/maps/" + mapId + redirect: "c/maps/{header.resourceId}/edit", + url: "c/restful/maps/" + mapId }); } }); @@ -309,16 +314,16 @@ $(function () { // Initialize dialog ... $("#rename-dialog-modal").dialogForm({ - type:'PUT', - clearForm:false, - postUpdate:function (reqBodyData) { + type: 'PUT', + clearForm: false, + postUpdate: function (reqBodyData) { tableElem.dataTableExt.removeSelectedRows(); rowData.title = reqBodyData.title; rowData.description = reqBodyData.description; dataTable.fnAddData(JSON.parse(JSON.stringify(rowData))); }, - url:"c/restful/maps/" + mapId + url: "c/restful/maps/" + mapId }); } }); @@ -331,12 +336,12 @@ $(function () { if (mapIds.length > 0) { // Initialize dialog ... $("#delete-dialog-modal").dialogForm({ - type:'DELETE', - postUpdate:function () { + type: 'DELETE', + postUpdate: function () { // Remove old entry ... tableUI.dataTableExt.removeSelectedRows(); }, - url:"c/restful/maps/batch?ids=" + jQuery.makeArray(mapIds).join(',') + url: "c/restful/maps/batch?ids=" + jQuery.makeArray(mapIds).join(',') }); } });