From 1ac80626b4455929674765ff6d48ecba8872f91a Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 15 Jul 2012 02:04:53 -0300 Subject: [PATCH] Remove username from the mindmap info. --- .../main/java/com/wisemapping/dao/MindmapManagerImpl.java | 2 +- .../src/main/java/com/wisemapping/model/Constants.java | 1 - .../main/java/com/wisemapping/rest/MindmapController.java | 1 - .../main/java/com/wisemapping/service/UserServiceImpl.java | 4 ++-- .../src/main/java/com/wisemapping/validator/Messages.java | 1 - wise-webapp/src/main/webapp/jsp/accountSettings.jsp | 7 ++----- .../src/test/java/com/wisemapping/test/model/JsonTest.java | 2 +- 7 files changed, 6 insertions(+), 12 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java b/wise-webapp/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java index 02b1a4ab..8d87fbf7 100644 --- a/wise-webapp/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java @@ -39,7 +39,7 @@ public class MindmapManagerImpl final Collaborator collaborator; final List collaborators = getHibernateTemplate().find("from com.wisemapping.model.Collaborator collaborator where email=?", email); if (collaborators != null && !collaborators.isEmpty()) { - assert collaborators.size() == 1 : "More than one user with the same username!"; + assert collaborators.size() == 1 : "More than one user with the same email!"; collaborator = collaborators.get(0); } else { collaborator = null; diff --git a/wise-webapp/src/main/java/com/wisemapping/model/Constants.java b/wise-webapp/src/main/java/com/wisemapping/model/Constants.java index f2885178..73492e98 100755 --- a/wise-webapp/src/main/java/com/wisemapping/model/Constants.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/Constants.java @@ -22,7 +22,6 @@ public class Constants { public static final int MAX_MAP_NAME_LENGTH = 512; public static final int MAX_MAP_DESCRIPTION_LENGTH = 512; - public static final int MAX_USER_USERNAME_LENGTH = 255; public static final int MAX_USER_LASTNAME_LENGTH = 255; public static final int MAX_USER_FIRSTNAME_LENGTH = 255; public static final int MAX_USER_PASSWORD_LENGTH = 255; 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 ff601cf4..3348b5de 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -404,7 +404,6 @@ public class MindmapController extends BaseController { } // Save new map ... - final User user = Utils.getUser(); createMap(new RestMindmap(mindMap, null), response, title, description); } 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 0020bb32..ec94c9d1 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java @@ -142,7 +142,7 @@ public class UserServiceImpl return user; } - private MindMap buildWelcomeMindmap(@NotNull String username) throws WiseMappingException { + private MindMap buildWelcomeMindmap(@NotNull String firstName) throws WiseMappingException { //To change body of created methods use File | Settings | File Templates. final Locale locale = LocaleContextHolder.getLocale(); MindMap result = new MindMap(); @@ -155,7 +155,7 @@ public class UserServiceImpl try { final byte[] bytes = IOUtils.toByteArray(resourceAsStream); result.setXml(bytes); - result.setTitle(messageSource.getMessage("WELCOME", null, locale) + " " + username); + result.setTitle(messageSource.getMessage("WELCOME", null, locale) + " " + firstName); result.setDescription(""); } catch (IOException e) { 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 07ce50e1..056fbe76 100644 --- a/wise-webapp/src/main/java/com/wisemapping/validator/Messages.java +++ b/wise-webapp/src/main/java/com/wisemapping/validator/Messages.java @@ -21,7 +21,6 @@ package com.wisemapping.validator; public interface Messages { String EMAIL_ALREADY_EXIST = "EMAIL_ALREADY_EXIST"; String NO_VALID_EMAIL_ADDRESS = "NO_VALID_EMAIL_ADDRESS"; - String USERNAME_ALREADY_EXIST = "USERNAME_ALREADY_EXIST"; String FIELD_REQUIRED = "FIELD_REQUIRED"; String IMPORT_MAP_ERROR = "IMPORT_MAP_ERROR"; String MAP_TITLE_ALREADY_EXISTS = "MAP_TITLE_ALREADY_EXISTS"; diff --git a/wise-webapp/src/main/webapp/jsp/accountSettings.jsp b/wise-webapp/src/main/webapp/jsp/accountSettings.jsp index aac8a9db..c77fc009 100755 --- a/wise-webapp/src/main/webapp/jsp/accountSettings.jsp +++ b/wise-webapp/src/main/webapp/jsp/accountSettings.jsp @@ -18,17 +18,14 @@ - - -
- "/> + "/> diff --git a/wise-webapp/src/test/java/com/wisemapping/test/model/JsonTest.java b/wise-webapp/src/test/java/com/wisemapping/test/model/JsonTest.java index 0c2ba53c..fc92854c 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/model/JsonTest.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/model/JsonTest.java @@ -22,7 +22,7 @@ public class JsonTest { String json2 = "{\"title\":\"some title\",\"description\":\"description here\"}"; mapper.readValue(json2, RestMindmap.class); - String userJson = "{\"username\":\"admin\",\"email\":\"admin@wisemapping.org\",\"tags\":[],\"creationDate\":1329706800000,\"firstname\":\"Wise\",\"lastname\":\"test\",\"password\":\"test\"}"; + String userJson = "{\"email\":\"admin@wisemapping.org\",\"tags\":[],\"creationDate\":1329706800000,\"firstname\":\"Wise\",\"lastname\":\"test\",\"password\":\"test\"}"; final RestUser restUser = mapper.readValue(userJson, RestUser.class); }