Package fr.ippon.tatami.service.dto

Examples of fr.ippon.tatami.service.dto.UserGroupDTO


            if (user.getLogin().equals(currentUser.getLogin())) {
                return user;
            }
        }

        UserGroupDTO currentUserDTO = new UserGroupDTO();
        currentUserDTO.setLogin(currentUser.getLogin());
        currentUserDTO.setUsername(currentUser.getUsername());
        currentUserDTO.setAvatar(currentUser.getAvatar());
        currentUserDTO.setFirstName(currentUser.getFirstName());
        currentUserDTO.setLastName(currentUser.getLastName());
        currentUserDTO.setIsMember(false);

        return currentUserDTO;
    }
View Full Code Here


        User currentUser = authenticationService.getCurrentUser();
        Group currentGroup = groupService.getGroupById(currentUser.getDomain(), groupId);
        User userToAdd = userService.getUserByUsername(username);

        UserGroupDTO dto = null;

        if (currentUser == null) {
            response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); // Authentication required
        } else if (currentGroup == null || userToAdd == null) {
            response.setStatus(HttpServletResponse.SC_NOT_FOUND); // Resource not found
View Full Code Here

        Collection<String> friendLogins = friendRepository.findFriendsForUser(login);
        Collection<UserGroupDTO> userGroupDTOs = new TreeSet<UserGroupDTO>();
        for (Map.Entry<String, String> member : membersMap.entrySet()) {
            User user = userRepository.findUserByLogin(member.getKey());
            if(user != null) { //User might be deleted
                UserGroupDTO dto = new UserGroupDTO();
                dto.setLogin(user.getLogin());
                dto.setUsername(user.getUsername());
                dto.setAvatar(user.getAvatar());
                dto.setFirstName(user.getFirstName());
                dto.setLastName(user.getLastName());
                dto.setRole(member.getValue());
                dto.setActivated(user.getActivated());
                if (friendLogins.contains(user.getLogin())) {
                    dto.setFriend(true);
                }
                if (login.equals(user.getLogin())) {
                    dto.setYou(true);
                }
                userGroupDTOs.add(dto);
            }
        }
        return userGroupDTOs;
View Full Code Here

        Map<String, String> membersMap = groupMembersRepository.findMembers(groupId);
        for (Map.Entry<String, String> member : membersMap.entrySet()) {
            User user = userRepository.findUserByLogin(member.getKey());
            if (user != null && userWanted.getLogin().equals(user.getLogin())) {
                UserGroupDTO dto = new UserGroupDTO();
                dto.setLogin(user.getLogin());
                dto.setUsername(user.getUsername());
                dto.setAvatar(user.getAvatar());
                dto.setFirstName(user.getFirstName());
                dto.setLastName(user.getLastName());
                dto.setRole(member.getValue());
                return dto;
            }
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of fr.ippon.tatami.service.dto.UserGroupDTO

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.