Package com.casamind.adware.shared.model

Examples of com.casamind.adware.shared.model.UserAccountDTO


  public String toString() {
    return "UserAccount [accessLevel=" + accessLevel + ", uniqueId=" + uniqueId + ", firstname=" + firstname + ", lastname=" + lastname + ", phone=" + phone + ", email=" + email + ", lastLoginOn=" + lastLoginOn + ", isReceiveNewsLetter=" + isReceiveNewsLetter + ", isReceiveNotifications=" + isReceiveNotifications + "]";
  }

  public static UserAccountDTO toDTO(UserAccount entity) {
    return entity == null ? null : new UserAccountDTO(entity.getId(), entity.getUUID(), entity.getAccessLevel(), entity.getLogin(), entity.getService(), entity.getFirstname(), entity.getLastname(), entity.getPhone(), entity.getEmail(), entity.getLastLoginOn(), entity.isReceiveNewsLetter(), entity.isReceiveNotifications());
  }
View Full Code Here


@SuppressWarnings("serial")
public class LoginServiceImpl extends RemoteServiceServlet implements
    LoginService {
  @Override
  public UserAccountDTO getLoggedInUserDTO(String requestUri) {
    UserAccountDTO userDTO = null;
    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    if (user != null) {
      if (userService.isUserAdmin()) {
        userDTO = new UserAccountDTO();
        userDTO.setId(new Long(0));
        userDTO.setLastname(user.getNickname());
        userDTO.setLogin(user.getEmail());
        userDTO.setEmail(user.getEmail());
        userDTO.setAccessLevel(1);
      } else {
        userDTO = UserAccount.toDTO(DatastoreProxy.getUserAccountByLogin(user.getEmail()));
        if (userDTO == null) {
          userDTO = new UserAccountDTO();
          userDTO.setLogin(user.getEmail());
        }
      }
    }
    userDTO.setLogoutUrl(userService.createLogoutURL(requestUri));
    // HttpSession session = super.getThreadLocalRequest().getSession();
    return userDTO;
    //
    // UserAccount u = LoginHelper.getLoggedInUser(session);
    // if (u == null)
View Full Code Here

TOP

Related Classes of com.casamind.adware.shared.model.UserAccountDTO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.