From cfe78bdf7e78dc408fe6f460792063af33d51bdc Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 20 Jun 2012 13:28:45 -0300 Subject: [PATCH] Finish account settings option. --- wise-editor/src/main/resources/web.xml | 119 ---------------- .../controller/ActivationController.java | 72 ---------- .../controller/BaseSimpleFormController.java | 67 --------- .../controller/ChangePasswordController.java | 53 ------- .../controller/EditProfileController.java | 65 --------- .../controller/SettingsController.java | 33 ----- .../controller/TagsController.java | 60 -------- .../UserRegistrationController.java | 132 ------------------ .../java/com/wisemapping/dao/UserManager.java | 2 - .../com/wisemapping/dao/UserManagerImpl.java | 10 +- .../wisemapping/mail/NotificationService.java | 43 +++++- .../wisemapping/mail/SmtpAuthenticator.java | 41 ------ .../ncontroller/MindmapController.java | 1 + .../ncontroller/UsersController.java | 10 +- .../wisemapping/rest/AccountController.java | 71 ++++++++++ .../com/wisemapping/rest/AdminController.java | 2 + .../wisemapping/service/UserServiceImpl.java | 7 +- .../validator/ChangePasswordValidator.java | 59 -------- .../validator/EditProfileValidator.java | 72 ---------- .../validator/MapInfoValidator.java | 1 - .../{controller => validator}/Messages.java | 2 +- .../wisemapping/validator/TagValidator.java | 47 ------- .../wisemapping/validator/UserValidator.java | 1 - .../java/com/wisemapping/validator/Utils.java | 2 - .../java/com/wisemapping/view/TagBean.java | 67 --------- .../mail/baseLayout.vm} | 18 ++- .../mail/confirmationMail.vm | 2 +- .../mail/newCollaboration.vm | 0 .../classes/mail/activationAccountMail.vm | 41 ------ .../webapp/WEB-INF/classes/mail/welcome.vm | 23 --- .../WEB-INF/classes/messages.properties | 10 +- .../WEB-INF/classes/messages_es.properties | 4 +- .../WEB-INF/classes/messages_fr.properties | 4 +- .../main/webapp/WEB-INF/defs/definitions.xml | 12 +- wise-webapp/src/main/webapp/WEB-INF/web.xml | 3 +- .../webapp/WEB-INF/wisemapping-nservlet.xml | 97 ------------- .../webapp/WEB-INF/wisemapping-servlet.xml | 110 ++++++++++----- .../src/main/webapp/jsp/accountSettings.jsp | 99 +++++++++++++ .../src/main/webapp/jsp/editorHeader.jsp | 4 +- wise-webapp/src/main/webapp/jsp/header.jsp | 50 +++++-- .../src/main/webapp/jsp/mindmapDetail.jsp | 4 +- .../src/main/webapp/jsp/mindmapEditor.jsp | 6 +- .../src/main/webapp/jsp/mindmapList.jsp | 20 +-- wise-webapp/src/main/webapp/jsp/template.jsp | 1 + .../main/webapp/jsp/userForgotPassword.jsp | 2 +- .../src/main/webapp/jsp/userSetting.jsp | 17 --- 46 files changed, 387 insertions(+), 1179 deletions(-) delete mode 100755 wise-webapp/src/main/java/com/wisemapping/controller/ActivationController.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/controller/BaseSimpleFormController.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/controller/ChangePasswordController.java delete mode 100755 wise-webapp/src/main/java/com/wisemapping/controller/EditProfileController.java delete mode 100755 wise-webapp/src/main/java/com/wisemapping/controller/SettingsController.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/controller/TagsController.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/controller/UserRegistrationController.java delete mode 100755 wise-webapp/src/main/java/com/wisemapping/mail/SmtpAuthenticator.java create mode 100644 wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/validator/ChangePasswordValidator.java delete mode 100755 wise-webapp/src/main/java/com/wisemapping/validator/EditProfileValidator.java rename wise-webapp/src/main/java/com/wisemapping/{controller => validator}/Messages.java (94%) delete mode 100755 wise-webapp/src/main/java/com/wisemapping/validator/TagValidator.java delete mode 100755 wise-webapp/src/main/java/com/wisemapping/view/TagBean.java rename wise-webapp/src/main/{webapp/WEB-INF/classes/mail/passwordRecovery.vm => resources/mail/baseLayout.vm} (68%) rename wise-webapp/src/main/{webapp/WEB-INF/classes => resources}/mail/confirmationMail.vm (89%) rename wise-webapp/src/main/{webapp/WEB-INF/classes => resources}/mail/newCollaboration.vm (100%) delete mode 100644 wise-webapp/src/main/webapp/WEB-INF/classes/mail/activationAccountMail.vm delete mode 100755 wise-webapp/src/main/webapp/WEB-INF/classes/mail/welcome.vm delete mode 100644 wise-webapp/src/main/webapp/WEB-INF/wisemapping-nservlet.xml create mode 100755 wise-webapp/src/main/webapp/jsp/accountSettings.jsp delete mode 100755 wise-webapp/src/main/webapp/jsp/userSetting.jsp diff --git a/wise-editor/src/main/resources/web.xml b/wise-editor/src/main/resources/web.xml index d383bfbb..4135b67b 100644 --- a/wise-editor/src/main/resources/web.xml +++ b/wise-editor/src/main/resources/web.xml @@ -5,124 +5,5 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> - - javax.servlet.jsp.jstl.fmt.localizationContext - messages - - - contextConfigLocation - - /WEB-INF/wisemapping-security.xml - /WEB-INF/wisemapping-dao.xml - /WEB-INF/wisemapping-service.xml - /WEB-INF/wisemapping-model.xml - /WEB-INF/wisemapping-acegi-security.xml - - - - - - com.wisemapping.service.HibernateAppListener - - - - - charsetFilter - org.springframework.web.filter.CharacterEncodingFilter - - encoding - UTF-8 - - - forceEncoding - true - - - - - charsetFilter - /* - - - hibernate - org.springframework.orm.hibernate3.support.OpenSessionInViewFilter - - singleSession - true - - - sessionFactoryBeanName - mindmapSessionFactory - - - - Acegi Filter Chain Proxy - org.acegisecurity.util.FilterToBeanProxy - - targetClass - org.acegisecurity.util.FilterChainProxy - - - - - Acegi Filter Chain Proxy - /* - - - - hibernate - /* - - - - org.springframework.web.context.ContextLoaderListener - - - - wisemapping - org.springframework.web.servlet.DispatcherServlet - 1 - - - contextConfigLocation - - /WEB-INF/wisemapping-servlet.xml - /WEB-INF/wisemapping-captcha.xml - - - - - - - dwr-invoker - org.directwebremoting.servlet.DwrServlet - - debug - true - - - - - wisemapping - *.htm - - - - dwr-invoker - /dwr/* - - - - - index.jsp - - - - 180 - \ No newline at end of file diff --git a/wise-webapp/src/main/java/com/wisemapping/controller/ActivationController.java b/wise-webapp/src/main/java/com/wisemapping/controller/ActivationController.java deleted file mode 100755 index 50f9e866..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/controller/ActivationController.java +++ /dev/null @@ -1,72 +0,0 @@ -/* -* Copyright [2011] [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.controller; - -import com.wisemapping.service.UserService; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.servlet.mvc.Controller; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - - -public class ActivationController - implements Controller, InitializingBean -{ - - //~ Instance fields ...................................................................................... - private UserService userService; - - //~ Methods .............................................................................................. - - public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) - throws Exception - { - ModelAndView modelAndView; - try - { - final String code = request.getParameter("code"); - userService.activateAccount(Long.parseLong(code)); - modelAndView = new ModelAndView("activationAccountConfirmation"); - } - catch (Throwable exc) - { - // TODO Fix it ! - exc.printStackTrace(); - // Any type of error - modelAndView = new ModelAndView("activationAccountConfirmationFail"); - } - return modelAndView; - } - - public void setUserService(UserService userService) { - this.userService = userService; - } - - /** - * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() - */ - public void afterPropertiesSet() - throws Exception { - if (userService == null) { - throw new RuntimeException("userService was not set!"); - } - } -} diff --git a/wise-webapp/src/main/java/com/wisemapping/controller/BaseSimpleFormController.java b/wise-webapp/src/main/java/com/wisemapping/controller/BaseSimpleFormController.java deleted file mode 100644 index 34e38e62..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/controller/BaseSimpleFormController.java +++ /dev/null @@ -1,67 +0,0 @@ -/* -* Copyright [2011] [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.controller; - -import com.wisemapping.model.MindMap; -import com.wisemapping.service.MindmapService; -import com.wisemapping.service.UserService; -import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.servlet.mvc.SimpleFormController; - -import javax.servlet.http.HttpServletRequest; - - -public class BaseSimpleFormController extends SimpleFormController -{ - - private MindmapService mindmapService; - private UserService userService; - private String errorView; - - public UserService getUserService() { - return userService; - } - - public void setUserService(UserService userService) { - this.userService = userService; - } - - public MindmapService getMindmapService() { - return mindmapService; - } - - public String getErrorView() { - return errorView; - } - - - @Override protected org.springframework.web.servlet.ModelAndView showForm(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, org.springframework.validation.BindException bindException) throws java.lang.Exception - { - final ModelAndView view = super.showForm(httpServletRequest, httpServletResponse,bindException); - final String viewName = getErrorView(); - if(viewName !=null && bindException.getAllErrors().size()>0) - { - view.setViewName(viewName); - view.addObject("errorView",true); - } - return view; - } -} - - diff --git a/wise-webapp/src/main/java/com/wisemapping/controller/ChangePasswordController.java b/wise-webapp/src/main/java/com/wisemapping/controller/ChangePasswordController.java deleted file mode 100644 index ac4a4c23..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/controller/ChangePasswordController.java +++ /dev/null @@ -1,53 +0,0 @@ -/* -* Copyright [2011] [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.controller; - -import com.wisemapping.model.User; -import com.wisemapping.security.Utils; -import com.wisemapping.service.UserService; -import com.wisemapping.view.ChangePasswordBean; -import org.springframework.validation.BindException; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public class ChangePasswordController - extends BaseSimpleFormController { - - //~ Methods .............................................................................................. - - public ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, - BindException errors) - throws ServletException { - final ChangePasswordBean bean = (ChangePasswordBean) command; - // Reload user only in case of being necessary... - final User model = Utils.getUser(); - - final UserService userService = this.getUserService(); - final User user = userService.reloadUser(model); - - user.setPassword(bean.getPassword()); - userService.changePassword(user); - - return new ModelAndView(getSuccessView()); - } - -} diff --git a/wise-webapp/src/main/java/com/wisemapping/controller/EditProfileController.java b/wise-webapp/src/main/java/com/wisemapping/controller/EditProfileController.java deleted file mode 100755 index f0e3199c..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/controller/EditProfileController.java +++ /dev/null @@ -1,65 +0,0 @@ -/* -* Copyright [2011] [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.controller; - -import com.wisemapping.model.User; -import com.wisemapping.security.Utils; -import com.wisemapping.service.UserService; -import com.wisemapping.view.UserBean; -import org.springframework.validation.BindException; -import org.springframework.web.servlet.ModelAndView; - - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public class EditProfileController extends BaseSimpleFormController { - - - protected Object formBackingObject(HttpServletRequest httpServletRequest) throws Exception { - final User model = Utils.getUser(); - return new UserBean(model); - } - - //~ Methods .............................................................................................. - - public ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, - BindException errors) - throws ServletException { - final UserBean bean = (UserBean) command; - final UserService userService = this.getUserService(); - - // Reload user only in case of beeing necessary... - final User model = Utils.getUser(); - final User user = userService.reloadUser(model); - - user.setFirstname(bean.getFirstname()); - user.setLastname(bean.getLastname()); - // trim() the email email in order to remove spaces - user.setEmail(bean.getEmail().trim()); - user.setAllowSendEmail(bean.isAllowSendEmail()); - - // Sync Acegi user and DB user - model.setAllowSendEmail(bean.isAllowSendEmail()); - userService.updateUser(user); - - return new ModelAndView(getSuccessView()); - } -} diff --git a/wise-webapp/src/main/java/com/wisemapping/controller/SettingsController.java b/wise-webapp/src/main/java/com/wisemapping/controller/SettingsController.java deleted file mode 100755 index 75ec1ee4..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/controller/SettingsController.java +++ /dev/null @@ -1,33 +0,0 @@ -/* -* Copyright [2011] [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.controller; - -import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public class SettingsController { - - public ModelAndView handleNoSuchRequestHandlingMethod(NoSuchRequestHandlingMethodException noSuchRequestHandlingMethodException, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) - throws Exception { - return new ModelAndView("setting"); - } -} diff --git a/wise-webapp/src/main/java/com/wisemapping/controller/TagsController.java b/wise-webapp/src/main/java/com/wisemapping/controller/TagsController.java deleted file mode 100644 index f4178383..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/controller/TagsController.java +++ /dev/null @@ -1,60 +0,0 @@ -/* -* Copyright [2011] [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.controller; - -import com.wisemapping.exceptions.WiseMappingException; -import com.wisemapping.importer.ImporterException; -import com.wisemapping.model.MindMap; -import com.wisemapping.model.User; -import com.wisemapping.security.Utils; -import com.wisemapping.view.TagBean; -import org.springframework.validation.BindException; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public class TagsController - extends BaseSimpleFormController { - - //~ Methods .............................................................................................. - protected Object formBackingObject(HttpServletRequest httpServletRequest) throws Exception { - - final MindMap mindmap = null; - final User user = Utils.getUser(); - final User dbUser = getUserService().getUserBy(user.getId()); - - final TagBean tagBean = new TagBean(); - tagBean.setUserTags(dbUser.getTags()); - tagBean.setMindmapId(mindmap.getId()); - tagBean.setMindmapTags(mindmap.getTags()); - tagBean.setMindmapTitle(mindmap.getTitle()); - return tagBean; - } - - public ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) - throws ServletException, WiseMappingException, ImporterException - { - final TagBean bean = (TagBean) command; - final MindMap mindmap = getMindmapService().findMindmapById(bean.getMindmapId()); - getMindmapService().addTags(mindmap, bean.getMindmapTags()); - return new ModelAndView(getSuccessView()); - } -} diff --git a/wise-webapp/src/main/java/com/wisemapping/controller/UserRegistrationController.java b/wise-webapp/src/main/java/com/wisemapping/controller/UserRegistrationController.java deleted file mode 100644 index e9279c5f..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/controller/UserRegistrationController.java +++ /dev/null @@ -1,132 +0,0 @@ -/* -* Copyright [2011] [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.controller; - -import com.wisemapping.model.User; -import com.wisemapping.service.UserService; -import com.wisemapping.view.UserBean; -import com.wisemapping.exceptions.WiseMappingException; -import net.tanesha.recaptcha.ReCaptcha; -import net.tanesha.recaptcha.ReCaptchaResponse; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.springframework.validation.BindException; -import org.springframework.validation.ObjectError; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - -public class UserRegistrationController - extends BaseSimpleFormController { - - //~ Instance fields ...................................................................................... - - private boolean emailConfirmEnabled; - private UserService userService; - private ReCaptcha captchaService; - private boolean captchaEnabled; - - //~ Methods .............................................................................................. - - - public boolean isEmailConfirmEnabled() { - return emailConfirmEnabled; - } - - public void setEmailConfirmEnabled(boolean emailConfirmEnabled) { - this.emailConfirmEnabled = emailConfirmEnabled; - } - - public ModelAndView onSubmit(@Nullable Object command) throws WiseMappingException { - final UserBean userBean = ((UserBean) command); - - if (userBean != null) { - final User user = new User(); - // trim() the email email in order to remove spaces - user.setEmail(userBean.getEmail().trim()); - user.setUsername(userBean.getUsername()); - user.setFirstname(userBean.getFirstname()); - user.setLastname(userBean.getLastname()); - user.setPassword(userBean.getPassword()); - userService.createUser(user, emailConfirmEnabled); - } - - final Map model = new HashMap(); - model.put("confirmByEmail", emailConfirmEnabled); - return new ModelAndView(getSuccessView(), model); - } - - public void setUserService(UserService userService) { - this.userService = userService; - } - - public void setCaptchaService(@NotNull final ReCaptcha captchaService) { - this.captchaService = captchaService; - } - - public ReCaptcha getCaptchaService() { - return captchaService; - } - - public boolean isCaptchaEnabled() { - return captchaEnabled; - } - - public void setCaptchaEnabled(boolean captchaEnabled) { - this.captchaEnabled = captchaEnabled; - } - - @Override - protected void onBindAndValidate(HttpServletRequest request, Object command, BindException errors) throws Exception { - - super.onBindAndValidate(request, command, errors); - // If captcha is enabled, generate it ... - if (isCaptchaEnabled()) { - - final String challenge = request.getParameter("recaptcha_challenge_field"); - final String uresponse = request.getParameter("recaptcha_response_field"); - - final String remoteAddr = request.getRemoteAddr(); - final ReCaptchaResponse reCaptchaResponse = captchaService.checkAnswer(remoteAddr, challenge, uresponse); - if (!reCaptchaResponse.isValid()) { - errors.rejectValue("captcha", Messages.CAPTCHA_ERROR); - } - } - } - - @Override - protected ModelAndView showForm(HttpServletRequest request, HttpServletResponse response, BindException bindException) throws Exception { - final ModelAndView modelAndView = super.showForm(request, response, bindException); - - // If captcha is enabled, generate it ... - if (isCaptchaEnabled()) { - final Properties prop = new Properties(); - prop.put("theme", "white"); - final String captchaHtml = captchaService.createRecaptchaHtml(null, prop); - request.setAttribute("captchaHtml", captchaHtml); - request.setAttribute("captchaEnabled", true); - } - return modelAndView; - } - -} 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 7439e3e9..aedcfff5 100644 --- a/wise-webapp/src/main/java/com/wisemapping/dao/UserManager.java +++ b/wise-webapp/src/main/java/com/wisemapping/dao/UserManager.java @@ -34,8 +34,6 @@ public interface UserManager { User getUserByUsername(String username); - boolean authenticate(String email, String password); - void createUser(User user); void auditLogin(UserLogin userLogin); 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 1604b531..5018090d 100644 --- a/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java @@ -86,14 +86,6 @@ public class UserManagerImpl return user; } - @Override - public boolean authenticate(final String email, final String password) { - final boolean result; - final User user = getUserBy(email); - result = user != null && user.getPassword().equals(password); - return result; - } - @Override public void createUser(User user) { assert user != null : "Trying to store a null user"; @@ -134,7 +126,7 @@ public class UserManagerImpl getHibernateTemplate().save(userLogin); } - public void updateUser(User user) { + public void updateUser(@NotNull User user) { assert user != null : "user is null"; user.setPassword(passwordEncoder.encodePassword(user.getPassword(), null)); getHibernateTemplate().update(user); 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 e56f81e8..8ab67a35 100644 --- a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java +++ b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java @@ -49,7 +49,7 @@ final public class NotificationService { final String collabEmail = collaboration.getCollaborator().getEmail(); // Build the subject ... - final String subject = user.getFullName() + " has shared a mindmap with you"; + final String subject = "[WiseMapping] " + user.getFullName() + " has shared a mindmap with you"; // Fill template properties ... final Map model = new HashMap(); @@ -70,15 +70,44 @@ final public class NotificationService { } public void resetPassword(@NotNull User user, @NotNull String temporalPassword) { + final String mailSubject = "[WiseMapping] Your new password"; + final String messageTitle = "Your new password has been generated"; + final String messageBody = + "

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

\n" + + "

Here is your new password: : " + temporalPassword + "

\n" + + "

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

"; + + sendTemplateMail(user, mailSubject, messageTitle, messageBody); + } + + public void passwordChanged(@NotNull User user) { + final String mailSubject = "[WiseMapping] Your password has been changed"; + final String messageTitle = "Your password has been changed successfully"; + final String messageBody = + "

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

"; + + sendTemplateMail(user, mailSubject, messageTitle, messageBody); + } + + public void newAccountCreated(@NotNull User user) { + final String mailSubject = "Welcome to WiseMapping !"; + final String messageTitle = "Your account has been created successfully"; + final String messageBody = + "

Thank you for your interest in WiseMapping. If have any feedback or idea, send us an email to feedback@wisemapping.com .We'd love to hear from you.

"; + sendTemplateMail(user, mailSubject, messageTitle, messageBody); + } + + private void sendTemplateMail(@NotNull User user, @NotNull String mailSubject, @NotNull String messageTitle, @NotNull String messageBody) { + try { final Map model = new HashMap(); - model.put("user", user); - model.put("temporalPassword", temporalPassword); - model.put("supportEmail", mailer.getSupportEmail()); - model.put("password", temporalPassword); + model.put("firstName", user.getFirstname()); + model.put("messageTitle", messageTitle); + model.put("messageBody", messageBody); model.put("baseUrl", this.baseUrl); + model.put("supportEmail", mailer.getSupportEmail()); - mailer.sendEmail(mailer.getServerSenderEmail(), user.getEmail(), "Reset Your WiseMapping Password", model, "passwordRecovery.vm"); + mailer.sendEmail(mailer.getServerSenderEmail(), user.getEmail(), mailSubject, model, "baseLayout.vm"); } catch (Exception e) { handleException(e); } @@ -100,7 +129,7 @@ final public class NotificationService { public void activateAccount(@NotNull User user) { final Map model = new HashMap(); model.put("user", user); - mailer.sendEmail(mailer.getServerSenderEmail(), user.getEmail(), "WiseMapping : Active account", model, "activationAccountMail.vm"); + mailer.sendEmail(mailer.getServerSenderEmail(), user.getEmail(), "[WiseMapping] Active account", model, "activationAccountMail.vm"); } public void sendRegistrationEmail(@NotNull User user) { diff --git a/wise-webapp/src/main/java/com/wisemapping/mail/SmtpAuthenticator.java b/wise-webapp/src/main/java/com/wisemapping/mail/SmtpAuthenticator.java deleted file mode 100755 index 9b47dfe9..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/mail/SmtpAuthenticator.java +++ /dev/null @@ -1,41 +0,0 @@ -/* -* Copyright [2011] [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.mail; - -import javax.mail.Authenticator; -import javax.mail.PasswordAuthentication; - -public class SmtpAuthenticator - extends Authenticator -{ - private String username; - private String password; - - public SmtpAuthenticator(String username, String password) - { - super(); - this.username = username; - this.password = password; - } - - public PasswordAuthentication getPasswordAuthentication() - { - return new PasswordAuthentication(username, password); - } -} \ No newline at end of file diff --git a/wise-webapp/src/main/java/com/wisemapping/ncontroller/MindmapController.java b/wise-webapp/src/main/java/com/wisemapping/ncontroller/MindmapController.java index 83b52af5..16888ea6 100644 --- a/wise-webapp/src/main/java/com/wisemapping/ncontroller/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/ncontroller/MindmapController.java @@ -58,6 +58,7 @@ public class MindmapController { public String showDetails(@PathVariable int id, @NotNull Model model) { final MindMapBean mindmap = findMindmapBean(id); model.addAttribute("mindmap", mindmap); + model.addAttribute("baseUrl", siteBaseUrl); return "mindmapDetail"; } diff --git a/wise-webapp/src/main/java/com/wisemapping/ncontroller/UsersController.java b/wise-webapp/src/main/java/com/wisemapping/ncontroller/UsersController.java index ce7e0ca4..d757d872 100644 --- a/wise-webapp/src/main/java/com/wisemapping/ncontroller/UsersController.java +++ b/wise-webapp/src/main/java/com/wisemapping/ncontroller/UsersController.java @@ -19,9 +19,10 @@ package com.wisemapping.ncontroller; -import com.wisemapping.controller.Messages; +import com.wisemapping.validator.Messages; import com.wisemapping.exceptions.WiseMappingException; import com.wisemapping.model.User; +import com.wisemapping.security.Utils; import com.wisemapping.service.InvalidUserEmailException; import com.wisemapping.service.UserService; import com.wisemapping.validator.UserValidator; @@ -33,6 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; @@ -119,6 +121,12 @@ public class UsersController { return result; } + @RequestMapping(value = "account/settings", method = RequestMethod.GET) + public String showUserSettingsPage(@NotNull Model model) { + model.addAttribute("user", Utils.getUser()); + return "accountSettings"; + } + private BindingResult validateRegistrationForm(@NotNull UserBean userBean, @NotNull HttpServletRequest request, @NotNull BindingResult bindingResult) { final UserValidator userValidator = new UserValidator(); userValidator.setUserService(userService); diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java new file mode 100644 index 00000000..d3d417f7 --- /dev/null +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java @@ -0,0 +1,71 @@ +/* +* Copyright [2011] [wisemapping] +* +* Licensed under WiseMapping Public License, Version 1.0 (the "License"). +* It is basically the Apache License, Version 2.0 (the "License") plus the +* "powered by wisemapping" text requirement on every single page; +* you may not use this file except in compliance with the License. +* You may obtain a copy of the license at +* +* http://www.wisemapping.org/license +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package com.wisemapping.rest; + +import com.wisemapping.model.User; +import com.wisemapping.security.Utils; +import com.wisemapping.service.UserService; +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.*; + +@Controller +public class AccountController extends BaseController { + @Qualifier("userService") + @Autowired + private UserService userService; + + @RequestMapping(method = RequestMethod.PUT, value = "account/password", consumes = {"text/plain"}) + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void changePassword(@RequestBody String password) { + if (password == null) { + throw new IllegalArgumentException("Password can not be null"); + } + + final User user = Utils.getUser(); + user.setPassword(password); + userService.changePassword(user); + } + + @RequestMapping(method = RequestMethod.PUT, value = "account/firstname", consumes = {"text/plain"}) + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void changeFirstname(@RequestBody String firstname) { + if (firstname == null) { + throw new IllegalArgumentException("Firstname can not be null"); + } + + final User user = Utils.getUser(); + user.setFirstname(firstname); + userService.updateUser(user); + } + + @RequestMapping(method = RequestMethod.PUT, value = "account/lastname", consumes = {"text/plain"}) + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void changeLastName(@RequestBody String lastname) { + if (lastname == null) { + throw new IllegalArgumentException("lastname can not be null"); + + } + final User user = Utils.getUser(); + user.setLastname(lastname); + userService.updateUser(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 c4c89c96..d0806806 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java @@ -23,6 +23,7 @@ import com.wisemapping.model.User; import com.wisemapping.rest.model.RestUser; import com.wisemapping.service.UserService; 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.*; @@ -33,6 +34,7 @@ import java.io.IOException; @Controller public class AdminController extends BaseController { + @Qualifier("userService") @Autowired private UserService userService; 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 7ce0779f..96dcc460 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java @@ -62,7 +62,7 @@ public class UserServiceImpl // Generate a random password ... final String password = randomstring(8, 10); user.setPassword(password); - changePassword(user); + updateUser(user); // Send an email with the new temporal password ... notificationService.resetPassword(user, password); @@ -119,11 +119,16 @@ public class UserServiceImpl // Send registration email. if (emailConfirmEnabled) { notificationService.sendRegistrationEmail(user); + } else { + // Send a welcome email .. + notificationService.newAccountCreated(user); } + return user; } public void changePassword(@NotNull User user) { + notificationService.passwordChanged(user); userManager.updateUser(user); } diff --git a/wise-webapp/src/main/java/com/wisemapping/validator/ChangePasswordValidator.java b/wise-webapp/src/main/java/com/wisemapping/validator/ChangePasswordValidator.java deleted file mode 100644 index 92e53fd9..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/validator/ChangePasswordValidator.java +++ /dev/null @@ -1,59 +0,0 @@ -/* -* Copyright [2011] [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.validator; - -import org.springframework.validation.Validator; -import org.springframework.validation.Errors; -import org.springframework.validation.ValidationUtils; -import com.wisemapping.view.ChangePasswordBean; -import com.wisemapping.model.Constants; - -public class ChangePasswordValidator - implements Validator { - - public boolean supports(final Class clazz) { - return clazz.equals(ChangePasswordBean.class); - } - - public void validate(Object obj, Errors errors) { - ChangePasswordBean bean = (ChangePasswordBean) obj; - - if (bean == null) { - errors.rejectValue("changePassword", "error.not-specified", null, "Value required."); - } else { - - ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "required", "Field is required."); - ValidationUtils.rejectIfEmptyOrWhitespace(errors, "retryPassword", "required", "Field is required."); - ValidatorUtils.rejectIfExceeded(errors, - "password", - "The password must have less than "+ Constants.MAX_USER_PASSWORD_LENGTH + " characters.", - bean.getPassword(), - Constants.MAX_USER_PASSWORD_LENGTH); - ValidatorUtils.rejectIfExceeded(errors, - "retryPassword", - "The retryPassword must have less than "+ Constants.MAX_USER_PASSWORD_LENGTH + " characters.", - bean.getRetryPassword(), - Constants.MAX_USER_PASSWORD_LENGTH); - final String password = bean.getPassword(); - if (password != null && !password.equals(bean.getRetryPassword())) { - errors.rejectValue("password", "Password mismatch", "Your password entries did not match"); - } - } - } -} diff --git a/wise-webapp/src/main/java/com/wisemapping/validator/EditProfileValidator.java b/wise-webapp/src/main/java/com/wisemapping/validator/EditProfileValidator.java deleted file mode 100755 index 42100fe4..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/validator/EditProfileValidator.java +++ /dev/null @@ -1,72 +0,0 @@ -/* -* Copyright [2011] [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.validator; - -import com.wisemapping.view.UserBean; -import com.wisemapping.controller.Messages; -import com.wisemapping.service.UserService; -import com.wisemapping.model.User; -import com.wisemapping.model.Constants; -import org.springframework.validation.Errors; -import org.springframework.validation.ValidationUtils; -import org.springframework.validation.Validator; - -public class EditProfileValidator implements Validator { - - private UserService userService; - - public boolean supports(final Class clazz) { - return clazz.equals(UserBean.class); - } - - public void validate(Object obj, Errors errors) { - UserBean user = (UserBean) obj; - if (user == null) { - errors.rejectValue("user", "error.not-specified", null, "Value required."); - } else { - - ValidationUtils.rejectIfEmptyOrWhitespace(errors, "firstname", "required", "Field is required."); - ValidationUtils.rejectIfEmptyOrWhitespace(errors, "lastname", "required", "Field is required."); - ValidatorUtils.rejectIfExceeded(errors, - "firstname", - "The firstname must have less than "+ Constants.MAX_USER_FIRSTNAME_LENGTH + " characters.", - user.getFirstname(), - Constants.MAX_USER_FIRSTNAME_LENGTH); - ValidatorUtils.rejectIfExceeded(errors, - "lastname", - "The lastname must have less than "+ Constants.MAX_USER_LASTNAME_LENGTH + " characters.", - user.getLastname(), - Constants.MAX_USER_LASTNAME_LENGTH); - final String email = user.getEmail(); - boolean isValid = Utils.isValidateEmailAddress(email); - if (isValid) { - final User oldUser = userService.getUserBy(email); - if (oldUser != null && user.getId() != oldUser.getId()) { - errors.rejectValue("email", Messages.EMAIL_ALREADY_EXIST); - } - } else { - Utils.validateEmailAddress(email, errors); - } - } - } - - public void setUserService(UserService userService) { - this.userService = userService; - } -} \ No newline at end of file diff --git a/wise-webapp/src/main/java/com/wisemapping/validator/MapInfoValidator.java b/wise-webapp/src/main/java/com/wisemapping/validator/MapInfoValidator.java index af9ead29..faef8e42 100755 --- a/wise-webapp/src/main/java/com/wisemapping/validator/MapInfoValidator.java +++ b/wise-webapp/src/main/java/com/wisemapping/validator/MapInfoValidator.java @@ -18,7 +18,6 @@ package com.wisemapping.validator; -import com.wisemapping.controller.Messages; import com.wisemapping.model.MindMap; import com.wisemapping.model.User; import com.wisemapping.model.Constants; diff --git a/wise-webapp/src/main/java/com/wisemapping/controller/Messages.java b/wise-webapp/src/main/java/com/wisemapping/validator/Messages.java similarity index 94% rename from wise-webapp/src/main/java/com/wisemapping/controller/Messages.java rename to wise-webapp/src/main/java/com/wisemapping/validator/Messages.java index e1a2bbe4..07ce50e1 100644 --- a/wise-webapp/src/main/java/com/wisemapping/controller/Messages.java +++ b/wise-webapp/src/main/java/com/wisemapping/validator/Messages.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package com.wisemapping.controller; +package com.wisemapping.validator; public interface Messages { String EMAIL_ALREADY_EXIST = "EMAIL_ALREADY_EXIST"; diff --git a/wise-webapp/src/main/java/com/wisemapping/validator/TagValidator.java b/wise-webapp/src/main/java/com/wisemapping/validator/TagValidator.java deleted file mode 100755 index 0e385c7c..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/validator/TagValidator.java +++ /dev/null @@ -1,47 +0,0 @@ -/* -* Copyright [2011] [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.validator; - -import com.wisemapping.model.Constants; -import com.wisemapping.view.TagBean; -import org.springframework.validation.Errors; -import org.springframework.validation.Validator; - -public class TagValidator implements Validator { - - public boolean supports(final Class clazz) { - return clazz.equals(TagBean.class); - } - - public void validate(Object obj, Errors errors) { - TagBean tag = (TagBean) obj; - if (tag == null) { - errors.rejectValue("user", "error.not-specified"); - } else { - - // Validate email address ... - final String tags = tag.getMindmapTags(); - ValidatorUtils.rejectIfExceeded(errors, - "mindmapTags", - "The tags must have less than "+ Constants.MAX_TAGS_LENGTH + " characters.", - tags, - Constants.MAX_TAGS_LENGTH); - } - } -} diff --git a/wise-webapp/src/main/java/com/wisemapping/validator/UserValidator.java b/wise-webapp/src/main/java/com/wisemapping/validator/UserValidator.java index e3919ba4..93b6a6f1 100644 --- a/wise-webapp/src/main/java/com/wisemapping/validator/UserValidator.java +++ b/wise-webapp/src/main/java/com/wisemapping/validator/UserValidator.java @@ -18,7 +18,6 @@ package com.wisemapping.validator; -import com.wisemapping.controller.Messages; import com.wisemapping.service.UserService; import com.wisemapping.view.UserBean; import com.wisemapping.model.Constants; diff --git a/wise-webapp/src/main/java/com/wisemapping/validator/Utils.java b/wise-webapp/src/main/java/com/wisemapping/validator/Utils.java index 25d3d58d..1b2ca15b 100644 --- a/wise-webapp/src/main/java/com/wisemapping/validator/Utils.java +++ b/wise-webapp/src/main/java/com/wisemapping/validator/Utils.java @@ -24,8 +24,6 @@ import org.springframework.validation.ValidationUtils; import java.util.regex.Pattern; import java.util.regex.Matcher; -import com.wisemapping.controller.Messages; - final public class Utils { //Set the email emailPattern string diff --git a/wise-webapp/src/main/java/com/wisemapping/view/TagBean.java b/wise-webapp/src/main/java/com/wisemapping/view/TagBean.java deleted file mode 100755 index dfe6b75b..00000000 --- a/wise-webapp/src/main/java/com/wisemapping/view/TagBean.java +++ /dev/null @@ -1,67 +0,0 @@ -/* -* Copyright [2011] [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.view; - -import java.util.Set; - -public class TagBean -{ - private Set userTags; - private String mindmapTitle; - private int mindmapId; - private String mindmapTags; - - public TagBean(){} - - public Set getUserTags() { - return userTags; - } - - public void setUserTags(Set tags) { - this.userTags = tags; - } - - public String getMindmapTags() { - return mindmapTags; - } - - public void setMindmapTags(String tags) { - this.mindmapTags = tags; - } - - public String getMindmapTitle() - { - return mindmapTitle; - } - - public void setMindmapTitle(String title) - { - this.mindmapTitle = title; - } - - public int getMindmapId() - { - return mindmapId; - } - - public void setMindmapId(int id) - { - this.mindmapId = id; - } -} diff --git a/wise-webapp/src/main/webapp/WEB-INF/classes/mail/passwordRecovery.vm b/wise-webapp/src/main/resources/mail/baseLayout.vm similarity index 68% rename from wise-webapp/src/main/webapp/WEB-INF/classes/mail/passwordRecovery.vm rename to wise-webapp/src/main/resources/mail/baseLayout.vm index ae9028f7..d8d51ec3 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/classes/mail/passwordRecovery.vm +++ b/wise-webapp/src/main/resources/mail/baseLayout.vm @@ -10,28 +10,32 @@ WiseMapping Log + alt="WiseMapping"/> - Your password has been reset + ${messageTitle}
-

A temporal password has been generated for you account.

+ Hi ${firstName}: +

+ ${messageBody} +

-

New Password: ${password}

- -

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

+

Regards,
+ The WiseMapping Team
+

Important: Do not reply this email. If - you need further help or have any concerns regarding your account, contact us to here. + you need further help or believe you have received this email in error, contact us to here.

\ No newline at end of file diff --git a/wise-webapp/src/main/webapp/WEB-INF/classes/mail/confirmationMail.vm b/wise-webapp/src/main/resources/mail/confirmationMail.vm similarity index 89% rename from wise-webapp/src/main/webapp/WEB-INF/classes/mail/confirmationMail.vm rename to wise-webapp/src/main/resources/mail/confirmationMail.vm index 0600d055..5d16c0a9 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/classes/mail/confirmationMail.vm +++ b/wise-webapp/src/main/resources/mail/confirmationMail.vm @@ -9,7 +9,7 @@

If you have received this mail by error, you do not need to take any action to cancel the account. The account will - not be activated, and you will not receive any futher emails. + not be activated, and you will not receive any further emails.

diff --git a/wise-webapp/src/main/webapp/WEB-INF/classes/mail/newCollaboration.vm b/wise-webapp/src/main/resources/mail/newCollaboration.vm similarity index 100% rename from wise-webapp/src/main/webapp/WEB-INF/classes/mail/newCollaboration.vm rename to wise-webapp/src/main/resources/mail/newCollaboration.vm diff --git a/wise-webapp/src/main/webapp/WEB-INF/classes/mail/activationAccountMail.vm b/wise-webapp/src/main/webapp/WEB-INF/classes/mail/activationAccountMail.vm deleted file mode 100644 index f53ea2d6..00000000 --- a/wise-webapp/src/main/webapp/WEB-INF/classes/mail/activationAccountMail.vm +++ /dev/null @@ -1,41 +0,0 @@ - - -

-
- - - - - - - -
- Document - I've shared Untitled - document - -
-
-
- Click to open: - - Google Docs makes it easy to create, store and share online documents, spreadsheets and presentations. - - -
-
- - \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/WEB-INF/classes/mail/welcome.vm b/wise-webapp/src/main/webapp/WEB-INF/classes/mail/welcome.vm deleted file mode 100755 index fffefe30..00000000 --- a/wise-webapp/src/main/webapp/WEB-INF/classes/mail/welcome.vm +++ /dev/null @@ -1,23 +0,0 @@ - - -

- Hi, -

- -

- Thank you so much for your interest in WiseMapping. Your subscription was a success! If you have any questions or - have any feedback, please don't hesitate to reply to this email, or use the on line form. We'd love to hear from - you. -

- -

- For questions or concerns regarding your account, send us an email to ${supportEmail}. -

- -

- Cheers,
- The WiseMapping Team. - WiseMapping Site -

- - \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/WEB-INF/classes/messages.properties b/wise-webapp/src/main/webapp/WEB-INF/classes/messages.properties index eb419d20..fbde4c95 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/classes/messages.properties +++ b/wise-webapp/src/main/webapp/WEB-INF/classes/messages.properties @@ -11,6 +11,7 @@ VIEWERS=Viewers ADD_VIEWERS=Add Viewers CURRENT_VIEWERS=Current Viewers USER_REGISTRATION=User Registration +SEND_ME_A_NEW_PASSWORD=Send Me A New Password CANCEL=Cancel SUBMIT=Submit FIRSTNAME=Firstname @@ -19,6 +20,8 @@ EMAIL=Email HELP=Help LOGOUT=Logout PASSWORD=Password +NEW_PASSWORD=New password +CONFIRM_NEW_PASSWORD=Confirm new password MY_WISEMAPS=My Wisemaps SAVE_AND_CLOSE=Save and Close RETYPE_PASSWORD=Retype Password @@ -26,7 +29,7 @@ REGISTER=Register REMEMBER_ME=Stay signed in SIGN_IN=Sign In SIGN_UP=Sign Up -SETTINGS=Settings +ACCOUNT=Account USERNAME=Username BACK=Back CLOSE=Close @@ -39,7 +42,7 @@ ROLE=Role YOUR_ROLE=Your Role CAPTCHA= Word Verification FORGOT_PASSWORD=Forgot Password ? -CHANGE_PASSWORD=Change your Password +CHANGE_PASSWORD=Change Password FAQ=Frequent Asked Questions SHORT_FAQ=FAQ LOGIN=Login @@ -99,6 +102,7 @@ EMAIL_ALREADY_EXIST=Email already exists NO_VALID_EMAIL_ADDRESS=Invalid email address USERNAME_ALREADY_EXIST=Username already exists PASSWORD_MISSMATCH=Your password entries did not match +CHANGE_PASSWORD_SUCCESS=Your password has been changed successfully. TYPE_CHARACTER_BELOW=Type the characters you see in the picture below. WISEMAPPING_ACCOUNT_MESSAGE=Please check the WiseMapping Account information you've entered above, and review the Terms of Service REGISTRATION_CLICK_ADVICE= By clicking on 'Register' below you are agreeing to the Terms of Service above and the Privacy Policy. @@ -139,7 +143,7 @@ INSERT=Insert WISE_IT=Wise It! EDITOR.LAST_SAVED=last modification by {0} SHARE_IT=Share It -SETTINGS_DETAIL=Do you want to change you user options?. Here is the place. +ACCOUNT_DETAIL=Do you want to change you user options?. Here is the place. SETTINGS_MSG=Please, select what option want to change from you profile: TAGS=Tags AVAILABLE_TAGS = Available tags diff --git a/wise-webapp/src/main/webapp/WEB-INF/classes/messages_es.properties b/wise-webapp/src/main/webapp/WEB-INF/classes/messages_es.properties index a6804bad..b74b7613 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/classes/messages_es.properties +++ b/wise-webapp/src/main/webapp/WEB-INF/classes/messages_es.properties @@ -25,7 +25,7 @@ REGISTER=Registración REMEMBER_ME=Recordar mi sesión SIGN_IN=Entrar SIGN_UP=Registrate -SETTINGS=Configuración +ACCOUNT=Configuración USERNAME=Nombre de usuario BACK=Atrás CLOSE=Cerrar @@ -141,7 +141,7 @@ INSERT=Insertar WISE_IT=Wise It! EDITOR.LAST_SAVED=ultima modificación hecha por {0} SHARE_IT=Compartilo -SETTINGS_DETAIL=Desea cambiar sus preferencias? Este es el lugar. +ACCOUNT_DETAIL=Desea cambiar sus preferencias? Este es el lugar. SETTINGS_MSG=Por favor, seleccione que opción desea modificar de su perfil: TAGS=Etiquetas AVAILABLE_TAGS = Etiquetas disponibles diff --git a/wise-webapp/src/main/webapp/WEB-INF/classes/messages_fr.properties b/wise-webapp/src/main/webapp/WEB-INF/classes/messages_fr.properties index 804a3017..65a2159a 100755 --- a/wise-webapp/src/main/webapp/WEB-INF/classes/messages_fr.properties +++ b/wise-webapp/src/main/webapp/WEB-INF/classes/messages_fr.properties @@ -25,7 +25,7 @@ REGISTER = S\'inscrire REMEMBER_ME = M\u00e9moriser SIGN_IN = S\'identifier SIGN_UP = Se d\u00e9connecter -SETTINGS = Param\u00e9tres du compte +ACCOUNT = Param\u00e9tres du compte USERNAME = Pseudo BACK = Pr\u00e9c\u00e9dent CLOSE = Fermer @@ -145,7 +145,7 @@ INSERT = Ins\u00e9rer EDITOR.LAST_SAVED = Derni\u00e9re modification par SHARE_IT = Partager -SETTINGS_DETAIL = Souhaitez-vous modifier les options de votre profil ? +ACCOUNT_DETAIL = Souhaitez-vous modifier les options de votre profil ? SETTINGS_MSG = S\u00e9lectionnez les options que vous souhaitez modifier dans votre profil TAGS = Mots-cl\u00e9s AVAILABLE_TAGS = Mots-cl\u00e9s disponibles diff --git a/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml b/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml index 3116be1f..51989a13 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml @@ -94,10 +94,9 @@ - + - - + @@ -173,11 +172,4 @@ - - - - - - - diff --git a/wise-webapp/src/main/webapp/WEB-INF/web.xml b/wise-webapp/src/main/webapp/WEB-INF/web.xml index 94d8e02a..67ac55ec 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/web.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/web.xml @@ -90,8 +90,7 @@ contextConfigLocation - - /WEB-INF/wisemapping-nservlet.xml + /WEB-INF/wisemapping-servlet.xml diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-nservlet.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-nservlet.xml deleted file mode 100644 index 7d75d883..00000000 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-nservlet.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - browserNotSupported - - securityError - - - - - - - - - - - - /WEB-INF/defs/definitions.xml - - - - - - - - - - - - - - - - - - - - - - - - - - - / - /index.jsp - /c/home - /c/login - /c/user/registration - /c/captcha - /c/publicView - /service/* - /c/search - /c/keyboard - /c/renameMap - /c/embeddedView - /c/user/resetPassword - - - - - - - - messages - - - - \ No newline at end of file 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 fcb6c7a2..7d75d883 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml @@ -1,51 +1,97 @@ - + - + + + - - - + + + - - + + + + - settings + browserNotSupported + + securityError - - + + - - - - - - - - - + + + + /WEB-INF/defs/definitions.xml + + - - + + - - - - - - - - + + - - + + + + -ans> \ No newline at end of file + + + + + + + + + + / + /index.jsp + /c/home + /c/login + /c/user/registration + /c/captcha + /c/publicView + /service/* + /c/search + /c/keyboard + /c/renameMap + /c/embeddedView + /c/user/resetPassword + + + + + + + + messages + + + + \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/jsp/accountSettings.jsp b/wise-webapp/src/main/webapp/jsp/accountSettings.jsp new file mode 100755 index 00000000..6d0bc8fd --- /dev/null +++ b/wise-webapp/src/main/webapp/jsp/accountSettings.jsp @@ -0,0 +1,99 @@ +<%@ include file="/jsp/init.jsp" %> + +
+ + +
+
+
+
+
+
+ + + + + + + + + + + + +
+ +
+
+ +
+
+
+
+
+
+ + + + + +
+ "/> +
+
+
+
+
+ + diff --git a/wise-webapp/src/main/webapp/jsp/editorHeader.jsp b/wise-webapp/src/main/webapp/jsp/editorHeader.jsp index 002f1b5d..c5a82d54 100644 --- a/wise-webapp/src/main/webapp/jsp/editorHeader.jsp +++ b/wise-webapp/src/main/webapp/jsp/editorHeader.jsp @@ -17,8 +17,8 @@ | "> - + title=""> + | "> diff --git a/wise-webapp/src/main/webapp/jsp/header.jsp b/wise-webapp/src/main/webapp/jsp/header.jsp index e287654b..23673137 100644 --- a/wise-webapp/src/main/webapp/jsp/header.jsp +++ b/wise-webapp/src/main/webapp/jsp/header.jsp @@ -1,17 +1,33 @@ -<%@page pageEncoding="UTF-8"%> +<%@page pageEncoding="UTF-8" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> +
@@ -38,13 +54,6 @@
-
- <%----%> -
@@ -55,3 +64,20 @@
+ + + + diff --git a/wise-webapp/src/main/webapp/jsp/mindmapDetail.jsp b/wise-webapp/src/main/webapp/jsp/mindmapDetail.jsp index f4c2af57..25e026dc 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapDetail.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapDetail.jsp @@ -49,11 +49,11 @@
  • :
  • -
    <iframe style="border:0;width:600px;height:400px;border: 1px solid black" src="http://www.wisemapping.com/c/embeddedView?mapId=${mindmap.id}&amzoom=1"></iframe>
    +
    <iframe style="border:0;width:600px;height:400px;border: 1px solid black" src="${baseUrl}/c/maps/${mindmap.id}/embed?zoom=1"></iframe>
  • diff --git a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp index 1fb457e8..687825d4 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp @@ -64,9 +64,9 @@ , ${principal.firstname}| | - "> - | "> + <%-- + <%--title=""> |--%> + "> diff --git a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp index d4c95343..96555dcd 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp @@ -115,7 +115,7 @@
    -