Search in sources :

Example 1 with UserLink

use of com.odysseusinc.arachne.portal.model.UserLink in project ArachneCentralAPI by OHDSI.

the class UserToUserProfileDTOConverter method convert.

@Override
public UserProfileDTO convert(IUser user) {
    UserProfileDTO dto = new UserProfileDTO();
    dto.setId(user.getUuid());
    dto.setEnabled(user.getEnabled());
    dto.setCreated(user.getCreated());
    dto.setUpdated(user.getUpdated());
    HashSet<SkillDTO> skills = new HashSet<>();
    for (Skill skill : user.getSkills()) {
        skills.add(conversionService.convert(skill, SkillDTO.class));
    }
    dto.setSkills(skills);
    LinkedList<UserPublicationDTO> publications = new LinkedList<>();
    for (UserPublication userPublication : user.getPublications()) {
        publications.add(conversionService.convert(userPublication, UserPublicationDTO.class));
    }
    dto.setPublications(publications);
    LinkedList<UserLinkDTO> links = new LinkedList<>();
    for (UserLink userLink : user.getLinks()) {
        links.add(conversionService.convert(userLink, UserLinkDTO.class));
    }
    dto.setLinks(links);
    dto.setGeneral(conversionService.convert(user, UserProfileGeneralDTO.class));
    return dto;
}
Also used : SkillDTO(com.odysseusinc.arachne.portal.api.v1.dto.dictionary.SkillDTO) UserLinkDTO(com.odysseusinc.arachne.portal.api.v1.dto.UserLinkDTO) UserProfileDTO(com.odysseusinc.arachne.portal.api.v1.dto.UserProfileDTO) LinkedList(java.util.LinkedList) UserPublication(com.odysseusinc.arachne.portal.model.UserPublication) UserLink(com.odysseusinc.arachne.portal.model.UserLink) Skill(com.odysseusinc.arachne.portal.model.Skill) UserProfileGeneralDTO(com.odysseusinc.arachne.portal.api.v1.dto.UserProfileGeneralDTO) UserPublicationDTO(com.odysseusinc.arachne.portal.api.v1.dto.UserPublicationDTO) HashSet(java.util.HashSet)

Example 2 with UserLink

use of com.odysseusinc.arachne.portal.model.UserLink in project ArachneCentralAPI by OHDSI.

the class LinkDTOToUserLinkConverter method convert.

@Override
public UserLink convert(UserLinkDTO linkDTO) {
    UserLink userLink = new UserLink();
    userLink.setUrl(linkDTO.getUrl());
    userLink.setId(linkDTO.getId());
    userLink.setTitle(linkDTO.getTitle());
    userLink.setDescription(linkDTO.getDescription());
    return userLink;
}
Also used : UserLink(com.odysseusinc.arachne.portal.model.UserLink)

Aggregations

UserLink (com.odysseusinc.arachne.portal.model.UserLink)2 UserLinkDTO (com.odysseusinc.arachne.portal.api.v1.dto.UserLinkDTO)1 UserProfileDTO (com.odysseusinc.arachne.portal.api.v1.dto.UserProfileDTO)1 UserProfileGeneralDTO (com.odysseusinc.arachne.portal.api.v1.dto.UserProfileGeneralDTO)1 UserPublicationDTO (com.odysseusinc.arachne.portal.api.v1.dto.UserPublicationDTO)1 SkillDTO (com.odysseusinc.arachne.portal.api.v1.dto.dictionary.SkillDTO)1 Skill (com.odysseusinc.arachne.portal.model.Skill)1 UserPublication (com.odysseusinc.arachne.portal.model.UserPublication)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1