use of com.odysseusinc.arachne.portal.model.UserPublication in project ArachneCentralAPI by OHDSI.
the class UserPublicationDTOToUserPublicationConverter method convert.
@Override
public UserPublication convert(UserPublicationDTO dto) {
UserPublication publication = new UserPublication();
publication.setTitle(dto.getTitle());
publication.setDescription(dto.getDescription());
publication.setDate(dto.getDate());
publication.setPublisher(dto.getPublisher());
publication.setUrl(dto.getUrl());
return publication;
}
use of com.odysseusinc.arachne.portal.model.UserPublication 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;
}
use of com.odysseusinc.arachne.portal.model.UserPublication in project ArachneCentralAPI by OHDSI.
the class BaseUserServiceImpl method addPublicationToUser.
@Override
public U addPublicationToUser(Long userId, UserPublication publication) throws NotExistException, NotUniqueException, PermissionDeniedException {
U forUpdate = userRepository.findOne(userId);
publication.setUser(forUpdate);
UserPublication userPublication = userPublicationService.create(publication);
forUpdate.getPublications().add(userPublication);
return initUserCollections((U) userPublication.getUser());
}
Aggregations