Package com.sparc.knappsack.models

Examples of com.sparc.knappsack.models.DomainUserRequestModel


        domainUserRequest.setStatus(Status.ACCEPTED);
        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());
        groupModel.setName(domainUserRequest.getDomain().getName());
        model.setDomain(groupModel);
        emailService.sendDomainUserAccessConfirmationEmail(model);

        assertEquals(1, wiser.getMessages().size());

        if (wiser.getMessages().size() > 0) {
View Full Code Here


    @Override
    public boolean sendNotifications(DomainUserRequest domainUserRequest) {
        boolean success = false;

        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);

            success = emailService.sendDomainUserAccessConfirmationEmail(domainUserRequestModel);
        }

        return success;
View Full Code Here

    @Override
    public boolean sendNotifications(EmailModel emailModel) {
        boolean success = false;
        if (emailModel != null) {
            try {
                DomainUserRequestModel domainUserRequestModel;
                Map<String, Object> modelMap = (Map<String, Object>) emailModel.getParams().get("domainUserRequestModel");
                if (modelMap != null) {
                    Map<String, Object> groupModelMap = (Map<String, Object>) modelMap.get("domain");
                    if (groupModelMap != null) {
                        domainUserRequestModel = new DomainUserRequestModel();
                        Integer domainUserRequestId = (Integer) modelMap.get("id");
                        if (domainUserRequestId != null) {
                            domainUserRequestModel.setId(domainUserRequestId.longValue());
                        }

                        UserModel userModel = null;
                        Map<String, Object> userModelMap = (Map<String, Object>) modelMap.get("user");
                        if (userModelMap != null) {
                            userModel = new UserModel();
                            userModel.setEmail((String) userModelMap.get("email"));
                            Integer id = (Integer) userModelMap.get("id");
                            if (id != null) {
                                userModel.setId(id.longValue());
                            }
                            userModel.setFirstName((String) userModelMap.get("firstName"));
                            userModel.setLastName((String) userModelMap.get("lastName"));
                            userModel.setUserName((String) userModelMap.get("userName"));

                            domainUserRequestModel.setUser(userModel);
                        }

                        GroupModel groupModel = new GroupModel();
                        Integer groupId = (Integer) groupModelMap.get("id");
                        if (groupId != null) {
                            groupModel.setId(groupId.longValue());
                        }
                        groupModel.setName((String) groupModelMap.get("name"));
                        domainUserRequestModel.setDomain(groupModel);

                        domainUserRequestModel.setStatus(Status.valueOf((String) modelMap.get("status")));
                        if (domainUserRequestModel != null && domainUserRequestModel.getUser() != null) {
                            success = emailService.sendDomainUserAccessConfirmationEmail(domainUserRequestModel);
                        }
                    }
                }
View Full Code Here

TOP

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

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.