Package com.sparc.knappsack.models

Examples of com.sparc.knappsack.models.UserModel


            return showRegistrationPage(request, response, model, null);
        }

//        invalidateSession(request, response);

        UserModel userModel = new UserModel();
        userModel.setEmail(registrationForm.getEmail().trim());
        userModel.setFirstName(registrationForm.getFirstName().trim());
        userModel.setLastName(registrationForm.getLastName().trim());
        userModel.setPassword(registrationForm.getFirstPassword().trim());

        User user = registrationService.registerUser(userModel, false);
        if (user != null && user.getId() != null && user.getId() > 0) {
            try {
                EventDelivery deliveryMechanism = eventDeliveryFactory.getEventDelivery(EventType.USER_ACCOUNT_ACTIVATION);
View Full Code Here


    @Override
    public boolean sendNotifications(Organization organization, OrganizationRegistrationComposite organizationRegistrationComposite) {
        boolean success = false;

        if (organization != null && organizationRegistrationComposite != null) {
            UserModel userModel = new UserModel();
            userModel.setId(organizationRegistrationComposite.getUserId());
            userModel.setFirstName(organizationRegistrationComposite.getFirstName());
            userModel.setLastName(organizationRegistrationComposite.getLastName());
            userModel.setEmail(organizationRegistrationComposite.getEmail());
            userModel.setUserName(organizationRegistrationComposite.getUserName());

            success = emailService.sendOrganizationRegistrationEmail(organization.getId(), userModel);
        }

        return success;
View Full Code Here

        boolean success = false;

        User principal = userService.getUserFromSecurityContext();

        if (applicationVersion != null && principal != null) {
            UserModel userModel = new UserModel();
            userModel.setEmail(principal.getEmail());
            userModel.setFirstName(principal.getFirstName());
            userModel.setLastName(principal.getLastName());
            userModel.setId(principal.getId());
            userModel.setUserName(principal.getUsername());
            success = emailService.sendApplicationPublishRequestEmail(applicationVersion.getId(), userModel);
        }

        return success;
    }
View Full Code Here

    @Autowired(required = true)
    private RoleService roleService;

    @Test
    public void registerUserTest() {
        UserModel userModel = new UserModel();
        userModel.setEmail("test@test.com");
        userModel.setFirstName("John");
        userModel.setLastName("Doe");
        userModel.setPassword("password");

        User user = registrationService.registerUser(userModel, false);
        assertNotNull(user);
        assertTrue(user.getEmail().equals("test@test.com"));
        assertTrue(user.getFirstName().equals("John"));
View Full Code Here

        invitation.setEmail(user.getEmail());
        Role role = roleService.getRoleByAuthority(UserRole.ROLE_ORG_USER.toString());
        invitation.setRole(role);
        invitationService.add(invitation);

        UserModel userModel = new UserModel();
        userModel.setEmail("test@test.com");
        userModel.setFirstName("John");
        userModel.setLastName("Doe");
        userModel.setPassword("password");

        user = registrationService.registerUser(userModel, false);
        assertNotNull(user);
        assertTrue(user.getEmail().equals("test@test.com"));
        assertTrue(user.getFirstName().equals("John"));
View Full Code Here

        domainUserRequestService.add(domainUserRequest);
        List<DomainUserRequest> domainUserRequests = domainUserRequestService.getAll(group.getId());
        assertTrue(domainUserRequests.size() == 1);

        DomainUserRequestModel model = new DomainUserRequestModel();
        UserModel userModel = new UserModel();
        userModel.setId(user.getId());
        userModel.setEmail(user.getEmail());
        userModel.setUserName(user.getUsername());
        userModel.setFirstName(user.getFirstName());
        userModel.setLastName(user.getLastName());
        model.setUser(userModel);
        model.setId(domainUserRequest.getId());
        model.setStatus(domainUserRequest.getStatus());
        GroupModel groupModel = new GroupModel();
        groupModel.setId(domainUserRequest.getDomain().getId());
View Full Code Here

    }

    @Test
    public void sendApplicationPublishRequestEmailTest() throws MessagingException {
        User user = getUserWithSecurityContext();
        UserModel userModel = new UserModel();
        userModel.setEmail(user.getEmail());
        userModel.setFirstName(user.getFirstName());
        userModel.setLastName(user.getLastName());
        userModel.setId(user.getId());
        userModel.setUserName(user.getUsername());
        Group group = getGroup(UserRole.ROLE_ORG_ADMIN, UserRole.ROLE_GROUP_ADMIN);
        emailService.sendApplicationPublishRequestEmail(group.getOwnedApplications().get(0).getApplicationVersions().get(0).getId(), userModel);

        assertEquals(1, wiser.getMessages().size());
View Full Code Here

    public void sendOrganizationRegistrationEmailTest() throws MessagingException {
        wiser.getMessages().clear();

        Organization organization = getOrganization();
        User user = getUserWithSecurityContext();
        UserModel userModel = new UserModel();
        userModel.setEmail(user.getEmail());
        userModel.setFirstName(user.getFirstName());
        userModel.setLastName(user.getLastName());
        userModel.setId(user.getId());
        userModel.setUserName(user.getUsername());

        boolean success = emailService.sendOrganizationRegistrationEmail(organization.getId(), userModel);

        assertTrue(success);
    }
View Full Code Here

    public void sendBandwidthLimitNotification_Success_Test() throws MessagingException {
        wiser.getMessages().clear();
        Organization organization = getOrganization();

        User user1 = getUserWithSecurityContext();
        UserModel userModel1 = new UserModel();
        userModel1.setEmail(user1.getEmail());
        userModel1.setUserName(user1.getUsername());
        userModel1.setFirstName(user1.getFirstName());
        userModel1.setLastName(user1.getLastName());
        userModel1.setId(user1.getId());

        User user2 = getUserWithSecurityContext();
        UserModel userModel2 = new UserModel();
        userModel2.setEmail(user2.getEmail());
        userModel2.setUserName(user2.getUsername());
        userModel2.setFirstName(user2.getFirstName());
        userModel2.setLastName(user2.getLastName());
        userModel2.setId(user2.getId());

        List<UserModel> userModels = new ArrayList<UserModel>();
        userModels.add(userModel1);
        userModels.add(userModel2);
View Full Code Here

        if (domainUserRequest != null) {
            DomainUserRequestModel domainUserRequestModel = new DomainUserRequestModel();
            domainUserRequestModel.setId(domainUserRequest.getId());
            domainUserRequestModel.setStatus(domainUserRequest.getStatus());

            UserModel userModel = new UserModel();
            userModel.setId(domainUserRequest.getUser().getId());
            userModel.setUserName(domainUserRequest.getUser().getUsername());
            userModel.setEmail(domainUserRequest.getUser().getEmail());
            userModel.setFirstName(domainUserRequest.getUser().getFirstName());
            userModel.setLastName(domainUserRequest.getUser().getLastName());
            domainUserRequestModel.setUser(userModel);

            DomainEntityService domainEntityService = domainEntityServiceFactory.getDomainEntityService(domainUserRequest.getDomain().getDomainType());
            DomainModel domainModel = domainEntityService.createDomainModel(domainUserRequest.getDomain());
            domainUserRequestModel.setDomain(domainModel);
View Full Code Here

TOP

Related Classes of com.sparc.knappsack.models.UserModel

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.