Package org.jayasoft.woj.portal.actions.utils

Examples of org.jayasoft.woj.portal.actions.utils.InvitationInfo


                        String godfather = f.getString(Params.REGISTER.USER.VALIDATE.PARAMS.GODFATHER);
                       
                        // Transfer info from dorm to bean
                        // If an error occured, we do not loose informations.
                        org.jayasoft.woj.portal.model.registration.Registration reg = (org.jayasoft.woj.portal.model.registration.Registration)request.getSession().getAttribute(Params.REGISTER.SESSION.CURRENT_REGISTRATION);
                        InvitationInfo invitInfo = (InvitationInfo) request.getSession().getAttribute(Params.REGISTER.SESSION.INVITATION_INFORMATION);
                       
                        UserImpl user = null;
                        if (reg != null) {
                            // Modification mode
                            user = (UserImpl)reg.getUser();
                        } else {
                            // Creation mode
                            user = new UserImpl();
                            if (invitInfo == null) {
                              reg = new org.jayasoft.woj.portal.model.registration.Registration();
                              reg.setUser(user);
                              // We remember the user for final registration
                              request.getSession().setAttribute(Params.REGISTER.SESSION.CURRENT_REGISTRATION, reg);
                            } else {
                              invitInfo.setUser(user);
                            }
                        }
                        user.setLogin(login);
                        user.setPassword(pass1);
                        user.setEmail(email);
View Full Code Here


                        String mail = request.getParameter(Params.REGISTER.INVITED.PARAMS.INVITED_MAIL);
                        String licenseId = request.getParameter(Params.REGISTER.INVITED.PARAMS.LICENSE_ID);
                        String adminId = request.getParameter(Params.REGISTER.INVITED.PARAMS.ADMIN_ID);
                        LOGGER.debug("dealing invitation usrMail:" + mail + " licId:" + licenseId + " admId:" + adminId);
                       
                        InvitationInfo invitationInfo = ServiceFactory.getUserService().getInvitationInfo(mail, licenseId, adminId);
            request.getSession().setAttribute(Params.REGISTER.SESSION.INVITATION_INFORMATION, invitationInfo);
                       
                        User invitedUser = ServiceFactory.getUserService().getUserByEmail(mail);
                        if (invitedUser != null) {
                          invitationInfo.setUser(invitedUser);
                            return "account.register.showClufFormAction";
                        } else {
                            DynaActionForm f = (DynaActionForm)form;
                            f.set(Params.REGISTER.USER.VALIDATE.PARAMS.EMAIL, mail);
                          return "account.register.showUserFormAction";
View Full Code Here

                       
                        // We clean the acceptance of the license, checkbox value in html page
                        DynaActionForm f = (DynaActionForm)form;
                        f.set(Params.REGISTER.CLUF.VALIDATE.PARAMS.CLUF_ACCEPTED, "0");

                        InvitationInfo invitInfo = (InvitationInfo) request.getSession().getAttribute(Params.REGISTER.SESSION.INVITATION_INFORMATION);
                        if (request.getSession().getAttribute(Params.REGISTER.SESSION.CURRENT_REGISTRATION) == null) {
                          if (invitInfo == null) {
                            // We check if we are in a good state
                            LOGGER.warn("the license page was requested whereas no current registration was found");
                            request.setAttribute(Params.REDIRECT.REQUEST.REDIRECTION_URL, ActionsHelper.homepageForward().getPath());
View Full Code Here

                        DynaActionForm f = (DynaActionForm)form;
                        String strForward = null;

                        String clufAccepted = f.getString(Params.REGISTER.CLUF.VALIDATE.PARAMS.CLUF_ACCEPTED);
                        String buyerId = request.getParameter(Params.REGISTER.CLUF.VALIDATE.PARAMS.BUYER_ID);
                        InvitationInfo invitInfo = (InvitationInfo) request.getSession().getAttribute(Params.REGISTER.SESSION.INVITATION_INFORMATION);
                        if (buyerId != null) {
                            // A trial user want to buy a license
                            // We build the registration
                            User user = Portal.getInstance().getUserService().getUserById(buyerId);
                            org.jayasoft.woj.portal.model.registration.Registration reg = new org.jayasoft.woj.portal.model.registration.Registration();
                            reg.setUser(user);
                            request.getSession().setAttribute(Params.REGISTER.SESSION.CURRENT_REGISTRATION, reg);
                            request.getSession().setAttribute(Params.REGISTER.SESSION.BUYER_ID, buyerId);
                            // We consider that we are modifying a existing user.
                            request.getSession().setAttribute(Params.REGISTER.SESSION.CURRENT_USER_ID, buyerId);
                            clufAccepted = "1";
                        } else if (invitInfo != null) {
                          // Invitation case
                            if ("1".equals(clufAccepted)) {
                                LOGGER.debug("user has accepted the license");
                                String adminId = invitInfo.getAdminId();
                                User admin = ServiceFactory.getUserService().getUserById(adminId);
                                ServiceFactory.getLicenseService().acceptInvitation(invitInfo);
                                request.setAttribute(Params.REGISTER.INVITATION_SUCCEED.REQUEST.ADMIN_MAIL, admin.getEmail());
                                request.getSession().removeAttribute(Params.REGISTER.SESSION.CURRENT_REGISTRATION);
                                request.getSession().removeAttribute(Params.REGISTER.SESSION.INVITATION_INFORMATION);
View Full Code Here

            throw new ServiceException(RessourceBundleApplicationMessage.error("woj.invite.user.error.license.id.invalid", null));
        } catch (DaoException e) {
            throw new ServiceException(RessourceBundleApplicationMessage.error("woj.invite.user.error.license.db.error", null));
        }
       
        return new InvitationInfo(mail, licenseId, adminId);
    }
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.portal.actions.utils.InvitationInfo

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.